Closes P0 #3 from .convoys/ship-readiness.md. Removes the hardcoded admin@tcgvault.com / admin123 credentials from scripts/setup-neon-db.js (make it env-var-driven) and from README.md. Single PR; small surface (2 files). No UI, no API, no migration. Auditor cohort skipped (no UX/a11y/design-system surface). P0 #3's third file (pages/api/setup-database.js) was already deleted by fix-auth-bypass Brief 3. Architect to address: - Existing-admin rotation story (going-forward fix vs. forced reset) - Confirm scripts/setup-neon-db.js no-go-zones rule applies to schema changes only (this is operational) - Whether to add vitest coverage for the env-var-required path depends_on: bump-next-js (shipped), fix-auth-bypass (shipped) Co-authored-by: Cursor <cursoragent@cursor.com>
3.7 KiB
| name | classification | success_metric | skip | status | created | parent | addresses | depends_on | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| drop-public-setup | convoy | No hardcoded admin credentials in repo (source or README). setup-neon-db.js requires ADMIN_INITIAL_PASSWORD env var. New env-var setup documented in README. Existing deployed admin user (if hash matches the known-weak default) is either rotated or flagged for manual rotation. |
|
open | 2026-05-23 | ship-readiness | P0 |
|
Drop public setup
Close P0 #3 from .convoys/ship-readiness.md: remove the hardcoded admin
credentials (admin@tcgvault.com / admin123) from the seed script and
the README.
Scope (verbatim from ship-readiness P0 #3)
scripts/setup-neon-db.jslines 130-138 — currently creates the admin user with a hardcodedadmin123bcrypt hash. Change to require anADMIN_INITIAL_PASSWORDenv var with no default. Fail loudly (exit non-zero with a clear message) if the env var is unset.README.md— strip the "Default Admin Account" section. Replace with "runnpm run setup-dband follow the prompt" (or however the architect decides to phrase it; the spec is "no credentials in README").pages/api/setup-database.js— already deleted by fix-auth-bypass Brief 3 (commitfc0dd73). Not in scope here; just noting for completeness.
Out of scope
- Migration tooling (
migration-toolconvoy, P1 #11) - Renaming the admin email from
admin@tcgvault.comto anything else (branding decision belongs topick-a-nameconvoy, P1 #12) - Any other
scripts/seed-*.jsorscripts/add-*.jsfiles (those are one-off historical jobs per no-go-zones) - Any change to
pages/api/auth/*.js(fix-auth-bypass shipped; further hardening lives incors-tighten/add-rate-limiting)
Architect's questions
-
Existing-admin story. If a deployed environment already has the admin row with
bcrypt.hash('admin123', ...), this convoy alone does NOT rotate that password — it only prevents the weak default on new envs. Options: a. Going-forward only. Flag for manual rotation; assume any environment with the default already needs operator attention. b. Add a one-time idempotent script underscripts/migrations/that checks the admin row's password_hash against the known weak default and forces a reset / requiresADMIN_RESET_PASSWORDenv var. c. Add a startup check to the deploy pipeline that fails the deploy if the admin row matches the weak hash.Recommend the architect pick (a) for simplicity and queue (b) as a follow-up if needed. (a) is consistent with how Brief 1 of fix-auth-bypass handled the JWT_SECRET — going-forward fix-loud, not a sweep of existing data.
-
setup-neon-db.jsno-go-zones rule. The rule says "do NOT editscripts/setup-neon-db.jsin place — it's idempotent and meant for first-time setup only." That rule is about schema changes (adding columns, etc.). This convoy edits the script's admin-creation logic to add an env-var gate — operational, not schema. Architect should confirm this reading and document the distinction in the brief. -
Test coverage. Brief 5 of fix-auth-bypass introduced vitest. Does this convoy add tests for the env-var-required path? Probably not (setup scripts are typically tested via manual smoke, not unit tests). Architect decides.
Expected size
1-2 briefs, ~3 files total, no UI, no API surface, no migration. Should ship as a single PR (no fan-out).