Rename maglev-frontend → maglevd-frontend; v0.9.1; API RX/TX pulse

Rename the web dashboard binary to maglevd-frontend and move it to
/usr/sbin (it's a daemon and belongs with maglevd). The systemd unit
name stays vpp-maglev-frontend.service since that prefix is the
package name. Manpage, README, user-guide, and debian packaging all
updated in lockstep; bump to 0.9.1 for the first real release.

All frontend env vars are now prefixed MAGLEV_FRONTEND_ so a single
/etc/default/vpp-maglev can be shared with maglevd without collisions.
Every flag has an env equivalent for Docker use. MAGLEV_FRONTEND_USER
and MAGLEV_FRONTEND_PASSWORD still gate the /admin surface.

VPPInfoPanel now pulses "API: ↑↓" indicators in the zippy title
whenever a vpp-api-send / vpp-api-recv log event arrives on the SSE
stream for the scoped maglevd — 250ms blue flash, re-triggerable,
with the two arrows tightly kerned via negative letter-spacing.
This commit is contained in:
2026-04-13 00:13:47 +02:00
parent 1191b3d994
commit 35643fd774
20 changed files with 380 additions and 83 deletions

18
debian/build-deb.sh vendored
View File

@@ -4,7 +4,7 @@
#
# The commit hash is baked into the binaries at link time via -ldflags
# in the Makefile, so `maglevd --version` / `maglevc --version` /
# `maglev-frontend --version` are the source of truth for "which
# `maglevd-frontend --version` are the source of truth for "which
# build". The .deb itself carries only the release version.
set -euo pipefail
@@ -28,15 +28,17 @@ install -d "$STAGING/etc/default"
install -d "$STAGING/etc/vpp-maglev"
install -d "$STAGING/DEBIAN"
# Binaries
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevd" "$STAGING/usr/sbin/maglevd"
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevc" "$STAGING/usr/bin/maglevc"
install -m 755 "$REPO_ROOT/build/${ARCH}/maglev-frontend" "$STAGING/usr/bin/maglev-frontend"
# Binaries. maglevd and maglevd-frontend are daemons and live under
# /usr/sbin; maglevc is the interactive CLI client and lives under
# /usr/bin so it's on every login shell's PATH.
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevd" "$STAGING/usr/sbin/maglevd"
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevc" "$STAGING/usr/bin/maglevc"
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevd-frontend" "$STAGING/usr/sbin/maglevd-frontend"
# Man pages
gzip -9 -c "$REPO_ROOT/docs/maglevd.8" > "$STAGING/usr/share/man/man8/maglevd.8.gz"
gzip -9 -c "$REPO_ROOT/docs/maglevc.1" > "$STAGING/usr/share/man/man1/maglevc.1.gz"
gzip -9 -c "$REPO_ROOT/docs/maglev-frontend.8" > "$STAGING/usr/share/man/man8/maglev-frontend.8.gz"
gzip -9 -c "$REPO_ROOT/docs/maglevd.8" > "$STAGING/usr/share/man/man8/maglevd.8.gz"
gzip -9 -c "$REPO_ROOT/docs/maglevc.1" > "$STAGING/usr/share/man/man1/maglevc.1.gz"
gzip -9 -c "$REPO_ROOT/docs/maglevd-frontend.8" > "$STAGING/usr/share/man/man8/maglevd-frontend.8.gz"
# Systemd units
install -m 644 "$REPO_ROOT/debian/vpp-maglev.service" "$STAGING/lib/systemd/system/vpp-maglev.service"

2
debian/control.in vendored
View File

@@ -13,7 +13,7 @@ Description: Maglev health-checker daemon, CLI client, and web frontend
maglevc is an interactive CLI client for maglevd with tab completion,
inline help, and one-shot mode for scripting.
.
maglev-frontend is an optional web dashboard that fans one or more
maglevd-frontend is an optional web dashboard that fans one or more
maglevd gRPC streams out to browsers over Server-Sent Events. It is
installed but not enabled by default; enable with:
systemctl enable --now vpp-maglev-frontend

View File

@@ -17,12 +17,21 @@ MAGLEV_CONFIG=/etc/vpp-maglev/maglev.yaml
# Log level: debug, info, warn, error (default: info)
#MAGLEV_LOG_LEVEL=info
# ---- maglev-frontend -------------------------------------------------------
# ---- maglevd-frontend ------------------------------------------------------
# The web dashboard is installed but not enabled by default. Enable with
# systemctl enable --now vpp-maglev-frontend
# after reviewing the arguments below.
# Command-line arguments passed to /usr/bin/maglev-frontend. At minimum
# Command-line arguments passed to /usr/sbin/maglevd-frontend. At minimum
# -server is required (comma-separated list of maglevd gRPC addresses).
# -listen controls the HTTP bind address. See maglev-frontend(8).
# -listen controls the HTTP bind address. See maglevd-frontend(8).
MAGLEV_FRONTEND_ARGS="-server localhost:9090 -listen=:8080"
# Basic-auth credentials for the /admin/ surface. When both are set to
# non-empty values, /admin/ is reachable and the SPA exposes backend
# lifecycle mutations (pause/resume/enable/disable/set-weight). When
# either is missing or empty, /admin/ returns 404 and the SPA hides
# the admin toggle entirely. Leave commented out for a read-only
# deployment.
#MAGLEV_FRONTEND_USER=admin
#MAGLEV_FRONTEND_PASSWORD=changeme

View File

@@ -1,6 +1,6 @@
[Unit]
Description=Maglev web frontend dashboard
Documentation=man:maglev-frontend(8)
Documentation=man:maglevd-frontend(8)
After=network-online.target
Wants=network-online.target
@@ -8,12 +8,13 @@ Wants=network-online.target
User=maglevd
Group=maglevd
EnvironmentFile=/etc/default/vpp-maglev
ExecStart=/usr/bin/maglev-frontend $MAGLEV_FRONTEND_ARGS
ExecStart=/usr/sbin/maglevd-frontend $MAGLEV_FRONTEND_ARGS
Restart=on-failure
RestartSec=5s
Type=simple
# Read-only presentation layer — needs no capabilities.
# Presentation layer — needs no capabilities. /admin/ mutations go
# through the gRPC client to maglevd, which does the privileged work.
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes