Files
Lyra/.env.example
T
Jonathan 851f725a98 feat(ops): scheduled Postgres backups via db-backup sidecar
All durable state (library, monitor/wanted lists, discovery, config, and the
encrypted credentials) lived only in the single postgres-data volume with no
backup — one volume loss = total loss. Adds a db-backup compose sidecar that
pg_dumps immediately on start then every BACKUP_INTERVAL_SECONDS (default daily),
keeping the last BACKUP_KEEP (default 7) custom-format dumps in ${BACKUP_DIR}.

Travels with the stack (no host cron), starts with `up -d`. .env.example
documents the knobs; README adds a "Backup & restore" section with pg_restore
steps and an off-box note. Verified live: sidecar wrote a valid 128K dump of the
real lyra DB (pg_restore -l lists all tables + _prisma_migrations).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 10:02:17 +02:00

31 lines
1.5 KiB
Bash

POSTGRES_USER=lyra
POSTGRES_PASSWORD=lyra
POSTGRES_DB=lyra
DATABASE_URL=postgresql://lyra:lyra@db:5432/lyra
# 32 random bytes, base64. Generate with: openssl rand -base64 32
LYRA_SECRET_KEY=MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=
# Host directory for the downloaded music library (bind-mounted into the worker at /music)
MUSIC_DIR=./music
# Host directory for per-job download staging (bind-mounted into the worker at /staging).
# Defaults to MUSIC_DIR/.staging. Point this at a fast LOCAL disk when MUSIC_DIR is a network
# share (SMB/NFS) so temporary downloads don't hammer the share; the final import copies the
# finished album onto the library volume and swaps it in atomically.
# STAGING_DIR=/srv/lyra-staging
# Host directory where slskd (the external Soulseek daemon) writes FINISHED downloads,
# bind-mounted into the worker at /slskd-downloads. The worker moves completed Soulseek
# transfers out of here into staging, so this MUST be the same directory slskd downloads to.
# Set this only once Lyra runs on the same host as slskd; until then Soulseek can search but
# not deliver. Defaults to ./slskd-downloads (an empty local dir) so the stack still starts.
# SLSKD_DOWNLOADS_DIR=/var/lib/slskd/downloads
# Postgres backups (db-backup sidecar). Dumps go to BACKUP_DIR on the host; the sidecar
# keeps the last BACKUP_KEEP dumps and runs every BACKUP_INTERVAL_SECONDS (default daily).
# Point BACKUP_DIR at a NAS/synced path for off-box safety. See README "Backup & restore".
# BACKUP_DIR=./backups
# BACKUP_INTERVAL_SECONDS=86400
# BACKUP_KEEP=7