Upstream builds a single static binary (main.go at repo root, no
cmd/... subpackage) that go:embeds templates/ and assets/ at compile
time, and uses a relative ./db directory (jsondb) instead of SQLite -
so WorkingDirectory in the systemd unit now matters for the DB path,
not for template/static serving like before.
Frontend assets (admin-lte, jquery plugins) need yarn + prepare_assets.sh
before go build, so all installers now also install nodejs/npm/yarn and
run prepare_assets.sh when assets/dist is missing or package.json changed.
Binary is now literally named "wireguard-ui" (matches upstream), listens
on 0.0.0.0:5000 by default. systemd unit rewritten accordingly with
WorkingDirectory=/var/lib/wireguard-ui-multi.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The web UI 404'd in production because templates/static were loaded
via relative paths ("internal/ui/templates", "internal/ui/static"),
which only resolved when running from the repo checkout. systemd sets
WorkingDirectory=/var/lib/wireguard-ui-multi, so those paths never
existed there.
Add a -ui-root flag (default /usr/local/share/wireguard-ui-multi/ui),
have install.sh copy internal/ui there, and resolve templates/static
paths through it instead of hardcoded relative strings.
Also add release-binary fast path to bootstrap.sh (falls back to
source build with CGO_ENABLED=0/-trimpath if no release exists yet),
and document real hardware/build-RAM requirements in the README.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
update.sh pulls the latest main, rebuilds, reinstalls, and restarts
the service in one step. install.sh/bootstrap.sh now also drop
/etc/profile.d/go-path.sh so Go stays on PATH in future shells, not
just within the running install script.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
go.sum was never committed (no local Go toolchain to generate it),
causing "missing go.sum entry" build failures on target hosts.
go mod tidy regenerates it automatically before go build.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
/usr/local/bin wasn't guaranteed to be on PATH in non-interactive
shells, so the symlinked go binary was invisible to later steps.
Export PATH explicitly and fail fast if go is still missing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>