Setup script fixes: - _cidr_to_mask: pad to 4 octets (/24 -> 255.255.255.0) - UCI quoting: remove embedded shell quotes from uci set calls - Bridge ports: auto-detect zt* interface instead of hardcoding ztabc0 - Bridge netmask: default to /23 (255.255.254.0) for ZT+WIBLAN - DHCP/WiFi AP: reference interface name (zt_wiblan) not device name (br_zt) - Firewall zone: add zt_wiblan to LAN zone for nftables fw4 - ZT IP persistence: ensure ZT-assigned IP stays on interface for ARP - Exit gateway routing: table 100/101 route via exit gateway, not self - New setup-wifi-ap subcommand for WIBLAN WiFi AP UBUS handler: - Add setup-wifi-ap to validation regex and error message Deploy task: - Auto-discover files from root/ and htdocs/ instead of hardcoded list - Clear LuCI cache before restarting services Documentation: - New docs/SETUP-GATEWAY.md with architecture, config, pitfalls, checklist - Updated docs/INSTALL.md with deploy task and setup wizard sections - Updated docs/PROGRESS.md with session log and learnings
3.0 KiB
3.0 KiB
Plan: Document installation guide + add deploy mise task
What
- Create
docs/INSTALL.md— installation guide for luci-app-zt-gateway covering all methods - Add
deploy:installtask tomise.toml— one-command SCP + install to a real OpenWrt device
1. docs/INSTALL.md
New file covering all 6 installation methods, researched from official OpenWrt docs:
| Method | When to use |
|---|---|
| LuCI web UI | End users, official feeds |
CLI (apk add / opkg install) |
Headless / SSH users |
| Custom feed | Distributing third-party packages via HTTP |
| Local file SCP | Dev/testing, quick iteration |
| OpenWrt SDK | Building proper .ipk/.apk with dependency metadata |
| Image Builder / ASU | Production firmware, survives factory reset |
Key details to document:
- OpenWrt 25.12+ uses
apk(notopkg); older usesopkg apk add --allow-untrustedrequired for unsigned local packagesopkg install /tmp/pkg.ipkfor opkg-based systems- SDK build:
make package/luci-app-zt-gateway/compile V=s - ASU:
luci-app-attendedsysupgrade→ Advanced Mode → add package - Prerequisites:
luci-base,ucode,rpcd-mod-ucode,luci-compat - Custom feed:
src/gzin/etc/opkg/customfeeds.confor apk equivalent
2. mise.toml — add deploy:install task
Following snowbud patterns: env var params, usage validation, step-by-step echo output.
Task design
[tasks."deploy:install"]
description = "SCP app files to an OpenWrt device and install"
Parameters (via env vars):
HOST— SSH target, defaultroot@192.168.15.1
What it does:
- Validate
sshconnectivity to$HOST - SCP each file from
root/to its corresponding remote path (stripping the leadingrootprefix) - SCP
htdocs/luci-static/resources/view/zt-gateway/overview.js→/www/luci-static/resources/view/zt-gateway/overview.js chmod +xthezt-gateway-switchscript on the remote- Restart
rpcdanduhttpdso LuCI picks up changes - Echo the URL to open
File mapping (local → remote)
| Local | Remote |
|---|---|
root/usr/sbin/zt-gateway-switch |
/usr/sbin/zt-gateway-switch |
root/usr/share/rpcd/ucode/zt-gateway.uc |
/usr/share/rpcd/ucode/zt-gateway.uc |
root/usr/share/rpcd/ucode/system.uc |
/usr/share/rpcd/ucode/system.uc |
root/usr/share/ucode/luci/runtime.uc |
/usr/share/ucode/luci/runtime.uc |
root/usr/share/luci/menu.d/luci-app-zt-gateway.json |
/usr/share/luci/menu.d/luci-app-zt-gateway.json |
root/usr/share/rpcd/acl.d/luci-app-zt-gateway.json |
/usr/share/rpcd/acl.d/luci-app-zt-gateway.json |
root/etc/config/zt-gateway |
/etc/config/zt-gateway |
htdocs/.../overview.js |
/www/.../overview.js |
Files to modify
| File | Action |
|---|---|
docs/INSTALL.md |
Create |
mise.toml |
Edit — append deploy:install task |
Verification
mise tasksshould list the newdeploy:installtaskdocs/INSTALL.mdshould be readable and cover all 6 methods