diff --git a/app.js b/app.js index bc79b10..736e66c 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,17 @@ let load = (name) => { return require(__dirname+'/bin/'+name+'/module'); }; +// environment variable check +let env_vars = ["APP_ID", "APP_SECRET"]; +let env_missing = false; +env_vars.forEach((el) => { + if(typeof process.env[el] == 'undefined') { + console.error("environment variable "+el+" is not set"); + env_missing = true; + } +}); +if(env_missing) process.exit(); + global['modules'].logs = load('logs'); // log handler global['logs'] = global['modules'].logs; // alias diff --git a/bin/config.js b/bin/config.js index 73364e7..9426beb 100644 --- a/bin/config.js +++ b/bin/config.js @@ -20,8 +20,8 @@ module.exports = { sso: { authenticator: "http://localhost:8080/api/authenticate", // redirect back to this url; redirectUser: "https://auth.rxbn.de/authenticate", // sso service - appId: "5bf5ab975f6e3f1b025105db", // app id - appSecret: "qya8ICn2h29Zp6vAsrTpRA8SZhKnoNIg" // random token + appId: process.env.APP_ID, // app id + appSecret: process.env.APP_SECRET // random token }, app: { name: "testApp" // app name - check auth/views