mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"upgrade-available": "<p>A new version (v%1) has been released. Consider <a href=\"https://docs.nodebb.org/en/latest/upgrading/index.html\">upgrading your NodeBB</a>.</p>",
|
"upgrade-available": "<p>A new version (v%1) has been released. Consider <a href=\"https://docs.nodebb.org/en/latest/upgrading/index.html\">upgrading your NodeBB</a>.</p>",
|
||||||
"prerelease-upgrade-available": "<p>This is an outdated pre-release version of NodeBB. A new version (v%1) has been released. Consider <a href=\"https://docs.nodebb.org/en/latest/upgrading/index.html\">upgrading your NodeBB</a>.</p>",
|
"prerelease-upgrade-available": "<p>This is an outdated pre-release version of NodeBB. A new version (v%1) has been released. Consider <a href=\"https://docs.nodebb.org/en/latest/upgrading/index.html\">upgrading your NodeBB</a>.</p>",
|
||||||
"prerelease-warning": "<p>This is a <strong>pre-release</strong> version of NodeBB. Unintended bugs may occur. <i class=\"fa fa-exclamation-triangle\"></i></p>",
|
"prerelease-warning": "<p>This is a <strong>pre-release</strong> version of NodeBB. Unintended bugs may occur. <i class=\"fa fa-exclamation-triangle\"></i></p>",
|
||||||
|
"running-in-development": "<span>Forum is running in development mode. The forum may be open to potential vulnerabilities; please contact your system administrator.</span>",
|
||||||
|
|
||||||
"notices": "Notices",
|
"notices": "Notices",
|
||||||
"restart-not-required": "Restart not required",
|
"restart-not-required": "Restart not required",
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ dashboardController.get = function (req, res, next) {
|
|||||||
link:'/admin/extend/plugins'
|
link:'/admin/extend/plugins'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (global.env !== 'production') {
|
||||||
|
notices.push({
|
||||||
|
done: false,
|
||||||
|
notDoneText: '[[admin/general/dashboard:running-in-development]]'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
plugins.fireHook('filter:admin.notices', notices, next);
|
plugins.fireHook('filter:admin.notices', notices, next);
|
||||||
}
|
}
|
||||||
}, function (err, results) {
|
}, function (err, results) {
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ module.exports = function (middleware) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
templateValues.configJSON = JSON.stringify(res.locals.config);
|
templateValues.configJSON = JSON.stringify(res.locals.config);
|
||||||
|
async.waterfall([
|
||||||
|
function (next) {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
scripts: function (next) {
|
scripts: function (next) {
|
||||||
plugins.fireHook('filter:scripts.get', [], next);
|
plugins.fireHook('filter:scripts.get', [], next);
|
||||||
@@ -100,11 +101,9 @@ module.exports = function (middleware) {
|
|||||||
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
||||||
banned: async.apply(user.isBanned, req.uid),
|
banned: async.apply(user.isBanned, req.uid),
|
||||||
banReason: async.apply(user.getBannedReason, req.uid)
|
banReason: async.apply(user.getBannedReason, req.uid)
|
||||||
}, function (err, results) {
|
}, next);
|
||||||
if (err) {
|
},
|
||||||
return callback(err);
|
function (results, next) {
|
||||||
}
|
|
||||||
|
|
||||||
if (results.banned) {
|
if (results.banned) {
|
||||||
req.logout();
|
req.logout();
|
||||||
return res.redirect('/?banned=' + (results.banReason || 'no-reason'));
|
return res.redirect('/?banned=' + (results.banReason || 'no-reason'));
|
||||||
@@ -151,23 +150,31 @@ module.exports = function (middleware) {
|
|||||||
modifyTitle(templateValues);
|
modifyTitle(templateValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function (err, data) {
|
plugins.fireHook('filter:middleware.renderHeader', {
|
||||||
if (err) {
|
req: req,
|
||||||
return callback(err);
|
res: res,
|
||||||
|
templateValues: templateValues
|
||||||
|
}, next);
|
||||||
|
},
|
||||||
|
function (data, next) {
|
||||||
|
req.app.render('header', data.templateValues, next);
|
||||||
}
|
}
|
||||||
|
], callback);
|
||||||
req.app.render('header', data.templateValues, callback);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
middleware.renderFooter = function (req, res, data, callback) {
|
middleware.renderFooter = function (req, res, data, callback) {
|
||||||
plugins.fireHook('filter:middleware.renderFooter', {templateValues: data, req: req, res: res}, function (err, data) {
|
async.waterfall([
|
||||||
if (err) {
|
function (next) {
|
||||||
return callback(err);
|
plugins.fireHook('filter:middleware.renderFooter', {
|
||||||
|
req: req,
|
||||||
|
res: res,
|
||||||
|
templateValues: data,
|
||||||
|
}, next);
|
||||||
|
},
|
||||||
|
function (data, next) {
|
||||||
|
req.app.render('footer', data.templateValues, next);
|
||||||
}
|
}
|
||||||
req.app.render('footer', data.templateValues, callback);
|
], callback);
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function modifyTitle(obj) {
|
function modifyTitle(obj) {
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ Sockets.init = function (server) {
|
|||||||
|
|
||||||
var SocketIO = require('socket.io');
|
var SocketIO = require('socket.io');
|
||||||
var socketioWildcard = require('socketio-wildcard')();
|
var socketioWildcard = require('socketio-wildcard')();
|
||||||
|
var ioConfig = {
|
||||||
|
transports: nconf.get('socket.io:transports')
|
||||||
|
};
|
||||||
|
|
||||||
io = new SocketIO({
|
io = new SocketIO({
|
||||||
path: nconf.get('relative_path') + '/socket.io'
|
path: nconf.get('relative_path') + '/socket.io'
|
||||||
});
|
});
|
||||||
@@ -47,17 +51,15 @@ Sockets.init = function (server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!override) {
|
if (!override) {
|
||||||
io.set('origins', parsedUrl.protocol + '//' + domain + ':*');
|
ioConfig.origins = parsedUrl.protocol + '//' + domain + ':*';
|
||||||
winston.info('[socket.io] Restricting access to origin: ' + parsedUrl.protocol + '//' + domain + ':*');
|
winston.info('[socket.io] Restricting access to origin: ' + parsedUrl.protocol + '//' + domain + ':*');
|
||||||
} else {
|
} else {
|
||||||
io.set('origins', override);
|
ioConfig.origins = override;
|
||||||
winston.info('[socket.io] Restricting access to origin: ' + override);
|
winston.info('[socket.io] Restricting access to origin: ' + override);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
io.listen(server, {
|
io.listen(server, ioConfig);
|
||||||
transports: nconf.get('socket.io:transports')
|
|
||||||
});
|
|
||||||
|
|
||||||
Sockets.server = io;
|
Sockets.server = io;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user