Files
mirror-3x-ui/internal
Sanaei eccf2e71bd fix(wireguard): change one peer without disturbing the others
A client's devices all carry the client's email, and the core removes a
WireGuard user by email, one peer at a time. The hot diff therefore removed
every peer of the email and added the survivors back, and a client that left
for good counted as a user whose sessions had to be dropped.

Measured on a running panel (Xray 26.11.9, kernel WireGuard clients):
- disabling or deleting one device cut the client's other devices for about
  15 s, the time a client waits before it handshakes again with a peer the
  server forgot;
- disabling or deleting a connected WireGuard client restarted the whole core
  with the default restartXrayOnClientDisable, taking every inbound down.

The diff is now per public key: a peer that stays is never touched, a changed
peer is updated in place, and a removed one goes through RemoveWireguardPeer,
which relabels that single peer and removes the label. A WireGuard session
ends with its peer, so its removal no longer asks for the restart.

After the change the other devices and other clients of the inbound keep
their tunnels with no gap, and the core keeps its pid.
2026-11-24 23:52:09 +03:30
..
2026-10-25 20:08:14 +01:00