已关闭
Add embedded SvelteKit admin UI runtime and secure local listener #92
urandon创建于 13 天前关闭于 13 天前
13 天前 添加了label:enhancement
13 天前 关联了pull request:Add embedded admin UI foundation
urandon
13 天前 评论:
13 天前 评论:
Implementation is ready in !96: https://gitcode.com/urandon/gitcode-mcp/merge_requests/96
What landed in the branch:
- Svelte 5 / SvelteKit / TypeScript frontend compiled with adapter-static and embedded through
go:embed; source installs still need no Node runtime. admin openattaches to the existing daemon and lazily starts a dynamic loopback listener;admin statusreturns only sanitized listener state.- The CLI creates raw launch material locally and sends only its SHA-256 hash over the control socket. The token is one-time/one-minute, lives in the URL fragment, and is removed before exchange.
- Browser sessions are bounded HttpOnly + SameSite Strict cookies. Mutations validate Host, Origin, Fetch Metadata and CSRF. API responses are
no-store; assets use generated hash-based CSP, no CORS, no framing, immutable hashed-asset caching and no-store SPA entry revalidation. - Authenticated readiness reports daemon/session/cache/schema/version state and surfaces UI/API version mismatch.
- The selected local-operator-console direction is implemented with a visible Light / Dark / System selector. System is the default and follows
prefers-color-scheme; explicit choices persist locally.
Dogfood / visual QA:
- Playwright exercised the real embedded listener and one-time session exchange, verified cookie flags, navigation, refresh, and all three theme states: 2/2 passed.
- A same-viewport (1487×1058) side-by-side comparison was used to align the sidebar, content column, readiness rows, actions and theme control.
- This QA caught a real CSP integration defect: SvelteKit's bootstrap was initially blocked. The fix uses a generated SHA-256 bootstrap hash and keeps
unsafe-inlinedisabled.
Verification:
./scripts/check-admin-ui-assets.shnpm run checknpm run testnpm run test:e2ego test ./...go install ./...git diff --check
The final source build is installed locally.


13 天前 关闭了 issue
13 天前 添加了label:enhancement;删除了label:enhancement
13 天前 关联了里程碑:Admin Web UI
13 天前 添加了label:admin-ui
13 天前 添加了label:service
Parent: #52
Design: https://gitcode.com/urandon/gitcode-mcp/wiki/Admin-Web-UI-Design-2026-08-25.md
Goal
Add the optional, secure single-binary runtime foundation for the local admin Web UI.
Scope
web/with Svelte 5, SvelteKit, TypeScript, Vite, and@sveltejs/adapter-static.//go:embed all:assets.gitcode-mcp service run.gitcode-mcp admin openandgitcode-mcp admin status.SameSite=Strict/HttpOnlysession, CSRF protection, Host/Origin checks, CSP, no CORS, and loopback-only defaults.go install ./...; add deterministic rebuild verification in CI.Acceptance criteria
gitcode-mcpbinary opens the embedded UI without Node at runtime.admin openattaches to the existing daemon; it does not start a second control plane or writer owner.index.htmlrevalidates; client routes fall back to embeddedindex.html.go install ./...,go test ./..., frontend unit checks, an initial Playwright smoke, asset rebuild verification, andgit diff --checkpass.Non-goals