create Variables for to many 418 errors when they are a hacker or bot to get blocked
Build and Push Docker Container / build-and-push (push) Successful in 2m28s

This commit is contained in:
2026-01-07 00:00:44 +01:00
parent b7ec488b44
commit e541000347
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
from my_modules.app.constens import BLOCKED_IPS_ACCESSING_TIMES, BLOCKED_IPS_STORED_TIMEFRAME
from my_modules.app.setup import app, LIMITER
from my_modules.app.logger import logger
@@ -38,7 +39,7 @@ async def not_found(e):
@app.errorhandler(418)
async def maybe_a_hacker(e=None):
try:
enforce_custom_limit(LIMITER, "BotScan", 5, 120)
enforce_custom_limit(LIMITER, "BotScan", BLOCKED_IPS_ACCESSING_TIMES, BLOCKED_IPS_STORED_TIMEFRAME)
except LookupError as e:
client_ip=get_ip()
await current_app.convex.increment_blocked_ip_address_access(