summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-04-05 01:40:55 +0200
committerTor Andersson <tor@ccxvii.net>2022-04-15 14:34:17 +0200
commit2f320ed21eba25fac0da4570949ce222f1410447 (patch)
tree7df97b32b2c18424b96369094aa788655900110c /server.js
parent8875d16a5d50541f1b0b914e0b9666fe4c2b26a8 (diff)
downloadserver-2f320ed21eba25fac0da4570949ce222f1410447.tar.gz
Drop IP blacklist. Just use iptables instead.
Diffstat (limited to 'server.js')
-rw-r--r--server.js3
1 files changed, 0 insertions, 3 deletions
diff --git a/server.js b/server.js
index b38c368..5d97417 100644
--- a/server.js
+++ b/server.js
@@ -224,7 +224,6 @@ function get_avatar(mail) {
* USER AUTHENTICATION
*/
-const SQL_BLACKLIST_IP = SQL("SELECT EXISTS ( SELECT 1 FROM blacklist_ip WHERE ip=? )").pluck();
const SQL_BLACKLIST_MAIL = SQL("SELECT EXISTS ( SELECT 1 FROM blacklist_mail WHERE ? LIKE mail )").pluck();
const SQL_EXISTS_USER_NAME = SQL("SELECT EXISTS ( SELECT 1 FROM users WHERE name=? )").pluck();
@@ -313,8 +312,6 @@ app.use(function (req, res, next) {
return res.redirect("/msie.html");
let ip = req.ip || req.connection.remoteAddress || "0.0.0.0";
res.setHeader('Cache-Control', 'no-store');
- if (SQL_BLACKLIST_IP.get(ip) === 1)
- return res.status(403).send('Sorry, but this IP has been banned.');
let sid = login_cookie(req);
if (sid) {
let user_id = login_sql_select.get(sid);