refactor(wireguard): drop removed workers field (xray v26.6.22) (#5509)

* 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) <noreply@anthropic.com>

* Update version

---------

Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rouzbeh†
2026-06-23 16:23:02 +02:00
committed by GitHub
parent fd092444a8
commit b07fad0e69
22 changed files with 0 additions and 27 deletions
@@ -111,7 +111,6 @@ export function createDefaultWireguardOutboundSettings(
mtu: 1420,
secretKey,
address: [],
workers: 2,
peers: [{
publicKey: '',
allowedIPs: ['0.0.0.0/0', '::/0'],
@@ -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))
@@ -62,9 +62,6 @@ export default function WireguardFields({ wgPubKey, regenInboundWg, regenWgPeerK
>
<Switch />
</Form.Item>
<Form.Item name={['settings', 'workers']} label='Workers'>
<InputNumber min={1} />
</Form.Item>
<Form.Item name={['settings', 'domainStrategy']} label={t('pages.xray.wireguard.domainStrategy')}>
<Select
allowClear
@@ -43,9 +43,6 @@ export default function WireguardFields({ form }: { form: FormInstance<OutboundF
<Form.Item label="MTU" name={['settings', 'mtu']}>
<InputNumber min={0} />
</Form.Item>
<Form.Item label={t('pages.xray.outboundForm.workers')} name={['settings', 'workers']}>
<InputNumber min={0} />
</Form.Item>
<Form.Item
label={t('pages.inbounds.info.noKernelTun')}
name={['settings', 'noKernelTun']}
@@ -103,7 +103,6 @@ export const WireguardOutboundFormSettingsSchema = z.object({
secretKey: z.string().default(''),
pubKey: z.string().default(''),
address: z.string().default(''),
workers: z.number().int().min(0).default(2),
domainStrategy: z.union([WireguardDomainStrategySchema, z.literal('')]).default(''),
reserved: z.string().default(''),
peers: z.array(WireguardOutboundFormPeerSchema).default([]),
@@ -38,7 +38,6 @@ export const WireguardInboundSettingsSchema = z.object({
secretKey: z.string().min(1),
peers: z.array(WireguardInboundPeerSchema).default([]),
noKernelTun: z.boolean().default(false),
workers: optionalClearedInt(z.number().int().min(1)),
domainStrategy: WireguardDomainStrategySchema.optional(),
});
export type WireguardInboundSettings = z.infer<typeof WireguardInboundSettingsSchema>;
@@ -22,7 +22,6 @@ export const WireguardOutboundSettingsSchema = z.object({
mtu: z.number().int().min(1).optional(),
secretKey: z.string().min(1),
address: z.array(z.string()).default([]),
workers: z.number().int().min(1).optional(),
domainStrategy: WireguardDomainStrategySchema.optional(),
reserved: z.array(z.number().int()).optional(),
peers: z.array(WireguardOutboundPeerSchema).min(1),
@@ -111,7 +111,6 @@ describe('outbound default factories: shape snapshots', () => {
const out = createDefaultWireguardOutboundSettings({ secretKey: SAMPLE_SECRET });
expect(out.secretKey).toBe(SAMPLE_SECRET);
expect(out.mtu).toBe(1420);
expect(out.workers).toBe(2);
expect(out.address).toEqual([]);
expect(out.noKernelTun).toBe(false);
expect(out.peers).toEqual([{
@@ -182,7 +182,6 @@ describe('outbound-form-adapter: round-trip', () => {
mtu: 1420,
secretKey: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
address: ['10.0.0.1', 'fd00::1'],
workers: 2,
peers: [{ publicKey: 'pk', allowedIPs: ['0.0.0.0/0'], endpoint: 'e:51820', preSharedKey: 'psk' }],
reserved: [1, 2, 3],
noKernelTun: false,