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
parent
f240401a42
commit
48ed5e7d34
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue