Files
homekeeper/docker-compose.yml
T
friessn 6c9cd67a08 Rebuild auth on Keycloak OIDC, fix rootless Ansible deploy
Replaces the single shared HTTP Basic service-account credential (which
caused a production outage from a username mismatch) with per-user login:
Keycloak (already running on this VM for gcnm, now also fronted on
auth.friessn.de with its own "homekeeper" realm) authenticates the user
once via the landing page, FastAPI verifies the OIDC id_token and mints
its own signed session JWT as a cookie, and both Shiny apps forward that
per-session token as a Bearer credential instead of a static shared one.
Authorization is a simple ALLOWED_USERS allowlist; the old auth.users
table and bcrypt seeding are gone entirely.

Also carries forward the in-progress rootless Podman/Quadlet migration
(gitea, homekeeper, podman roles) and fixes a pre-existing bug where
each role's handlers were malformed inside tasks/main.yml instead of
their own handlers/main.yml, which broke ansible-playbook entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FbiCdckkTX2HyAkyi1R39d
2026-07-13 06:31:36 +00:00

77 lines
1.6 KiB
YAML

name: homekeeper
services:
db:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_DB: homestead
POSTGRES_USER: homestead
POSTGRES_PASSWORD: homestead
volumes:
- ./pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U homestead -d homestead"]
interval: 5s
timeout: 5s
retries: 10
api:
build: ./api
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: homestead
DB_USER: homestead
DB_PASSWORD: homestead
ROOT_PATH: /api
ENV: development
COOKIE_SECURE: "false"
PUBLIC_BASE_URL: http://localhost
SESSION_JWT_SECRET: dev-only-secret-do-not-use-in-prod
ALLOWED_USERS: "nico"
OIDC_ISSUER_URL: ""
OIDC_CLIENT_ID: ""
OIDC_CLIENT_SECRET: ""
restart: unless-stopped
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./www:/usr/share/nginx/html:ro
depends_on:
- beekeeper
- api
restart: unless-stopped
listkeeper:
build: ./listkeeper
depends_on:
api:
condition: service_started
environment:
API_URL: http://api:8000
LOG_DIR: /logs
volumes:
- ./listkeeper/logs:/logs
restart: unless-stopped
beekeeper:
build: ./beekeeper
depends_on:
api:
condition: service_started
environment:
API_URL: http://api:8000
LOG_DIR: /logs
volumes:
- ./beekeeper/logs:/logs
restart: unless-stopped