mirror of https://github.com/calzoneman/sync.git
Change login timeout
This commit is contained in:
parent
8313e7b006
commit
63055c51a2
|
@ -128,8 +128,6 @@ module.exports.initGlobalTables = function () {
|
||||||
"PRIMARY KEY (`visit_id`), INDEX (`ip`))",
|
"PRIMARY KEY (`visit_id`), INDEX (`ip`))",
|
||||||
fail("aliases"));
|
fail("aliases"));
|
||||||
|
|
||||||
// TODO actionlog? or no?
|
|
||||||
|
|
||||||
query("CREATE TABLE IF NOT EXISTS `stats` (" +
|
query("CREATE TABLE IF NOT EXISTS `stats` (" +
|
||||||
"`time` BIGINT NOT NULL," +
|
"`time` BIGINT NOT NULL," +
|
||||||
"`usercount` INT NOT NULL," +
|
"`usercount` INT NOT NULL," +
|
||||||
|
@ -138,6 +136,20 @@ module.exports.initGlobalTables = function () {
|
||||||
"PRIMARY KEY (`time`))" +
|
"PRIMARY KEY (`time`))" +
|
||||||
"CHARACTER SET utf8",
|
"CHARACTER SET utf8",
|
||||||
fail("stats"));
|
fail("stats"));
|
||||||
|
|
||||||
|
query("CREATE TABLE IF NOT EXISTS `meta` (" +
|
||||||
|
"`key` VARCHAR(255) NOT NULL," +
|
||||||
|
"`value` TEXT NOT NULL," +
|
||||||
|
"PRIMARY KEY (`key`))" +
|
||||||
|
"CHARACTER SET utf8",
|
||||||
|
function (err, res) {
|
||||||
|
if (err) {
|
||||||
|
fail("meta")(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO select/update appropriate values
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/* REGION global bans */
|
/* REGION global bans */
|
||||||
|
|
|
@ -39,7 +39,7 @@ function handleLogin(req, res) {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
res.cookie("auth", user.name + ":" + user.hash, {
|
res.cookie("auth", user.name + ":" + user.hash, {
|
||||||
expires: new Date(Date.now() + 60*60*1000),
|
expires: new Date(Date.now() + 7*24*60*60*1000),
|
||||||
httpOnly: true
|
httpOnly: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,7 @@ function sendJade(res, view, locals) {
|
||||||
});
|
});
|
||||||
cache[view] = fn;
|
cache[view] = fn;
|
||||||
}
|
}
|
||||||
var start = Date.now();
|
|
||||||
var html = cache[view](merge(locals));
|
var html = cache[view](merge(locals));
|
||||||
var end = Date.now();
|
|
||||||
console.log(view + " " + (end - start) + "ms");
|
|
||||||
res.send(html);
|
res.send(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue