8cdeadd6dd
PR 1 of 4 for the runtime service registry change. - Add Fernet encryption helper (services/secrets.py) with a required MANAGE_ENCRYPTION_KEY; validate it on startup. - Add closed integrations/ registry with Pydantic config + widget-config definitions for grafana, prometheus, jellyfin, nextcloud, and ssh_tasks. - Add services + service_task_runs tables and SettingsStore CRUD with cascade-delete (defensive until widgets carry service_id). - Add /api/services/types and /api/services/instances CRUD (encrypted secrets, secrets_set flags only; never plaintext). - Declare cryptography as a direct dependency. - Require MANAGE_ENCRYPTION_KEY in compose + .env.example + README. - Add 25 backend tests (registry, encryption, CRUD, cascade, task-run history). Verification: ruff clean; pytest 225 passed; frontend lint/build green.
78 lines
2.4 KiB
Bash
78 lines
2.4 KiB
Bash
# Manage environment template
|
|
# Copy this file to .env, fill in the required values, and export them in your shell
|
|
# before running docker compose. Compose files use interpolation, not env_file.
|
|
|
|
# App
|
|
APP_VERSION=0.1.0
|
|
APP_BUILD_INFO=dev
|
|
|
|
# Hosts
|
|
BACKEND_APP_HOST=api.manage.example.com
|
|
FRONTEND_APP_HOST=manage.example.com
|
|
GRAFANA_APP_HOST=grafana.example.com
|
|
BACKEND_APP_PORT=8000
|
|
FRONTEND_APP_PORT=80
|
|
GRAFANA_APP_PORT=3000
|
|
BACKEND_APP_NAME=manage-backend
|
|
FRONTEND_APP_NAME=manage-frontend
|
|
GRAFANA_APP_NAME=grafana
|
|
|
|
# Traefik / certificates
|
|
CERT_RESOLVER=letsencrypt
|
|
|
|
# Backend
|
|
LOG_LEVEL=INFO
|
|
LOG_FORMAT=json
|
|
PROMETHEUS_ENABLED=true
|
|
PROMETHEUS_FILE_SD_DIR=/app/backend/.cache/prometheus-file-sd
|
|
ALERTMANAGER_URL=http://alertmanager:9093
|
|
ALERTMANAGER_WEBHOOK_URL=
|
|
GRAFANA_URL=http://grafana:3000
|
|
PROMETHEUS_URL=http://prometheus:9090
|
|
# Required: master key for encrypting service secrets (API keys/tokens) at rest.
|
|
# Generate one with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
|
MANAGE_ENCRYPTION_KEY=replace-with-a-fernet-key
|
|
BACKEND_CACHE_DIR=./backend-cache
|
|
|
|
# Auth
|
|
AUTH_ENABLED=true
|
|
OIDC_ISSUER_URL=https://auth.example.com/application/o/manage/
|
|
OIDC_AUDIENCE=manage
|
|
OIDC_JWKS_URL=https://auth.example.com/application/o/manage/jwks/
|
|
OIDC_CLOCK_SKEW_SECONDS=30
|
|
|
|
# Frontend OIDC
|
|
VITE_API_URL=/api
|
|
VITE_OIDC_ENABLED=true
|
|
VITE_OIDC_ISSUER=https://auth.example.com/application/o/manage/
|
|
VITE_OIDC_CLIENT_ID=manage
|
|
VITE_OIDC_SCOPE=openid profile email
|
|
VITE_OIDC_REDIRECT_URI=https://manage.example.com/oidc/callback
|
|
VITE_OIDC_POST_LOGOUT_REDIRECT_URI=https://manage.example.com/
|
|
VITE_DEV_API_PROXY_TARGET=http://backend:8000
|
|
VITE_GRAFANA_URL=https://grafana.example.com
|
|
VITE_PROMETHEUS_URL=https://prometheus.example.com
|
|
|
|
# SMTP
|
|
SMTP_HOST=smtp.example.com
|
|
SMTP_PORT=587
|
|
SMTP_USERNAME=
|
|
SMTP_PASSWORD=
|
|
SMTP_FROM_ADDRESS=no-reply@example.com
|
|
SMTP_FROM_NAME=Manage
|
|
SMTP_USE_TLS=true
|
|
SMTP_USE_SSL=false
|
|
SMTP_TIMEOUT=30
|
|
|
|
# Grafana admin / OAuth
|
|
GRAFANA_ADMIN_USER=admin
|
|
GRAFANA_ADMIN_PASSWORD=change-me
|
|
GF_AUTH_GENERIC_OAUTH_CLIENT_ID=manage
|
|
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET=
|
|
GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://auth.example.com/application/o/manage/authorize/
|
|
GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://auth.example.com/application/o/manage/token/
|
|
GF_AUTH_GENERIC_OAUTH_API_URL=https://auth.example.com/application/o/manage/userinfo/
|
|
|
|
# Alerting
|
|
ALERT_EMAIL_TO=admin@example.com
|