diff --git a/files/routes/admin.py b/files/routes/admin.py index 1978817cd..14ca07b5e 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -389,7 +389,7 @@ 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: + if SITE == 'rdrama.net': 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) diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 071e05c4d..d7e92b917 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -56,19 +56,16 @@ def calc_users(): g.loggedin_counter = len(loggedin) g.loggedout_counter = len(loggedout) - if SITE == 'watchpeopledie.tv': - ddos_threshold = 3500 - else: + if SITE == 'rdrama.net': ddos_threshold = 1000 - - if g.loggedin_counter + g.loggedout_counter > ddos_threshold: - 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') + if g.loggedin_counter + g.loggedout_counter > ddos_threshold: + 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():