add optional web UI: busybox httpd + shell CGI, dark theme
- /etc/init.d/wirecon-web supervises `busybox httpd` on WEB_PORT (8080).
- /var/www/wirecon: single-page UI with Status / Config / Logs tabs.
- Status auto-refreshes every 5s: service states + wg0 endpoint,
handshake age, MTU, rx/tx.
- Config edits wg0.conf + wirecon.conf, saves atomically, restarts
dependents, surfaces their output.
- Logs tails /var/log/wirecon-{watchdog,monitor}.log.
- CGI returns plain text (key=value or raw) — no JSON-escape pain.
- HTTP Basic Auth template in /etc/wirecon/httpd.conf.
- Disable via `rc-service wirecon-web stop && rc-update del wirecon-web`.
This commit is contained in:
1 parent
2d07a590e2
commit
4e7e0f34ba
12 files changed
+543
-4
No files matched your search
+17
-1
@@ -59,8 +59,20 @@ install -m 0755 "$SRC/usr/local/bin/wirecon-mtu-probe.sh" /usr/local/bin/
|
||||
log "deploying OpenRC init scripts"
|
||||
install -m 0755 "$SRC/etc/init.d/wirecon-watchdog" /etc/init.d/
|
||||
install -m 0755 "$SRC/etc/init.d/wirecon-monitor" /etc/init.d/
|
||||
install -m 0755 "$SRC/etc/init.d/wirecon-web" /etc/init.d/
|
||||
install -m 0644 "$SRC/etc/conf.d/wg-quick" /etc/conf.d/wg-quick
|
||||
|
||||
log "deploying web UI"
|
||||
install -d -m 0755 /var/www/wirecon /var/www/wirecon/cgi-bin
|
||||
install -m 0644 "$SRC/var/www/wirecon/index.html" /var/www/wirecon/
|
||||
install -m 0644 "$SRC/var/www/wirecon/style.css" /var/www/wirecon/
|
||||
install -m 0644 "$SRC/var/www/wirecon/app.js" /var/www/wirecon/
|
||||
install -m 0755 "$SRC/var/www/wirecon/cgi-bin/status.sh" /var/www/wirecon/cgi-bin/
|
||||
install -m 0755 "$SRC/var/www/wirecon/cgi-bin/config-get.sh" /var/www/wirecon/cgi-bin/
|
||||
install -m 0755 "$SRC/var/www/wirecon/cgi-bin/config-save.sh" /var/www/wirecon/cgi-bin/
|
||||
install -m 0755 "$SRC/var/www/wirecon/cgi-bin/logs.sh" /var/www/wirecon/cgi-bin/
|
||||
install -m 0644 "$SRC/etc/wirecon/httpd.conf" /etc/wirecon/httpd.conf
|
||||
|
||||
# Per-interface wg-quick symlink so the init script knows which iface to bring up.
|
||||
if [[ ! -L /etc/init.d/wg-quick.wg0 ]]; then
|
||||
ln -s wg-quick /etc/init.d/wg-quick.wg0
|
||||
@@ -95,9 +107,11 @@ NEXT STEPS:
|
||||
rc-update add wg-quick.wg0 default
|
||||
rc-update add wirecon-watchdog default
|
||||
rc-update add wirecon-monitor default
|
||||
rc-update add wirecon-web default # optional, http://<lxc>:8080
|
||||
rc-service wg-quick.wg0 start
|
||||
rc-service wirecon-watchdog start
|
||||
rc-service wirecon-monitor start
|
||||
rc-service wirecon-web start
|
||||
4. Watch the logs:
|
||||
tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log
|
||||
EOF
|
||||
@@ -106,8 +120,10 @@ else
|
||||
rc-update add wg-quick.wg0 default 2>/dev/null || true
|
||||
rc-update add wirecon-watchdog default 2>/dev/null || true
|
||||
rc-update add wirecon-monitor default 2>/dev/null || true
|
||||
rc-update add wirecon-web default 2>/dev/null || true
|
||||
rc-service wg-quick.wg0 restart
|
||||
rc-service wirecon-watchdog restart
|
||||
rc-service wirecon-monitor restart
|
||||
log "done. tail logs: tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log"
|
||||
rc-service wirecon-web restart
|
||||
log "done. UI: http://<lxc-ip>:${WEB_PORT:-8080}/ | logs: tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log"
|
||||
fi
|
||||
Reference in new issue
Block a user