diff --git a/apps/wizarr-backend/wizarr_backend/app/config.py b/apps/wizarr-backend/wizarr_backend/app/config.py index c6386304..de4e57f4 100644 --- a/apps/wizarr-backend/wizarr_backend/app/config.py +++ b/apps/wizarr-backend/wizarr_backend/app/config.py @@ -2,7 +2,7 @@ from os import environ, path from flask import Flask from app.security import secret_key, SchedulerAuth -from definitions import DATABASE_DIR +from definitions import DATABASE_DIR, MAX_CONTENT_LENGTH def create_config(app: Flask): config = {} @@ -30,5 +30,6 @@ def create_config(app: Flask): config["SCHEDULER_API_ENABLED"] = True config["SCHEDULER_API_PREFIX"] = "/api/scheduler" config["SCHEDULER_AUTH"] = SchedulerAuth() + config["MAX_CONTENT_LENGTH"] = MAX_CONTENT_LENGTH return config diff --git a/apps/wizarr-backend/wizarr_backend/definitions.py b/apps/wizarr-backend/wizarr_backend/definitions.py index 0c150f55..481cb2f4 100644 --- a/apps/wizarr-backend/wizarr_backend/definitions.py +++ b/apps/wizarr-backend/wizarr_backend/definitions.py @@ -3,3 +3,4 @@ ROOT_DIR = getenv("ROOT_DIR", path.abspath(path.join(path.abspath(__file__), "../"))) LATEST_FILE = getenv("LATEST_FILE", path.join(ROOT_DIR, "../", "../", "../", "latest")) DATABASE_DIR = getenv("DATABASE_DIR", path.join(ROOT_DIR, "../", "database")) +MAX_CONTENT_LENGTH = getenv("MAX_CONTENT_LENGTH", 5 * 1024 * 1024) # 5MB diff --git a/files/nginx-backend.conf b/files/nginx-backend.conf index 3606af9d..3a9d7e10 100644 --- a/files/nginx-backend.conf +++ b/files/nginx-backend.conf @@ -8,6 +8,8 @@ server { add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization'; + client_max_body_size 0; # Disables limit, relying on Flask's MAX_CONTENT_LENGTH + location /api { proxy_pass http://127.0.0.1:5000; # proxy_set_header Host $host;