mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-09 21:48:03 +08:00
update 2026-10-23 00:28:40
This commit is contained in:
1 parent
3f38c69f75
commit
d64c67f0ed
320 files changed
+109777
-2309
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user