diff --git a/config.example.yaml b/config.example.yaml index 3ea8968..3ce73b0 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -1,36 +1,21 @@ -# FabledNetMon configuration example -# Copy to config.yaml and fill in your values. -# Secrets can be set via env vars: FABLEDNETMON_ - -secret_key: "change-me-to-a-random-string" +# FabledNetMon — Bootstrap Configuration Example +# +# The only REQUIRED setting is the database URL. +# Set it via env var (recommended for Docker): +# +# FABLEDNETMON_DATABASE_URL=postgresql+asyncpg://user:pass@host/db +# +# All other settings (SMTP, webhook, ansible, plugins, retention) +# are stored in the database and managed via the Settings UI at /settings/. +# +# config.yaml is optional. Use it only if you prefer file-based bootstrap. database: url: "postgresql+asyncpg://fablednetmon:password@localhost/fablednetmon" -session: - lifetime_hours: 8 +# Optional: override the auto-generated secret key. +# If not set, a key is auto-generated on first run and saved to /data/secret.key. +# secret_key: "change-me-to-a-random-string" -data: - retention_days: 90 - -# plugin_dir: ./plugins # optional; defaults to ./plugins relative to config.yaml - -plugins: {} - # traefik: - # enabled: true - # metrics_url: "http://localhost:8080/metrics" - # scrape_interval_seconds: 60 - -smtp: - host: "" - port: 587 - tls: true - username: "" - password: "" # or: FABLEDNETMON_SMTP__PASSWORD env var - recipients: [] - # - admin@example.com - -webhook: - url: "" # leave empty to disable - template: | - {"content": "**{{ alert.state }}** — {{ alert.resource }} — {{ alert.rule_name }} ({{ alert.metric }} = {{ alert.value }})"} +# Optional: path to plugin directory (default: "plugins") +# plugin_dir: "./plugins" diff --git a/docker-compose.yml b/docker-compose.yml index 7530859..096500f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,11 +4,9 @@ services: ports: - "5000:5000" volumes: - - ./config.yaml:/config/config.yaml:ro - - playbook_cache:/data/playbook_cache - - plugins:/data/plugins + - app_data:/data environment: - - FABLEDNETMON_DATABASE__URL=postgresql+asyncpg://fablednetmon:fablednetmon@db/fablednetmon + - FABLEDNETMON_DATABASE_URL=postgresql+asyncpg://fablednetmon:fablednetmon@db/fablednetmon depends_on: db: condition: service_healthy @@ -31,5 +29,4 @@ services: volumes: pgdata: - playbook_cache: - plugins: + app_data: