* Initial work on moving to JSON configured Message Areas (vs ID's in SQLite). This will be applied to user groups, and other types as well such that JSON can simply be edited in config.json

* Hopefully better/proper merge of config.js + config.json => config
This commit is contained in:
Bryan Ashby 2015-08-20 16:35:04 -06:00
parent ec70cc8caa
commit 35de0a2487
4 changed files with 103 additions and 10 deletions

View file

@ -31,7 +31,15 @@ function init(configPath, cb) {
});
},
function mergeWithDefaultConfig(configJson, callback) {
var mergedConfig = _.defaultsDeep(configJson, getDefaultConfig());
//var mergedConfig = _.defaultsDeep(configJson, getDefaultConfig());
var mergedConfig = _.merge(getDefaultConfig(), configJson, function mergeCustomizer(conf1, conf2) {
// Arrays should always concat
if(_.isArray(conf1)) {
// :TODO: look for collisions & override dupes
return conf1.concat(conf2);
}
});
callback(null, mergedConfig);
}
],
@ -67,6 +75,7 @@ function getDefaultConfig() {
passwordMax : 128,
requireActivation : true, // require SysOp activation?
invalidUsernames : [],
defaultGroups : [ 'users' ]
},
@ -113,6 +122,12 @@ function getDefaultConfig() {
}
},
messages : {
areas : [
{ name : "private_mail", desc : "Private Email", groups : [ "users" ] }
]
},
networks : {
/*
networkName : { // e.g. fidoNet