feat(xray): update xray-core to v26.9.30 and adapt panel

Bump xtls/xray-core to b26a91de4f (v26.9.30) and the three binary pins
(DockerInit.sh, release.yml Linux + Windows) in lockstep. No deleted
symbols; the sing and sing-shadowsocks indirect deps drop out with the
SS2022 rewrite.

XDNS finalmask (#6718) replaced its string lists with objects: domains
are {name, types, edns0, lenLimit, labelLimit} and client resolvers
{type, settings.addr}. The loader no longer parses the old lists, so a
single stored xdns mask keeps the whole core from starting. The new leaf
package internal/util/maskcompat converts them: "name[:type]" becomes a
domain and "name[:type]+udp://addr" a domain plus a udp resolver. A bare
name maps to TXT, the type legacy clients queried by default, and each
converted domain keeps the 1232-byte EDNS0 the old code always used
(without it the server caps answers at 512). It runs from:
- the XdnsFinalmaskObjectsFix seeder, over inbound streams, hosts, the
  xray template, the global sub-JSON mask and cached subscription
  outbounds;
- inbound save (normalizeStreamSettings) and GetXrayConfig, for rows
  that never went through the seeder;
- both link importers, since fm= from an older panel carries the lists.
The finalmask form edits the object shape (every key needs a registered
field, or the finalmask watch drops it on save) and lifts legacy masks
on open. The udp-mask golden fixture moves to the object shape, which
TestGoldenStreamFixturesBuildInXray now builds through the core. The
wire format changed as well, so pre-upgrade clients need the new core.

WireGuard outbound (#6771) dropped settings.domainStrategy and the
remoteDNS "local" mode. The endpoint lookup now follows
sockopt.domainStrategy and in-tunnel targets the outbound's
targetStrategy. The old key is silently ignored, which undid the
IPv4-first endpoint lookup the WARP outbound depends on (#5205), and
"local" now panics the core at startup because remoteDNS goes through
netip.MustParseAddr. The WireguardDomainStrategyFix seeder moves a stored
family preference to both keys (a value already set wins) and turns
"local" into targetStrategy; the outbound form lifts legacy rows the same
way and drops its select, the WARP modal writes the new placement, and
the inbound form loses a field the server never read.
ValidateOutboundConfig now refuses a non-IP remoteDNS entry, which
conf.Build() lets through, on template save and for outbound
subscriptions.

Noise finalmask items accept type "exp" (#6862), a tag expression. The
form offers it for noise items only: header-custom items go through the
core's PraseByteSlice, which refuses it.

TUN gained autoSystemDnsToGateway (Linux) and autoSystemWfpBlockLeak
(Windows). Both pass through the settings schema so a value set in JSON
survives the next form save.

MASQUE (inbound, outbound, transport) and the XDRIVE transport are new
protocols the panel does not offer yet; their new loader refusals only
cover configs the panel never generates. The FakeDNS IPv6 pool default,
the SS2022 rewrite (same gRPC account; emails are now deduped
case-insensitively, as the panel already does), the restored udphop
interval default and the rest change no panel-facing config.
This commit is contained in:
MHSanaei committed 2026-10-02 13:54:39 +02:00
1 parent 99047c0a63
commit 62423cacd1
38 files changed
+1487 -165

No files matched your search

+2 -2
View File
@@ -115,7 +115,7 @@ jobs:
cd x-ui/bin
# Download dependencies
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.9.9/"
Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.9.30/"
if [ "${{ matrix.platform }}" == "amd64" ]; then
fetch ${Xray_URL}Xray-linux-64.zip
unzip Xray-linux-64.zip
@@ -300,7 +300,7 @@ jobs:
cd x-ui\bin
# Download Xray for Windows
$Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.9.9/"
$Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.9.30/"
Invoke-WebRequest @retry -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"
+1 -1
View File
@@ -33,7 +33,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.9.9/Xray-linux-${ARCH}.zip"
curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.9.30/Xray-linux-${ARCH}.zip"
unzip "Xray-linux-${ARCH}.zip"
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat
mv xray "xray-linux-${FNAME}"
@@ -18,6 +18,7 @@ import type { NamePath } from 'antd/es/form/interface';
import { RandomUtil } from '@/utils';
import { activateOnKey } from '@/utils/a11y';
import { OutboundProtocols, UTLS_FINGERPRINT } from '@/schemas/primitives';
import { upgradeLegacyXdnsMasks, XDNS_LEGACY_EDNS0 } from '@/lib/xray/xdns-mask';
const UTLS_FINGERPRINT_OPTIONS = Object.values(UTLS_FINGERPRINT).map((value) => ({
value,
@@ -244,28 +245,34 @@ export default function FinalMaskForm({
}: FinalMaskFormProps) {
const base = asPath(name);
// Migrate legacy TCP mask shapes once on mount so configs saved before
// #6334 (fragment ranges) and #6487 (xmc profiles) render in the list UI.
// Migrate legacy mask shapes once on mount so configs saved before #6334 (fragment
// ranges), #6487 (xmc profiles) and #6718 (xdns objects) render in the list UI.
const migratedRef = useRef(false);
useEffect(() => {
if (migratedRef.current) return;
migratedRef.current = true;
const tcp = form.getFieldValue([...base, 'tcp']);
if (!Array.isArray(tcp)) return;
let anyChanged = false;
const next = tcp.map((mask) => {
if (!mask || typeof mask !== 'object') return mask;
const m = mask as Record<string, unknown>;
if (m.type !== 'fragment' && m.type !== 'xmc') return mask;
if (!m.settings || typeof m.settings !== 'object') return mask;
const settings = m.settings as Record<string, unknown>;
const { next: migrated, changed } =
m.type === 'fragment' ? migrateFragmentSettings(settings) : migrateXmcSettings(settings);
if (!changed) return mask;
anyChanged = true;
return { ...m, settings: migrated };
});
if (anyChanged) form.setFieldValue([...base, 'tcp'], next);
if (Array.isArray(tcp)) {
let anyChanged = false;
const next = tcp.map((mask) => {
if (!mask || typeof mask !== 'object') return mask;
const m = mask as Record<string, unknown>;
if (m.type !== 'fragment' && m.type !== 'xmc') return mask;
if (!m.settings || typeof m.settings !== 'object') return mask;
const settings = m.settings as Record<string, unknown>;
const { next: migrated, changed } =
m.type === 'fragment' ? migrateFragmentSettings(settings) : migrateXmcSettings(settings);
if (!changed) return mask;
anyChanged = true;
return { ...m, settings: migrated };
});
if (anyChanged) form.setFieldValue([...base, 'tcp'], next);
}
const udp = form.getFieldValue([...base, 'udp']);
if (Array.isArray(udp)) {
const { next, changed } = upgradeLegacyXdnsMasks(udp);
if (changed) form.setFieldValue([...base, 'udp'], next);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
@@ -958,11 +965,7 @@ function UdpMaskItem({
);
}
if (type === 'xdns') {
return (
<Form.Item label="Domains" name={[fieldName, 'settings', 'domains']}>
<Select mode="tags" style={{ width: '100%' }} tokenSeparators={[',']} />
</Form.Item>
);
return <XdnsSettings udpFieldName={fieldName} />;
}
if (type === 'xicmp') {
return (
@@ -1255,6 +1258,113 @@ function UdpHeaderCustom({
);
}
const XDNS_RECORD_TYPE_OPTIONS = [
{ value: 16, label: 'TXT' },
{ value: 1, label: 'A' },
{ value: 28, label: 'AAAA' },
{ value: 5, label: 'CNAME' },
];
// Every xdns key needs a registered field: the finalmask watch drops keys without one.
// Resolvers and extraPoll are read by clients only; a server keeps them for the share link.
function XdnsSettings({ udpFieldName }: { udpFieldName: number }) {
const { t } = useTranslation();
return (
<>
<Form.List name={[udpFieldName, 'settings', 'domains']}>
{(domains, { add, remove }) => (
<>
<Form.Item label="Domains">
<Button
type="primary"
size="small"
icon={<PlusOutlined />}
aria-label={t('add')}
onClick={() => add({ name: '', types: [16], edns0: XDNS_LEGACY_EDNS0 })}
/>
</Form.Item>
{domains.map((domain, di) => (
<div key={domain.key}>
<Divider style={{ margin: 0 }}>
Domain {di + 1}
<DeleteOutlined
className="danger-icon"
role="button"
tabIndex={0}
aria-label={t('remove')}
onClick={() => remove(domain.name)}
onKeyDown={activateOnKey(() => remove(domain.name))}
/>
</Divider>
<Form.Item label="Name" name={[domain.name, 'name']}>
<Input placeholder="t.example.com" />
</Form.Item>
<Form.Item
label="Record Types"
name={[domain.name, 'types']}
rules={[{ required: true, type: 'array', min: 1 }]}
>
<Select mode="multiple" options={XDNS_RECORD_TYPE_OPTIONS} />
</Form.Item>
<Form.Item label="EDNS0" name={[domain.name, 'edns0']}>
<InputNumber min={512} max={4096} placeholder="off" />
</Form.Item>
<Form.Item label="Length Limit" name={[domain.name, 'lenLimit']}>
<InputNumber min={0} max={255} placeholder="255" />
</Form.Item>
<Form.Item label="Label Limit" name={[domain.name, 'labelLimit']}>
<InputNumber min={0} max={63} placeholder="63" />
</Form.Item>
</div>
))}
</>
)}
</Form.List>
<Form.List name={[udpFieldName, 'settings', 'resolvers']}>
{(resolvers, { add, remove }) => (
<>
<Form.Item label="Resolvers (client)">
<Button
type="primary"
size="small"
icon={<PlusOutlined />}
aria-label={t('add')}
onClick={() => add({ type: 'udp', settings: { addr: '' } })}
/>
</Form.Item>
{resolvers.map((resolver, ri) => (
<Form.Item key={resolver.key} label={`Resolver ${ri + 1}`}>
<Space.Compact block>
<Form.Item name={[resolver.name, 'type']} noStyle>
<Select
style={{ width: 80 }}
options={[
{ value: 'udp', label: 'UDP' },
{ value: 'tcp', label: 'TCP' },
]}
/>
</Form.Item>
<Form.Item name={[resolver.name, 'settings', 'addr']} noStyle>
<Input placeholder="8.8.8.8:53" />
</Form.Item>
<Button
icon={<DeleteOutlined />}
aria-label={t('remove')}
onClick={() => remove(resolver.name)}
/>
</Space.Compact>
</Form.Item>
))}
</>
)}
</Form.List>
<Form.Item label="Extra Poll (client)" name={[udpFieldName, 'settings', 'extraPoll']}>
<InputNumber min={0} max={3} placeholder="0" />
</Form.Item>
</>
);
}
function NoiseItems({
udpFieldName,
form,
@@ -1352,6 +1462,8 @@ function ItemEditor({
{ value: 'str', label: 'String' },
{ value: 'hex', label: 'Hex' },
{ value: 'base64', label: 'Base64' },
// Only the noise mask parses tag expressions (xray-core 26.9.30, #6862).
...(delayMode === 'string' ? [{ value: 'exp', label: 'Expression' }] : []),
]}
/>
</Form.Item>
@@ -1420,7 +1532,7 @@ function ItemEditor({
}
return (
<Form.Item label="Packet" name={[fieldName, 'packet']}>
<Input placeholder="binary data" />
<Input placeholder={type === 'exp' ? '<b 0d0a0d0a><t><rc 20-40>' : 'binary data'} />
</Form.Item>
);
}}
Loaded 3 of 38 files, more files were not shown because too many files have changed in this diff. Show more