Repository navigation
Conversation
…h missing or placeholder secrets The compose files shipped fixed NEXTAUTH_SECRET, DATABASE_ENCRYPTION_KEY and MEDIA_SERVER_WEBHOOK_SECRET values that are public in this repo. They now require values from .env, and cap-web (in production) and the media server refuse to start when a secret is missing or still one of those known placeholders. The self-hosting docs explain the upgrade step and what replacing each secret changes.
|
@07rjain is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| DATABASE_ENCRYPTION_KEY: ${DATABASE_ENCRYPTION_KEY:?Set DATABASE_ENCRYPTION_KEY in .env (run: openssl rand -hex 32)} | ||
| NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:?Set NEXTAUTH_SECRET in .env (run: openssl rand -hex 32)} | ||
| MEDIA_SERVER_WEBHOOK_SECRET: ${MEDIA_SERVER_WEBHOOK_SECRET:?Set MEDIA_SERVER_WEBHOOK_SECRET in .env (run: openssl rand -hex 32)} |
There was a problem hiding this comment.
The unquoted secret values contain : in (run: openssl rand -hex 32), which breaks YAML syntax. Docker Compose cannot read either compose file, even when all three secrets are set. Quote the entire ${...} value at every changed secret entry in both docker-compose.yml and docker-compose.template.yml.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docker-compose.yml
Line: 17-19
Comment:
**Compose files cannot load**
The unquoted secret values contain `: ` in `(run: openssl rand -hex 32)`, which breaks YAML syntax. Docker Compose cannot read either compose file, even when all three secrets are set. Quote the entire `${...}` value at every changed secret entry in both `docker-compose.yml` and `docker-compose.template.yml`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| 2. Generate a new value for each secret with `openssl rand -hex 32` and put them in the `.env` next to your compose file (or in your platform's variables). Use the same `MEDIA_SERVER_WEBHOOK_SECRET` on cap-web and the media server. | ||
| 3. Pull and restart: `docker compose pull && docker compose up -d`. |
There was a problem hiding this comment.
Template upgrade steps miss secrets
The older docker-compose.template.yml sets secrets directly, so adding new values to .env does not replace them. docker compose pull only updates images; users following these steps still pass the public secrets to the new web image, which refuses to start. Tell template users to update their compose file or replace its hardcoded values before restarting.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/content/docs/self-hosting.mdx
Line: 211-212
Comment:
**Template upgrade steps miss secrets**
The older `docker-compose.template.yml` sets secrets directly, so adding new values to `.env` does not replace them. `docker compose pull` only updates images; users following these steps still pass the public secrets to the new web image, which refuses to start. Tell template users to update their compose file or replace its hardcoded values before restarting.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.The `${VAR:?... (run: openssl rand -hex 32)}` values contain ': ', which YAML reads as a nested mapping, so docker compose rejected docker-compose.yml and docker-compose.template.yml before interpolation. Quoting keeps the friendly missing-secret message.
|
Thanks @07rjain for splitting this out and for the detailed upgrade section, that's exactly what we were hoping for. Quoting the values in eae90b6 fixes Greptile's P1: both compose files parse now, and
We need Greptile at 5/5 on the latest commit and green CI before we can merge. After pushing, you can mention @greptileai in a comment to get a re-review. Thanks! |
Split out of #2580 (self-host secret checks).
Problem.
docker-compose.yml,docker-compose.template.ymland older docs shipped fixedNEXTAUTH_SECRET,DATABASE_ENCRYPTION_KEYandMEDIA_SERVER_WEBHOOK_SECRETvalues. They are public in this repo, so anyone could forge sessions, decrypt stored credentials or spoof media-server webhooks on installs that kept them.What changes
.env(${VAR:?…}). New.env.self-hosting.example.packages/env/secrets.tslists the known placeholders. In production, cap-web exits at startup when a secret is missing or still a placeholder. This runs after main'sserverEnv()/DATABASE_ENCRYPTION_KEYformat validation, and both checks are kept.MEDIA_SERVER_WEBHOOK_SECRETis missing or a placeholder.MEDIA_SERVER_ALLOW_INSECURE_SECRET=trueis forpackages/local-dockeronly.Tests.
insecure-secrets.test.ts,startup-checks.test.ts, existingdatabase-encryption-key-env.test.ts.

Confidence Score: 5/5
The latest changes appear safe to merge; the existing upgrade-documentation finding remains non-blocking.Findings
Fix with agent prompt
Summary
Removes public default secrets and adds startup checks for self-hosted deployments.
Reviews (2) · Last reviewed commit: "fix(self-host): quote required-secret en..." · Reviewed by Greptile