Zielserver-Entscheidung durch optionales Install-Script aufgelöst statt festgeschrieben: deploy/glitchtip-install.sh installiert GlitchTip per Docker Compose auf einem beliebigen, selbst gewählten Host - nichts automatisch/ungefragt. DSN wird zur Laufzeit über eine neue Admin-GUI-Seite ein-/ausschaltbar (Systemeinstellung-Singleton, GET/PATCH /einstellungen/sentry), statt nur per .env - kein Redeploy zum Umschalten nötig. Frontend lädt @sentry/react nur dynamisch nach, wenn tatsächlich aktiv. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVgbozhYmuEhiEJHffRXCV
46 lines
1.8 KiB
Python
46 lines
1.8 KiB
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Konfiguration aus Umgebungsvariablen (.env auf dem Zielsystem, nie committen)."""
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
database_url: str = "postgresql+asyncpg://mabea:changeme@localhost:5432/mabea"
|
|
jwt_secret_key: str = "change-me-to-a-long-random-value"
|
|
jwt_algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 480
|
|
|
|
# ID des systemknoten-Datensatzes mit typ='haupt' (Sprintplan E6).
|
|
systemknoten_id: int = 1
|
|
|
|
# Karte 05 / Sprint 6: E-Mail-Benachrichtigung bei neuem Fehlbestand.
|
|
# Leer (Default) = Versand wird übersprungen, nur geloggt (sicherer Default für
|
|
# Entwicklung/Tests ohne konfigurierten Mailserver).
|
|
smtp_host: str = ""
|
|
smtp_port: int = 587
|
|
smtp_user: str = ""
|
|
smtp_password: str = ""
|
|
smtp_from: str = "mabea@example.org"
|
|
smtp_use_tls: bool = True
|
|
|
|
# Dokumente-Modul (Roadmap Phase 5): lokale Ablage, kein Cloud-Storage-
|
|
# Zwang (Self-Hosting-Anforderung). Relativer Default reicht für
|
|
# Entwicklung, Produktion setzt einen absoluten Pfad außerhalb des
|
|
# Anwendungsverzeichnisses (z.B. /opt/mabea/uploads, siehe deploy/README.md).
|
|
upload_dir: str = "./uploads"
|
|
max_upload_size_mb: int = 25
|
|
|
|
# FOUND-006: Log-Level aus Umgebung statt hartcodiert - Produktion läuft
|
|
# standardmäßig auf INFO, bei Bedarf per .env auf DEBUG hochsetzbar ohne
|
|
# Code-Änderung/Neubau.
|
|
log_level: str = "INFO"
|
|
|
|
# FOUND-013: GlitchTip (Sentry-API-kompatibel) für Error-Tracking, optional
|
|
# per deploy/glitchtip-install.sh selbst gehostet. Leer (Default) = kein
|
|
# Fehler-Tracking, No-Op - kein Zwang, GlitchTip zu betreiben.
|
|
sentry_dsn: str = ""
|
|
|
|
|
|
settings = Settings()
|