Generate pREST config
When to use
- Starting a new pREST project from an existing PostgreSQL database
- Migrating ad-hoc connection settings into
prest.toml/ env vars - Producing a local Docker Compose stack
Ask first
Collect only what is missing:
- pREST version (prefer v2; ask if unclear)
- Postgres host, port, database name, schema, SSL mode
- DB user / password strategy (env vars vs local demo values)
- Auth needs (none for local demo, JWT, table-based
/auth) - Prefer Docker Compose or bare
prestdbinary - Single database or multi-database (
pg.single = false)
Instructions
- Emit a minimal, documented config — do not invent undocumented TOML keys.
- Prefer environment variables for secrets (
PREST_PG_PASS,DATABASE_URL,PREST_JWT_KEY). - Generate:
.env.example(never real secrets)prest.tomlusing v2-friendly sections ([http],[pg],[pg.ssl], optional[jwt],[auth],[expose],[access],[queries])- Optional
docker-compose.ymlwith Postgres + pREST (prest/prestimage) when the user wants Compose
- For local demos only, use obvious placeholder credentials and label them as non-production.
- Warn that production must use strong secrets, TLS, restricted
access, and non-superuser DB roles. - Point to https://docs.prestd.com/get-started/configuring-prest for authoritative field lists.
Output shape
Provide files ready to paste, plus a short “how to run” section (docker compose up or prestd).
Safety
- No real credentials in committed examples.
- Prefer
access.restrict = truein anything beyond throwaway demos. - Mention that
debug = truedisables JWT enforcement.