mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-01 10:45:00 +03:00
feat(xray): update xray-core to v26.10.21 and adapt panel
Bump xtls/xray-core to 1b1647cd9ddf (v26.10.21) and move the three binary pins (DockerInit.sh, both release.yml fetches) in lockstep. The v26.10.10 release was pulled upstream, so the old pins already 404. XDRIVE (#7182): the core now runs XDRIVE only for VLESS inside VLESS encryption, with no flow, and an outbound only over Mux; it refuses the whole config otherwise. The panel offers XDRIVE only for VLESS, refuses to save an inbound without decryption, never emits a client flow on an XDRIVE stream (config, JSON subscription, forms), and turns Mux on when an outbound picks XDRIVE. An inbound or template outbound stored before the upgrade that the core would refuse is left out of the generated config with a warning, so it no longer stops every other inbound. The service "Google Drive" is now "google-drive" (old name read as a deprecated alias); saves, the schema and both form adapters store the new name. XDRIVE and MASQUE gain a client xmux; both schemas keep it instead of stripping it on an inbound save. Lua scripts (#7124, #7136): the core refuses a routing script beside rules or domainStrategy, and a dns script beside the fallback/parallel switches or a domain-scoped server. The panel always keeps its api routing rule, so a template save now refuses any routing script and a dns script in a refused combination, and a stored one is dropped from the generated config so the core still starts. Noise masks gain a Lua script that the loader compiles inside Build: the in-process build (template save check, hot add) now resolves a relative script the way the xray child does, beside the xray binary, instead of failing it. The mask editor gets a Script field that replaces the noise list. XDNS (#7140): a resolver takes https:// DoH addresses with worker, tlsConfig and quicConfig. The mask editor registered only addrs, so a save dropped the rest; it now edits all four. Finalmask filter (#7206): a new TCP/UDP mask screens an inbound's source IPs. The inbound mask editor offers it with its allow and block lists; it is a no-op on a dialer and an older client core refuses the type, so the share link and JSON subscription drop it like the Go link already does.
This commit is contained in:
@@ -10,7 +10,9 @@ import { z } from 'zod';
|
||||
// here would dwarf the rest of the stream module without buying anything
|
||||
// the safety net doesn't already cover.
|
||||
|
||||
export const TcpMaskTypeSchema = z.enum(['fragment', 'sudoku', 'header-custom', 'xmc']);
|
||||
// 'filter' (xray-core 26.10.21) screens a listener's source IPs, so only the server-side
|
||||
// editors offer it and the share-link generators drop it.
|
||||
export const TcpMaskTypeSchema = z.enum(['fragment', 'sudoku', 'header-custom', 'xmc', 'filter']);
|
||||
export type TcpMaskType = z.infer<typeof TcpMaskTypeSchema>;
|
||||
|
||||
export const TcpMaskSchema = z.object({
|
||||
@@ -31,6 +33,7 @@ export const UdpMaskTypeSchema = z.enum([
|
||||
'sudoku',
|
||||
'realm',
|
||||
'udphop',
|
||||
'filter',
|
||||
]);
|
||||
export type UdpMaskType = z.infer<typeof UdpMaskTypeSchema>;
|
||||
|
||||
|
||||
@@ -22,5 +22,8 @@ export const MasqueStreamSettingsSchema = z.object({
|
||||
pass: z.string().optional(),
|
||||
headers: z.record(z.string(), z.string()).optional(),
|
||||
warp: MasqueWarpSchema.optional(),
|
||||
// Client XMUX (xray-core 26.10.17); left unset, the core keeps one connection, so no
|
||||
// defaults are filled in here. A JSON subscription hands an inbound's value to clients.
|
||||
xmux: z.record(z.string(), z.unknown()).optional(),
|
||||
});
|
||||
export type MasqueStreamSettings = z.infer<typeof MasqueStreamSettingsSchema>;
|
||||
|
||||
@@ -2,13 +2,28 @@ import { z } from 'zod';
|
||||
|
||||
// Both XDRIVE ends carry the same service, folder and secrets; an absent tuning knob takes
|
||||
// the core's default (segmentBytes and concurrency are capped there at 16 MiB / 64).
|
||||
export const XDriveServiceSchema = z.enum(['Google Drive', 'local', 'template']);
|
||||
export const XDriveServiceSchema = z.enum(['google-drive', 'local', 'template']);
|
||||
export type XDriveService = z.infer<typeof XDriveServiceSchema>;
|
||||
|
||||
// xray-core 26.10.17 (#7182) renamed "Google Drive" and reads the old name only as a deprecated alias.
|
||||
const canonicalXDriveService = (value: unknown) =>
|
||||
value === 'Google Drive' ? 'google-drive' : value;
|
||||
|
||||
const XDriveServiceInputSchema = z.preprocess(canonicalXDriveService, XDriveServiceSchema);
|
||||
|
||||
/** Lifts a stored stream's legacy service name before an editor reads it unparsed. */
|
||||
export function liftLegacyXDriveService(stream: Record<string, unknown>): void {
|
||||
const xdrive = stream.xdriveSettings;
|
||||
if (!xdrive || typeof xdrive !== 'object' || Array.isArray(xdrive)) return;
|
||||
const settings = xdrive as Record<string, unknown>;
|
||||
const service = canonicalXDriveService(settings.service);
|
||||
if (service !== settings.service) stream.xdriveSettings = { ...settings, service };
|
||||
}
|
||||
|
||||
const MillisSchema = z.number().int().min(0);
|
||||
|
||||
export const XDriveStreamSettingsSchema = z.object({
|
||||
service: XDriveServiceSchema.default('Google Drive'),
|
||||
service: XDriveServiceInputSchema.default('google-drive'),
|
||||
remoteFolder: z.string().default(''),
|
||||
// Google Drive takes exactly three, in order: ClientID, ClientSecret, RefreshToken.
|
||||
secrets: z.array(z.string()).default([]),
|
||||
@@ -21,5 +36,8 @@ export const XDriveStreamSettingsSchema = z.object({
|
||||
eagerWindowMs: MillisSchema.optional(),
|
||||
holeTimeoutMs: MillisSchema.optional(),
|
||||
template: z.record(z.string(), z.unknown()).optional(),
|
||||
// Client XMUX (xray-core 26.10.21); left unset, the core sizes it per service, so no
|
||||
// defaults are filled in here. A JSON subscription hands an inbound's value to clients.
|
||||
xmux: z.record(z.string(), z.unknown()).optional(),
|
||||
});
|
||||
export type XDriveStreamSettings = z.infer<typeof XDriveStreamSettingsSchema>;
|
||||
|
||||
Reference in New Issue
Block a user