Add /reload console command, change some internal config
This commit is contained in:
parent
2bd6a207ba
commit
4e2c6d486b
4 changed files with 53 additions and 24 deletions
|
|
@ -14,8 +14,8 @@ function merge(locals) {
|
|||
siteTitle: Config.get("html-template.title"),
|
||||
siteDescription: Config.get("html-template.description"),
|
||||
siteAuthor: "Calvin 'calzoneman' 'cyzon' Montgomery",
|
||||
loginDomain: Config.get("https.enabled") ? Config.get("https.domain")+":"+Config.get("https.port")
|
||||
: Config.get("http.domain")+":"+Config.get("http.port")
|
||||
loginDomain: Config.get("https.enabled") ? Config.get("https.full-address")
|
||||
: Config.get("http.full-address")
|
||||
};
|
||||
if (typeof locals !== "object") {
|
||||
return _locals;
|
||||
|
|
@ -30,7 +30,7 @@ function merge(locals) {
|
|||
* Renders and serves a jade template
|
||||
*/
|
||||
function sendJade(res, view, locals) {
|
||||
if (!(view in cache) || process.env["DEBUG"]) {
|
||||
if (!(view in cache) || Config.get("debug")) {
|
||||
var file = path.join(templates, view + ".jade");
|
||||
var fn = jade.compile(fs.readFileSync(file), {
|
||||
filename: file,
|
||||
|
|
|
|||
|
|
@ -64,12 +64,7 @@ function logRequest(req, status) {
|
|||
|
||||
function cookieall(res, name, val, opts) {
|
||||
res.cookie(name, val, opts);
|
||||
|
||||
opts.domain = Config.get("http.root-domain");
|
||||
if (Config.get("http.domain").indexOf(opts.domain) === -1) {
|
||||
opts.domain = Config.get("http.domain");
|
||||
}
|
||||
|
||||
res.cookie(name, val, opts);
|
||||
}
|
||||
|
||||
|
|
@ -78,11 +73,7 @@ function cookieall(res, name, val, opts) {
|
|||
*/
|
||||
function redirectHttps(req, res) {
|
||||
if (!req.secure && Config.get("https.enabled")) {
|
||||
var ssldomain = Config.get("https.domain");
|
||||
var port = Config.get("https.port");
|
||||
if (port !== 443) {
|
||||
ssldomain += ":" + port;
|
||||
}
|
||||
var ssldomain = Config.get("https.full-address");
|
||||
res.redirect(ssldomain + req.path);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -94,11 +85,7 @@ function redirectHttps(req, res) {
|
|||
*/
|
||||
function redirectHttp(req, res) {
|
||||
if (req.secure) {
|
||||
var domain = Config.get("http.domain");
|
||||
var port = Config.get("http.port");
|
||||
if (port !== 80) {
|
||||
domain += ":" + port;
|
||||
}
|
||||
var domain = Config.get("http.full-address");
|
||||
res.redirect(domain + req.path);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -129,7 +116,7 @@ function handleChannel(req, res) {
|
|||
|
||||
var sio;
|
||||
if (req.secure) {
|
||||
sio = Config.get("https.domain") + ":" + Config.get("https.port");
|
||||
sio = Config.get("https.full-address");
|
||||
} else {
|
||||
sio = Config.get("io.domain") + ":" + Config.get("io.port");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue