clusev/docker
boban 7794e98997 fix(wg): write-bridge handler no longer dies before replying (v0.9.41)
The host handler `clusev-wg.sh serve-request` aborted under `set -euo pipefail`
BEFORE writing run/wg-result-<id>.json, so the dashboard waited ~30s and showed
"Keine Antwort vom Host" even though the systemd watcher was running correctly.
The write-bridge had therefore never actually worked on a real deployment.

Two root causes, both fixed:

1. Field extraction: each `id/action/name/endpoint/port/subnet` value is pulled
   with `grep -oE | head | sed`. A field that is empty or absent (an "auto"
   endpoint at setup; gate/add-peer/remove-peer payloads that carry no
   endpoint/port/subnet) makes grep fail → with pipefail the whole pipeline
   fails → `set -e` aborts the handler before _write_result. Appended `|| true`
   to every extraction so a non-match yields "" instead of killing the handler.

2. Action dispatch: gate-up/gate-down/gate-ssh-on/off and set-endpoint/port/
   subnet (and remove-peer) called helpers that run require_setup, which `die`s
   (exit) when the tunnel isn't configured yet — aborting serve-request before
   the reply. Each handler now runs in a subshell `( ... )` so an internal exit
   becomes a caught non-zero and still yields a clean failure result.
   (add-peer/setup were already isolated via their $(...) command substitution.)

Verified end-to-end: all ten actions now write a result for minimal/empty-field
payloads instead of timing out. New smoke test docker/wg/serve-request.test.sh
(root-bypassed, no WireGuard needed) guards both regressions. shellcheck clean,
348 PHP tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 21:53:25 +02:00
..
caddy fix(tls): reverb WebSocket + honest TLS status behind an external proxy 2026-06-19 20:49:25 +02:00
clusev feat(wg): wire 'clusev wg' into the host CLI wrapper 2026-06-20 22:42:16 +02:00
motd feat: short clusev commands in versions panel, lang strings, MOTD 2026-06-19 23:18:25 +02:00
nginx feat(branding): favicons + PWA manifest, and custom branded error pages 2026-06-14 15:27:49 +02:00
php feat: scaffold — Dockerized Laravel 13 + Livewire 3 + Tailwind 4 + Reverb 2026-06-12 00:31:50 +02:00
restart-sentinel feat(versions): one-click 'update now' from the dashboard 2026-06-19 18:13:34 +02:00
supervisor feat(ssh): wire real fleet data over SSH (FleetService + live poller) 2026-06-12 21:34:13 +02:00
wg fix(wg): write-bridge handler no longer dies before replying (v0.9.41) 2026-06-21 21:53:25 +02:00
entrypoint.sh feat(domain): change the panel domain from the dashboard (v0.4.0) 2026-06-14 01:38:16 +02:00