Repository navigation
Description
Thanks for hosts (#71). It made Kanzo easy to put behind a proxy at the root. I'd like to run it under a path instead, like http://myserver/kanzo/, next to other apps on one gateway that routes by path. A setup like that has one hostname and one certificate, and each app gets a path.
Today that doesn't work, because the board asks for everything at the root: /app.js, /api/..., /logo.png, /sw.js. Behind location /kanzo/ { proxy_pass http://kanzo:4242/; } those requests go to the proxy's root instead of to Kanzo. Rewriting the responses in the proxy works, but it breaks whenever a path changes in a release.
Proposal: make the board's URLs relative, with no new setting. Kanzo already routes by hash (#all, #<project>) and already prefixes API calls through base(), so it's most of the way there (line numbers from 27d698c):
index.html:href="logo.png",icon.png,manifest.webmanifest,src="app.js"(5 places).- The manifest in
web.rs:"id": "./","start_url": "./","src": "icon.png". Relative URLs in a manifest resolve against the manifest's own URL. app.js:base()(line 44) returns"."or"./remote"instead of""or"/remote", sobase() + "/api" + pathbecomes./api/...;fetch("changelog.md")(line 2353);register("sw.js")andgetRegistration("./")(lines 2041, 2060);history.replaceState(null, "", app ? "./?app" : "./")(line 2023).
sw.js: build its URLs fromself.registration.scope(new URL("api/push", self.registration.scope), and the same foricon.pngandopenWindow). It then follows wherever the board was registered.
What doesn't change:
- the server's routes, the API, MCP over stdio and
/mcp; - a board at the root behaves exactly as now;
- there's no new option or dependency.
What I'd test: cargo fmt --check, cargo clippy --all-targets -D warnings and cargo test; the ES2020 parse your syntax test does; and a browser pass in current Chrome, Edge and Firefox, in light and dark, both at the root and behind nginx at /kanzo/:
- loading, editing, moving and searching cards;
- attaching and opening images;
- notifications (the service worker's register, push and click-to-open);
- installed-app mode (
?app); - a shared and a joined board.
There's no Safari 13.1, Chrome 80 or Firefox 78 here. The change adds no new syntax (only paths, and new URL(path, scope) in the service worker, which those versions have), so the ES2020 parse stands in for them, as in #90.
Possible follow-up, separate: an icon = "..." key in config.toml that serves a file in place of the built-in logo.png and icon.png, for people who want the board's icon to match their other apps. Happy to leave that out if it's more than you want.
If this approach sounds right, I'll send a PR.
· Generated with Claude Code · Opus 5.5 ·
Activity
emanuele-em commentedon Dec 3, 2026
Thanks for the clear proposal! I went ahead with it in #102: every URL the board asks for is now relative, plus
i18n/zh-cn.js, which the Chinese board also needs under a path. If you get a chance to try it behind your gateway, that would be great.baron-hines commentedon Dec 3, 2026
Thanks! I built
mainat 504993b and ran it behind nginx at/kanzo/(proxy_pass http://127.0.0.1:4499/,hosts = ["localhost"]), plus at the root for comparison. It works as expected.I tested it in current Chromium and Firefox, in light and dark mode, through Playwright. In all 8 runs:
changelog.mdandi18n/zh-cn.jsloaded;/kanzo/;start_urland icon resolved under it;/kanzo/.The only refusal was
/api/networkanswering 403, the existing rule for listedhosts.We'll put it behind our own gateway once it's in a release.
· Generated with Claude Code · Opus 5.5 ·
Serve the board from a path behind a proxy (emanuele-em#102)