From 814cda3fb4d08c26ea2c22a9b2b2de24251899c9 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 12 Jul 2026 00:30:47 +0200 Subject: [PATCH] feat(xray): update xray-core to v26.7.11 and adapt panel Bump xtls/xray-core to 50231eaf (v26.7.11) and the three binary pins (DockerInit.sh, release.yml x2) in lockstep. Adapt the panel to the upstream changes: - Shadowsocks "none"/"plain" and VMess "none"/"zero" were removed from the core. A migration rewrites stored none/plain SS methods to a supported cipher and none/zero VMess security to "auto" (on both the clients column and inbound settings JSON); the SS build-time heal does the same so a row injected after boot cannot brick startup. The removed values are dropped from every frontend option list, schema and adapter, and coerced to "auto" at the Go link/sub/Clash emit sites and both link importers. Fix the CipherType_NONE sentinel that no longer compiles. - Unencrypted vless/trojan outbounds to a public address are now refused by the core. Validate outbounds through the vendored config loader when saving the xray template and when storing/merging outbound subscriptions, so one such outbound cannot keep the core from starting. - New TCP finalmask type "xmc" (Minecraft mimicry): add it to the sub link allowlist, the frontend enum and the FinalMask form (hostname, usernames, required password), and document it. - streamSettings gained a "method" alias for "network"; canonicalize it to "network" at inbound save time and in the form adapters/schema so a method-keyed config keeps its transport. - New root "env" config key is passed through xray.Config, compared in Equals, and forces a restart in the hot diff. - REALITY now defaults minClientVer to 26.3.27; update the form placeholder. --- .github/workflows/release.yml | 4 +- DockerInit.sh | 2 +- docs/content/docs/en/config/transports.mdx | 4 +- docs/content/docs/fa/config/transports.mdx | 4 +- docs/content/docs/ru/config/transports.mdx | 4 +- docs/content/docs/zh/config/transports.mdx | 3 +- .../xray/forms/transport/FinalMaskForm.tsx | 38 ++++++ frontend/src/lib/xray/inbound-form-adapter.ts | 4 + .../src/lib/xray/outbound-form-adapter.ts | 6 +- frontend/src/lib/xray/outbound-link-parser.ts | 4 +- .../src/pages/clients/ClientFormModal.tsx | 6 +- .../pages/inbounds/form/security/reality.tsx | 2 +- frontend/src/schemas/primitives/options.ts | 2 - .../src/schemas/protocols/shared/vmess.ts | 12 +- .../src/schemas/protocols/stream/finalmask.ts | 4 +- .../src/schemas/protocols/stream/index.ts | 26 +++- .../test/__snapshots__/finalmask.test.ts.snap | 10 ++ .../golden/fixtures/finalmask/tcp-mask.json | 8 ++ frontend/src/test/stream.test.ts | 13 ++ go.mod | 12 +- go.sum | 24 ++-- internal/database/db.go | 125 ++++++++++++++++++ internal/database/model/model.go | 35 ++++- .../model/model_shadowsocks_removed_test.go | 43 ++++++ .../database/removed_cipher_migration_test.go | 117 ++++++++++++++++ internal/sub/clash_service.go | 6 +- internal/sub/json_service.go | 5 +- internal/sub/service.go | 15 ++- internal/sub/service_test.go | 15 +++ internal/util/link/outbound.go | 6 +- internal/web/service/inbound.go | 30 ++++- internal/web/service/outbound_subscription.go | 45 ++++++- .../web/service/stream_network_alias_test.go | 57 ++++++++ internal/web/service/xray_setting.go | 15 +++ internal/xray/api.go | 19 ++- internal/xray/config.go | 4 + internal/xray/hot_diff.go | 1 + internal/xray/hot_diff_test.go | 6 + internal/xray/outbound_validation_test.go | 42 ++++++ 39 files changed, 709 insertions(+), 69 deletions(-) create mode 100644 internal/database/model/model_shadowsocks_removed_test.go create mode 100644 internal/database/removed_cipher_migration_test.go create mode 100644 internal/web/service/stream_network_alias_test.go create mode 100644 internal/xray/outbound_validation_test.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfd95cdb2..d4b42f058 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -118,7 +118,7 @@ jobs: cd x-ui/bin # Download dependencies - Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.6.27/" + Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.7.11/" if [ "${{ matrix.platform }}" == "amd64" ]; then wget -q ${Xray_URL}Xray-linux-64.zip unzip Xray-linux-64.zip @@ -273,7 +273,7 @@ jobs: cd x-ui\bin # Download Xray for Windows - $Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.6.27/" + $Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.7.11/" Invoke-WebRequest -Uri "${Xray_URL}Xray-windows-64.zip" -OutFile "Xray-windows-64.zip" Expand-Archive -Path "Xray-windows-64.zip" -DestinationPath . Remove-Item "Xray-windows-64.zip" diff --git a/DockerInit.sh b/DockerInit.sh index 10a821306..172180ab9 100755 --- a/DockerInit.sh +++ b/DockerInit.sh @@ -32,7 +32,7 @@ if [ -z "$MTG_MULTI_VER" ]; then fi mkdir -p build/bin cd build/bin -curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.6.27/Xray-linux-${ARCH}.zip" +curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.7.11/Xray-linux-${ARCH}.zip" unzip "Xray-linux-${ARCH}.zip" rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat mv xray "xray-linux-${FNAME}" diff --git a/docs/content/docs/en/config/transports.mdx b/docs/content/docs/en/config/transports.mdx index f6d1a1fcf..77ed33cf6 100644 --- a/docs/content/docs/en/config/transports.mdx +++ b/docs/content/docs/en/config/transports.mdx @@ -122,7 +122,9 @@ Only valid when the protocol is **Hysteria2**. disguise transports that don't carry TLS (like mKCP) or add a second skin on top of TLS. Masks are configured per direction: -- **TCP masks** — `fragment`, `sudoku`, `header-custom`. +- **TCP masks** — `fragment`, `sudoku`, `header-custom`, `xmc` (disguises the + stream as Minecraft protocol traffic; requires a password, with optional + hostname and player usernames). - **UDP masks** — `salamander`, `mkcp-legacy`, `header-custom`, `xdns`, `xicmp`, `noise`, `sudoku`, `realm`. (`mkcp-legacy` reproduces the old mKCP header obfuscation.) diff --git a/docs/content/docs/fa/config/transports.mdx b/docs/content/docs/fa/config/transports.mdx index b112f7d05..c9657a959 100644 --- a/docs/content/docs/fa/config/transports.mdx +++ b/docs/content/docs/fa/config/transports.mdx @@ -123,7 +123,9 @@ icon: Network انتقال‌هایی را که TLS حمل نمی‌کنند (مانند mKCP) استتار کند یا پوسته‌ای دوم روی TLS بیفزاید. ماسک‌ها برای هر جهت پیکربندی می‌شوند: -- **ماسک‌های TCP** — `fragment`، `sudoku`، `header-custom`. +- **ماسک‌های TCP** — `fragment`، `sudoku`، `header-custom`، `xmc` (ترافیک را به شکل + پروتکل Minecraft استتار می‌کند؛ گذرواژه الزامی است و نام میزبان و نام‌های بازیکن + اختیاری‌اند). - **ماسک‌های UDP** — `salamander`، `mkcp-legacy`، `header-custom`، `xdns`، `xicmp`، `noise`، `sudoku`، `realm`. (`mkcp-legacy` همان مبهم‌سازی قدیمی هدر mKCP را بازتولید می‌کند.) diff --git a/docs/content/docs/ru/config/transports.mdx b/docs/content/docs/ru/config/transports.mdx index 884d82d47..3d67cc9eb 100644 --- a/docs/content/docs/ru/config/transports.mdx +++ b/docs/content/docs/ru/config/transports.mdx @@ -125,7 +125,9 @@ HTTPUpgrade — это одноразовый HTTP/1.1 `Upgrade` без фрей поэтому он может замаскировать транспорты, не несущие TLS (например, mKCP), или добавить вторую оболочку поверх TLS. Маски настраиваются по направлениям: -- **TCP-маски** — `fragment`, `sudoku`, `header-custom`. +- **TCP-маски** — `fragment`, `sudoku`, `header-custom`, `xmc` (маскирует поток + под трафик протокола Minecraft; требуется пароль, имя хоста и имена игроков + опциональны). - **UDP-маски** — `salamander`, `mkcp-legacy`, `header-custom`, `xdns`, `xicmp`, `noise`, `sudoku`, `realm`. (`mkcp-legacy` воспроизводит старую обфускацию заголовка mKCP.) diff --git a/docs/content/docs/zh/config/transports.mdx b/docs/content/docs/zh/config/transports.mdx index 774717426..a6887cb87 100644 --- a/docs/content/docs/zh/config/transports.mdx +++ b/docs/content/docs/zh/config/transports.mdx @@ -117,7 +117,8 @@ Session-ID 字段(`sessionIDPlacement`、`sessionIDKey`、`sessionIDTable`、 **FinalMask** 在传输方式和安全层**之后**包裹流量,因此它既能伪装那些承载不了 TLS 的 传输(如 mKCP),也能在 TLS 之上再加一层外壳。掩码按方向分别配置: -- **TCP 掩码** — `fragment`、`sudoku`、`header-custom`。 +- **TCP 掩码** — `fragment`、`sudoku`、`header-custom`、`xmc`(把流量伪装成 + Minecraft 协议;密码必填,主机名和玩家用户名可选)。 - **UDP 掩码** — `salamander`、`mkcp-legacy`、`header-custom`、`xdns`、`xicmp`、 `noise`、`sudoku`、`realm`。(`mkcp-legacy` 重现旧版 mKCP 的头部混淆。) - **QUIC 参数** — 拥塞控制(`reno`、`bbr`、`brutal`、`force-brutal`)、Brutal 上/下行 diff --git a/frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx b/frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx index ce04a2496..7406e59d6 100644 --- a/frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx +++ b/frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx @@ -81,6 +81,8 @@ function defaultTcpMaskSettings(type: string): Record { }; case 'header-custom': return { clients: [], servers: [] }; + case 'xmc': + return { hostname: '', usernames: [], password: RandomUtil.randomLowerAndNum(16) }; default: return {}; } @@ -294,6 +296,7 @@ function TcpMaskItem({ { value: 'fragment', label: 'Fragment' }, { value: 'header-custom', label: 'Header Custom' }, { value: 'sudoku', label: 'Sudoku' }, + { value: 'xmc', label: 'XMC (Minecraft)' }, ]} /> @@ -371,6 +374,41 @@ function TcpMaskItem({ /> ); } + if (type === 'xmc') { + return ( + <> + + + + + + +