feat: GL kit-connect ipk + one-button wizard + web dashboard for both platforms

Synology kit-connect (SPK):
- wizard.sh — one-button Keylink IT fleet setup (auto-runs on install)
- www/index.html — dark-themed local dashboard (same design as busrouter)
- bin/serve-dashboard.sh — busybox httpd on port 8089 with CGI endpoints
- start-stop-status updated to manage dashboard alongside daemon
- INFO updated: RT2600ac + RT6600ax compatibility noted
- postinst now runs wizard --auto for first-time setup

GL kit-connect (OpenWrt ipk):
- Makefile — DEPENDS: +curl +openssh-client +tailscale
- procd init — USE_PROCD=1, respawn with 5s delay
- connect-daemon.sh — Tailscale + reverse SSH (same as Synology version)
- connect-wizard.sh — one-button setup, idempotent, UCI config
- connect-register.sh — standalone hub registration
- www/kitconnect/index.html — dark-themed dashboard with wizard button
- www/kitconnect/wizard.cgi — web-triggered wizard endpoint
- UCI config at /etc/config/kitconnect

Both platforms share: same hub protocol, same Tailscale key, same port pool.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 03:10:32 +00:00
parent 0c68fb2461
commit 52e7e478e4
16 changed files with 1241 additions and 77 deletions
@@ -0,0 +1,60 @@
#!/bin/sh
# wizard.cgi — Web endpoint for the one-button setup wizard.
# GET ?action=status → returns connectivity state (plain text)
# POST → runs the setup wizard, returns output
echo "Content-Type: text/plain"
echo ""
METHOD="${REQUEST_METHOD:-GET}"
ACTION=$(echo "${QUERY_STRING:-}" | grep -o 'action=[^&]*' | cut -d= -f2)
if [ "$METHOD" = "GET" ] && [ "$ACTION" = "status" ]; then
echo "=== kit-connect Status ==="
echo ""
DEVICE_ID=$(cat /etc/busrouter/device-id 2>/dev/null || hostname)
echo "Device: ${DEVICE_ID}"
PID=$(cat /var/run/kitconnect/daemon.pid 2>/dev/null || echo "")
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
echo "Daemon: running (PID ${PID})"
else
echo "Daemon: stopped"
fi
TUNNEL_PID=$(cat /var/run/kitconnect/tunnel.pid 2>/dev/null || echo "")
if [ -n "$TUNNEL_PID" ] && kill -0 "$TUNNEL_PID" 2>/dev/null; then
echo "Tunnel: active (PID ${TUNNEL_PID})"
else
echo "Tunnel: not connected"
fi
PORT=$(uci -q get kitconnect.main.tunnel_remote_port 2>/dev/null || echo "pending")
echo "Hub port: ${PORT}"
HUB=$(uci -q get kitconnect.main.hub_host 2>/dev/null || echo "unknown")
echo "Hub host: ${HUB}"
if command -v tailscale >/dev/null 2>&1; then
TS_IP=$(tailscale ip -4 2>/dev/null || echo "unknown")
echo "Tailscale: ${TS_IP}"
else
echo "Tailscale: not installed"
fi
echo ""
echo "Config:"
uci -q show kitconnect 2>/dev/null | while IFS='=' read -r key val; do
printf " %-25s = %s\n" "${key##*.}" "${val//\'/}"
done
exit 0
fi
if [ "$METHOD" = "POST" ]; then
/usr/sbin/connect-wizard.sh --force 2>&1
exit $?
fi
echo "Usage: GET ?action=status or POST to run wizard"