Replaces per-member Nextcloud credentials with a BandStorage model that supports multiple providers. Credentials are Fernet-encrypted at rest; worker receives audio via an internal streaming endpoint instead of direct storage access. - Add BandStorage DB model with partial unique index (one active per band) - Add migrations 0007 (create band_storage) and 0008 (drop old nc columns) - Add StorageFactory that builds the correct StorageClient from BandStorage - Add storage router: connect/nextcloud, OAuth2 authorize/callback, list, disconnect - Add Fernet encryption helpers in security/encryption.py - Rewrite watcher for per-band polling via internal API config endpoint - Update worker to stream audio from API instead of accessing storage directly - Update frontend: new storage API in bands.ts, rewritten StorageSection, simplified band creation modal (no storage step) - Add STORAGE_ENCRYPTION_KEY to all docker-compose files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
135 lines
3.7 KiB
YAML
135 lines
3.7 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-rehearsalhub}
|
|
POSTGRES_USER: ${POSTGRES_USER:-rh_user}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-default_secure_password}
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
networks:
|
|
- rh_net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rh_user} -d ${POSTGRES_DB:-rehearsalhub} || exit 1"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
retries: 30
|
|
start_period: 45s
|
|
restart: unless-stopped
|
|
command: ["postgres", "-c", "max_connections=200", "-c", "shared_buffers=256MB"]
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
command: redis-server --save 60 1 --loglevel warning
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- rh_net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 15
|
|
start_period: 25s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
|
|
api:
|
|
image: git.sschuhmann.de/sschuhmann/rehearsalhub/api:0.1.0
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-rh_user}:${POSTGRES_PASSWORD:-default_secure_password}@db:5432/${POSTGRES_DB:-rehearsalhub}
|
|
NEXTCLOUD_URL: ${NEXTCLOUD_URL:-https://cloud.example.com}
|
|
NEXTCLOUD_USER: ${NEXTCLOUD_USER:-rh_service}
|
|
NEXTCLOUD_PASS: ${NEXTCLOUD_PASS:-default_password}
|
|
REDIS_URL: redis://redis:6379/0
|
|
SECRET_KEY: ${SECRET_KEY:-replace_me_with_32_byte_hex_default}
|
|
INTERNAL_SECRET: ${INTERNAL_SECRET:-replace_me_with_32_byte_hex_default}
|
|
STORAGE_ENCRYPTION_KEY: ${STORAGE_ENCRYPTION_KEY}
|
|
DOMAIN: ${DOMAIN:-localhost}
|
|
networks:
|
|
- rh_net
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1"]
|
|
interval: 20s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 60s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
|
|
audio-worker:
|
|
image: git.sschuhmann.de/sschuhmann/rehearsalhub/worker:0.1.0
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-rh_user}:${POSTGRES_PASSWORD:-default_secure_password}@db:5432/${POSTGRES_DB:-rehearsalhub}
|
|
REDIS_URL: redis://redis:6379/0
|
|
API_URL: http://api:8000
|
|
INTERNAL_SECRET: ${INTERNAL_SECRET:-replace_me_with_32_byte_hex_default}
|
|
ANALYSIS_VERSION: "1.0.0"
|
|
volumes:
|
|
- audio_tmp:/tmp/audio
|
|
networks:
|
|
- rh_net
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
api:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
deploy:
|
|
replicas: ${WORKER_REPLICAS:-2}
|
|
|
|
nc-watcher:
|
|
image: git.sschuhmann.de/sschuhmann/rehearsalhub/watcher:0.1.0
|
|
environment:
|
|
NEXTCLOUD_URL: ${NEXTCLOUD_URL:-https://cloud.example.com}
|
|
NEXTCLOUD_USER: ${NEXTCLOUD_USER:-rh_service}
|
|
NEXTCLOUD_PASS: ${NEXTCLOUD_PASS:-default_password}
|
|
API_URL: http://api:8000
|
|
REDIS_URL: redis://redis:6379/0
|
|
POLL_INTERVAL: "30"
|
|
networks:
|
|
- rh_net
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
api:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
|
|
web:
|
|
image: git.sschuhmann.de/sschuhmann/rehearsalhub/web:0.1.0
|
|
ports:
|
|
- "8080:80"
|
|
networks:
|
|
- frontend
|
|
- rh_net
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
frontend:
|
|
name: proxy
|
|
external: true
|
|
rh_net:
|
|
|
|
volumes:
|
|
pg_data:
|
|
redis_data:
|
|
audio_tmp:
|