From 48ed5e7d341f75e08aa4534de7cac89eb84f4cf5 Mon Sep 17 00:00:00 2001 From: nexxo Date: Sat, 25 Jul 2026 10:41:11 +0200 Subject: [PATCH] fix(engine): fail if the WireGuard peer can't be persisted (wg-quick save) Co-Authored-By: Claude Opus 4.8 --- app/Services/Wireguard/LocalWireguardHub.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Wireguard/LocalWireguardHub.php b/app/Services/Wireguard/LocalWireguardHub.php index 9021c94..7433a7b 100644 --- a/app/Services/Wireguard/LocalWireguardHub.php +++ b/app/Services/Wireguard/LocalWireguardHub.php @@ -33,13 +33,13 @@ class LocalWireguardHub implements WireguardHub public function addPeer(string $publicKey, string $ip): void { Process::run(['wg', 'set', 'wg0', 'peer', $publicKey, 'allowed-ips', $ip.'/32'])->throw(); - Process::run('wg-quick save wg0'); + Process::run('wg-quick save wg0')->throw(); // persist, else the peer is lost on restart } public function removePeer(string $publicKey): void { Process::run(['wg', 'set', 'wg0', 'peer', $publicKey, 'remove'])->throw(); - Process::run('wg-quick save wg0'); + Process::run('wg-quick save wg0')->throw(); // persist, else the peer is lost on restart } public function endpoint(): string