diff --git a/README.md b/README.md index 3df348d..8c41677 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ WireGuard **client** tooling for an unprivileged Alpine LXC on Proxmox. Connects - an OpenRC **watchdog** that detects stale handshakes / ping loss and re-dials fast - a continuous **monitor** that emits structured logs for post-mortem analysis - an **MTU probe** that finds the real path MTU via DF-ping binary search +- an optional **web UI** (busybox httpd + CGI, dark theme) for status, config editing, and log viewing — switch off anytime to save resources The server side is intentionally out of scope — point the LXC at any existing WireGuard endpoint. @@ -46,24 +47,29 @@ vi /etc/wirecon/wirecon.conf # PEER_IP + watchdog thresholds (optional) rc-update add wg-quick.wg0 default && rc-service wg-quick.wg0 start rc-update add wirecon-watchdog default && rc-service wirecon-watchdog start rc-update add wirecon-monitor default && rc-service wirecon-monitor start +rc-update add wirecon-web default && rc-service wirecon-web start # optional tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log ``` +Then open **`http://:8080/`** in a browser. + ## Layout ``` lxc/ install.sh idempotent apk + OpenRC installer (runs inside the LXC) bootstrap.sh clones repo into /opt/wirecon then calls install.sh - etc/init.d/ OpenRC services: wirecon-watchdog, wirecon-monitor - etc/wirecon/wirecon.conf tunable thresholds (peer IP, handshake age, MTU bounds…) + etc/init.d/ OpenRC services: wirecon-watchdog, wirecon-monitor, wirecon-web + etc/wirecon/wirecon.conf tunable thresholds (peer IP, handshake age, MTU bounds, WEB_PORT…) + etc/wirecon/httpd.conf busybox httpd config (HTTP Basic Auth template) etc/wireguard/wg0.conf.example usr/local/bin/ wirecon-watchdog.sh one tick: handshake age + in-tunnel ping → reconnect if needed wirecon-watchdog-loop.sh supervise-daemon target that re-runs the tick every WATCHDOG_INTERVAL wirecon-monitor.sh long-running structured-log emitter wirecon-mtu-probe.sh DF-ping binary search → recommended WG MTU + var/www/wirecon/ web UI assets + CGI scripts (status / config / logs) proxmox/ create-lxc.sh host-side LXC provisioner (the one-liner above) @@ -97,3 +103,27 @@ tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log grep event=reconnect /var/log/wirecon-watchdog.log awk -F'rtt_ms=' '/rtt_ms=/{split($2,a," "); print $0}' /var/log/wirecon-monitor.log ``` + +## Web UI + +Optional. Serves at `http://:8080/` — dark theme, three tabs: + +- **Status** — running/stopped state for each service, live wg0 endpoint + handshake age + rx/tx (auto-refresh every 5s). +- **Config** — edit `/etc/wireguard/wg0.conf` and `/etc/wirecon/wirecon.conf` in-browser; saving triggers a restart of the affected services and returns their stdout. +- **Logs** — tail of `wirecon-watchdog.log` and `wirecon-monitor.log`. + +Runs on **busybox httpd** (~2 MiB RSS) with shell CGI — no Python/Go runtime needed. Disable anytime: + +``` +rc-service wirecon-web stop +rc-update del wirecon-web +``` + +**Security:** the UI edits `wg0.conf` (contains private keys) and restarts services, so expose it on the LAN only. Enable HTTP Basic Auth by adding a line to `/etc/wirecon/httpd.conf`: + +``` +# generate hash: openssl passwd -1 'your-password' +/:admin:$1$salt$hash +``` + +Change `WEB_PORT` / `WEB_BIND` in `/etc/wirecon/wirecon.conf` and restart `wirecon-web` to move it. diff --git a/lxc/etc/init.d/wirecon-web b/lxc/etc/init.d/wirecon-web new file mode 100755 index 0000000..613f8fa --- /dev/null +++ b/lxc/etc/init.d/wirecon-web @@ -0,0 +1,26 @@ +#!/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 +} diff --git a/lxc/etc/wirecon/httpd.conf b/lxc/etc/wirecon/httpd.conf new file mode 100644 index 0000000..202d321 --- /dev/null +++ b/lxc/etc/wirecon/httpd.conf @@ -0,0 +1,12 @@ +# busybox httpd config for wirecon web UI. +# +# HTTP Basic Auth (recommended — the UI can edit wg0.conf): +# /:admin:$1$salt$hash +# Generate the hash with: openssl passwd -1 'your-password' +# Uncomment the line below and paste your hash. Restart: rc-service wirecon-web restart +# +# /:admin:REPLACE_WITH_HASH + +# Treat scripts under /cgi-bin/ as CGI (busybox httpd does this by default, +# but being explicit doesn't hurt). +*.sh:/bin/sh diff --git a/lxc/etc/wirecon/wirecon.conf b/lxc/etc/wirecon/wirecon.conf index 72a6e19..e17d5ab 100644 --- a/lxc/etc/wirecon/wirecon.conf +++ b/lxc/etc/wirecon/wirecon.conf @@ -30,8 +30,13 @@ MONITOR_INTERVAL=10 # Watchdog cadence (seconds between tick invocations by the loop wrapper) WATCHDOG_INTERVAL=20 -# Log tag (shows up as SYSLOG_IDENTIFIER in journald) +# Log tag (used by scripts when emitting structured lines) LOG_TAG=wirecon # Runtime state dir STATE_DIR=/run/wirecon + +# Web UI (busybox httpd). Disable to save resources: +# rc-service wirecon-web stop && rc-update del wirecon-web +WEB_PORT=8080 +WEB_BIND=0.0.0.0 diff --git a/lxc/install.sh b/lxc/install.sh index 42acbfe..fd6e7b4 100755 --- a/lxc/install.sh +++ b/lxc/install.sh @@ -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://: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://:${WEB_PORT:-8080}/ | logs: tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log" fi diff --git a/lxc/var/www/wirecon/app.js b/lxc/var/www/wirecon/app.js new file mode 100644 index 0000000..f2d2237 --- /dev/null +++ b/lxc/var/www/wirecon/app.js @@ -0,0 +1,117 @@ +// wirecon web UI — vanilla JS. Talks to CGI scripts in /cgi-bin/ that +// return plain text (key=value for status, raw text for config/logs). + +const $ = s => document.querySelector(s); +const $$ = s => document.querySelectorAll(s); + +// --- tabs ------------------------------------------------------------------ +$$('nav button').forEach(btn => btn.addEventListener('click', () => { + $$('nav button').forEach(b => b.classList.toggle('active', b === btn)); + const tab = btn.dataset.tab; + $$('.tab').forEach(s => s.classList.toggle('active', s.id === `tab-${tab}`)); + if (tab === 'config') loadConfigs(); + if (tab === 'logs') loadLogs(); +})); + +// --- helpers --------------------------------------------------------------- +const parseKV = txt => Object.fromEntries( + txt.trim().split('\n').filter(Boolean).map(l => { + const i = l.indexOf('='); + return [l.slice(0, i), l.slice(i + 1)]; + }) +); + +const setOverall = ok => { + const el = $('#overall'); + el.textContent = ok ? 'all systems ok' : 'attention'; + el.className = 'pill ' + (ok ? 'ok' : 'err'); +}; + +// --- status ---------------------------------------------------------------- +async function refreshStatus() { + try { + const r = await fetch('cgi-bin/status.sh', { cache: 'no-store' }); + const kv = parseKV(await r.text()); + + const services = ['wg-quick.wg0', 'wirecon-watchdog', 'wirecon-monitor', 'wirecon-web']; + const tbody = $('#svc-table tbody'); + tbody.innerHTML = ''; + let allOk = true; + for (const s of services) { + const state = kv[`svc.${s}`] || 'unknown'; + if (state !== 'running') allOk = false; + tbody.insertAdjacentHTML('beforeend', + `${s}${state}`); + } + + const age = kv['wg0.handshake_age_s']; + const stale = age && parseInt(age, 10) > 180; + if (stale) allOk = false; + + const dl = $('#wg-info'); + dl.innerHTML = ''; + const fields = [ + ['interface', kv['wg0.iface'] || '—'], + ['endpoint', kv['wg0.endpoint'] || '—'], + ['MTU', kv['wg0.mtu'] || '—'], + ['last handshake', age === undefined ? '—' : age === '-1' ? 'never' : `${age}s ago`], + ['rx / tx', `${kv['wg0.rx_bytes'] || '—'} / ${kv['wg0.tx_bytes'] || '—'}`], + ]; + for (const [k, v] of fields) { + dl.insertAdjacentHTML('beforeend', `
${k}
${v}
`); + } + + $('#status-updated').textContent = `updated ${new Date().toLocaleTimeString()}`; + setOverall(allOk); + } catch (e) { + setOverall(false); + $('#status-updated').textContent = `error: ${e.message}`; + } +} + +// --- config ---------------------------------------------------------------- +async function loadConfig(which) { + const r = await fetch(`cgi-bin/config-get.sh?file=${which}`, { cache: 'no-store' }); + if (!r.ok) { $(`#cfg-${which}`).value = `[failed to load: HTTP ${r.status}]`; return; } + $(`#cfg-${which}`).value = await r.text(); +} + +async function loadConfigs() { await Promise.all([loadConfig('wg0'), loadConfig('wirecon')]); } + +$$('button[data-save]').forEach(btn => btn.addEventListener('click', async () => { + const which = btn.dataset.save; + const res = $(`#res-${which}`); + res.className = 'result'; + res.textContent = 'saving…'; + try { + const body = $(`#cfg-${which}`).value; + const r = await fetch(`cgi-bin/config-save.sh?file=${which}`, { + method: 'POST', + headers: { 'Content-Type': 'text/plain' }, + body, + }); + const txt = await r.text(); + res.textContent = txt; + res.className = 'result ' + (r.ok ? 'ok' : 'err'); + if (r.ok) refreshStatus(); + } catch (e) { + res.className = 'result err'; + res.textContent = `error: ${e.message}`; + } +})); + +// --- logs ------------------------------------------------------------------ +async function loadLog(which) { + const r = await fetch(`cgi-bin/logs.sh?service=${which}&lines=200`, { cache: 'no-store' }); + $(`#log-${which}`).textContent = await r.text(); + // scroll to bottom + const el = $(`#log-${which}`); + el.scrollTop = el.scrollHeight; +} +async function loadLogs() { await Promise.all([loadLog('watchdog'), loadLog('monitor')]); } + +$$('button[data-reload]').forEach(btn => btn.addEventListener('click', () => loadLog(btn.dataset.reload))); + +// --- boot ------------------------------------------------------------------ +refreshStatus(); +setInterval(refreshStatus, 5000); diff --git a/lxc/var/www/wirecon/cgi-bin/config-get.sh b/lxc/var/www/wirecon/cgi-bin/config-get.sh new file mode 100755 index 0000000..6239085 --- /dev/null +++ b/lxc/var/www/wirecon/cgi-bin/config-get.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# CGI: return a config file's contents as text/plain. +# file=wg0 → /etc/wireguard/wg0.conf +# file=wirecon → /etc/wirecon/wirecon.conf +set -u + +file="" +case "${QUERY_STRING:-}" in + *file=wg0*) file=/etc/wireguard/wg0.conf ;; + *file=wirecon*) file=/etc/wirecon/wirecon.conf ;; +esac + +if [[ -z "$file" ]]; then + printf 'Status: 400 Bad Request\r\nContent-Type: text/plain\r\n\r\n' + echo "bad file parameter" + exit 0 +fi + +if [[ ! -r "$file" ]]; then + printf 'Status: 404 Not Found\r\nContent-Type: text/plain\r\n\r\n' + echo "not readable: $file" + exit 0 +fi + +printf 'Content-Type: text/plain\r\n\r\n' +cat "$file" diff --git a/lxc/var/www/wirecon/cgi-bin/config-save.sh b/lxc/var/www/wirecon/cgi-bin/config-save.sh new file mode 100755 index 0000000..6f2154c --- /dev/null +++ b/lxc/var/www/wirecon/cgi-bin/config-save.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# CGI: accept POST body as the new contents of a config file, write it +# atomically, then restart the services that depend on it. +# Query: file=wg0|wirecon +# Body: raw text +set -u + +file=""; label=""; restart=() +case "${QUERY_STRING:-}" in + *file=wg0*) + file=/etc/wireguard/wg0.conf + label="wg0.conf" + restart=(wg-quick.wg0 wirecon-watchdog wirecon-monitor) + mode=0600 + ;; + *file=wirecon*) + file=/etc/wirecon/wirecon.conf + label="wirecon.conf" + restart=(wirecon-watchdog wirecon-monitor) + mode=0644 + ;; + *) + printf 'Status: 400 Bad Request\r\nContent-Type: text/plain\r\n\r\n' + echo "bad file parameter"; exit 0 + ;; +esac + +if [[ "${REQUEST_METHOD:-}" != "POST" ]]; then + printf 'Status: 405 Method Not Allowed\r\nContent-Type: text/plain\r\n\r\n' + echo "POST required"; exit 0 +fi + +# Read body (CONTENT_LENGTH bytes; fallback to EOF). +len="${CONTENT_LENGTH:-0}" +tmp=$(mktemp "${file}.XXXXXX") +trap 'rm -f "$tmp"' EXIT + +if [[ "$len" -gt 0 ]]; then + head -c "$len" > "$tmp" +else + cat > "$tmp" +fi + +# Refuse empty writes — likely a bug, not intent. +if [[ ! -s "$tmp" ]]; then + printf 'Status: 400 Bad Request\r\nContent-Type: text/plain\r\n\r\n' + echo "refusing empty body"; exit 0 +fi + +chmod "$mode" "$tmp" +mv -f "$tmp" "$file" +trap - EXIT + +# Restart dependents, collect output for the UI. +printf 'Content-Type: text/plain\r\n\r\n' +echo "saved $file ($(wc -c < "$file") bytes)" + +for svc in "${restart[@]}"; do + echo "" + echo "--- restart $svc ---" + rc-service "$svc" restart 2>&1 || echo "(restart of $svc returned non-zero)" +done diff --git a/lxc/var/www/wirecon/cgi-bin/logs.sh b/lxc/var/www/wirecon/cgi-bin/logs.sh new file mode 100755 index 0000000..b5d5261 --- /dev/null +++ b/lxc/var/www/wirecon/cgi-bin/logs.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# CGI: return the tail of a log file as text/plain. +# Query: service=watchdog|monitor lines=N (capped to 1000) +set -u + +service=""; lines=100 +case "${QUERY_STRING:-}" in + *service=watchdog*) service=watchdog ;; + *service=monitor*) service=monitor ;; +esac + +# pull lines= from query string +if [[ "${QUERY_STRING:-}" =~ lines=([0-9]+) ]]; then + lines="${BASH_REMATCH[1]}" + (( lines > 1000 )) && lines=1000 +fi + +if [[ -z "$service" ]]; then + printf 'Status: 400 Bad Request\r\nContent-Type: text/plain\r\n\r\n' + echo "service must be watchdog or monitor"; exit 0 +fi + +file="/var/log/wirecon-${service}.log" +printf 'Content-Type: text/plain\r\n\r\n' +if [[ -r "$file" ]]; then + tail -n "$lines" "$file" +else + echo "(no log yet at $file)" +fi diff --git a/lxc/var/www/wirecon/cgi-bin/status.sh b/lxc/var/www/wirecon/cgi-bin/status.sh new file mode 100755 index 0000000..0931e02 --- /dev/null +++ b/lxc/var/www/wirecon/cgi-bin/status.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# CGI: emit service + tunnel state as key=value lines. +set -u + +printf 'Content-Type: text/plain\r\n\r\n' + +for svc in wg-quick.wg0 wirecon-watchdog wirecon-monitor wirecon-web; do + if rc-service "$svc" status >/dev/null 2>&1; then + state=running + else + state=stopped + fi + printf 'svc.%s=%s\n' "$svc" "$state" +done + +IFACE="${WG_INTERFACE:-wg0}" + +if ip link show "$IFACE" >/dev/null 2>&1; then + printf 'wg0.iface=up\n' + mtu=$(ip -o link show "$IFACE" | awk '{for(i=1;i<=NF;i++) if($i=="mtu"){print $(i+1); exit}}') + printf 'wg0.mtu=%s\n' "${mtu:-?}" + + # peer dump: pub psk endpoint allowed_ips last_handshake rx tx keepalive + dump=$(wg show "$IFACE" dump 2>/dev/null | awk 'NR==2') + if [[ -n "$dump" ]]; then + endpoint=$(awk '{print $3}' <<<"$dump") + hs_ts=$(awk '{print $5}' <<<"$dump") + rx=$(awk '{print $6}' <<<"$dump") + tx=$(awk '{print $7}' <<<"$dump") + now=$(date +%s) + age=-1 + [[ "$hs_ts" != "0" && -n "$hs_ts" ]] && age=$((now - hs_ts)) + printf 'wg0.endpoint=%s\n' "${endpoint:-none}" + printf 'wg0.handshake_age_s=%s\n' "$age" + printf 'wg0.rx_bytes=%s\n' "${rx:-0}" + printf 'wg0.tx_bytes=%s\n' "${tx:-0}" + fi +else + printf 'wg0.iface=down\n' +fi diff --git a/lxc/var/www/wirecon/index.html b/lxc/var/www/wirecon/index.html new file mode 100644 index 0000000..3ac4a15 --- /dev/null +++ b/lxc/var/www/wirecon/index.html @@ -0,0 +1,75 @@ + + + + + + wirecon + + + +
+

wirecon

+
checking…
+
+ + + +
+ +
+
+

services

+ +
+ + + +
namestate
+ +

tunnel

+
+
+ + +
+
+
+

/etc/wireguard/wg0.conf

+ +
+ +

+      
+ +
+
+

/etc/wirecon/wirecon.conf

+ +
+ +

+      
+
+ + +
+
+

watchdog

+ +
+

+      
+

monitor

+ +
+

+    
+
+ + + + diff --git a/lxc/var/www/wirecon/style.css b/lxc/var/www/wirecon/style.css new file mode 100644 index 0000000..c43a802 --- /dev/null +++ b/lxc/var/www/wirecon/style.css @@ -0,0 +1,101 @@ +:root { + --bg: #0e0e11; + --panel: #17171c; + --panel-2: #1f1f27; + --border: #2a2a33; + --text: #e7e7ea; + --muted: #8b8b95; + --accent: #2dd4bf; + --ok: #4ade80; + --warn: #fbbf24; + --err: #f87171; + --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace; + --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif; +} + +* { box-sizing: border-box; } +html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.45; } +h1, h2 { margin: 0; font-weight: 600; } +h1 { font-size: 18px; letter-spacing: 0.02em; } +h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); } + +header { + display: flex; align-items: center; justify-content: space-between; + padding: 14px 22px; + border-bottom: 1px solid var(--border); + background: var(--panel); +} + +nav { + display: flex; gap: 4px; + padding: 10px 18px; + border-bottom: 1px solid var(--border); + background: var(--panel); +} +nav button { + appearance: none; border: 0; background: transparent; + color: var(--muted); font-family: var(--sans); font-size: 13px; + padding: 6px 14px; border-radius: 6px; cursor: pointer; +} +nav button:hover { color: var(--text); background: var(--panel-2); } +nav button.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); } + +main { padding: 22px; max-width: 960px; margin: 0 auto; } +.tab { display: none; } +.tab.active { display: block; } + +.row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; } +.row h2 { margin: 0; } + +.pill { + padding: 3px 10px; border-radius: 999px; + font-family: var(--mono); font-size: 12px; + background: var(--panel-2); color: var(--muted); + border: 1px solid var(--border); +} +.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); } +.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); } +.pill.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--border)); } + +table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; } +th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; } +th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; } +tr:last-child td { border-bottom: 0; } +td.state-running { color: var(--ok); } +td.state-stopped { color: var(--err); } +td.state-unknown { color: var(--muted); } + +.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; + margin: 0; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; + font-family: var(--mono); font-size: 13px; } +.kv dt { color: var(--muted); } +.kv dd { margin: 0; } + +textarea { + width: 100%; display: block; + background: #0a0a0d; color: var(--text); border: 1px solid var(--border); border-radius: 8px; + font-family: var(--mono); font-size: 12.5px; line-height: 1.55; + padding: 12px; resize: vertical; tab-size: 2; +} +textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); } + +button[data-save], button[data-reload] { + appearance: none; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); + padding: 6px 12px; border-radius: 6px; cursor: pointer; font-family: var(--sans); font-size: 12px; +} +button[data-save]:hover, button[data-reload]:hover { border-color: var(--accent); color: var(--accent); } + +.config-block + .config-block { margin-top: 28px; } + +.result { margin-top: 10px; min-height: 0; padding: 0; background: transparent; border: 0; + font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: pre-wrap; } +.result.ok { color: var(--ok); } +.result.err { color: var(--err); } + +.log { + background: #0a0a0d; border: 1px solid var(--border); border-radius: 8px; + padding: 12px; max-height: 360px; overflow: auto; + font-family: var(--mono); font-size: 12px; white-space: pre-wrap; +} + +.muted { color: var(--muted); font-size: 12px; font-family: var(--mono); }