Remove config files in favor of environment variables
This commit is contained in:
@@ -1,8 +0,0 @@
|
|||||||
const databaseConfig = {
|
|
||||||
database_host: '100.20.1.45',
|
|
||||||
database_user: 'DRB_CNC',
|
|
||||||
database_password: 'baMbC6IAl$Rn7$h0PS',
|
|
||||||
database_database: 'DRB_CNC'
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = databaseConfig;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const discordConfig = {
|
|
||||||
channelID: '367396189529833476'
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = discordConfig;
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Config
|
// Config
|
||||||
const discordConfig = require("../config/discordConfig");
|
require('dotenv').config();
|
||||||
// Debug
|
// Debug
|
||||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||||
const log = new DebugBuilder("server", "adminController");
|
const log = new DebugBuilder("server", "adminController");
|
||||||
@@ -28,7 +28,7 @@ async function requestNodeListenToPreset(preset, nodeId, callback) {
|
|||||||
mysqlHandler.getNodeInfoFromId(nodeId, (nodeObject) =>{
|
mysqlHandler.getNodeInfoFromId(nodeId, (nodeObject) =>{
|
||||||
reqOptions = new requests.requestOptions("/bot/join", "POST", nodeObject.ip, nodeObject.port);
|
reqOptions = new requests.requestOptions("/bot/join", "POST", nodeObject.ip, nodeObject.port);
|
||||||
requests.sendHttpRequest(reqOptions, JSON.stringify({
|
requests.sendHttpRequest(reqOptions, JSON.stringify({
|
||||||
"channelID": discordConfig.channelID,
|
"channelID": process.env.DEFAULT_VOICE_CHANNEL_ID,
|
||||||
"presetName": preset
|
"presetName": preset
|
||||||
}), (responseObject) => {
|
}), (responseObject) => {
|
||||||
return callback(responseObject)
|
return callback(responseObject)
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ exports.updateFeeds = (client) => {
|
|||||||
if (!client) throw new Error("Client object not passed");
|
if (!client) throw new Error("Client object not passed");
|
||||||
// Create a temp pool to use for all connections while updating the feed
|
// Create a temp pool to use for all connections while updating the feed
|
||||||
var tempConnection = mysql.createPool({
|
var tempConnection = mysql.createPool({
|
||||||
host: process.env.DB_HOST,
|
host: process.env.EM_DB_HOST,
|
||||||
user: process.env.DB_USER,
|
user: process.env.EM_DB_USER,
|
||||||
password: process.env.DB_PASS,
|
password: process.env.EM_DB_PASS,
|
||||||
database: process.env.DB_NAME,
|
database: process.env.EM_DB_NAME,
|
||||||
connectionLimit: 10
|
connectionLimit: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ const transactionsTable = process.env.DB_TRANSACTIONS_TABLE;
|
|||||||
const pricingTable = process.env.DB_PRICING_TABLE;
|
const pricingTable = process.env.DB_PRICING_TABLE;
|
||||||
|
|
||||||
var Connection = mysql.createPool({
|
var Connection = mysql.createPool({
|
||||||
host: process.env.DB_HOST,
|
host: process.env.EM_DB_HOST,
|
||||||
user: process.env.DB_USER,
|
user: process.env.EM_DB_USER,
|
||||||
password: process.env.DB_PASS,
|
password: process.env.EM_DB_PASS,
|
||||||
database: process.env.DB_NAME,
|
database: process.env.EM_DB_NAME,
|
||||||
connectionLimit: 10
|
connectionLimit: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
|
require('dotenv').config();
|
||||||
const mysql = require('mysql');
|
const mysql = require('mysql');
|
||||||
const databaseConfig = require('../config/databaseConfig');
|
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
|
|
||||||
const connection = mysql.createPool({
|
const connection = mysql.createPool({
|
||||||
host: databaseConfig.database_host,
|
host: process.env.NODE_DB_HOST,
|
||||||
user: databaseConfig.database_user,
|
user: process.env.NODE_DB_USER,
|
||||||
password: databaseConfig.database_password,
|
password: process.env.NODE_DB_PASS,
|
||||||
database: databaseConfig.database_database
|
database: process.env.NODE_DB_NAME
|
||||||
});
|
});
|
||||||
|
|
||||||
const nodesTable = `${databaseConfig.database_database}.nodes`;
|
const nodesTable = `${process.env.NODE_DB_NAME}.nodes`;
|
||||||
|
|
||||||
/** Get all nodes the server knows about regardless of status
|
/** Get all nodes the server knows about regardless of status
|
||||||
* @param {*} callback Callback function
|
* @param {*} callback Callback function
|
||||||
|
|||||||
Reference in New Issue
Block a user