1
0
Fork 0

secret data as environment variables

This commit is contained in:
Ruben Meyer 2019-09-08 19:56:03 +02:00
parent b3b263d6c3
commit 6bc814bd50
2 changed files with 13 additions and 2 deletions

11
app.js
View File

@ -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

View File

@ -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