Files
FabledSteward/docker-compose.yml
T
bvandeusen 93d5ed8fb0 feat: managed NUT setup, plugin config improvements, migration fix
- Add managed NUT mode: configure NUT daemon from Settings → Plugins
  (UPS plugin), writes /data/nut_managed.json read by entrypoint on
  restart — no env vars or USB passthrough required
- entrypoint.sh: start NUT from /data/nut_managed.json or NUT_MANAGED=1
  env var; drop to app user via gosu after NUT daemons start
- nut_setup.py: support --from-file <json> in addition to env vars
- Dockerfile: add nut, nut-client, gosu packages and entrypoint
- docker-compose.yml: document optional NUT_MANAGED env var block
- Fix plugin hot-reload migration failure: pass all plugin migration
  dirs to Alembic so previously-stamped revisions from other plugins
  remain resolvable (fixes UPS and any plugin with depends_on)
- Fix plugin list-type config (e.g. SNMP devices) rendering as broken
  text input — now shows a read-only note to edit plugin.yaml instead
- Fix _sync_nut_managed_config: only write JSON when nut_ups_host is
  non-empty, preventing NUT startup loop on container restart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 08:15:48 -04:00

49 lines
1.8 KiB
YAML

services:
app:
build: .
ports:
- "5000:5000"
volumes:
- app_data:/data
- ./plugins:/app/plugins:ro
# Uncomment to enable Traefik access log ingestion (set access_log.enabled: true in plugin config):
- /mnt/Data/traefik/log:/var/log/traefik:ro
environment:
- FABLEDSCRYER_DATABASE_URL=postgresql+asyncpg://fabledscryer:fabledscryer@db/fabledscryer
# ── Managed NUT (optional) ───────────────────────────────────────────────
# Set NUT_MANAGED=1 to run NUT inside this container and connect to your
# UPS over the network (SNMP or XML/HTTP). No USB or special privileges
# required — just network access to the UPS management card.
#
# - NUT_MANAGED=1
# - NUT_UPS_HOST=192.168.1.x # IP/hostname of UPS management card (required)
# - NUT_DRIVER=snmp-ups # snmp-ups (default) or netxml-ups for Eaton
# - NUT_UPS_NAME=ups # must match 'ups_name' in UPS plugin settings
# - NUT_SNMP_COMMUNITY=public # SNMP community string (snmp-ups only)
# - NUT_SNMP_VERSION=v1 # v1 or v2c (snmp-ups only)
# - NUT_USERNAME= # upsd auth username (blank = no auth)
# - NUT_PASSWORD= # upsd auth password
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: fabledscryer
POSTGRES_PASSWORD: fabledscryer
POSTGRES_DB: fabledscryer
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fabledscryer"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
pgdata:
app_data: