c4cccea775
The bootstrap-admin-from-env-vars flow was a holdover from before self-registration could create the first admin. Now that handleRegister + CreateUserFirstAdminRace promotes the first user to register on an empty users table (verified shipped in v2026.05.08.2 / #376), the bootstrap path is just a second source of truth that confuses operators (and leaves an "admin" account in the DB that nobody asked for). Removes: - internal/auth/bootstrap.go + its test - The auth.Bootstrap call from cmd/minstrel/main.go - AuthConfig + AdminBootstrapConfig structs from config - MINSTREL_AUTH_ADMIN_USERNAME / _PASSWORD env reads + their test - The auth: block from config.example.yaml - Bootstrap-related comments in docker-compose.yml + README.md The README quickstart now points operators at /register on first start instead of "watch the logs for a one-time password." Existing instances keep their bootstrap-admin row in the DB; operators who want it gone can register a new admin via /register, promote them in /admin/users, then delete the old bootstrap user (last-admin guard will require the new admin to be promoted first). No migration needed. Recovery story for forgotten admin passwords now hinges on Fable #321 (admin password reset CLI) — currently the only path back in if no other admin exists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
version: "3.9"
|
|
|
|
# Local development environment for Minstrel.
|
|
# Not used by CI — integration tests run against this compose stack manually:
|
|
# docker compose up -d postgres
|
|
# MINSTREL_TEST_DATABASE_URL=postgres://minstrel:minstrel@localhost:5432/minstrel?sslmode=disable \
|
|
# go test ./...
|
|
#
|
|
# Full stack (server + db):
|
|
# docker compose up --build
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: minstrel
|
|
POSTGRES_PASSWORD: minstrel
|
|
POSTGRES_DB: minstrel
|
|
networks:
|
|
- minstrel
|
|
# ports:
|
|
# - "5432:5432"
|
|
volumes:
|
|
- minstrel-pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U minstrel -d minstrel"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
minstrel:
|
|
build: .
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
MINSTREL_DATABASE_URL: postgres://minstrel:minstrel@postgres:5432/minstrel?sslmode=disable
|
|
MINSTREL_LOG_FORMAT: text
|
|
MINSTREL_LIBRARY_SCAN_PATHS: /music
|
|
MINSTREL_LIBRARY_SCAN_ON_STARTUP: "true"
|
|
MINSTREL_STORAGE_DATA_DIR: /app/data
|
|
networks:
|
|
- minstrel
|
|
ports:
|
|
- "4533:4533"
|
|
volumes:
|
|
# Point ./music at your test library (symlink, bind-mount, whatever).
|
|
# Read-only so a buggy scanner can't rewrite your files.
|
|
- /mnt/Media/Music:/music:ro
|
|
# Cached artifacts: playlist cover collages, artist art, album-cover
|
|
# fallbacks (when the music dir is RO). Persists across container
|
|
# recreates so the operator doesn't redownload art on every up/down.
|
|
- minstrel-data:/app/data
|
|
|
|
volumes:
|
|
minstrel-pgdata:
|
|
minstrel-data:
|
|
|
|
networks:
|
|
minstrel: |