From ef4bda4e061daff2334314d98b62ba015d80016c Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 11 Oct 2026 15:40:46 +0200 Subject: [PATCH] feat(inbounds): TUN adapter type and auto-system options xray-core 26.9 added three TUN settings the inbound form could not set: - desc, the tunnel type a new Wintun adapter is created with on Windows. The settings schema did not list it, so the parse stripped it and a value entered as JSON vanished on the next save; - autoSystemDnsToGateway (Linux), which points systemd-resolved at the TUN gateway; - autoSystemWfpBlockLeak (Windows), whose dns / misconfigtun filters keep traffic from leaking past the TUN. The tooltips name the platform each one acts on and what it needs, since the core refuses to build or start the TUN otherwise. --- .../src/pages/inbounds/form/protocols/tun.tsx | 35 ++++++++++++++- frontend/src/schemas/protocols/inbound/tun.ts | 2 + frontend/src/test/inbound-form-modal.test.tsx | 43 +++++++++++++++++++ frontend/src/test/inbound-from-db.test.ts | 4 +- internal/web/translation/ar-EG.json | 8 +++- internal/web/translation/en-US.json | 8 +++- internal/web/translation/es-ES.json | 8 +++- internal/web/translation/fa-IR.json | 8 +++- internal/web/translation/id-ID.json | 8 +++- internal/web/translation/ja-JP.json | 8 +++- internal/web/translation/pt-BR.json | 8 +++- internal/web/translation/ru-RU.json | 8 +++- internal/web/translation/tr-TR.json | 8 +++- internal/web/translation/uk-UA.json | 8 +++- internal/web/translation/vi-VN.json | 8 +++- internal/web/translation/zh-CN.json | 8 +++- internal/web/translation/zh-TW.json | 8 +++- 17 files changed, 173 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/inbounds/form/protocols/tun.tsx b/frontend/src/pages/inbounds/form/protocols/tun.tsx index 2a92b3971..81b0281de 100644 --- a/frontend/src/pages/inbounds/form/protocols/tun.tsx +++ b/frontend/src/pages/inbounds/form/protocols/tun.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; -import { Button, Form, Input, InputNumber, Space, Tooltip } from 'antd'; +import { Button, Form, Input, InputNumber, Select, Space, Switch, Tooltip } from 'antd'; import { MinusOutlined, PlusOutlined } from '@ant-design/icons'; import { useFieldArray, useFormContext } from 'react-hook-form'; @@ -35,6 +35,12 @@ function StringList({ name, label, placeholder }: StringListProps) { ); } +// xray-core 26.9.30 accepts exactly these autoSystemWfpBlockLeak values. +const WFP_BLOCK_LEAK_OPTIONS = [ + { value: 'dns', label: 'dns' }, + { value: 'misconfigtun', label: 'misconfigtun' }, +]; + export default function TunFields() { const { t } = useTranslation(); return ( @@ -42,6 +48,13 @@ export default function TunFields() { + + + @@ -77,6 +90,26 @@ export default function TunFields() { > + + + + +