chore: replace short JWT_SECRET defaults with ≥32-char value - #238
Conversation
MonaAghili
left a comment
There was a problem hiding this comment.
Verified against both PR branches directly (not just the diffs).
Correctness: the touched paths do fix the crash — both new literals are ≥32 chars (my_long_jwt_secret_at_least_32_chars = 36, euro-office-dev-jwt-secret-key-2026 = 35).
Two things worth resolving before merge:
-
#13's sweep is incomplete.
git diff main pr13 --name-onlyshows only 9 files changed, but these still have secrets under 32 chars and will still reproduce the original error:web/documentserver-example/nodejs/config/default.json:37—"secret": "secret". This is what node-config actually loads whenNODE_CONFIGisn't set (e.g. localnpm startoutside Docker).web/documentserver-example/csharp/README.md:47,csharp-mvc/README.md:46—value="secret".nodejs/README.md:55,176inline JSON examples, plus the documented-default tables inphp,php-laravel,python,rubyREADMEs — all still showsecret/your-256-bit-secret.
-
This trades a loud failure for a silent one. DocumentServer's production
docker-entrypoint.shenables JWT by default (JWT_ENABLED:=true). Previously, forgetting to setJWT_SECRETcrashed immediately — an accidental safety net. Now the fallback is long enough to pass validation, so that same misconfiguration starts up fine, silently signing with a secret that's public in this repo's git history. Worth either failing startup whenJWT_ENABLED=trueandJWT_SECRETis unset, or at least logging a loud warning when the fallback is used.
No other issues — quoting/expansion in the entrypoint scripts is unchanged, and the submodule bump points at exactly #13's head commit with nothing extra riding along.
The EuroOffice connector v11+ enforces a minimum JWT secret length of
32 characters. Short defaults ("secret", "my_jwt_secret") in example
commands and the orchestrated entrypoint fallback would fail at runtime.
- README.md: update docker run example secret to ≥32 chars
- docker-entrypoint.sh: raise ${JWT_SECRET:=secret} fallback to 35 chars
- example-docker-entrypoint.sh: same
- document-server-integration: bump submodule to apply the same fix
across all integration examples (see Euro-Office/document-server-integration PR)
Assisted-by: ClaudeCode:claude-sonnet-4-6
Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
Follow-up to review feedback on PR #238. The orchestrated entrypoint enables JWT by default (JWT_ENABLED:=true). Giving JWT_SECRET a fallback long enough to satisfy the connector's 32-character minimum meant a deployment that forgot to set it would now start up cleanly and sign with a secret that is public in this repository, where it previously failed immediately. That traded a loud failure for a silent one. Drop the fallback and fail startup instead when JWT is enabled and no secret was supplied. Unlike the standalone entrypoint, generating a random secret is not an option here: docservice, converter and adminpanel run as separate containers and must all sign with the same value, so a per-container random secret would break signing between them. Also warn when a JWT_SECRET shorter than 32 characters is supplied, since that is the case that fails later inside the connector rather than here. The submodule bump carries the matching completion of the secret sweep in document-server-integration. Assisted-by: ClaudeCode:claude-opus-5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Schaefer <christoph.schaefer@nextcloud.com>
6b884e0 to
4553985
Compare
MonaAghili
left a comment
There was a problem hiding this comment.
One residual, low-severity note (not blocking): the standalone nodejs example's own docker-entrypoint.sh still falls back to the new long literal when JWT_SECRET is unset — but JWT_ENABLED there defaults to false, so it can't silently turn on JWT the way the DocumentServer production entrypoint could. This is a test/example client, not the server, so I wouldn't hold up the merge for it.
No other issues found — quoting/expansion is unchanged, and DCO/clone checks pass. The only non-green check is a cancelled (not failed) build run against the current head commit; it hasn't actually re-run since the last push, so I'd re-trigger CI before merging rather than merge on stale results.
Context
Companion PR to Euro-Office/document-server-integration#13. Both PRs must be merged together — this PR bumps the
document-server-integrationsubmodule pointer to the commit in that PR.The EuroOffice connector v11+ enforces a minimum JWT secret length of 32 characters. Short defaults in example commands and the orchestrated entrypoint fallback cause an immediate runtime error: "JWT secret key is too short (minimum 32 characters required)".
What changes
README.md— docker run example secret updated to ≥32 charsbuild/scripts/orchestrated/docker-entrypoint.sh—${JWT_SECRET:=secret}fallback raised to 35 charsbuild/scripts/orchestrated/example-docker-entrypoint.sh— samedocument-server-integration— submodule bumped to chore: replace short JWT_SECRET examples with ≥32-char value document-server-integration#13Assisted-by: ClaudeCode:claude-sonnet-4-6