ddos mitigation tweak for WPD

master
Aevann 2023-03-12 01:11:46 +02:00
parent 2c2edabf5c
commit eb5f2723c2
2 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,10 @@ def calc_users():
loggedout_counter = len(loggedout) loggedout_counter = len(loggedout)
if get_setting('automatic_DDOS_mitigation'): 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'): if not get_setting('login_required'):
toggle_setting('login_required') toggle_setting('login_required')
else: else:

View File

@ -54,9 +54,6 @@ def get_logged_in_user():
else: else:
session.pop("lo_user") 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']): 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) abort(403)