Saving a client or rule restarted the whole host tunnel (wg-quick down/up)
and re-ran the firewall manager setup, which was slow and briefly dropped
every client on the host.
Client and rule changes now sync peers with `wg syncconf` and re-run the
PostUp script, skipping the firewalld/ufw step. Host creation and edits
still do a full restart.
PostUp now loads the per-host chains with `iptables-restore --noflush`, so
re-running it on a live tunnel swaps the rules atomically instead of
leaving the chains empty between flush and re-add.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Saved rules and client form drafts can now be edited through the rule
modal. On the Rules tab, saving re-runs client setup so the firewall
matches, and both add and edit ask for confirmation.
Comma-separated destinations were rejected because drafts were validated
before being split; validate each one after splitting instead. When
editing, the first destination updates the rule and the rest are added
as new rules.
Pin the id in the client_rules PUT handler so a request body can't
change it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Caddy previously ran as a host binary in /opt/caddy with a wgui-caddy
systemd/OpenRC unit. Only Caddy is containerized; the app still runs on the
host as root because it shells out to wg, ip and iptables.
- Add caddy-container-commands.ts as the single source of truth for the
run/exec/validate/inspect argument arrays. Every value stays a separate
argv element, the image is pinned to caddy:2.11.4-alpine, and the
entrypoint is set explicitly because some mirrors publish the image with
a null Entrypoint (which made Docker exec "run" as a binary).
- Rewrite install-caddy.sh: require_docker with distro-specific hints,
pull + recreate the container, assert it is running and echo the daemon
error instead of discarding it, normalize the admin socket path in
existing Caddyfiles, and clean up a legacy native install only after the
container is up so the ingress port is never unbound. Add
--purge-legacy / --purge for hosts that want to drop the old install
without installing the container.
- Move the admin socket to /var/lib/wgui/caddy/admin.sock so it lives
inside the mounted Caddy dir and reloads work over docker exec.
- Validate candidate configs in a throwaway container, mounting the TLS
dir read-only as well: provisioning the tls app loads every certificate
referenced by a tls directive, so without that mount a route with a
certificate failed validation and its Caddyfile was never committed.
- Report docker-based installed/version/service_active, skip
validate/reload with a warning when the image is absent, and update the
system setup tool check to look for docker.
- Issue certificates with a docker exec reload command and chown files to
root:root, since the container reads them through a read-only mount.
- Update the Setup UI copy and docs (README, AGENTS.md).
Also drops the unused EmptyContent import and a stray debug log in the
client route form, and stops passing the unsupported cancel_href prop to
ClientRouteForm from the route add/edit pages.
- Drop unused email module and media text extraction path
- Remove 12 unused dependencies
- Remove unused imports in server.ts
- Add typecheck and test scripts
- Rewrite AGENTS.md to describe this project
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Non-super-admin PUT updated the client whose id equalled the user's id;
it now updates the requested client only if the user owns it. POST no
longer lets non-super-admins overwrite existing clients by id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Require admin auth on interface-local-ip, network-interfaces,
next-listen-port and public-ip (interface-local-ip and public-ip
allowed unauthenticated command injection as root)
- Validate interface names and call ip/curl via execFileSync
- Write host/client WireGuard configs with fs instead of shell
heredocs, validating IPs, AllowedIPs, endpoint and listen port
- Replace rm -rf/cat/mkdir/chmod/test shell calls with fs APIs
- Refuse private media requested through the public media route
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Import types from @moduletrace/bun-sqlite/types now that the package
has an exports map, and guard optional ctx.props in signup server fn.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- setup-main-host-button: live availability status, grab-next-subnet helper, error/success feedback
- setup-wireguard-host: harden generated shell scripts with set -e
- check-private-ip-address-availability: add user access check, drop manual body validation
- setup-main-host: pass host object with wg_ip_address
- install-wg-ui.sh: run service as the invoking user (root or sudo) instead of a dedicated wgui user, and skip systemd/OpenRC daemon setup when NODE_ENV=development