From b9c9291fd87d2512abe12ba90258b63378e42f5b Mon Sep 17 00:00:00 2001 From: Well Lima Date: Fri, 10 Jul 2026 02:19:26 -0300 Subject: [PATCH] fix(gensui): correct frontend dist path resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GENSUI_ROOT (gensui/config.py:14) resolves to /app/gensui — the Python package directory. app.py used GENSUI_ROOT / "frontend" / "dist" to locate the built admin UI, but the Docker image places the built frontend one level up, at /app/frontend/dist (see gensui/Dockerfile:31, `COPY --from=frontend-builder /app/frontend/dist ./frontend/dist` under WORKDIR /app). Effect: frontend_dist.exists() was always False inside the container, so the `/` route and the SPA catch-all were never registered. Every request to the root or any client-side route returned FastAPI's default 404: $ curl -s http://127.0.0.1:8787/ {"detail":"Not Found"} ...despite the built files being present and intact: $ docker exec gensui ls /app/frontend/dist/index.html /app/frontend/dist/index.html Fix: try GENSUI_ROOT.parent / "frontend" / "dist" first (matches the Docker layout), falling back to the original GENSUI_ROOT / "frontend" / "dist" if that doesn't exist — preserves behavior for the local `install.sh` install path, which may lay out files differently. After fix: $ curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8787/ 200 --- gensui/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gensui/app.py b/gensui/app.py index 6f2f5da..02f22e4 100644 --- a/gensui/app.py +++ b/gensui/app.py @@ -118,7 +118,9 @@ async def health_check(): return {"status": "ok", "service": "gensui", "version": "0.1.0"} # ── Serve Frontend (production) ────────────────────────── - frontend_dist = GENSUI_ROOT / "frontend" / "dist" + frontend_dist = GENSUI_ROOT.parent / "frontend" / "dist" + if not frontend_dist.exists(): + frontend_dist = GENSUI_ROOT / "frontend" / "dist" if frontend_dist.exists(): # Serve /assets/* static files assets_path = frontend_dist / "assets"