summaryrefslogtreecommitdiff
path: root/blob
diff options
context:
space:
mode:
authorHorus32014-04-16 13:43:34 +0200
committerHorus32014-04-16 13:43:34 +0200
commitb70acc4bce1450a726cf50a2f2f09539d74252b0 (patch)
treefd8b70beb7bbe57534137f3b19ea7c0f6fa0191a /blob
parent3dc852b163daba5fa59499215f8b725a6f0a39eb (diff)
downloadfiles.iamfabulous.de-b70acc4bce1450a726cf50a2f2f09539d74252b0.tar.gz
Improved brutforce protection and added ban page.
Diffstat (limited to 'blob')
-rwxr-xr-xblob/database_schema2
-rwxr-xr-xblob/nginx_rewrite_rules2
2 files changed, 3 insertions, 1 deletions
diff --git a/blob/database_schema b/blob/database_schema
index c994910..d2bf0cf 100755
--- a/blob/database_schema
+++ b/blob/database_schema
@@ -6,6 +6,6 @@ CREATE TABLE IF NOT EXISTS files (id INTEGER PRIMARY KEY, parent INTEGER, owner
CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY, user INTEGER, login TEXT, FOREIGN KEY(user) REFERENCES user(id));
-CREATE TABLE IF NOT EXISTS banned_user (id INTEGER PRIMARY KEY, ip TEXT, session_id TEXT, time INTEGER);
+CREATE TABLE IF NOT EXISTS banned_user (id INTEGER PRIMARY KEY, login_attempts, ip TEXT, session_id TEXT, time INTEGER, user INTEGER);
CREATE TRIGGER IF NOT EXISTS delete_files AFTER DELETE ON user FOR EACH ROW BEGIN DELETE FROM files WHERE owner=OLD.id; END;
diff --git a/blob/nginx_rewrite_rules b/blob/nginx_rewrite_rules
index e6783f0..1b65c16 100755
--- a/blob/nginx_rewrite_rules
+++ b/blob/nginx_rewrite_rules
@@ -11,6 +11,8 @@ location /robots.txt {} #stop rewriting the robots.txt
location /favicon.ico {}
location /static {}
+rewrite ^/banned$ /httperror.php?e=ban;
+
location ~* ^/?login/?([a-z0-9]+=[a-z0-9]+(&[a-z0-9]+=[a-z0-9]+)?)?$ {
rewrite ^/?login([?/]?.*) /index.php?task=login&arguments=$1 last;
}