diff --git a/app/classes/ratelimitrer.php b/app/classes/ratelimiter.php similarity index 99% rename from app/classes/ratelimitrer.php rename to app/classes/ratelimiter.php index 7e8481c..ecd1eb6 100644 --- a/app/classes/ratelimitrer.php +++ b/app/classes/ratelimiter.php @@ -22,8 +22,7 @@ class RateLimiter { id INTEGER PRIMARY KEY AUTOINCREMENT, ip_address TEXT NOT NULL, username TEXT NOT NULL, - attempted_at TEXT DEFAULT (DATETIME('now')), - INDEX idx_ip_username (ip_address, username) + attempted_at TEXT DEFAULT (DATETIME('now')) )"; $this->db->exec($sql); diff --git a/doc/jilo-web.schema b/doc/jilo-web.schema index ef1a67e..f0f8e3d 100644 --- a/doc/jilo-web.schema +++ b/doc/jilo-web.schema @@ -33,7 +33,6 @@ CREATE TABLE login_attempts ( username TEXT NOT NULL, attempted_at TEXT DEFAULT (DATETIME('now')), ); -CREATE INDEX idx_ip_username ON login_attempts (ip_address, username); CREATE TABLE ip_whitelist ( id INTEGER PRIMARY KEY AUTOINCREMENT, diff --git a/public_html/index.php b/public_html/index.php index 35fa643..40fedd2 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -111,6 +111,9 @@ include '../app/helpers/logs.php'; $logObject = new Log($dbWeb); $user_IP = getUserIP(); +// init rate limiter +require '../app/classes/ratelimiter.php'; + // get platforms details require '../app/classes/platform.php'; $platformObject = new Platform($dbWeb);