mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-28 00:24:19 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "تجاوز حظر IP الخاص الافتراضي في Xray",
|
||||
"blockDelay": "تأخير الحظر (ms)",
|
||||
"reverseSniffing": "Sniffing عكسي",
|
||||
"workers": "Workers",
|
||||
"reserved": "محجوز",
|
||||
"minUploadInterval": "أدنى فاصل رفع (ms)",
|
||||
"maxUploadSizeBytes": "حجم الرفع الأقصى (بايت)",
|
||||
|
||||
@@ -1597,7 +1597,6 @@
|
||||
"overrideXrayPrivateIp": "Override Xray's default private-IP block",
|
||||
"blockDelay": "Block delay (ms)",
|
||||
"reverseSniffing": "Reverse Sniffing",
|
||||
"workers": "Workers",
|
||||
"reserved": "Reserved",
|
||||
"minUploadInterval": "Min upload interval (ms)",
|
||||
"maxUploadSizeBytes": "Max upload size (bytes)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Sobrescribir el bloqueo de IP privada por defecto de Xray",
|
||||
"blockDelay": "Retraso de bloqueo (ms)",
|
||||
"reverseSniffing": "Sniffing inverso",
|
||||
"workers": "Workers",
|
||||
"reserved": "Reservado",
|
||||
"minUploadInterval": "Intervalo mín. de subida (ms)",
|
||||
"maxUploadSizeBytes": "Tamaño máx. de subida (bytes)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "override بلاک پیشفرض IP خصوصی Xray",
|
||||
"blockDelay": "تأخیر بلاک (ms)",
|
||||
"reverseSniffing": "Sniffing معکوس",
|
||||
"workers": "Workerها",
|
||||
"reserved": "رزرو شده",
|
||||
"minUploadInterval": "حداقل بازه آپلود (ms)",
|
||||
"maxUploadSizeBytes": "حداکثر اندازه آپلود (بایت)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Timpa blok IP privat default Xray",
|
||||
"blockDelay": "Penundaan blokir (ms)",
|
||||
"reverseSniffing": "Sniffing terbalik",
|
||||
"workers": "Workers",
|
||||
"reserved": "Dicadangkan",
|
||||
"minUploadInterval": "Min. interval upload (ms)",
|
||||
"maxUploadSizeBytes": "Ukuran upload maks. (byte)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Xray のデフォルトプライベート IP ブロックを上書き",
|
||||
"blockDelay": "ブロック遅延 (ms)",
|
||||
"reverseSniffing": "逆 sniffing",
|
||||
"workers": "Workers",
|
||||
"reserved": "予約",
|
||||
"minUploadInterval": "最小アップロード間隔 (ms)",
|
||||
"maxUploadSizeBytes": "最大アップロードサイズ (バイト)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Sobrescrever o bloqueio de IP privado padrão do Xray",
|
||||
"blockDelay": "Atraso do bloqueio (ms)",
|
||||
"reverseSniffing": "Sniffing reverso",
|
||||
"workers": "Workers",
|
||||
"reserved": "Reservado",
|
||||
"minUploadInterval": "Intervalo mín. de upload (ms)",
|
||||
"maxUploadSizeBytes": "Tamanho máx. de upload (bytes)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Переопределить дефолтный блок частных IP в Xray",
|
||||
"blockDelay": "Задержка блока (мс)",
|
||||
"reverseSniffing": "Обратный sniffing",
|
||||
"workers": "Воркеры",
|
||||
"reserved": "Зарезервировано",
|
||||
"minUploadInterval": "Мин. интервал загрузки (мс)",
|
||||
"maxUploadSizeBytes": "Макс. размер загрузки (байт)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Xray'in varsayılan özel IP bloğunu geçersiz kıl",
|
||||
"blockDelay": "Engelleme Gecikmesi (ms)",
|
||||
"reverseSniffing": "Ters Sniffing",
|
||||
"workers": "Workers",
|
||||
"reserved": "Ayrılmış",
|
||||
"minUploadInterval": "Min. Yükleme Aralığı (ms)",
|
||||
"maxUploadSizeBytes": "Maks. Yükleme Boyutu (bayt)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Перевизначити дефолтний блок приватних IP у Xray",
|
||||
"blockDelay": "Затримка блоку (мс)",
|
||||
"reverseSniffing": "Зворотний sniffing",
|
||||
"workers": "Воркери",
|
||||
"reserved": "Зарезервовано",
|
||||
"minUploadInterval": "Мін. інтервал завантаження (мс)",
|
||||
"maxUploadSizeBytes": "Макс. розмір завантаження (байт)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "Ghi đè chặn IP riêng mặc định của Xray",
|
||||
"blockDelay": "Trễ chặn (ms)",
|
||||
"reverseSniffing": "Sniffing ngược",
|
||||
"workers": "Workers",
|
||||
"reserved": "Đã đặt trước",
|
||||
"minUploadInterval": "Khoảng upload tối thiểu (ms)",
|
||||
"maxUploadSizeBytes": "Kích thước upload tối đa (byte)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "覆盖 Xray 默认的私有 IP 阻止",
|
||||
"blockDelay": "阻塞延迟 (ms)",
|
||||
"reverseSniffing": "反向 sniffing",
|
||||
"workers": "Workers",
|
||||
"reserved": "保留",
|
||||
"minUploadInterval": "最小上传间隔 (ms)",
|
||||
"maxUploadSizeBytes": "最大上传大小 (字节)",
|
||||
|
||||
@@ -1489,7 +1489,6 @@
|
||||
"overrideXrayPrivateIp": "覆寫 Xray 預設的私有 IP 封鎖",
|
||||
"blockDelay": "阻斷延遲 (ms)",
|
||||
"reverseSniffing": "反向 sniffing",
|
||||
"workers": "Workers",
|
||||
"reserved": "保留",
|
||||
"minUploadInterval": "最小上傳間隔 (ms)",
|
||||
"maxUploadSizeBytes": "最大上傳大小 (位元組)",
|
||||
|
||||
Reference in New Issue
Block a user