🗽 Sync 2026-10-23 00:46:23

This commit is contained in:
github-actions[bot] committed 2026-10-23 00:46:23 +08:00
1 parent 6032a57538
commit 2b29b0c4e1
112 files changed
+1859 -6208

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ LUCI_TITLE:=luci-app-ssr-plus
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=198
PKG_RELEASE:=95
PKG_RELEASE:=96
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \
@@ -932,9 +932,11 @@ o:value("5", "v5 (UUID / Password)")
o:value("4", "v4 (Token)")
o.default = "5"
o:depends({type = "v2ray", v2ray_protocol = "tuic"})
o = s:option(Value, "xray_tuic_token", "TUIC Token")
o.password = true
o:depends({type = "v2ray", v2ray_protocol = "tuic", xray_tuic_version = "4"})
o = s:option(Value, "xray_tuic_ca", translate("Certificate File Path"))
o:depends({type = "v2ray", v2ray_protocol = "tuic"})
@@ -1136,26 +1138,32 @@ o = s:option(Value, "xray_kcptun_key", "Kcptun Key")
o:depends("transport", "kcptun")
o.password = true
o.rmempty = false
o = s:option(ListValue, "xray_kcptun_crypt", "Kcptun Encryption")
o:depends("transport", "kcptun")
for _, crypt in ipairs({"aes", "aes-128", "aes-192", "aes-128-gcm", "salsa20", "tea", "xor", "none", "null", "blowfish", "twofish", "cast5", "3des", "xtea"}) do o:value(crypt, crypt) end
o.default = "aes"
o = s:option(ListValue, "xray_kcptun_mode", "Kcptun Mode")
o:depends("transport", "kcptun")
for _, mode in ipairs({"normal", "fast", "fast2", "fast3", "manual"}) do o:value(mode, mode) end
o.default = "fast"
o = s:option(ListValue, "xray_kcptun_smuxver", "Kcptun smux Version")
o:depends("transport", "kcptun")
o:value("1", "v1")
o:value("2", "v2")
o.default = "1"
o = s:option(Flag, "xray_kcptun_nocomp", translate("Disable Compression"))
o:depends("transport", "kcptun")
o.default = "0"
o = s:option(Value, "xray_kcptun_conn", translate("Connections"))
o:depends("transport", "kcptun")
o.datatype = "range(1,256)"
o.default = "1"
o = s:option(TextValue, "xray_kcptun_options", "Kcptun Advanced Options (JSON)")
o:depends("transport", "kcptun")
o.rows = 4
@@ -1538,28 +1546,34 @@ for _, proto in ipairs({"vmess", "vless", "trojan", "shadowsocks"}) do
o:depends({type = "v2ray", v2ray_protocol = proto, transport = "raw", tls = false, reality = false})
end
o.description = translate("ShadowTLS protects TCP connections. The inner proxy protocol must provide encryption.")
o = s:option(ListValue, "xray_shadowtls_version", "ShadowTLS Version")
o:depends("xray_shadowtls", "1")
o:value("3", "v3")
o:value("2", "v2")
o:value("1", "v1")
o.default = "3"
o = s:option(Value, "xray_shadowtls_password", "ShadowTLS Password")
o:depends({xray_shadowtls = "1", xray_shadowtls_version = "2"})
o:depends({xray_shadowtls = "1", xray_shadowtls_version = "3"})
o.password = true
o.rmempty = false
o = s:option(Value, "xray_shadowtls_sni", "ShadowTLS SNI")
o:depends("xray_shadowtls", "1")
o.datatype = "hostname"
o.rmempty = false
o = s:option(ListValue, "xray_shadowtls_fingerprint", translate("TLS Client Fingerprint"))
o:depends("xray_shadowtls", "1")
for _, fp in ipairs({"chrome", "firefox", "safari", "ios", "android", "edge", "none"}) do o:value(fp, fp) end
o.default = "chrome"
o = s:option(Flag, "xray_shadowtls_strict", translate("TLS 1.3 Strict mode"))
o:depends({xray_shadowtls = "1", xray_shadowtls_version = "3"})
o.default = "1"
o = s:option(Flag, "xray_shadowtls_insecure", translate("Allow Insecure"))
o:depends("xray_shadowtls", "1")
o.default = "0"
@@ -1699,7 +1713,6 @@ o:depends("xtls", true)
o:depends("reality", true)
o.rmempty = true
o:depends({type = "v2ray", v2ray_protocol = "tuic"})
o:depends({type = "v2ray", v2ray_protocol = "naive"})
-- TLS ALPN
@@ -1983,6 +1996,7 @@ for _, field in ipairs({
o.default = "0"
o:depends({type = "v2ray", v2ray_protocol = "naive"})
end
for _, field in ipairs({
{"naive_certificate_file", "Naive trusted CA certificate file"},
{"naive_ech_config", "Naive ECH config list (base64)"}
@@ -242,7 +242,6 @@ o.rmempty = true
o:depends("tls", "1")
o:depends("type", "tuic")
o:depends("type", "anytls")
o:depends("type", "naive")
o = s:option(Value, "tls_keyFile", translate("Private Key File Path"))
@@ -251,9 +250,9 @@ o.rmempty = true
o:depends("tls", "1")
o:depends("type", "tuic")
o:depends("type", "anytls")
o:depends("type", "naive")
-- ========== 传输层设置 (Transport) ==========
o:depends("type", "naive")
o = s:option(ListValue, "transport", translate("Transport Protocol"))
o:value("tcp", "TCP")
@@ -430,15 +429,18 @@ end
o = s:option(Value, "snell_psk", translate("Snell PSK"))
o.password = true
o:depends("type", "snell")
o = s:option(ListValue, "snell_version", translate("Snell Version"))
for _, version in ipairs({"1", "2", "3", "4", "5"}) do o:value(version, "v" .. version) end
o.default = "4"
o:depends("type", "snell")
o = s:option(ListValue, "snell_obfs", translate("Snell Obfs"))
o:value("", translate("Disable"))
o:value("http", "HTTP")
o:value("tls", "TLS")
o:depends("type", "snell")
o = s:option(Flag, "snell_udp", translate("UDP Relay"))
o.default = "1"
for _, version in ipairs({"3", "4", "5"}) do
@@ -448,6 +450,7 @@ end
o = s:option(Value, "anytls_password", translate("Password"))
o.password = true
o:depends("type", "anytls")
o = s:option(TextValue, "anytls_padding", "AnyTLS Padding Scheme")
o.rows = 5
o.rmempty = true
@@ -459,19 +462,23 @@ for _, v in ipairs({"aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr",
o.default = "aes-128-cfb"
o.rmempty = false
o:depends("type", "ssr-xray")
o = s:option(ListValue, "ssr_protocol", translate("Protocol"))
for _, v in ipairs({"origin", "auth_sha1_v4", "auth_aes128_md5", "auth_aes128_sha1", "auth_chain_a", "auth_chain_b"}) do o:value(v) end
o.default = "auth_aes128_sha1"
o.rmempty = false
o:depends("type", "ssr-xray")
o = s:option(Value, "ssr_protocol_param", "SSR Protocol Param")
o.description = "1001:password1,1002:password2"
o:depends("type", "ssr-xray")
o = s:option(ListValue, "ssr_obfs", translate("Obfs"))
for _, v in ipairs({"plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth", "tls1.2_ticket_fastauth"}) do o:value(v) end
o.default = "plain"
o.rmempty = false
o:depends("type", "ssr-xray")
o = s:option(Value, "ssr_obfs_param", translate("Obfs param (optional)"))
o.description = "HTTP Host: example.com,example.org"
o:depends({type = "ssr-xray", ssr_obfs = "http_simple"})
+28 -34
View File
@@ -1571,15 +1571,15 @@ generate_xray_config() {
{
"log": {
"loglevel": "warning"
},
"inbounds": [$inbound_json],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
},
"inbounds": [$inbound_json],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
EOF
return 0
}
@@ -2260,7 +2260,6 @@ get_udp_relay_mode() {
naive)
[ "$(uci_get_by_name "$node" naive_udp_over_tcp 0)" = "1" ] && echo "native" || echo "disabled"
;;
http)
echo "disabled"
;;
@@ -2754,7 +2753,6 @@ start_server() {
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray NaiveProxy Server$server_count Started!"
;;
ssr-xray)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
@@ -2764,7 +2762,6 @@ start_server() {
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray ShadowsocksR Server$server_count Started!"
;;
anytls)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
@@ -2774,7 +2771,6 @@ start_server() {
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray AnyTLS Server$server_count Started!"
;;
snell)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
@@ -2784,7 +2780,6 @@ start_server() {
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray Snell Server$server_count Started!"
;;
tuic)
xray_bin="$(first_type xray)"
[ -x "$xray_bin" ] || return 1
@@ -2794,7 +2789,6 @@ start_server() {
ln_start_bin "$xray_bin" xray-server-$server_count run -c "$config_file"
echolog "Server: Xray TUIC Server$server_count Started!"
;;
vmess|vless|trojan|shadowsocks)
# Xray 服务端支持
port=$(uci_get_by_name "$1" server_port)
@@ -3060,26 +3054,26 @@ start_rules() {
fi
elif [ "$USE_TABLES" = "iptables" ]; then
ARG_A=""
fi
/usr/share/shadowsocksr/gfw2ipset.sh
/usr/bin/ssr-rules \
-s "$server" \
-l "$local_port" \
-S "$udp_server" \
-L "$udp_local_port" \
-a "$ac_ips" \
-i "/etc/ssrplus/china_ssr.txt" \
-b "$(uci_get_by_type access_control wan_bp_ips)" \
-w "$(uci_get_by_type access_control wan_fw_ips)" \
-B "$(uci_get_by_type access_control lan_bp_ips)" \
-p "$(uci_get_by_type access_control lan_fp_ips)" \
-G "$(uci_get_by_type access_control lan_gm_ips)" \
-m "$(uci_get_by_type access_control Interface)" \
-D "$proxyport" \
$(get_arg_out) $(gfwmode) $ARG_UDP $ARG_UDP_RULES $ARG_A
fi
/usr/share/shadowsocksr/gfw2ipset.sh
/usr/bin/ssr-rules \
-s "$server" \
-l "$local_port" \
-S "$udp_server" \
-L "$udp_local_port" \
-a "$ac_ips" \
-i "/etc/ssrplus/china_ssr.txt" \
-b "$(uci_get_by_type access_control wan_bp_ips)" \
-w "$(uci_get_by_type access_control wan_fw_ips)" \
-B "$(uci_get_by_type access_control lan_bp_ips)" \
-p "$(uci_get_by_type access_control lan_fp_ips)" \
-G "$(uci_get_by_type access_control lan_gm_ips)" \
-m "$(uci_get_by_type access_control Interface)" \
-D "$proxyport" \
$(get_arg_out) $(gfwmode) $ARG_UDP $ARG_UDP_RULES $ARG_A
return $?
}
return $?
}
start() {
local run_mode
@@ -364,41 +364,41 @@ function outbound:handleIndex(index)
trojan_shadowsocks()
end,
snell = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
tuic = function()
local version = tonumber(server.xray_tuic_version) or 5
local alpn = {}
for value in (server.tuic_alpn or ""):gmatch("[^,]+") do alpn[#alpn + 1] = value end
if #alpn == 0 then alpn = {"h3"} end
outbound_settings = {
address = server.server, port = tonumber(server.server_port), version = version,
token = version == 4 and server.xray_tuic_token or nil,
uuid = version == 5 and server.tuic_uuid or nil,
password = version == 5 and server.tuic_passwd or nil,
serverName = server.tls_host, certificateFile = server.xray_tuic_ca,
allowInsecure = server.insecure == "1",
alpn = alpn,
congestionControl = server.congestion_control or "cubic",
udpRelayMode = server.udp_relay_mode or "native",
heartbeatInterval = (tonumber(server.heartbeat) or 10) * 1000,
requestTimeout = (tonumber(server.timeout) or 8) * 1000,
reduceRtt = server.zero_rtt_handshake == "1"
}
end,
local version = tonumber(server.xray_tuic_version) or 5
local alpn = {}
for value in (server.tuic_alpn or ""):gmatch("[^,]+") do alpn[#alpn + 1] = value end
if #alpn == 0 then alpn = {"h3"} end
outbound_settings = {
address = server.server, port = tonumber(server.server_port), version = version,
token = version == 4 and server.xray_tuic_token or nil,
uuid = version == 5 and server.tuic_uuid or nil,
password = version == 5 and server.tuic_passwd or nil,
serverName = server.tls_host, certificateFile = server.xray_tuic_ca,
allowInsecure = server.insecure == "1",
alpn = alpn,
congestionControl = server.congestion_control or "cubic",
udpRelayMode = server.udp_relay_mode or "native",
heartbeatInterval = (tonumber(server.heartbeat) or 10) * 1000,
requestTimeout = (tonumber(server.timeout) or 8) * 1000,
reduceRtt = server.zero_rtt_handshake == "1"
}
end,
shadowsocksr = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
password = server.password, method = server.ssr_method or "aes-128-cfb",
protocol = server.ssr_protocol or "origin", protocolParam = server.protocol_param,
obfs = server.ssr_obfs or "plain", obfsParam = server.obfs_param
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
password = server.password, method = server.ssr_method or "aes-128-cfb",
protocol = server.ssr_protocol or "origin", protocolParam = server.protocol_param,
obfs = server.ssr_obfs or "plain", obfsParam = server.obfs_param
}
end,
shadowsocks = function()
trojan_shadowsocks()
end,
@@ -412,18 +412,18 @@ function outbound:handleIndex(index)
wireguard()
end,
naive = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
username = server.username, password = server.password,
serverName = server.tls_host,
certificateFile = server.naive_certificate_file,
quic = server.naive_quic == "1",
udpOverTcp = server.naive_udp_over_tcp == "1",
insecureConcurrency = tonumber(server.naive_concurrency),
quicCongestionControl = server.naive_quic_congestion,
echConfigList = server.naive_ech_config
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
username = server.username, password = server.password,
serverName = server.tls_host,
certificateFile = server.naive_certificate_file,
quic = server.naive_quic == "1",
udpOverTcp = server.naive_udp_over_tcp == "1",
insecureConcurrency = tonumber(server.naive_concurrency),
quicCongestionControl = server.naive_quic_congestion,
echConfigList = server.naive_ech_config
}
end,
anytls = function()
outbound_settings = {
address = server.server,
@@ -930,48 +930,48 @@ Xray.outbounds = {
-- These protocols own their framing, obfuscation and multiplexing.
-- Preserve Xray socket marks and dialer chains.
if server.v2ray_protocol == "naive" or server.v2ray_protocol == "shadowsocksr" or server.v2ray_protocol == "tuic" or server.v2ray_protocol == "snell" then
local ob = Xray.outbounds[1]
ob.streamSettings = { network = "raw", sockopt = ob.streamSettings.sockopt }
ob.mux = nil
local ob = Xray.outbounds[1]
ob.streamSettings = { network = "raw", sockopt = ob.streamSettings.sockopt }
ob.mux = nil
end
if server.type == "v2ray" and server.transport == "kcptun" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true, socks = true, http = true}
assert(supported[server.v2ray_protocol], "Kcptun requires a supported stream proxy protocol")
assert(server.tls ~= "1" and server.reality ~= "1" and server.xtls ~= "1", "Kcptun cannot be combined with stream TLS or REALITY")
assert(server.kcp_enable ~= "1", "Native Kcptun cannot be combined with the external Kcptun client")
assert(not server.tls_flow or server.tls_flow == "", "Kcptun cannot be combined with XTLS flow")
local options = {}
if server.xray_kcptun_options and server.xray_kcptun_options:match("%S") then
assert(server.xray_kcptun_options:match("^%s*{"), "Kcptun options must be a JSON object")
options = json.parse(server.xray_kcptun_options)
assert(type(options) == "table", "Kcptun options must be a JSON object")
end
options.key = server.xray_kcptun_key
options.crypt = server.xray_kcptun_crypt or "aes"
options.mode = server.xray_kcptun_mode or "fast"
options.smuxver = tonumber(server.xray_kcptun_smuxver) or 1
options.nocomp = server.xray_kcptun_nocomp == "1"
options.conn = tonumber(server.xray_kcptun_conn) or 1
Xray.outbounds[1].streamSettings.kcptunSettings = options
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true, socks = true, http = true}
assert(supported[server.v2ray_protocol], "Kcptun requires a supported stream proxy protocol")
assert(server.tls ~= "1" and server.reality ~= "1" and server.xtls ~= "1", "Kcptun cannot be combined with stream TLS or REALITY")
assert(server.kcp_enable ~= "1", "Native Kcptun cannot be combined with the external Kcptun client")
assert(not server.tls_flow or server.tls_flow == "", "Kcptun cannot be combined with XTLS flow")
local options = {}
if server.xray_kcptun_options and server.xray_kcptun_options:match("%S") then
assert(server.xray_kcptun_options:match("^%s*{"), "Kcptun options must be a JSON object")
options = json.parse(server.xray_kcptun_options)
assert(type(options) == "table", "Kcptun options must be a JSON object")
end
options.key = server.xray_kcptun_key
options.crypt = server.xray_kcptun_crypt or "aes"
options.mode = server.xray_kcptun_mode or "fast"
options.smuxver = tonumber(server.xray_kcptun_smuxver) or 1
options.nocomp = server.xray_kcptun_nocomp == "1"
options.conn = tonumber(server.xray_kcptun_conn) or 1
Xray.outbounds[1].streamSettings.kcptunSettings = options
end
if server.type == "v2ray" and server.xray_shadowtls == "1" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true}
assert(supported[server.v2ray_protocol], "ShadowTLS requires a supported TCP proxy protocol")
assert((server.transport or "raw") == "raw" or server.transport == "tcp", "ShadowTLS requires RAW/TCP")
assert(server.tls ~= "1" and server.reality ~= "1", "ShadowTLS cannot be combined with TLS or REALITY")
assert(not server.tls_flow or server.tls_flow == "", "ShadowTLS cannot be combined with XTLS flow")
local stream = Xray.outbounds[1].streamSettings
stream.security = "shadowtls"
stream.shadowtlsSettings = {
version = tonumber(server.xray_shadowtls_version) or 3,
password = server.xray_shadowtls_password,
serverName = server.xray_shadowtls_sni,
fingerprint = server.xray_shadowtls_fingerprint or "chrome",
strictMode = server.xray_shadowtls_strict ~= "0",
allowInsecure = server.xray_shadowtls_insecure == "1"
}
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true}
assert(supported[server.v2ray_protocol], "ShadowTLS requires a supported TCP proxy protocol")
assert((server.transport or "raw") == "raw" or server.transport == "tcp", "ShadowTLS requires RAW/TCP")
assert(server.tls ~= "1" and server.reality ~= "1", "ShadowTLS cannot be combined with TLS or REALITY")
assert(not server.tls_flow or server.tls_flow == "", "ShadowTLS cannot be combined with XTLS flow")
local stream = Xray.outbounds[1].streamSettings
stream.security = "shadowtls"
stream.shadowtlsSettings = {
version = tonumber(server.xray_shadowtls_version) or 3,
password = server.xray_shadowtls_password,
serverName = server.xray_shadowtls_sni,
fingerprint = server.xray_shadowtls_fingerprint or "chrome",
strictMode = server.xray_shadowtls_strict ~= "0",
allowInsecure = server.xray_shadowtls_insecure == "1"
}
end
if xray_builtin_dns then
@@ -1390,13 +1390,13 @@ function config:handleIndex(index)
end
end,
snell = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
tuic = function()
print(json.stringify(tuic, 1))
end