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',
|
|
|
|
|
2014-10-30 04:23:44 +00:00
|
|
|
// :TODO: probably replace this with 'firstMenu' or somthing once that's available
|
2014-10-31 04:59:21 +00:00
|
|
|
entryMod : 'matrix',
|
2014-10-30 04:23:44 +00:00
|
|
|
|
|
|
|
preLoginTheme : '*',
|
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/'),
|
2014-10-29 11:30:20 +00:00
|
|
|
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-19 05:08:23 +00:00
|
|
|
enabled : false,
|
2014-10-17 02:21:06 +00:00
|
|
|
rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'),
|
|
|
|
dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|