From b07fad0e697bdcf808edd31930efb42ff0eb99b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouzbeh=E2=80=A0?= <78313022+rqzbeh@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:23:02 +0200 Subject: [PATCH] refactor(wireguard): drop removed workers field (xray v26.6.22) (#5509) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * v3.4.0 * refactor(wireguard): drop removed `workers` field (xray v26.6.22) xray-core v26.6.22 (PR #6287) removed the WireGuard `workers` (num_workers) config field; the engine now relies on wireguard-go's internal worker fallback and no longer reads it. Remove it from the panel so it stops emitting a key xray ignores. Removed from the inbound/outbound/outbound-form WireGuard schemas, both WireGuard forms, the outbound form adapter (both directions) and defaults, the two affected tests, and the `workers` label in all 13 locales. Existing configs that still carry workers are simply dropped on parse — no migration needed since the field had no runtime effect. Co-Authored-By: Claude Opus 4.8 (1M context) * Update version --------- Co-authored-by: MHSanaei Co-authored-by: Claude Opus 4.8 (1M context) --- frontend/src/lib/xray/outbound-defaults.ts | 1 - frontend/src/lib/xray/outbound-form-adapter.ts | 2 -- frontend/src/pages/inbounds/form/protocols/wireguard.tsx | 3 --- frontend/src/pages/xray/outbounds/protocols/wireguard.tsx | 3 --- frontend/src/schemas/forms/outbound-form.ts | 1 - frontend/src/schemas/protocols/inbound/wireguard.ts | 1 - frontend/src/schemas/protocols/outbound/wireguard.ts | 1 - frontend/src/test/outbound-defaults.test.ts | 1 - frontend/src/test/outbound-form-adapter.test.ts | 1 - internal/web/translation/ar-EG.json | 1 - internal/web/translation/en-US.json | 1 - internal/web/translation/es-ES.json | 1 - internal/web/translation/fa-IR.json | 1 - internal/web/translation/id-ID.json | 1 - internal/web/translation/ja-JP.json | 1 - internal/web/translation/pt-BR.json | 1 - internal/web/translation/ru-RU.json | 1 - internal/web/translation/tr-TR.json | 1 - internal/web/translation/uk-UA.json | 1 - internal/web/translation/vi-VN.json | 1 - internal/web/translation/zh-CN.json | 1 - internal/web/translation/zh-TW.json | 1 - 22 files changed, 27 deletions(-) diff --git a/frontend/src/lib/xray/outbound-defaults.ts b/frontend/src/lib/xray/outbound-defaults.ts index 9b4a35b06..1bd010468 100644 --- a/frontend/src/lib/xray/outbound-defaults.ts +++ b/frontend/src/lib/xray/outbound-defaults.ts @@ -111,7 +111,6 @@ export function createDefaultWireguardOutboundSettings( mtu: 1420, secretKey, address: [], - workers: 2, peers: [{ publicKey: '', allowedIPs: ['0.0.0.0/0', '::/0'], diff --git a/frontend/src/lib/xray/outbound-form-adapter.ts b/frontend/src/lib/xray/outbound-form-adapter.ts index ca501716e..e048d7300 100644 --- a/frontend/src/lib/xray/outbound-form-adapter.ts +++ b/frontend/src/lib/xray/outbound-form-adapter.ts @@ -205,7 +205,6 @@ function wireguardFromWire(raw: Raw): WireguardOutboundFormSettings { secretKey, pubKey, address: addressArr.join(','), - workers: asNumber(raw.workers, 2), domainStrategy: ((): WireguardOutboundFormSettings['domainStrategy'] => { const allowed = ['ForceIP', 'ForceIPv4', 'ForceIPv4v6', 'ForceIPv6', 'ForceIPv6v4']; const s = asString(raw.domainStrategy); @@ -495,7 +494,6 @@ function wireguardToWire(s: WireguardOutboundFormSettings) { mtu: s.mtu || undefined, secretKey: s.secretKey, address: s.address ? s.address.split(',').map((x) => x.trim()).filter(Boolean) : [], - workers: s.workers || undefined, domainStrategy: s.domainStrategy || undefined, reserved: s.reserved ? s.reserved.split(',').map((x) => Number(x.trim())).filter((n) => Number.isFinite(n)) diff --git a/frontend/src/pages/inbounds/form/protocols/wireguard.tsx b/frontend/src/pages/inbounds/form/protocols/wireguard.tsx index cdf4aa597..e14cef35c 100644 --- a/frontend/src/pages/inbounds/form/protocols/wireguard.tsx +++ b/frontend/src/pages/inbounds/form/protocols/wireguard.tsx @@ -62,9 +62,6 @@ export default function WireguardFields({ wgPubKey, regenInboundWg, regenWgPeerK > - - -