secret data as environment variables
This commit is contained in:
parent
b3b263d6c3
commit
6bc814bd50
11
app.js
11
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user