feat(server): split runtime knobs out of .env into settings.toml

.env shrinks to bootstrap values only (port, paths, log, auth, deploy
flags). The 14 admin-tunable values (retention, whisper, ollama, llm)
move to a new settings.toml with serde(default)-based per-section
defaults and an empty-prompt fallback to the code default. settings.toml
is gitignored alongside .env; settings.toml.example is the template.

This commit fixes the file layout. The server-side wiring (Config shrink,
AppState integration, consumer migration) follows separately.
This commit is contained in:
2026-04-27 11:21:23 +02:00
parent 0205301018
commit 6bbbf10f77
4 changed files with 298 additions and 33 deletions
+13 -33
View File
@@ -1,42 +1,22 @@
# === Required (Phase 1) ===
# Doctate operator config — bootstrap, logging, auth, deploy topology.
# Admin-tunable values (retention, providers, prompts) live in settings.toml
# (see settings.toml.example for the template).
# Server bootstrap
SERVER_PORT=3000
DATA_PATH=/data
USERS_FILE=users.toml
# Logging
LOG_LEVEL=info
LOG_PATH=/var/log/recorder
LOG_MAX_DAYS=90
# === Optional (Phase 2+) ===
# Retention
RETENTION_AUDIO_DAYS=30
RETENTION_TRANSCRIPT_DAYS=30
RETENTION_DOCUMENT_DAYS=0
# faster-whisper
WHISPER_URL=http://localhost:10300
WHISPER_TIMEOUT_SECONDS=120
# Ollama
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=gemma3:4b
OLLAMA_KEEP_ALIVE=0
# LLM provider (Ionos)
LLM_URL=https://openai.inference.de-txl.ionos.com
LLM_API_KEY=
LLM_MODEL=
LLM_TEMPERATURE=0
LLM_TIMEOUT_SECONDS=180
# Optional override of the consolidation system prompt. If unset or empty, a default is used.
# Single line — escape newlines with \n if your shell preserves them, or put the prompt on one logical line.
LLM_SYSTEM_PROMPT="Du bist ein medizinischer Assistent. Fasse die folgenden diktierten Abschnitte zu einem zusammenhängenden Text zusammen. Bereinigen und strukturieren, nichts hinzufügen, nichts interpretieren, keine Diagnose, keine Arztbrief-Struktur. Entferne Redundanzen. Spätere Aufnahmen haben Vorrang — Korrekturen, Nachträge und Widersprüche zugunsten der chronologisch letzten Aussage auflösen. Antworte auf Deutsch. Nur der zusammengefasste Text, keine Einleitung, kein Abschlusssatz."
# Gazetteer (pre-LLM proper-name correction)
# Directory with *.txt files, one entry per line. Blank and #-comment lines
# are skipped. Missing directory is non-fatal — analysis runs without hints.
VOCAB_DIR=./vocab
# Session
# Auth
SESSION_TIMEOUT_HOURS=8
# Set to false for plain-HTTP local dev; browsers refuse Secure cookies on http://
COOKIE_SECURE=true
# Optional filesystem resources (uncomment if used)
# VOCAB_DIR=./vocab
# HUNSPELL_DICT=/usr/share/hunspell/de_DE.dic