Skip to content

fix: scaffolded projects ship no known secret and get generated ones - #12

Merged
amenophis1er merged 1 commit into
mainfrom
fix/scaffold-no-placeholder-secrets
Nov 9, 2026
Merged

amenophis1er merged 1 commit into
mainfrom
fix/scaffold-no-placeholder-secrets

Conversation

@amenophis1er

Copy link
Copy Markdown
Contributor

Item 8 of the 3.6 work (scaffold side).

Removed known values

  • jwtSecret: process.env.JWT_SECRET || 'change-me-in-production' → process.env.TROKKY_JWT_SECRET, no fallback.
  • ADMIN_PASSWORD || 'admin123' → the admin user is only created when ADMIN_PASSWORD is set; otherwise the first administrator claims the site (protected by TROKKY_CLAIM_SECRET).
  • .env.example no longer carries placeholders that switch a feature on with a fake value: Google sign-in (your-client-id showed a Google button that cannot work), Resend (re_xxxxx replaced the console adapter with one that fails), Turnstile/reCAPTCHA (a fake secret fails every form).

Generated secrets

  • trokky create writes .env (mode 0600, gitignored, never overwrites an existing one) with fresh TROKKY_JWT_SECRET and TROKKY_CLAIM_SECRET, so development keeps its sign-ins across restarts. The printed next steps say so and say where to claim (Studio, or POST /api/auth/claim for api-only).

Tested end to end by a reviewer: all three templates scaffolded, installed (3.5.6) and run; claim through the real Studio UI and through the API; ADMIN_PASSWORD path. That run found the Postgres claim bug, fixed in Trokky/trokky (separate PR). Reviewed by Codex.

trokky create no longer writes a JWT secret fallback, a default admin password, or
placeholder keys that switch Google sign-in, Resend mail or a captcha on with fake
values. It writes a gitignored .env with generated TROKKY_JWT_SECRET and
TROKKY_CLAIM_SECRET; without ADMIN_PASSWORD the first administrator claims the site
(in the Studio, or POST /api/auth/claim for api-only).
@amenophis1er
amenophis1er merged commit 99e589b into main Nov 9, 2026
1 check passed
@amenophis1er
amenophis1er deleted the fix/scaffold-no-placeholder-secrets branch November 9, 2026 03:45
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