Files
zmb-webui/deploy/zfs-manager-backend.service
patrick d9c77e0b46 Konfigurierbares CORS per ZMB_CORS_ORIGINS + dynamische Frontend-URL
- main.py: CORS-Origins aus ZMB_CORS_ORIGINS (kommagetrennt), Default "*"
- allow_credentials automatisch aktiv bei konkreten Origins, aus bei "*"
- Root-Endpoint liefert Frontend-URL dynamisch via request.base_url
- keine hartkodierten IPs mehr im Anwendungscode
- Doku in CLAUDE.md und systemd-Unit ergaenzt

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 14:58:50 +02:00

31 lines
768 B
Desktop File

[Unit]
Description=ZMB Webui Backend API
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/zmb-webui/backend
Environment="PATH=/opt/zmb-webui/venv/bin"
Environment="PYTHONUNBUFFERED=1"
Environment="PYTHONDONTWRITEBYTECODE=1"
# CORS: comma-separated list of allowed frontend origins.
# Leave unset (or "*") for development. Set to specific origins in production,
# e.g. Environment="ZMB_CORS_ORIGINS=https://<host>:8090"
#Environment="ZMB_CORS_ORIGINS=*"
ExecStart=/opt/zmb-webui/venv/bin/python -m uvicorn main:app \
--host 0.0.0.0 \
--port 8000
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zmb-webui-backend
ReadWritePaths=/opt/zmb-webui/backend
[Install]
WantedBy=multi-user.target