2015-07-20 09:41:58 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var env = process.env.NODE_ENV || "development";
|
2015-08-28 12:52:01 +00:00
|
|
|
var test = env === "test";
|
2015-07-20 09:41:58 +00:00
|
|
|
|
|
|
|
var fs = require("fs");
|
|
|
|
var path = require("path");
|
|
|
|
|
2015-08-17 13:53:55 +00:00
|
|
|
var baseConfig = require(path.join(__dirname, path.join("environments/" + env.toLowerCase())));
|
2015-07-20 09:41:58 +00:00
|
|
|
|
2015-09-05 16:26:56 +00:00
|
|
|
baseConfig.steamBot = {};
|
2017-06-22 13:47:29 +00:00
|
|
|
baseConfig.discordBot = {};
|
2015-07-22 13:58:05 +00:00
|
|
|
|
2015-09-05 16:26:56 +00:00
|
|
|
if (!test) {
|
|
|
|
if (process.env.PORT) {
|
|
|
|
baseConfig.port = parseInt(process.env.PORT, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.MONGOLAB_URI) {
|
|
|
|
baseConfig.mongo.uri = process.env.MONGOLAB_URI;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.RAILS_SECRET) {
|
|
|
|
baseConfig.secret_token = process.env.RAILS_SECRET;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.GATHER_STEAM_ACCOUNT) {
|
|
|
|
baseConfig.steamBot.account_name = process.env.GATHER_STEAM_ACCOUNT;
|
|
|
|
}
|
2015-08-05 00:11:46 +00:00
|
|
|
|
2015-09-05 16:26:56 +00:00
|
|
|
if (process.env.GATHER_STEAM_PASSWORD) {
|
|
|
|
baseConfig.steamBot.password = process.env.GATHER_STEAM_PASSWORD;
|
|
|
|
}
|
2017-06-22 13:47:29 +00:00
|
|
|
|
|
|
|
if (process.env.GATHER_DISCORD_HOOK_ID) {
|
|
|
|
baseConfig.discordBot.hook_id = process.env.GATHER_DISCORD_HOOK_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.GATHER_DISCORD_HOOK_TOKEN) {
|
|
|
|
baseConfig.discordBot.hook_token = process.env.GATHER_DISCORD_HOOK_TOKEN;
|
|
|
|
}
|
|
|
|
|
2015-08-05 00:11:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-17 13:50:59 +00:00
|
|
|
module.exports = baseConfig;
|