Files
kit-busrouter/hub
kitadmin 14d46d96a4 fix: daemon hang, postinst mkdir, hub key authorization, boot persistence
SPK daemon fixes (x5925 testing feedback):
- register_with_hub: added --max-time 15 to prevent indefinite hang
- Removed bash 'local' keyword for busybox ash compatibility
- postinst: mkdir -p /usr/local/bin before copying Tailscale binaries
- postinst: chmod +x all bin/*.sh (fixes 644 execute bit bug)
- Added x5925-boot.sh for reboot persistence (stopgap until daemon fixed)

Hub security hardening:
- Added POST /api/authorize-key endpoint with device_id + pubkey
- Keys auto-authorized with restrict,port-forwarding,permitlisten="<port>"
- No shell access allowed — only tunnel forwarding to assigned port
- Server.py updated with input validation on key format
- register.sh --authorize-key subcommand for secure key management

GL daemon: same --max-time fix applied for curl timeout

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 04:09:49 +00:00
..

Busfleet Hub

Registration endpoint for kit-connect devices. Runs on the VPS at 162.243.83.36:8080.

Files

  • register.sh — Called per-device. Assigns a tunnel port from pool 2230-2299, records it in port-registry.json, returns JSON.
  • server.py — Minimal Python HTTP server. Routes GET /api/register/<DEVICE_ID>register.sh.
  • port-registry.json — Persistent device→port mapping.

Deploy

scp hub/register.sh hub/server.py root@162.243.83.36:/opt/busfleet-hub/
ssh root@162.243.83.36 systemctl restart busfleet-hub

API

GET /api/register/<DEVICE_ID>

Response (existing device):

{"device_id": "x5925", "tunnel_port": 2230, "tailscale_auth_key": "tskey-auth-...", "status": "existing"}

Response (new device):

{"device_id": "x9999", "tunnel_port": 2231, "tailscale_auth_key": "tskey-auth-...", "status": "new"}

Port Pool

22302299. Already assigned:

  • x4078: 2226 (grandfathered)
  • x5925: 2230