From ab83d60730247d54a16945f9996741ab45a5fba9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 26 Apr 2022 15:01:05 +0200 Subject: [PATCH] fds --- files/__main__.py | 2 +- files/routes/comments.py | 8 ++++---- files/routes/errors.py | 2 +- files/routes/posts.py | 8 ++++---- files/routes/settings.py | 12 ++++++------ files/routes/subs.py | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 08d9553fa..09e06c488 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -32,7 +32,7 @@ app.config["SERVER_NAME"] = environ.get("DOMAIN").strip() app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 3153600 app.config["SESSION_COOKIE_NAME"] = "session_" + environ.get("SITE_NAME").strip().lower() app.config["VERSION"] = "1.0.0" -app.config['MAX_CONTENT_LENGTH'] = 8 * 1024 * 1024 +app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 app.config["SESSION_COOKIE_SECURE"] = True app.config["SESSION_COOKIE_SAMESITE"] = "Lax" app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365 diff --git a/files/routes/comments.py b/files/routes/comments.py index 3838bff61..be8018c20 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -166,8 +166,8 @@ def api_comment(v): if v.admin_level < 3: if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 parent_submission = request.values.get("submission").strip() parent_fullname = request.values.get("parent_fullname").strip() @@ -674,8 +674,8 @@ def edit_comment(cid, v): if v.admin_level < 3: if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 c = get_comment(cid, v=v) diff --git a/files/routes/errors.py b/files/routes/errors.py index eeb32ab13..fffe06802 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -47,7 +47,7 @@ def error_405(e): @app.errorhandler(413) def error_413(e): - return {"error": "Max file size is 4 MB (8 MB for paypigs)"}, 413 + return {"error": "Max file size is 8 MB (16 MB for paypigs)"}, 413 @app.errorhandler(429) def error_429(e): diff --git a/files/routes/posts.py b/files/routes/posts.py index 760568876..2fe5ab328 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -424,8 +424,8 @@ def morecomments(v, cid): def edit_post(pid, v): if v.admin_level < 3: if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 p = get_post(pid) @@ -885,8 +885,8 @@ def submit_post(v, sub=None): if v.admin_level < 3: if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return error( "Max file size is 4 MB (8 MB for paypigs).") - elif request.content_length > 4 * 1024 * 1024: return error( "Max file size is 4 MB (8 MB for paypigs).") + if request.content_length > 16 * 1024 * 1024: return error( "Max file size is 8 MB (16 MB for paypigs).") + elif request.content_length > 8 * 1024 * 1024: return error( "Max file size is 8 MB (16 MB for paypigs).") if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username) diff --git a/files/routes/settings.py b/files/routes/settings.py index 8bb3228a1..4f7c22c86 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -41,8 +41,8 @@ def removebackground(v): @auth_required def settings_profile_post(v): if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 updated = False @@ -542,8 +542,8 @@ def settings_log_out_others(v): @auth_required def settings_images_profile(v): if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403 @@ -581,8 +581,8 @@ def settings_images_profile(v): @auth_required def settings_images_banner(v): if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403 diff --git a/files/routes/subs.py b/files/routes/subs.py index 6107c72c4..4d348405d 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -403,8 +403,8 @@ def get_sub_css(sub): @is_not_permabanned def sub_banner(v, sub): if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403 @@ -434,8 +434,8 @@ def sub_banner(v, sub): @is_not_permabanned def sub_sidebar(v, sub): if v and v.patron: - if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 - elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413 + if request.content_length > 16 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 + elif request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB (16 MB for paypigs)."}, 413 if request.headers.get("cf-ipcountry") == "T1": return {"error":"Image uploads are not allowed through TOR."}, 403