diff --git a/home-apps/demo-service/Caddyfile b/home-apps/demo-service/Caddyfile index 489b3a6..e66439e 100644 --- a/home-apps/demo-service/Caddyfile +++ b/home-apps/demo-service/Caddyfile @@ -1,5 +1,4 @@ # Caddy for Demo Service — internal server, TLS handled by Nginx Ingress -# Auth is handled by the Python API (calls OAuth2 Proxy for SSO validation) :80 { log { @@ -7,6 +6,16 @@ format json } + # ── Custom error pages (canvas animation, served directly by Caddy) ── + handle_errors { + @html_errors expression `{err.status_code} in [401, 403, 404]` + handle @html_errors { + root * /app/static + rewrite * /error-page.html + file_server + } + } + # Management API → Python service handle /api/* { reverse_proxy localhost:3000 { @@ -29,19 +38,11 @@ reverse_proxy localhost:3000 } - # ── Security: block access to internal/hidden files ── - # Prevent leaking .draft, .bak, .meta, .git files - @blocked path_regexp \.(draft|bak)$|^\.meta|^\.git - handle @blocked { - error 404 - } - # Static demo sites — public, no auth handle_path /* { root * /data/demos file_server { index index.html - hide .* } } diff --git a/home-apps/demo-service/Dockerfile b/home-apps/demo-service/Dockerfile index e8dd1eb..2b2d079 100644 --- a/home-apps/demo-service/Dockerfile +++ b/home-apps/demo-service/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app RUN pip install --no-cache-dir fastapi uvicorn python-multipart httpx -COPY service.py _config.py _loaders.py error-page.html /app/ +COPY service.py _config.py _loaders.py error-page.html admin-ui.html /app/ RUN mkdir -p /data/demos diff --git a/home-apps/demo-service/admin-ui.html b/home-apps/demo-service/admin-ui.html new file mode 100644 index 0000000..9410d32 --- /dev/null +++ b/home-apps/demo-service/admin-ui.html @@ -0,0 +1,249 @@ + + +
+ + +