Repository navigation
fix: scaffolded projects ship no known secret and get generated ones - #12
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whenADMIN_PASSWORDis set; otherwise the first administrator claims the site (protected byTROKKY_CLAIM_SECRET)..env.exampleno longer carries placeholders that switch a feature on with a fake value: Google sign-in (your-client-idshowed a Google button that cannot work), Resend (re_xxxxxreplaced the console adapter with one that fails), Turnstile/reCAPTCHA (a fake secret fails every form).Generated secrets
trokky createwrites.env(mode 0600, gitignored, never overwrites an existing one) with freshTROKKY_JWT_SECRETandTROKKY_CLAIM_SECRET, so development keeps its sign-ins across restarts. The printed next steps say so and say where to claim (Studio, orPOST /api/auth/claimfor 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_PASSWORDpath. That run found the Postgres claim bug, fixed in Trokky/trokky (separate PR). Reviewed by Codex.