This commit is contained in:
2024-01-05 22:06:34 -05:00
parent c8f00cdeaf
commit abc547c642
34 changed files with 6586 additions and 1561 deletions

25
conf/base.js Normal file
View File

@ -0,0 +1,25 @@
'use strict';
module.exports = {
ldap: {
url: 'ldap://10.1.0.55:389',
bindDN: 'cn=ldapclient service,ou=people,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'
},
sql: {
"storage": "database_test.sqlite",
"dialect": "sqlite",
logging: false,
},
transmission: {
host:'10.2.254.40',
ssl: false,
port: 9091,
username: 'william',
password: '__IN SRECREST FILE__',
}
};

32
conf/index.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}
);