From eb5f2723c2f621f47da8028b51ae8c76a2c73727 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 12 Mar 2023 01:11:46 +0200 Subject: [PATCH] ddos mitigation tweak for WPD --- files/routes/jinja2.py | 5 ++++- files/routes/wrappers.py | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index b8fd447db..2f97a83b9 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -77,7 +77,10 @@ def calc_users(): loggedout_counter = len(loggedout) if get_setting('automatic_DDOS_mitigation'): - if loggedout_counter > loggedin_counter: + if SITE == 'watchpeopledie.tv': mul = 3 + else: mul = 1 + + if loggedout_counter > (loggedin_counter * mul): if not get_setting('login_required'): toggle_setting('login_required') else: diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index c6b9966c7..cb8eeaa2e 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -54,9 +54,6 @@ def get_logged_in_user(): else: session.pop("lo_user") - # if SITE == 'devrama.net' and not (v and v.id == 7): - # abort(403, "Only Aevann can access devrama for now!") - if request.method.lower() != "get" and get_setting('read_only_mode') and not (v and v.admin_level >= PERMS['SITE_BYPASS_READ_ONLY_MODE']): abort(403)