From 4f9df8c5bf3d3c3126702df4bff606acee84f031 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 20 May 2022 20:32:36 +0200 Subject: [PATCH 1/5] sdf --- files/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/__main__.py b/files/__main__.py index 313a1fec9b..7edf998b06 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -88,7 +88,7 @@ def before_request(): with open('site_settings.json', 'r') as f: app.config['SETTINGS'] = json.load(f) - if request.host != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 401 + # if request.host != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 401 if request.headers.get("CF-Worker"): return {"error":"Cloudflare workers are not allowed to access this website."}, 401 if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"): abort(503) From 9c978a13ac9cd156ebcc7c02570b8a521a4e27d1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 20 May 2022 20:42:18 +0200 Subject: [PATCH 2/5] fsd --- ubuntu_setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu_setup b/ubuntu_setup index f442f0b55f..f3e35c1905 100644 --- a/ubuntu_setup +++ b/ubuntu_setup @@ -3,7 +3,7 @@ cp ./env /env . /env apt update apt -y upgrade -apt -y install git postgresql postgresql-contrib redis-server python3-pip libenchant1c2a ffmpeg tmux nginx snapd +apt -y install git postgresql postgresql-contrib redis-server python3-pip libenchant1c2a ffmpeg tmux nginx snapd ufw cp pg_hba.conf /etc/postgresql/12/main/pg_hba.conf service postgresql restart psql -U postgres -f schema.sql postgres From aed84df4adf193ce21494a6a1e5aa2133e06696f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 20 May 2022 20:45:12 +0200 Subject: [PATCH 3/5] fsd --- files/__main__.py | 2 +- files/classes/user.py | 1 + files/templates/header.html | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 7edf998b06..313a1fec9b 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -88,7 +88,7 @@ def before_request(): with open('site_settings.json', 'r') as f: app.config['SETTINGS'] = json.load(f) - # if request.host != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 401 + if request.host != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 401 if request.headers.get("CF-Worker"): return {"error":"Cloudflare workers are not allowed to access this website."}, 401 if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"): abort(503) diff --git a/files/classes/user.py b/files/classes/user.py index dfb4348ac9..31ba523374 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -188,6 +188,7 @@ class User(Base): @property @lazy def is_cakeday(self): + if SITE_NAME != 'rDrama': return False if time.time() - self.created_utc > 363 * 86400: date = time.strftime("%d %b", time.gmtime(self.created_utc)) now = time.strftime("%d %b", time.gmtime()) diff --git a/files/templates/header.html b/files/templates/header.html index 035fe3023f..8c9c9cc5aa 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -27,8 +27,13 @@ {% endif %} -