Files
wirecon/lxc/etc/init.d/wirecon-web
T
d4nn13 4e7e0f34ba 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`.
2026-04-19 18:55:36 +02:00

27 lines
745 B
Plaintext
Executable File

#!/sbin/openrc-run
# wirecon web UI — busybox httpd serving /var/www/wirecon with CGI.
# Disable to save resources:
# rc-service wirecon-web stop && rc-update del wirecon-web
name="wirecon-web"
description="wirecon web UI (busybox httpd)"
# Pull WEB_PORT from wirecon.conf if present.
: "${WIRECON_CONF:=/etc/wirecon/wirecon.conf}"
[ -r "$WIRECON_CONF" ] && . "$WIRECON_CONF"
: "${WEB_PORT:=8080}"
: "${WEB_BIND:=0.0.0.0}"
: "${WEB_ROOT:=/var/www/wirecon}"
supervisor="supervise-daemon"
command="/bin/busybox"
command_args="httpd -f -v -p ${WEB_BIND}:${WEB_PORT} -h ${WEB_ROOT} -c /etc/wirecon/httpd.conf"
respawn_delay=5
respawn_max=0
output_log="/var/log/wirecon-web.log"
error_log="/var/log/wirecon-web.log"
depend() {
need net
}