enigma-bbs/core/config.js

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2014-10-17 02:21:06 +00:00
/* jslint node: true */
'use strict';
var fs = require('fs');
var paths = require('path');
var miscUtil = require('./misc_util.js');
module.exports = {
defaultPath : function() {
var base = miscUtil.resolvePath('~/');
if(base) {
return paths.join(base, '.enigmabbs', 'config.json');
}
},
initFromFile : function(path, cb) {
var data = fs.readFileSync(path, 'utf8');
this.config = JSON.parse(data);
},
createDefault : function() {
this.config = {
bbsName : 'Another Fine ENiGMA½ BBS',
// :TODO: probably replace this with 'firstMenu' or somthing once that's available
entryMod : 'matrix',
preLoginTheme : '*',
2014-10-17 02:21:06 +00:00
2015-04-15 04:27:07 +00:00
users : {
usernameMin : 2,
usernameMax : 22,
passwordMin : 6,
requireActivation : true, // require SysOp activation?
defaultTheme : 'NU-MAYA',
2015-04-15 04:27:07 +00:00
},
2014-10-17 02:21:06 +00:00
paths : {
mods : paths.join(__dirname, './../mods/'),
servers : paths.join(__dirname, './servers/'),
art : paths.join(__dirname, './../mods/art/'),
themes : paths.join(__dirname, './../mods/art/themes/'),
2014-10-17 02:21:06 +00:00
logs : paths.join(__dirname, './../logs/'), // :TODO: set up based on system, e.g. /var/logs/enigmabbs or such
2014-10-20 05:30:44 +00:00
db : paths.join(__dirname, './../db/'),
2014-10-17 02:21:06 +00:00
},
servers : {
telnet : {
port : 8888,
enabled : true,
},
ssh : {
port : 8889,
2015-03-23 04:52:04 +00:00
enabled : true,
2014-10-17 02:21:06 +00:00
rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'),
dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'),
}
},
};
}
};