Backend-Arbeitsstand: ERP-Sync, Lieferlebenszyklus, Reports + config.toml
Bringt das Backend vom initialen Skeleton auf den aktuellen Arbeitsstand (Clean Architecture: domain → application → infrastructure → api). Wesentliche Bereiche: - ERP-Anbindung (MSSQL-Pull der Touren, Import-Scheduler, Rückschreiben) - Lieferlebenszyklus: Scan/Hold/Cancel/Complete, Gutschriften, Notizen, Bild-Anhänge, Unterschriften, PDF-Lieferreport → DOCUframe - Stammdaten: Kunden, Artikel, Lager, Zahlungsarten, Services - Keycloak-JWT-Gate + Fahrer-Provisionierung via Admin-API - Admin-API-Key-Gate (X-Admin-Api-Key) für Maschinen-Endpunkte Jüngste Änderungen dieser Session: - Belegspezifische Kontaktdaten: alle ERP-Adressen (Beleg-/Liefer-/ Rechnungsadresse, Ansprechpartner, Kundenstamm) mit Telefon/Mobil/ E-Mail werden gesynct (Migration 0029, MSSQL-Query, TourDetails) - Konfiguration von .env (envy/dotenvy) auf config.toml (toml/serde) umgestellt; Vorlage config.example.toml, Pfad via HOLZLEITNER_CONFIG Nicht im Repo (per .gitignore): config.toml (Secrets), data/ (Laufzeit-/ Kundendaten), demo.mp4, .claude/, variocontrol-ai/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
92
config.example.toml
Normal file
92
config.example.toml
Normal file
@ -0,0 +1,92 @@
|
||||
# Vorlage für die lokale Backend-Konfiguration.
|
||||
# Kopieren nach `config.toml` und Werte anpassen:
|
||||
#
|
||||
# cp config.example.toml config.toml
|
||||
#
|
||||
# Die `config.toml` selbst enthält Secrets und gehört NICHT in Git.
|
||||
# Pfad überschreibbar via Env `HOLZLEITNER_CONFIG=/pfad/zu/config.toml`.
|
||||
#
|
||||
# Pflicht-Sections: [server], [database], [keycloak], [gsd].
|
||||
# Alle anderen Sections/Felder sind optional und fallen auf Defaults zurück.
|
||||
|
||||
# --- HTTP-Server ----------------------------------------------------------
|
||||
[server]
|
||||
host = "127.0.0.1"
|
||||
port = 3000
|
||||
|
||||
# --- Postgres -------------------------------------------------------------
|
||||
# Passt zur docker-compose.yml (Service `postgres`).
|
||||
[database]
|
||||
url = "postgres://holzleitner:holzleitner_dev@localhost:5432/holzleitner"
|
||||
max_connections = 10
|
||||
|
||||
# --- Keycloak (OIDC) ------------------------------------------------------
|
||||
# issuer_url muss EXAKT dem `iss`-Claim entsprechen, das Keycloak ausstellt.
|
||||
[keycloak]
|
||||
issuer_url = "http://localhost:8080/realms/holzleitner"
|
||||
audience = "holzleitner-api"
|
||||
jwks_cache_ttl_seconds = 3600
|
||||
admin_url = "http://localhost:8080"
|
||||
realm = "holzleitner"
|
||||
provisioner_client_id = "holzleitner-provisioner"
|
||||
provisioner_client_secret = "provisioner-dev-secret"
|
||||
driver_default_password = "Holzleitner-Start1!"
|
||||
driver_role = "driver"
|
||||
# Default false → Sync legt keine Fahrer-Konten an.
|
||||
provisioning_enabled = false
|
||||
|
||||
# --- GSD / DOCUframe (Datei-Upload) ---------------------------------------
|
||||
# password_md5 ist der MD5-Hash des Service-Account-Passworts (kein Klartext).
|
||||
[gsd]
|
||||
rest_url = "http://192.168.1.9:8334"
|
||||
app_key = "GSD-RestApi"
|
||||
user = "GSDWebServiceTmp"
|
||||
password_md5 = "<md5-des-passworts>"
|
||||
app_names = ["GSD-RestApi"]
|
||||
|
||||
# --- ERPframe MSSQL (täglicher Touren-Pull) -------------------------------
|
||||
[erp]
|
||||
host = "192.168.1.7"
|
||||
port = 61279
|
||||
database = "HOLZ_SQL"
|
||||
user = "sa"
|
||||
password = "<erp-passwort>"
|
||||
trust_cert = true
|
||||
writeback_enabled = false
|
||||
|
||||
# --- ERP-Import-Scheduler -------------------------------------------------
|
||||
[import]
|
||||
enabled = false
|
||||
cron = "0 0 3 * * *"
|
||||
date_offset_days = 1
|
||||
|
||||
# --- PDF-Lieferreport → DOCUframe ----------------------------------------
|
||||
[report]
|
||||
storage_dir = "./data/reports"
|
||||
upload_enabled = false
|
||||
retry_cron = "0 */5 * * * *"
|
||||
|
||||
# --- Lokale Speicher (Signaturen / Bild-Notizen) --------------------------
|
||||
[signature]
|
||||
storage_dir = "./data/signatures"
|
||||
|
||||
[attachment]
|
||||
storage_dir = "./data/attachments"
|
||||
|
||||
# --- DEV-ONLY-Schalter ----------------------------------------------------
|
||||
[dev]
|
||||
# today_override weglassen = echte Uhr. Zum Testen mit importierten Touren
|
||||
# den quotierten String setzen, z. B.:
|
||||
# today_override = "2026-06-01"
|
||||
sync_enabled = false
|
||||
|
||||
# --- Admin-API-Key (Maschinen-Zugang zu /admin) ---------------------------
|
||||
# Leer ⇒ alle /admin-Endpunkte gesperrt (fail-closed). In Produktion einen
|
||||
# hochentropischen Zufallswert setzen (`openssl rand -hex 32`).
|
||||
[admin]
|
||||
api_key = ""
|
||||
|
||||
# --- Logging --------------------------------------------------------------
|
||||
# RUST_LOG-Env hat Vorrang. Binary-Crate heißt `holzleitner_server`.
|
||||
[logging]
|
||||
filter = "holzleitner_server=info,holzleitner_api=info,holzleitner_application=info,holzleitner_infrastructure=info,tower_http=info"
|
||||
Reference in New Issue
Block a user