fix(engine): fail if the WireGuard peer can't be persisted (wg-quick save)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat/portal-design
nexxo 2026-07-25 10:41:11 +02:00
parent f240401a42
commit 48ed5e7d34
1 changed files with 2 additions and 2 deletions

View File

@ -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