feat(wireguard): per-peer comments for identifying devices (#5168)

WG peers were only identifiable by their keys. Add an optional panel-side
comment per peer: editable in the inbound form (echoed next to "Peer N"
in the section header), stored in the settings JSON alongside the
panel-only privateKey (xray-core ignores unknown peer fields), and
appended to the share link / .conf remark so the device is identifiable
in client apps too.
This commit is contained in:
MHSanaei
2026-06-12 09:10:57 +02:00
parent d1a13844b2
commit d04cb10971
3 changed files with 24 additions and 4 deletions
@@ -26,6 +26,10 @@ export const WireguardInboundPeerSchema = z.object({
preSharedKey: z.string().optional(),
allowedIPs: z.array(z.string()).default([]),
keepAlive: optionalClearedInt(z.number().int().min(0)),
// Panel-only annotation (#5168): which client/device this peer belongs to.
// Rides along in the settings JSON like privateKey does; xray-core ignores
// unknown peer fields.
comment: z.string().optional(),
});
export type WireguardInboundPeer = z.infer<typeof WireguardInboundPeerSchema>;