mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-12 07:36:07 +00:00
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.
This commit is contained in:
@@ -442,8 +442,23 @@ func StripVlessInboundEncryption(settings string) (string, bool) {
|
||||
return string(out), true
|
||||
}
|
||||
|
||||
// HealShadowsocksClientMethods normalises the per-client `method` field
|
||||
// on a shadowsocks inbound's settings JSON before it leaves for xray-core:
|
||||
// ReplaceRemovedShadowsocksCipher maps ciphers that xray-core v26.7.11
|
||||
// deleted ("none"/"plain" make the whole config fail with "unknown cipher
|
||||
// method") to a still-supported replacement. Returns the replacement and
|
||||
// true when the given method is one of the removed ciphers.
|
||||
func ReplaceRemovedShadowsocksCipher(method string) (string, bool) {
|
||||
switch method {
|
||||
case "none", "plain":
|
||||
return "chacha20-ietf-poly1305", true
|
||||
}
|
||||
return method, false
|
||||
}
|
||||
|
||||
// HealShadowsocksClientMethods normalises the `method` fields on a
|
||||
// shadowsocks inbound's settings JSON before it leaves for xray-core:
|
||||
// - Ciphers removed upstream (none/plain): rewritten via
|
||||
// ReplaceRemovedShadowsocksCipher so one legacy row cannot prevent
|
||||
// xray from starting.
|
||||
// - Legacy ciphers (aes-*, chacha20-*): every client must carry a
|
||||
// per-user `method` matching the inbound's top-level method, otherwise
|
||||
// xray fails with "unsupported cipher method:".
|
||||
@@ -462,12 +477,24 @@ func HealShadowsocksClientMethods(settings string) (string, bool) {
|
||||
return settings, false
|
||||
}
|
||||
method, _ := parsed["method"].(string)
|
||||
changed := false
|
||||
if replacement, removed := ReplaceRemovedShadowsocksCipher(method); removed {
|
||||
method = replacement
|
||||
parsed["method"] = method
|
||||
changed = true
|
||||
}
|
||||
clients, ok := parsed["clients"].([]any)
|
||||
if !ok {
|
||||
return settings, false
|
||||
if !changed {
|
||||
return settings, false
|
||||
}
|
||||
out, err := json.MarshalIndent(parsed, "", " ")
|
||||
if err != nil {
|
||||
return settings, false
|
||||
}
|
||||
return string(out), true
|
||||
}
|
||||
is2022 := strings.HasPrefix(method, "2022-blake3-")
|
||||
changed := false
|
||||
for i := range clients {
|
||||
cm, ok := clients[i].(map[string]any)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user