Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase file upload size #473

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/wizarr-backend/wizarr_backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions apps/wizarr-backend/wizarr_backend/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions files/nginx-backend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down