v0.5.0: Add RBAC auth, LLM router, audit logging, output sanitization
- New: auth.py – Role-based access (operator/approver/viewer) - New: llm_router.py – Configurable primary/fallback provider chain - New: audit_log.py + audit_query.py – DSGVO-compliant audit trail - New: sanitize_output() – masks secrets in bot responses - Updated: bot.py – Integrated auth guards, router, audit logging - Updated: ollama_client.py – Router-compatible interface - Updated: CLOWNFISCHSERVER.md – Documentation updated - Updated: README.md – Documentation updated
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# 🐠 Clownfischserver – Konfiguration
|
||||
# Diese Datei wird automatisch durch install.sh erstellt.
|
||||
# Niemals diese Datei committen oder teilen!
|
||||
|
||||
# Telegram
|
||||
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrSTUvwxYZ
|
||||
# Legacy single-user mode: dieser Nutzer bekommt automatisch die operator-Rolle,
|
||||
# wenn keine CLOWNFISCH_* Rollen-Variablen gesetzt sind (v0.4-Kompatibilität).
|
||||
TELEGRAM_CHAT_ID=987654321
|
||||
|
||||
# === Team-Rollen (v0.5.0) ===========================================
|
||||
# Kommagetrennte Telegram User-IDs (nicht Chat-IDs!).
|
||||
# Operator = darf /shell /code /run /ja /ssh /snapshot /rollback ausführen
|
||||
# Approver = darf /ja (Bestätigungen) ausführen
|
||||
# Viewer = darf /start /help /status /snapshots /chat lesen
|
||||
# Inheritance: operator > approver > viewer (höhere Rolle erbt niedrigere Rechte).
|
||||
# CLOWNFISCH_OPERATORS=12345,67890
|
||||
# CLOWNFISCH_APPROVERS=11111
|
||||
# CLOWNFISCH_VIEWERS=22222,33333
|
||||
|
||||
# === Audit-Trail (DSGVO Art. 5, 32) =================================
|
||||
# Pfad zur JSON-Lines-Audit-Datei. Default: $INSTALL_DIR/audit.jsonl
|
||||
# AUDIT_LOG_PATH=/opt/clownfischserver/audit.jsonl
|
||||
# Aufbewahrungsdauer in Tagen (Art. 5(1)(e) – Storage Limitation).
|
||||
# Beim Bot-Start werden ältere Einträge automatisch entfernt. 0 = nie löschen.
|
||||
AUDIT_RETENTION_DAYS=90
|
||||
# Maximale Länge eines Audit-Detailfeldes (Datenminimierung).
|
||||
AUDIT_MAX_DETAIL_LEN=2000
|
||||
|
||||
# Ollama
|
||||
OLLAMA_BASE_URL=http://localhost:11434
|
||||
OLLAMA_MODEL=qwen2.5-coder:7b
|
||||
OLLAMA_MODEL_FAST=gemma3:4b
|
||||
OLLAMA_NUM_CTX=16384
|
||||
|
||||
# OpenRouter (optional – kostenloser Fallback bei Ollama-Timeout)
|
||||
# API Key von openrouter.ai (kostenlos, keine Kreditkarte)
|
||||
# OPENROUTER_API_KEY=sk-or-v1-...
|
||||
|
||||
# === LLM Routing (v0.5.0, Phase 3) ==================================
|
||||
# Konfiguriert welches Modell als Primary und welches als Fallback genutzt wird.
|
||||
# Wenn nicht gesetzt: defaultet auf Ollama primary, OpenRouter fallback (sofern
|
||||
# OPENROUTER_API_KEY gesetzt ist). Damit bleibt das v0.4-Verhalten erhalten.
|
||||
#
|
||||
# Primary (für sensible Daten – läuft lokal, keine Cloud)
|
||||
# LLM_PRIMARY_PROVIDER=ollama
|
||||
# LLM_PRIMARY_MODEL=qwen2.5-coder:7b
|
||||
# LLM_PRIMARY_MODEL_FAST=gemma3:4b
|
||||
# Gemma 4 27B benötigt mindestens 64K Token Kontext – sonst halluziniert das Modell.
|
||||
# Override pro Provider (überschreibt OLLAMA_NUM_CTX).
|
||||
# LLM_PRIMARY_NUM_CTX=65536
|
||||
#
|
||||
# Fallback (nur falls Primary nicht erreichbar / Timeout)
|
||||
# LLM_FALLBACK_PROVIDER=openrouter
|
||||
# LLM_FALLBACK_MODEL=deepseek/deepseek-r1:free
|
||||
# Wert "none" oder leer = Fallback explizit deaktivieren
|
||||
# LLM_FALLBACK_PROVIDER=none
|
||||
#
|
||||
# Optional: Kostentracking für Admins (informativ, keine Limit-Erzwingung).
|
||||
# TRACK_LLM_COSTS=true
|
||||
|
||||
# Snapshots
|
||||
SNAPSHOT_DIR=/opt/clownfisch-snapshots
|
||||
SNAPSHOT_METHOD=tar
|
||||
|
||||
# HomeIP Auto-Update (optional – myfritz.net Dynamic DNS)
|
||||
# Domain für automatische Firewall-Regel-Updates bei IP-Wechsel
|
||||
# CLOWNFISCHSERVER_HOME_IP_DOMAIN=vorname.myfritz.net
|
||||
|
||||
# Paths
|
||||
INSTALL_DIR=/opt/clownfischserver
|
||||
MGMT_USER=clownfish
|
||||
AIDER_WORKDIR=/opt/clownfisch-workspace
|
||||
Reference in New Issue
Block a user