docs(office): document all env vars and add size limits guide - #15414
docs(office): document all env vars and add size limits guide#15414chrip wants to merge 2 commits into
Conversation
📖 Documentation Preview📄 1 changed documentation pageLast updated: Thu, 13 Aug 2026 15:24:16 GMT |
84fbe4b to
75c25c3
Compare
Document every environment variable supported by the Document Server Docker image in the installation page. Previously only a subset was listed. Add a 'Size limits' section with a 200 MB PPTX example showing how the four size-gate variables interact at different stages (nginx upload, temp file buffer, converter download, uncompressed XML size). Assisted-by: OpenCode:qwen3.6-27b Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
75c25c3 to
1eba328
Compare
There was a problem hiding this comment.
TL;DR: Most of the new env-var table checks out against the entrypoint script and the two upstream PRs it's based on, but the new "Size limits" walkthrough gets the request flow wrong for its own headline scenario (opening a stored document), and USE_UNAUTHORIZED_STORAGE is mis-described in a way that understates its security impact. Requesting changes on those two before merge; the completeness gaps below can be a fast follow.
Full review, with exact lines
1. "Size limits" section's core narrative is backwards
installation_docker.rst#L192-L228
Opening a document already stored in Nextcloud is a server-side download, not a browser upload:
canvasService.downloadFile(canvasservice.js#L1744) is what actually fetches the document. It readsFILECONVERTER_MAX_DOWNLOAD_BYTESatL1771and passes it intoutils.downloadUrlPromiseatL1849— that's stage 3/4 territory, not stage 1/2.- The route is registered as
app.get('/downloadfile/:docid', canvasService.downloadFile)with no body parser at all — see the route table inserver.js#L206-L244.rawFileParser(thebodyParser.raw({ limit: limits_tempfile_upload })thatMAX_FILE_SIZEcontrols,L206-L211) is only attached to/command,/converter,/upload/:docid,/savefile/:docid,/downloadfile/:docidPOST — image inserts, save-back, WOPI callbacks. Nothing in the "open a stored document" path. NGINX_CLIENT_MAX_BODY_SIZEgates inbound POST bodies to nginx — same problem, no inbound POST body exists when the Document Server is the one fetching the file.
So of the four stages walked through in the doc, only 3 and 4 (FILECONVERTER_MAX_DOWNLOAD_BYTES, FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED) apply to the "user opens a 200 MB PPTX" scenario as written. Following the guide's stage 1/2 advice for that scenario won't do anything.
2. USE_UNAUTHORIZED_STORAGE description is wrong, and understates the risk
installation_docker.rst#L161-L163 documents it as "Allow fetching documents from HTTP (non-TLS) storage."
It actually flows into requestDefaults.rejectUnauthorized, cloned into the HTTPS agent options for the exact same downloadUrlPromise call used to fetch documents — see utils.js#L345-L355, specifically httpsAgentOptions = {...https.globalAgent.options, ...options} at L354. rejectUnauthorized: false is the standard Node.js TLS option for skipping certificate-chain validation — it has no bearing on plain HTTP (no certificate is ever presented on an HTTP connection either way). Flip this thinking you're permitting a legacy plaintext endpoint, and you've disabled cert validation on every HTTPS storage connection too — an unlabelled MITM exposure.
3. The PR's stated goal — "document every environment variable" — isn't quite true
entrypoint.sh still reads several operator-facing vars the table skips (all in entrypoint.sh):
SSL_CERTIFICATE_PATH/SSL_KEY_PATH/SSL_DHPARAM_PATH (L349-L367), SECURE_LINK_SECRET (L118-L127), METRICS_HOST/PORT/PREFIX (L45-L47), REDIS_SERVER_USER/DB, AMQP_URI/VHOST, NGINX_WORKER_CONNECTIONS, ADMINPANEL_ENABLED/EXAMPLE_ENABLED, DS_LOG_LEVEL.
Worth prioritizing the SSL ones: this PR does document SSL_VERIFY_CLIENT and both ONLYOFFICE_HTTPS_HSTS_* vars, but all three only take effect inside the if [ -n "$SSL_CERTIFICATE_PATH" ] && [ -n "$SSL_KEY_PATH" ] gate at L349-L367. Document those three without the two vars that gate them, and a reader can set all three and see zero effect.
4. Minor — undocumented edge-case behavior (low priority)
FILECONVERTER_INPUT_LIMIT_UNCOMPRESSEDreplaces the entireinputLimitsarray rather than patching one entry (entrypoint.sh#L261-L270). Harmless today (only four format groups exist indefault.json), but a footgun if a fifth type group is ever added upstream.FILECONVERTER_MAX_DOWNLOAD_BYTESis silently ignored (stderr warning only) if it isn't a plain integer (entrypoint.sh#L255-L260) — worth a one-line callout.
Addresses the review on #15414. The "Size limits" walkthrough described opening a stored document as a browser upload and walked through all four variables in one sequence. The Document Server downloads such a file itself, so the two request-body limits never apply. Split into the two paths that actually exist: - documents the server downloads (FILECONVERTER_MAX_DOWNLOAD_BYTES, FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED) - files posted to the server (NGINX_CLIENT_MAX_BODY_SIZE, MAX_FILE_SIZE) for image inserts, save-back, and conversion or command requests USE_UNAUTHORIZED_STORAGE was documented as allowing HTTP storage. It sets rejectUnauthorized: false on every outbound HTTPS connection, disabling certificate, host name, and expiry validation, and has no effect on plain HTTP. Now carries a warning naming the MITM exposure. Adds the operator-facing variables the table skipped: SSL_CERTIFICATE_PATH, SSL_KEY_PATH, SSL_DHPARAM_PATH, SECURE_LINK_SECRET, METRICS_HOST/PORT/PREFIX, REDIS_SERVER_USER/DB, AMQP_VHOST/URI, NGINX_WORKER_CONNECTIONS, ADMINPANEL_ENABLED, EXAMPLE_ENABLED, DS_LOG_LEVEL. SSL_VERIFY_CLIENT and both HSTS variables are noted as inert unless SSL_CERTIFICATE_PATH and SSL_KEY_PATH are set and both files exist, since documenting them without their gate led readers to expect an effect. Also notes that FILECONVERTER_MAX_DOWNLOAD_BYTES is silently ignored when given a unit suffix, that FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED replaces the whole limit list, and documents /var/www/euro-office/Data, whose loss regenerates the JWT secret and breaks the connector. Tables are grouped by concern, since one flat table had become unreadable. Signed-off-by: Christoph Schäfer <christoph.schaefer@nextcloud.com> Assisted-by: Claude Opus 5 (1M context) Signed-off-by: Christoph Schäfer <christoph.schaefer@nextcloud.com>
Ports the corrections from the review of the same content in nextcloud/documentation#15414, where these two defects were caught. The "Size limits" box described opening a stored document as a browser upload and walked through all four variables in one sequence. The Document Server downloads such a file itself, so the two request-body limits never apply. Split into the two paths that actually exist: - documents the server downloads (FILECONVERTER_MAX_DOWNLOAD_BYTES, FILECONVERTER_INPUT_LIMIT_UNCOMPRESSED) - files posted to the server (NGINX_CLIENT_MAX_BODY_SIZE, MAX_FILE_SIZE) for image inserts, save-back, and conversion or command requests USE_UNAUTHORIZED_STORAGE was documented as allowing HTTP storage. It sets rejectUnauthorized: false on every outbound HTTPS connection, disabling certificate, host name, and expiry validation, and has no effect on plain HTTP. Now carries a warning naming the MITM exposure. Adds the operator-facing variables the table skipped: SSL_CERTIFICATE_PATH, SSL_KEY_PATH, SSL_DHPARAM_PATH, SECURE_LINK_SECRET, REDIS_SERVER_USER/DB, AMQP_VHOST/URI, NGINX_WORKER_CONNECTIONS, ADMINPANEL_ENABLED, EXAMPLE_ENABLED, DS_LOG_LEVEL. SSL_VERIFY_CLIENT and both HSTS variables are noted as inert unless SSL_CERTIFICATE_PATH and SSL_KEY_PATH are set and both files exist. Also documents the /var/www/euro-office/Data volume on the Docker installation page, whose loss regenerates the JWT secret and breaks the connector, and groups the environment tables by concern since one flat table had become unreadable. Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com> Assisted-by: Claude Opus 5 (1M context) Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
|
Thanks @moodyjmz — this was a genuinely useful review, and you were right on both 1. Size limits narrative — fixedYou were right that opening a stored document is a server-side download, so
The 200 MB PPTX example stays but now resolves correctly: the 500 MB download default is 2.
|
Document every environment variable supported by the Document Server Docker image in the installation page. Previously only a subset was listed.
Add a 'Size limits' section with a 200 MB PPTX example showing how the four size-gate variables interact at different stages (nginx upload, temp file buffer, converter download, uncompressed XML size).
Related to Euro-Office/DocumentServer#237 and Euro-Office/server#35
Assisted-by: OpenCode:qwen3.6-27b