Phase 12: a headless hub in Docker #20
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/phase-12-headless"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 12: a headless hub in Docker
Kanbot can now run with no desktop: a container on a home server or a VM is the hub. Browsers pair with it to use the board, and the computers that run agents join as nodes or as desktops in Connect mode. Guide:
docs/headless-hub.md.What's in it
Dockerfile: multi-stage, fromnode:24.19.0-bookwormto-slim, both pinned by digest./datavolume.NITRO_HOST=127.0.0.1: the plain listener, which trusts its callers as this computer, is reachable only bydocker exec.KANBOT_HUB_ENABLED=1andKANBOT_HUB_PORT=7433(the one EXPOSE), plusKANBOT_LOCAL_AGENTS=0.HEALTHCHECKiskanbot-hub health..dockerignoreanddocker-compose.yml.KANBOT_HUB_ENABLED/KANBOT_HUB_PORTdecide thehubsection. The app shows it locked, andSettings.updaterefuses changes withSettingFromEnvironment.KANBOT_LOCAL_AGENTS=0gives the hub's own machine a capacity of 0 (Machine.agentsOff).KANBOT_HUB_PUBLIC_URLis the address the hub gives out: a container only knows its Docker address.kanbot-hubCLI (.output/hub-cli, DB-free, over the container's loopback):offer [--kind browser|node|desktop]prints the code, its expiry, what to run on the other computer, the fingerprint and the URLs.status.health.backup <dir>(SQLite online backup plus the rest of the data dir, 0700).scripts/bundleExternals.mjsis shared by desktop-prepare and the CLI build.Checks
npm run lint,npm run typecheck,npx vitest run: 1422 passed, 2 skipped.test/hub/dockerImage.test.tskeeps the Dockerfile and compose file consistent without a daemon.whoamigets 401 and the board redirects to/pair. Port 3000 is unreachable from the host.kanbot-hub statusshows hub mode set by the environment.kanbot-hub offer --kind node: akanbot-nodeon this Mac pairs with--fingerprintand connects over pinned wss.agentsOff) and the Mac's node online.docker restart, the cookie still works and the node reconnected by itself, with no new hint.kanbot-hub backupgives the database (integrity ok, both devices), certificate, key, machine id and attachments.KANBOT_HUB_PUBLIC_URL, status, offer and the hint give out that address.docker compose configvalidates.Not in it
https://<host>:7433directly (LAN, VPN, a forwarded port).network_mode: hoston Linux. That also makes the loopback listener the host's, so local processes on the host are trusted (documented).Base:
refactor/phase-11-discovery(PR #19).🤖 Generated with Claude Code