mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
ssl support 101
This commit is contained in:
@@ -63,7 +63,7 @@
|
|||||||
<footer id="footer" class="container footer hide">
|
<footer id="footer" class="container footer hide">
|
||||||
{footerHTML}
|
{footerHTML}
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
Copyright © 2013 <a target="_blank" href="http://www.nodebb.com">NodeBB Forums</a> | <a target="_blank" href="//github.com/designcreateplay/NodeBB/graphs/contributors">Contributors</a>
|
Copyright © 2013 <a target="_blank" href="https://www.nodebb.com">NodeBB Forums</a> | <a target="_blank" href="//github.com/designcreateplay/NodeBB/graphs/contributors">Contributors</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ var path = require('path'),
|
|||||||
data.motd_class = (parseInt(meta.config.show_motd, 10) === 1 || meta.config.show_motd === undefined) ? '' : ' none';
|
data.motd_class = (parseInt(meta.config.show_motd, 10) === 1 || meta.config.show_motd === undefined) ? '' : ' none';
|
||||||
data.motd_class += (meta.config.motd && meta.config.motd.length > 0 ? '' : ' default');
|
data.motd_class += (meta.config.motd && meta.config.motd.length > 0 ? '' : ' default');
|
||||||
|
|
||||||
data.motd = require('marked')(meta.config.motd || "<div class=\"pull-right btn-group\"><a target=\"_blank\" href=\"http://www.nodebb.org\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-comment\"></i><span class='hidden-mobile'> Get NodeBB</span></a> <a target=\"_blank\" href=\"https://github.com/designcreateplay/NodeBB\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-github\"></i><span class='hidden-mobile'> Fork us on Github</span></a> <a target=\"_blank\" href=\"https://twitter.com/NodeBB\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-twitter\"></i><span class='hidden-mobile'> @NodeBB</span></a></div>\n\n# NodeBB <span>v" + pkg.version + "</span>\nWelcome to NodeBB, the discussion platform of the future.");
|
data.motd = require('marked')(meta.config.motd || "<div class=\"pull-right btn-group\"><a target=\"_blank\" href=\"https://www.nodebb.org\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-comment\"></i><span class='hidden-mobile'> Get NodeBB</span></a> <a target=\"_blank\" href=\"https://github.com/designcreateplay/NodeBB\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-github\"></i><span class='hidden-mobile'> Fork us on Github</span></a> <a target=\"_blank\" href=\"https://twitter.com/NodeBB\" class=\"btn btn-default btn-lg\"><i class=\"fa fa-twitter\"></i><span class='hidden-mobile'> @NodeBB</span></a></div>\n\n# NodeBB <span>v" + pkg.version + "</span>\nWelcome to NodeBB, the discussion platform of the future.");
|
||||||
res.json(data);
|
res.json(data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
var path = require('path'),
|
var path = require('path'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
|
nconf = require('nconf'),
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
express_namespace = require('express-namespace'),
|
express_namespace = require('express-namespace'),
|
||||||
WebServer = express(),
|
WebServer = express(),
|
||||||
server = require('http').createServer(WebServer),
|
server,
|
||||||
nconf = require('nconf'),
|
|
||||||
winston = require('winston'),
|
winston = require('winston'),
|
||||||
validator = require('validator'),
|
validator = require('validator'),
|
||||||
async = require('async'),
|
async = require('async'),
|
||||||
@@ -30,6 +29,16 @@ var path = require('path'),
|
|||||||
plugins = require('./plugins'),
|
plugins = require('./plugins'),
|
||||||
logger = require('./logger');
|
logger = require('./logger');
|
||||||
|
|
||||||
|
if(nconf.get('ssl')) {
|
||||||
|
server = require('https').createServer({
|
||||||
|
key: fs.readFileSync(nconf.get('ssl').key),
|
||||||
|
cert: fs.readFileSync(nconf.get('ssl').cert)
|
||||||
|
}, WebServer);
|
||||||
|
} else {
|
||||||
|
server = require('http').createServer(WebServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
(function (app) {
|
(function (app) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user