fix: add memory_limit and LimitRequestBody for big file upload support#472
fix: add memory_limit and LimitRequestBody for big file upload support#472DeepDiver1975 wants to merge 6 commits into
Conversation
DeepDiver1975
left a comment
There was a problem hiding this comment.
Adds OWNCLOUD_MEMORY_LIMIT (default 512M) to both v22.04 and v24.04 images, sets it in the PHP ini template, and adds LimitRequestBody 0 to the Apache vhost config. Changes are applied symmetrically across both version directories.
The fix is correct and well-targeted. A few notes:
LimitRequestBody 0: Setting this to 0 (unlimited) in the <Directory> block is the right approach for an ownCloud upload-focused image. Just be aware this applies to the entire document root — if any application code is served under the same vhost that should have request size limits, this would remove them. For a dedicated ownCloud container this is a non-issue.
memory_limit in ini vs .htaccess: The Docker-idiomatic approach (PHP ini) is correct here and avoids the mod_php8 module-name dependency. The companion owncloud/core#41612 adds the .htaccess block for non-Docker Apache installs.
ENVIRONMENT.md gap: The PR description notes OWNCLOUD_MEMORY_LIMIT is not yet documented. Worth a follow-up PR or adding it here — undocumented env vars in Docker images tend to stay undiscovered.
Symmetric v22.04/v24.04 changes: Both versions are updated identically, which is correct.
Safe to merge once CI passes.
|
I need to review this first if this is needed .... |
Summary
Two related gaps in big file upload support surfaced by owncloud/core#41611:
memory_limitnot set in Docker:owncloud.ini.tmplsetsupload_max_filesizeandpost_max_sizeviaOWNCLOUD_MAX_UPLOAD, butmemory_limitwas absent. For v24.04 (PHP 8.3 +mod_php8), the.htaccess<IfModule mod_php7.c>block doesn't fire, so PHP falls back to its compiled-in default of 128M instead of the intended 512M. For v22.04 (PHP 7.4), the.htaccessblock does fire, but having it in the ini is more explicit and Docker-idiomatic.LimitRequestBodynot explicit:apache.conf.tmplhad noLimitRequestBodydirective. Apache 2.4's default is 0 (unlimited) for regular files, but some Ubuntu builds/configs cap it at 1 GiB. Setting it explicitly to0ensures unlimited request body size regardless of distro defaults.Changes
v22.04/overlay/etc/templates/owncloud.ini.tmplmemory_limit = "{{ .Env.OWNCLOUD_MEMORY_LIMIT }}"v24.04/overlay/etc/templates/owncloud.ini.tmplv22.04/overlay/etc/templates/apache.conf.tmplLimitRequestBody 0inside<Directory>blockv24.04/overlay/etc/templates/apache.conf.tmplv22.04/overlay/etc/entrypoint.d/10-base.shOWNCLOUD_MEMORY_LIMITdefault512Mv24.04/overlay/etc/entrypoint.d/10-base.shNote:
OWNCLOUD_MEMORY_LIMITis not yet documented inENVIRONMENT.md— that can be addressed in a follow-up.