Skip to content
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
5 changes: 3 additions & 2 deletions .env.nginx.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# Request limits
###
# Max request body size accepted by nginx. Must be >= PHP_UPLOAD_MAX_FILESIZE
# in .env.php, otherwise large uploads get truncated at the proxy. Default: 140m.
NGINX_MAX_BODY_SIZE=140m
# in .env.php and >= MEDIA_MAX_UPLOAD_SIZE_MB in .env.symfony (app cap, default
# 200 MiB), otherwise large uploads get truncated at the proxy. Default: 210m.
NGINX_MAX_BODY_SIZE=210m

###
# Upstream FPM (rarely needs tuning — only useful with custom topology)
Expand Down
13 changes: 8 additions & 5 deletions .env.php.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
PHP_MAX_EXECUTION_TIME=30
# Memory cap per PHP process. Default: 128M.
PHP_MEMORY_LIMIT=256M
# Total POST body size accepted by PHP. Default: 8M. Raise in lockstep with
# NGINX_MAX_BODY_SIZE.
PHP_POST_MAX_SIZE=140M
# Maximum size of an uploaded file. Default: 2M.
PHP_UPLOAD_MAX_FILESIZE=128M
# Total POST body size accepted by PHP. Default: 8M. Keep in lockstep with
# NGINX_MAX_BODY_SIZE and >= PHP_UPLOAD_MAX_FILESIZE plus multipart overhead.
PHP_POST_MAX_SIZE=210M
# Maximum size of an uploaded file. Default: 2M. The Symfony app caps media
# uploads at MEDIA_MAX_UPLOAD_SIZE_MB (.env.symfony, default 200 MiB); this
# must be >= that value, otherwise PHP rejects the upload before the app
# validator sees it.
PHP_UPLOAD_MAX_FILESIZE=200M
# Default timezone. Default: Europe/Copenhagen.
PHP_TIMEZONE=Europe/Copenhagen

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ See the [v2.x.x — Skipped](#v2xx---skipped) entry below for why this major ski
`logs:access`, `logs:disk`.
- Global JSON-file log rotation (10MB × 3 files per service), tunable via `LOG_MAX_SIZE` /
`LOG_MAX_FILE`.
- Aligned media-upload limits with the upstream 3.0.0 app cap: `.env.php.example` ships
`PHP_UPLOAD_MAX_FILESIZE=200M` / `PHP_POST_MAX_SIZE=210M` and `.env.nginx.example` ships
`NGINX_MAX_BODY_SIZE=210m`, matching the new `MEDIA_MAX_UPLOAD_SIZE_MB=200` Symfony validator
ceiling that 3.0.0 introduces. UPGRADE.md §5 explains the four-layer alignment rule.

### Local development

Expand Down
19 changes: 19 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,25 @@ $EDITOR .env.mariadb
task env:traefik
```

##### Media upload size: align all three layers

v3 adds an app-level cap on media uploads, `MEDIA_MAX_UPLOAD_SIZE_MB` (default `200`,
in MiB), enforced by the Symfony validator on `Media::$file`. Because uploads cross
nginx → PHP-FPM → Symfony, all three layers must agree, or the lowest wins (and the
operator sees a confusing 413 / `UPLOAD_ERR_INI_SIZE` instead of the app's clear
"file exceeds N MiB" error). Defaults shipped in `.env.php.example` and
`.env.nginx.example` are aligned to `200`; if you've customised any of them, keep
the inequality intact:

```text
NGINX_MAX_BODY_SIZE >= PHP_POST_MAX_SIZE >= PHP_UPLOAD_MAX_FILESIZE >= MEDIA_MAX_UPLOAD_SIZE_MB
```

`task env:migrate` carries `MEDIA_MAX_UPLOAD_SIZE_MB` over from the image's bundled
`.env`, so it lands in `.env.symfony` automatically. Verify with `task env:diff` after
`env:init` — if the diff shows the key only on the image side, your migrated file
predates this var and you should copy the line over by hand.

#### 6. MariaDB 10.x → 11.4 upgrade

The bundled MariaDB is `mariadb:11.4.10` in 3.x (was `mariadb:10.x` in 1.x). Three things must
Expand Down
Loading