From 8a4c2c4b6f3771a9c4de03ddf00caeaac20f4383 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 29 Apr 2024 00:00:51 +0300 Subject: [PATCH] same as last commit --- files/routes/admin.py | 4 ---- files/routes/wrappers.py | 13 ------------- 2 files changed, 17 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index d599a4ec3..15d60e80c 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -389,10 +389,6 @@ def reported_comments(v): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @admin_level_required(PERMS['ADMIN_HOME_VISIBLE']) def admin_home(v): - if CLOUDFLARE_AVAILABLE: - try: under_attack = (requests.get(f"{CLOUDFLARE_API_URL}/zones/{CF_ZONE}/settings/security_level", headers=CF_HEADERS, timeout=CLOUDFLARE_REQUEST_TIMEOUT_SECS).json()['result']['value'] == "under_attack") - except: return render_template("admin/admin_home.html", v=v) - set_setting('under_attack', under_attack) return render_template("admin/admin_home.html", v=v) @app.post("/admin/site_settings/") diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 6b32089c1..992262c53 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -56,19 +56,6 @@ def calc_users(): g.loggedin_counter = len(loggedin) g.loggedout_counter = len(loggedout) - if SITE == 'watchpeopledie.tv': - ddos_threshold = 3500 - else: - ddos_threshold = 1000 - - if g.loggedin_counter + g.loggedout_counter > ddos_threshold or (SITE == 'watchpeopledie.tv' and get_setting('login_required')): - if not get_setting('under_attack'): - set_setting('under_attack', True) - set_security_level('under_attack') - # else: - # if get_setting('under_attack'): - # set_setting('under_attack', False) - # set_security_level('high') return '' def get_logged_in_user():