This commit is contained in:
2020-05-03 18:22:51 -04:00
commit 8dc0e946b1
98 changed files with 19301 additions and 0 deletions

15
nodejs/conf/base.js Normal file
View File

@ -0,0 +1,15 @@
'use strict';
module.exports = {
userModel: 'ldap', // pam, redis, ldap
ldap: {
url: 'ldap://192.168.1.54:389',
bindDN: 'cn=admin,dc=theta42,dc=com',
bindPassword: '__IN SRECREST FILE__',
userBase: 'ou=people,dc=theta42,dc=com',
groupBase: 'ou=groups,dc=theta42,dc=com',
userFilter: '(objectClass=posixAccount)',
userNameAttribute: 'uid'
},
SENDGRID_API_KEy: '__IN SRECREST FILE__',
};

32
nodejs/conf/conf.js Normal file
View File

@ -0,0 +1,32 @@
'use strict';
const extend = require('extend');
const environment = process.env.NODE_ENV || 'development';
function load(filePath, required){
try {
return require(filePath);
} catch(error){
if(error.name === 'SyntaxError'){
console.error(`Loading ${filePath} file failed!\n`, error);
process.exit(1);
} else if (error.code === 'MODULE_NOT_FOUND'){
console.warn(`No config file ${filePath} FOUND! This may cause issues...`);
if (required){
process.exit(1);
}
return {};
}else{
console.dir(`Unknown error in loading ${filePath} config file.\n`, error);
}
}
};
module.exports = extend(
true, // enable deep copy
load('./base', true),
load(`./${environment}`),
load('./secrets'),
{environment}
);