|
|
@ -60,7 +60,7 @@
|
|
|
|
nconf.file({
|
|
|
|
nconf.file({
|
|
|
|
file: __dirname + '/config.json'
|
|
|
|
file: __dirname + '/config.json'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
meta = require('./src/meta.js');
|
|
|
|
meta = require('./src/meta');
|
|
|
|
|
|
|
|
|
|
|
|
nconf.set('url', nconf.get('base_url') + (nconf.get('use_port') ? ':' + nconf.get('port') : '') + nconf.get('relative_path') + '/');
|
|
|
|
nconf.set('url', nconf.get('base_url') + (nconf.get('use_port') ? ':' + nconf.get('port') : '') + nconf.get('relative_path') + '/');
|
|
|
|
nconf.set('upload_url', nconf.get('url') + 'uploads/');
|
|
|
|
nconf.set('upload_url', nconf.get('url') + 'uploads/');
|
|
|
@ -73,60 +73,62 @@
|
|
|
|
winston.info('Base Configuration OK.');
|
|
|
|
winston.info('Base Configuration OK.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
meta.configs.init(function () {
|
|
|
|
require('./src/database').init(function(err) {
|
|
|
|
|
|
|
|
meta.configs.init(function () {
|
|
|
|
//
|
|
|
|
|
|
|
|
// TODO : figure out reds search after dbal is complete
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// TODO : figure out reds search after dbal is complete
|
|
|
|
//var reds = require('reds'),
|
|
|
|
//
|
|
|
|
// db = require('./src/database');
|
|
|
|
//var reds = require('reds'),
|
|
|
|
/*reds.createClient = function () {
|
|
|
|
// db = require('./src/database');
|
|
|
|
return reds.client || (reds.client = db);
|
|
|
|
/*reds.createClient = function () {
|
|
|
|
};*/
|
|
|
|
return reds.client || (reds.client = db);
|
|
|
|
|
|
|
|
};*/
|
|
|
|
var templates = require('./public/src/templates'),
|
|
|
|
|
|
|
|
translator = require('./public/src/translator'),
|
|
|
|
var templates = require('./public/src/templates'),
|
|
|
|
webserver = require('./src/webserver'),
|
|
|
|
translator = require('./public/src/translator'),
|
|
|
|
SocketIO = require('socket.io').listen(global.server, { log: false, transports: ['websocket', 'xhr-polling', 'jsonp-polling', 'flashsocket'], 'browser client minification': true}),
|
|
|
|
webserver = require('./src/webserver'),
|
|
|
|
websockets = require('./src/websockets'),
|
|
|
|
SocketIO = require('socket.io').listen(global.server, { log: false, transports: ['websocket', 'xhr-polling', 'jsonp-polling', 'flashsocket'], 'browser client minification': true}),
|
|
|
|
plugins = require('./src/plugins'),
|
|
|
|
websockets = require('./src/websockets'),
|
|
|
|
notifications = require('./src/notifications'),
|
|
|
|
plugins = require('./src/plugins'),
|
|
|
|
upgrade = require('./src/upgrade');
|
|
|
|
notifications = require('./src/notifications'),
|
|
|
|
|
|
|
|
upgrade = require('./src/upgrade');
|
|
|
|
upgrade.check(function(schema_ok) {
|
|
|
|
|
|
|
|
if (schema_ok || nconf.get('check-schema') === false) {
|
|
|
|
upgrade.check(function(schema_ok) {
|
|
|
|
websockets.init(SocketIO);
|
|
|
|
if (schema_ok || nconf.get('check-schema') === false) {
|
|
|
|
console.log('calling plugins init');
|
|
|
|
websockets.init(SocketIO);
|
|
|
|
plugins.init();
|
|
|
|
|
|
|
|
global.templates = {};
|
|
|
|
plugins.init();
|
|
|
|
global.translator = translator;
|
|
|
|
global.templates = {};
|
|
|
|
|
|
|
|
global.translator = translator;
|
|
|
|
translator.loadServer();
|
|
|
|
|
|
|
|
|
|
|
|
translator.loadServer();
|
|
|
|
var customTemplates = meta.config['theme:templates'] ? path.join(__dirname, 'node_modules', meta.config['theme:id'], meta.config['theme:templates']) : false;
|
|
|
|
|
|
|
|
|
|
|
|
var customTemplates = meta.config['theme:templates'] ? path.join(__dirname, 'node_modules', meta.config['theme:id'], meta.config['theme:templates']) : false;
|
|
|
|
// todo: replace below with read directory code, derp.
|
|
|
|
|
|
|
|
templates.init([
|
|
|
|
// todo: replace below with read directory code, derp.
|
|
|
|
'header', 'footer', 'logout', 'outgoing', 'admin/header', 'admin/footer', 'admin/index',
|
|
|
|
templates.init([
|
|
|
|
'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext',
|
|
|
|
'header', 'footer', 'logout', 'outgoing', 'admin/header', 'admin/footer', 'admin/index',
|
|
|
|
'emails/header', 'emails/footer',
|
|
|
|
'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext',
|
|
|
|
|
|
|
|
'emails/header', 'emails/footer',
|
|
|
|
'noscript/header', 'noscript/home', 'noscript/category', 'noscript/topic'
|
|
|
|
|
|
|
|
], customTemplates);
|
|
|
|
'noscript/header', 'noscript/home', 'noscript/category', 'noscript/topic'
|
|
|
|
|
|
|
|
], customTemplates);
|
|
|
|
|
|
|
|
|
|
|
|
plugins.ready(function() {
|
|
|
|
|
|
|
|
templates.ready(webserver.init);
|
|
|
|
plugins.ready(function() {
|
|
|
|
});
|
|
|
|
templates.ready(webserver.init);
|
|
|
|
|
|
|
|
});
|
|
|
|
notifications.init();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
notifications.init();
|
|
|
|
winston.warn('Your NodeBB schema is out-of-date. Please run the following command to bring your dataset up to spec:');
|
|
|
|
} else {
|
|
|
|
winston.warn(' node app --upgrade');
|
|
|
|
winston.warn('Your NodeBB schema is out-of-date. Please run the following command to bring your dataset up to spec:');
|
|
|
|
winston.warn('To ignore this error (not recommended):');
|
|
|
|
winston.warn(' node app --upgrade');
|
|
|
|
winston.warn(' node app --no-check-schema')
|
|
|
|
winston.warn('To ignore this error (not recommended):');
|
|
|
|
process.exit();
|
|
|
|
winston.warn(' node app --no-check-schema')
|
|
|
|
}
|
|
|
|
process.exit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if (nconf.get('setup') || nconf.get('install') || !fs.existsSync(__dirname + '/config.json')) {
|
|
|
|
} else if (nconf.get('setup') || nconf.get('install') || !fs.existsSync(__dirname + '/config.json')) {
|
|
|
|