From b71805ffd3b8654e88dd7a7dd43bc11651b8c8d8 Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Sat, 5 Sep 2015 17:26:56 +0100 Subject: [PATCH] Allow storage of bot configuration --- config/config.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/config/config.js b/config/config.js index a724173..dfc9d0d 100644 --- a/config/config.js +++ b/config/config.js @@ -8,16 +8,28 @@ var path = require("path"); var baseConfig = require(path.join(__dirname, path.join("environments/" + env.toLowerCase()))); -if (!test && process.env.PORT) { - baseConfig.port = parseInt(process.env.PORT, 10); -} +baseConfig.steamBot = {}; -if (!test && process.env.MONGOLAB_URI) { - baseConfig.mongo.uri = process.env.MONGOLAB_URI; -} +if (!test) { + if (process.env.PORT) { + baseConfig.port = parseInt(process.env.PORT, 10); + } -if (!test && process.env.RAILS_SECRET) { - baseConfig.secret_token = process.env.RAILS_SECRET; + 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; + } + + if (process.env.GATHER_STEAM_PASSWORD) { + baseConfig.steamBot.password = process.env.GATHER_STEAM_PASSWORD; + } } module.exports = baseConfig;