From dc8e5e262f044eee79363d8c19411a420bf44c6f Mon Sep 17 00:00:00 2001 From: fuomag9 <1580624+fuomag9@users.noreply.github.com> Date: Sat, 8 Nov 2025 12:05:03 +0100 Subject: [PATCH] fixed Proxy Hosts Not Working After Docker Restart --- src/instrumentation.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/instrumentation.ts b/src/instrumentation.ts index 0f7f96b8..eb79a6e4 100644 --- a/src/instrumentation.ts +++ b/src/instrumentation.ts @@ -25,5 +25,17 @@ export async function register() { console.error("Failed to initialize database:", error); // Don't throw - let the app start anyway, errors will surface when users try to use features } + + // Apply Caddy configuration from database on startup + const { applyCaddyConfig } = await import("./lib/caddy"); + try { + console.log("Applying Caddy configuration from database..."); + await applyCaddyConfig(); + console.log("Caddy configuration applied successfully"); + } catch (error) { + console.error("Failed to apply Caddy configuration on startup:", error); + // Don't throw - Caddy might not be ready yet, or config might be applied later + // This ensures proxy hosts work after container restart + } } }