From 24d110f063d01821db7922fe319ba92f5c014839 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 16 Sep 2024 19:14:52 +0000 Subject: [PATCH] settings: Increase default max file upload size to 100MB. This also _lowers_ the default nginx client_max_body_size, since that no longer caps the upload file size. --- puppet/zulip/templates/nginx.conf.template.erb | 2 +- zproject/default_settings.py | 2 +- zproject/prod_settings_template.py | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/puppet/zulip/templates/nginx.conf.template.erb b/puppet/zulip/templates/nginx.conf.template.erb index 98d07b4b58..84e46bbd8f 100644 --- a/puppet/zulip/templates/nginx.conf.template.erb +++ b/puppet/zulip/templates/nginx.conf.template.erb @@ -19,7 +19,7 @@ http { tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; - client_max_body_size 80m; + client_max_body_size 25m; include /etc/nginx/mime.types; default_type application/octet-stream; diff --git a/zproject/default_settings.py b/zproject/default_settings.py index dc21cea2ce..099d88d202 100644 --- a/zproject/default_settings.py +++ b/zproject/default_settings.py @@ -167,7 +167,7 @@ S3_AVATAR_PUBLIC_URL_PREFIX: str | None = None LOCAL_UPLOADS_DIR: str | None = None LOCAL_AVATARS_DIR: str | None = None LOCAL_FILES_DIR: str | None = None -MAX_FILE_UPLOAD_SIZE = 25 +MAX_FILE_UPLOAD_SIZE = 100 # How many GB an organization on a paid plan can upload per user, # on zulipchat.com. UPLOAD_QUOTA_PER_USER_GB = 5 diff --git a/zproject/prod_settings_template.py b/zproject/prod_settings_template.py index aff324dbce..9a28017bc3 100644 --- a/zproject/prod_settings_template.py +++ b/zproject/prod_settings_template.py @@ -800,13 +800,10 @@ LOCAL_UPLOADS_DIR = "/home/zulip/uploads" # S3_SKIP_PROXY = True # S3_UPLOADS_STORAGE_CLASS = "STANDARD" -## Maximum allowed size of uploaded files, in megabytes. This value is -## capped at 80MB in the nginx configuration, because the file upload -## implementation doesn't use chunked uploads, and browsers may crash -## with larger uploads. -## Set MAX_FILE_UPLOAD_SIZE to 0 to disable file uploads completely +## Maximum allowed size of uploaded files, in megabytes. Set +## MAX_FILE_UPLOAD_SIZE to 0 to disable file uploads completely ## (including hiding upload-related options from UI). -MAX_FILE_UPLOAD_SIZE = 25 +MAX_FILE_UPLOAD_SIZE = 100 ## Controls whether name changes are completely disabled for this ## installation. This is useful when you're syncing names from an