hapi db bootstrap creates the database and roles #75

Open
opened 2026-11-27 16:43:19 -05:00 by bobby · 0 comments
Owner

Part of #73 (spec: #72)

What to build

The Owner can run hapi db bootstrap to create the hapi database and the hapi_migrator, hapi_app, and hapi_backup roles from mounted password files, with the admin password pasted in at run time. Running it twice changes nothing. Local dev gets Postgres 18 in Docker Compose. Config is pydantic-settings with the HAPI_ prefix, reads secrets from secrets_dir (never env vars), and fails fast on startup when misconfigured.

Acceptance criteria

  • Against an empty Postgres 18, hapi db bootstrap creates the database and the three roles with the documented privileges (hapi_app DML only, hapi_migrator owner, hapi_backup read-only BYPASSRLS)
  • A second run exits 0 and changes nothing
  • The admin password is prompted for, never read from a file or env
  • The app refuses to start, naming the setting, when a required setting or secret file is missing
  • just dev brings up Postgres 18 in Docker Compose
Part of #73 (spec: #72) ## What to build The Owner can run `hapi db bootstrap` to create the `hapi` database and the `hapi_migrator`, `hapi_app`, and `hapi_backup` roles from mounted password files, with the admin password pasted in at run time. Running it twice changes nothing. Local dev gets Postgres 18 in Docker Compose. Config is pydantic-settings with the `HAPI_` prefix, reads secrets from `secrets_dir` (never env vars), and fails fast on startup when misconfigured. ## Acceptance criteria - [ ] Against an empty Postgres 18, `hapi db bootstrap` creates the database and the three roles with the documented privileges (`hapi_app` DML only, `hapi_migrator` owner, `hapi_backup` read-only `BYPASSRLS`) - [ ] A second run exits 0 and changes nothing - [ ] The admin password is prompted for, never read from a file or env - [ ] The app refuses to start, naming the setting, when a required setting or secret file is missing - [ ] `just dev` brings up Postgres 18 in Docker Compose
bobby added the ready-for-agent label 2026-11-27 16:43:19 -05:00
bobby added a new dependency 2026-11-27 16:43:19 -05:00
bobby added a new dependency 2026-11-27 16:43:20 -05:00
bobby added a new dependency 2026-11-27 16:44:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#75