diff --git a/.env.example b/.env.example index d458691..47557a0 100644 --- a/.env.example +++ b/.env.example @@ -29,3 +29,11 @@ RUST_LOG=info,picloud=debug # Public base URL the dashboard uses to render full URLs for user routes. # Set to the host:port (and scheme) users actually reach in their browser. PICLOUD_PUBLIC_BASE_URL=http://localhost:8000 + +# ---------- Bootstrap admin ---------- +# Required. Used once on first startup to seed the admin_users table. +# Ignored on subsequent boots if the table is non-empty. For prod, +# prefer PICLOUD_ADMIN_PASSWORD_HASH (pre-computed Argon2id PHC) so the +# raw password never lands in env or compose files; see blueprint §11.5. +PICLOUD_ADMIN_USERNAME=admin +PICLOUD_ADMIN_PASSWORD=admin diff --git a/docker-compose.yml b/docker-compose.yml index bbd8403..8c9a88d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,6 +40,12 @@ services: DATABASE_URL: postgres://${POSTGRES_USER:-picloud}:${POSTGRES_PASSWORD:-picloud}@postgres:5432/${POSTGRES_DB:-picloud} RUST_LOG: ${RUST_LOG:-info} PICLOUD_PUBLIC_BASE_URL: ${PICLOUD_PUBLIC_BASE_URL:-http://localhost:8000} + # Bootstrap admin (Phase 3a). Read once on first start to seed the + # admin_users table; ignored on subsequent boots if the table is + # non-empty. No defaults on purpose — leaving these unset in prod + # is a foot-gun. For dev, .env.example documents sensible values. + PICLOUD_ADMIN_USERNAME: ${PICLOUD_ADMIN_USERNAME:?set PICLOUD_ADMIN_USERNAME (see .env.example)} + PICLOUD_ADMIN_PASSWORD: ${PICLOUD_ADMIN_PASSWORD:?set PICLOUD_ADMIN_PASSWORD (see .env.example)} depends_on: postgres: condition: service_healthy