Files
kit-busrouter/kit-connect/build.sh
T
kitadmin 52e7e478e4 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>
2026-07-22 03:10:32 +00:00

66 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
# build.sh — Assemble kit-connect SPK for Synology SRM (ipq806x)
# Compatible: RT2600ac, RT6600ax, all ipq806x SRM routers.
# Output: kit-connect-0.1-0001.spk
#
# SPK structure (outer tar, UNCOMPRESSED):
# INFO
# PACKAGE_ICON.PNG (72x72)
# PACKAGE_ICON_256.PNG (256x256)
# scripts/
# postinst, start-stop-status, preinst, preuninst, postuninst
# conf/
# privilege, resource
# package.tgz (gzipped inner tar: bin/ + conf/connect.conf + wizard.sh + www/)
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
PKG_NAME="kit-connect"
VERSION="0.1-0001"
OUTPUT="${PKG_NAME}-${VERSION}.spk"
BUILD_DIR="/tmp/kit-connect-build-$$"
echo "=== Building ${PKG_NAME}-${VERSION}.spk ==="
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
# ── 1. Create inner package.tgz ─────────────────────────────────
echo " → Creating package.tgz"
tar -czf "$BUILD_DIR/package.tgz" \
--format=ustar \
bin/ \
conf/connect.conf \
wizard.sh \
www/
echo " → package.tgz contents:"
tar tzf "$BUILD_DIR/package.tgz"
# ── 2. Stage and assemble outer SPK (NO checksum — deprecated) ──
STAGE="$BUILD_DIR/stage"
mkdir -p "$STAGE"
cp INFO PACKAGE_ICON.PNG PACKAGE_ICON_256.PNG "$STAGE/"
cp -r scripts "$STAGE/"
mkdir -p "$STAGE/conf"
cp conf/privilege conf/resource "$STAGE/conf/"
cp "$BUILD_DIR/package.tgz" "$STAGE/"
echo " → Assembling SPK"
tar -cf "${OUTPUT}" -C "$STAGE" --format=ustar \
INFO PACKAGE_ICON.PNG PACKAGE_ICON_256.PNG scripts conf package.tgz
echo " → Verifying SPK contents"
tar -tf "${OUTPUT}" | sort
SIZE=$(stat -f%z "${OUTPUT}" 2>/dev/null || stat -c%s "${OUTPUT}" 2>/dev/null)
echo ""
echo "=== Build complete: ${OUTPUT} ==="
echo " Size: ${SIZE} bytes"
echo " MD5: $(md5sum "${OUTPUT}" | awk '{print $1}')"
rm -rf "$BUILD_DIR"