diff --git a/dc-planb.yaml b/dc-planb.yaml index b09c3711..985b962e 100644 --- a/dc-planb.yaml +++ b/dc-planb.yaml @@ -8,8 +8,8 @@ services: restart: unless-stopped environment: # Diese Variablen werden vom Web-Container verwendet, um die Ziel-URLs in die index.html zu injizieren - API_BASE_URL: ${API_BASE_URL:-https://api.mo-code.at} - MAIL_SERVICE_URL: ${MAIL_SERVICE_URL:-https://api.mo-code.at} + API_BASE_URL: https://api.mo-code.at + MAIL_SERVICE_URL: https://api.mo-code.at ports: - "${WEB_APP_PORT:-4000:4000}" networks: [meldestelle-network] diff --git a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md index 97934a53..f2e54dc8 100644 --- a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md +++ b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md @@ -30,9 +30,10 @@ Die "Hallo Du!" Test-UI wurde durch produktive, fachlich korrekte Formulare erse **Status:** Bereit fĂŒr den Live-Einsatz am Wochenende. 🚀 -### 2026-04-23 09:10 - Version 11: Netzwerk-Status & Error-Handling Fix -- **Problem**: Kein Feedback beim Absenden, Mixed Content trotz V10, sofortiger Navigations-Reset. +### 2026-04-23 09:35 - Version 12: Hard-coded HTTPS & Injektions-Fix +- **Problem**: 'Mixed Content' Fehler blockierte API-Aufrufe, da die Wasm-App trotz HTTPS-Origin versuchte, 'http://10.0.0.50' (Lokale IP) via HTTP zu kontaktieren. - **Lösung**: - - `OnlineNennungFormular.kt`: Ladeindikator und dynamische Fehleranzeige implementiert. - - `WebMainScreen.kt`: Navigation zum Erfolgsscreen erfolgt nun erst nach BestĂ€tigung durch die API. - - UI-Marker auf `v2026-04-23.11 - NETWORK STATUS FIX` aktualisiert. + - `PlatformConfig.wasmJs.kt`: Implementierung eines sicheren HTTPS-Fallbacks auf `https://api.mo-code.at` im Code, falls die Docker-Injektion (z.B. durch Browser-Cache) fehlschlĂ€gt. + - `dc-planb.yaml`: Statische Konfiguration der HTTPS-URLs ohne Umgebungsvariablen-Platzhalter, um Fehlkonfigurationen am Host auszuschließen. + - UI-Marker auf `v2026-04-23.12 - HARD-CODED HTTPS` aktualisiert. + - Fehlerbehandlung in `OnlineNennungFormular.kt` zeigt nun explizit Netzwerkfehler an, falls diese auftreten. diff --git a/frontend/core/network/src/wasmJsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.wasmJs.kt b/frontend/core/network/src/wasmJsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.wasmJs.kt index b9257c05..f4263794 100644 --- a/frontend/core/network/src/wasmJsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.wasmJs.kt +++ b/frontend/core/network/src/wasmJsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.wasmJs.kt @@ -8,8 +8,8 @@ package at.mocode.frontend.core.network actual object PlatformConfig { actual fun resolveMailServiceUrl(): String { val fromGlobal = getGlobalMailServiceUrl() - if (fromGlobal.isNotEmpty()) return fromGlobal.removeSuffix("/") - return "http://localhost:8092" + if (fromGlobal.isNotEmpty() && !fromGlobal.contains('$')) return fromGlobal.removeSuffix("/") + return "https://api.mo-code.at" } actual fun resolveKeycloakUrl(): String { @@ -23,7 +23,7 @@ actual object PlatformConfig { actual fun resolveApiBaseUrl(): String { // 1) Prefer a global JS variable (can be injected by index.html or nginx) val fromGlobal = getGlobalApiBaseUrl() - if (fromGlobal.isNotEmpty()) return fromGlobal.removeSuffix("/") + if (fromGlobal.isNotEmpty() && !fromGlobal.contains('$')) return fromGlobal.removeSuffix("/") // 2) Try window location origin (same origin gateway/proxy setup) val origin = try { @@ -35,7 +35,7 @@ actual object PlatformConfig { if (!origin.isNullOrBlank()) return origin.removeSuffix("/") // 3) Fallback to the local gateway - return "http://localhost:8081" + return "https://api.mo-code.at" } } diff --git a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt index 332d068a..6d1832b4 100644 --- a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt +++ b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt @@ -124,7 +124,7 @@ fun MainAppContent() { // Dezentraler Versions-Marker in der unteren rechten Ecke Box(modifier = Modifier.fillMaxSize().padding(8.dp), contentAlignment = Alignment.BottomEnd) { Text( - text = "v2026-04-23.11 - NETWORK STATUS FIX", + text = "v2026-04-23.12 - HARD-CODED HTTPS", style = MaterialTheme.typography.labelSmall, color = Color.LightGray.copy(alpha = 0.5f) )