Skip to content

fix(security,config): harden secret guards, scrub Caddyfile, fix deploy docs (Batch D) - #5

Merged
sathyaprakash000 merged 1 commit into
mainfrom
fix/config-secrets-deploy
May 25, 2026
Merged

fix(security,config): harden secret guards, scrub Caddyfile, fix deploy docs (Batch D)#5
sathyaprakash000 merged 1 commit into
mainfrom
fix/config-secrets-deploy

Conversation

@sathyaprakash000

@sathyaprakash000 sathyaprakash000 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Batch D — 5 audit Criticals + related (REVIEW.md P0 #4#8).

  • Prod secret guards (auth.js/crypto.js) now reject the .env.example placeholders and values < 32 chars — copying the example unchanged can no longer boot prod with public-known keys.
  • .env.example: add POSTGRES_PASSWORD (+ matching DATABASE_URL) and META_APP_SECRET; document the entropy requirement + openssl generation.
  • Caddyfile: real domain forgechat.akilsadik.liveforgechat.example.com + 'replace me' note (missed by the earlier scrub).
  • DEPLOY.md: fix wrong env var names (FORGECRM_JWT_SECRETJWT_SECRET, etc.), drop unused COOKIE_PARENT_DOMAINS, add POSTGRES_PASSWORD/META_APP_SECRET.
  • Admin seed: generated one-time password → 0600 file, not stdout.
  • Health check: real route is /health; added nginx location + fixed both guides' smoke test (was /api/health → 404).

… deploy docs

Batch D — 5 audit Criticals + related:
- auth.js/crypto.js: production guards now reject the .env.example placeholder
  secrets and any value < 32 chars (not just the empty/dev-default), so a
  self-hoster copying .env.example unchanged can't run prod with public keys.
- .env.example: add POSTGRES_PASSWORD (+ matching DATABASE_URL) and META_APP_SECRET;
  document the >=32-char / no-placeholder requirement + openssl generation.
- Caddyfile: replace the real domain forgechat.akilsadik.live with
  forgechat.example.com + an explicit 'replace with your domain' note.
- DEPLOY.md: fix wrong env var names (FORGECRM_JWT_SECRET -> JWT_SECRET,
  FORGECRM_META_WEBHOOK_VERIFY_TOKEN -> META_WEBHOOK_VERIFY_TOKEN), drop the
  unused COOKIE_PARENT_DOMAINS, add POSTGRES_PASSWORD/META_APP_SECRET.
- admin seed: write the generated one-time password to a 0600 file instead of
  stdout (avoids credential persistence in log aggregators).
- health check: backend route is /health (not /api/health); add an nginx
  location so it's reachable externally, and fix both deploy guides' smoke test.

Audit refs: REVIEW.md P0 #4,#5,#6,#7,#8 (lanes 04,24,25).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: KingArthur000 <sathyaprakashelango@gmail.com>
@sathyaprakash000
sathyaprakash000 merged commit f94f4ac into main May 25, 2026
9 checks passed
@sathyaprakash000
sathyaprakash000 deleted the fix/config-secrets-deploy branch May 25, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant