diff --git a/files/__main__.py b/files/__main__.py index c3155ba79..0d0bc4d28 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'] = 86400 app.config["SESSION_COOKIE_NAME"] = "session_" + environ.get("SITE_NAME").strip().lower() app.config["VERSION"] = "1.0.0" -app.config['MAX_CONTENT_LENGTH'] = 99 * 1024 * 1024 +app.config['MAX_CONTENT_LENGTH'] = 8 * 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/settings.py b/files/routes/settings.py index d3445f07f..38b563a9b 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -43,9 +43,9 @@ def removebackground(v): @limiter.limit("1/second;30/minute;200/hour;1000/day") @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 8 MB."}, 413 - # elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413 + if v and v.patron: + if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413 + elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413 updated = False @@ -537,7 +537,7 @@ def settings_security_post(v): if new_email == v.email: return render_template("settings_security.html", v=v, error="That email is already yours!") - url = f"{SITE_FULL}/activate" + url = f"{request.host_url}activate" now = int(time.time()) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 8b786e2fe..4c2486145 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 282354c21..cf162fe4d 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 8894abc71..f2d1e7d97 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index aae1eb229..ff048b090 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index eb234bd5c..0817122a3 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 95b4d9f29..5fc1789eb 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 7f7550fdd..6a1438fef 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index b837d0ac3..1177f139a 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 1c3b7914b..5ba3a28f2 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}