mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 08:25:13 +08:00
update 2026-05-17 21:09:00
This commit is contained in:
1 parent
9d2cd3c1c7
commit
39a3fb3cf9
10 files changed
+11
-249
No files matched your search
@@ -18,8 +18,6 @@ PKG_CONFIG_DEPENDS:= \
|
|||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Client \
|
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Server \
|
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client \
|
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client \
|
||||||
@@ -86,17 +84,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy
|
|||||||
select PACKAGE_naiveproxy
|
select PACKAGE_naiveproxy
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Client
|
|
||||||
bool "Include Shadowsocks Libev Client"
|
|
||||||
select PACKAGE_shadowsocks-libev-ss-local
|
|
||||||
select PACKAGE_shadowsocks-libev-ss-redir
|
|
||||||
default y
|
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Libev_Server
|
|
||||||
bool "Include Shadowsocks Libev Server"
|
|
||||||
select PACKAGE_shadowsocks-libev-ss-server
|
|
||||||
default y if aarch64||arm||i386||x86_64
|
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client
|
||||||
bool "Include Shadowsocks Rust Client"
|
bool "Include Shadowsocks Rust Client"
|
||||||
depends on !i386
|
depends on !i386
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
local api = require "luci.passwall.api"
|
local api = require "luci.passwall.api"
|
||||||
local uci = api.uci
|
local uci = api.uci
|
||||||
local appname = "passwall"
|
local appname = "passwall"
|
||||||
local has_ss = api.is_finded("ss-redir")
|
|
||||||
local has_ss_rust = api.is_finded("sslocal")
|
local has_ss_rust = api.is_finded("sslocal")
|
||||||
local has_singbox = api.finded_com("sing-box")
|
local has_singbox = api.finded_com("sing-box")
|
||||||
local has_xray = api.finded_com("xray")
|
local has_xray = api.finded_com("xray")
|
||||||
@@ -12,10 +11,6 @@ local vmess_type = {}
|
|||||||
local vless_type = {}
|
local vless_type = {}
|
||||||
local hysteria2_type = {}
|
local hysteria2_type = {}
|
||||||
local xray_version = api.get_app_version("xray")
|
local xray_version = api.get_app_version("xray")
|
||||||
if has_ss then
|
|
||||||
local s = "shadowsocks-libev"
|
|
||||||
table.insert(ss_type, s)
|
|
||||||
end
|
|
||||||
if has_ss_rust then
|
if has_ss_rust then
|
||||||
local s = "shadowsocks-rust"
|
local s = "shadowsocks-rust"
|
||||||
table.insert(ss_type, s)
|
table.insert(ss_type, s)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ end
|
|||||||
|
|
||||||
m:append(Template(appname .. "/cbi/nodes_listvalue_com"))
|
m:append(Template(appname .. "/cbi/nodes_listvalue_com"))
|
||||||
|
|
||||||
local has_ss = api.is_finded("ss-redir")
|
|
||||||
local has_ss_rust = api.is_finded("sslocal")
|
local has_ss_rust = api.is_finded("sslocal")
|
||||||
local has_singbox = api.finded_com("sing-box")
|
local has_singbox = api.finded_com("sing-box")
|
||||||
local has_xray = api.finded_com("xray")
|
local has_xray = api.finded_com("xray")
|
||||||
@@ -27,10 +26,6 @@ local vmess_type = {}
|
|||||||
local vless_type = {}
|
local vless_type = {}
|
||||||
local hysteria2_type = {}
|
local hysteria2_type = {}
|
||||||
local xray_version = api.get_app_version("xray")
|
local xray_version = api.get_app_version("xray")
|
||||||
if has_ss then
|
|
||||||
local s = "shadowsocks-libev"
|
|
||||||
table.insert(ss_type, s)
|
|
||||||
end
|
|
||||||
if has_ss_rust then
|
if has_ss_rust then
|
||||||
local s = "shadowsocks-rust"
|
local s = "shadowsocks-rust"
|
||||||
table.insert(ss_type, s)
|
table.insert(ss_type, s)
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
local m, s = ...
|
|
||||||
|
|
||||||
if not api.is_finded("ss-local") and not api.is_finded("ss-redir") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
type_name = "SS"
|
|
||||||
|
|
||||||
-- [[ Shadowsocks Libev ]]
|
|
||||||
|
|
||||||
s.fields["type"]:value(type_name, "Shadowsocks Libev")
|
|
||||||
|
|
||||||
if s.val["type"] ~= type_name then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local option_prefix = "ss_"
|
|
||||||
|
|
||||||
local function _n(name)
|
|
||||||
return option_prefix .. name
|
|
||||||
end
|
|
||||||
|
|
||||||
local ss_encrypt_method_list = {
|
|
||||||
"rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr",
|
|
||||||
"aes-192-ctr", "aes-256-ctr", "bf-cfb", "salsa20", "chacha20", "chacha20-ietf",
|
|
||||||
"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305",
|
|
||||||
"xchacha20-ietf-poly1305"
|
|
||||||
}
|
|
||||||
|
|
||||||
o = s:option(ListValue, _n("del_protocol")) --始终隐藏,用于删除 protocol
|
|
||||||
o:depends({ [_n("__hide")] = "1" })
|
|
||||||
o.rewrite_option = "protocol"
|
|
||||||
|
|
||||||
o = s:option(Value, _n("address"), translate("Address (Support Domain Name)"))
|
|
||||||
|
|
||||||
o = s:option(Value, _n("port"), translate("Port"))
|
|
||||||
o.datatype = "port"
|
|
||||||
|
|
||||||
o = s:option(Value, _n("password"), translate("Password"))
|
|
||||||
o.password = true
|
|
||||||
|
|
||||||
o = s:option(Value, _n("method"), translate("Encrypt Method"))
|
|
||||||
for a, t in ipairs(ss_encrypt_method_list) do o:value(t) end
|
|
||||||
|
|
||||||
o = s:option(Value, _n("timeout"), translate("Connection Timeout"))
|
|
||||||
o.datatype = "uinteger"
|
|
||||||
o.default = 300
|
|
||||||
|
|
||||||
o = s:option(Flag, _n("tcp_fast_open"), "TCP " .. translate("Fast Open"), translate("Need node support required"))
|
|
||||||
o.default = 0
|
|
||||||
|
|
||||||
o = s:option(Flag, _n("plugin_enabled"), translate("plugin"))
|
|
||||||
o.default = 0
|
|
||||||
|
|
||||||
o = s:option(ListValue, _n("plugin"), "SIP003 " .. translate("plugin"))
|
|
||||||
o.default = "none"
|
|
||||||
o:value("none", translate("none"))
|
|
||||||
if api.is_finded("xray-plugin") then o:value("xray-plugin") end
|
|
||||||
if api.is_finded("v2ray-plugin") then o:value("v2ray-plugin") end
|
|
||||||
if api.is_finded("obfs-local") then o:value("obfs-local") end
|
|
||||||
o:depends({ [_n("plugin_enabled")] = true })
|
|
||||||
|
|
||||||
o = s:option(Value, _n("plugin_opts"), translate("opts"))
|
|
||||||
o:depends({ [_n("plugin_enabled")] = true })
|
|
||||||
|
|
||||||
api.luci_types(arg[1], m, s, type_name, option_prefix)
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
local m, s = ...
|
|
||||||
|
|
||||||
local api = require "luci.passwall.api"
|
|
||||||
|
|
||||||
if not api.is_finded("ss-server") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local type_name = "SS"
|
|
||||||
|
|
||||||
local option_prefix = "ss_"
|
|
||||||
|
|
||||||
local function _n(name)
|
|
||||||
return option_prefix .. name
|
|
||||||
end
|
|
||||||
|
|
||||||
local ss_encrypt_method_list = {
|
|
||||||
"rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr",
|
|
||||||
"aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb",
|
|
||||||
"camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20",
|
|
||||||
"chacha20-ietf", -- aead
|
|
||||||
"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305",
|
|
||||||
"xchacha20-ietf-poly1305"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- [[ Shadowsocks ]]
|
|
||||||
|
|
||||||
s.fields["type"]:value(type_name, translate("Shadowsocks"))
|
|
||||||
|
|
||||||
o = s:option(Flag, _n("custom"), translate("Use Custom Config"))
|
|
||||||
|
|
||||||
o = s:option(Value, _n("port"), translate("Listen Port"))
|
|
||||||
o.datatype = "port"
|
|
||||||
o:depends({ [_n("custom")] = false })
|
|
||||||
|
|
||||||
o = s:option(Value, _n("password"), translate("Password"))
|
|
||||||
o.password = true
|
|
||||||
o:depends({ [_n("custom")] = false })
|
|
||||||
|
|
||||||
o = s:option(ListValue, _n("method"), translate("Encrypt Method"))
|
|
||||||
for a, t in ipairs(ss_encrypt_method_list) do o:value(t) end
|
|
||||||
o:depends({ [_n("custom")] = false })
|
|
||||||
|
|
||||||
o = s:option(Value, _n("timeout"), translate("Connection Timeout"))
|
|
||||||
o.datatype = "uinteger"
|
|
||||||
o.default = 300
|
|
||||||
o:depends({ [_n("custom")] = false })
|
|
||||||
|
|
||||||
o = s:option(Flag, _n("tcp_fast_open"), "TCP " .. translate("Fast Open"))
|
|
||||||
o.default = "0"
|
|
||||||
o:depends({ [_n("custom")] = false })
|
|
||||||
|
|
||||||
o = s:option(TextValue, _n("custom_config"), translate("Custom Config"))
|
|
||||||
o.rows = 10
|
|
||||||
o.wrap = "off"
|
|
||||||
o:depends({ [_n("custom")] = true })
|
|
||||||
o.validate = function(self, value, t)
|
|
||||||
if value and api.jsonc.parse(value) then
|
|
||||||
return value
|
|
||||||
else
|
|
||||||
return nil, translate("Custom Config") .. " " .. translate("Must be JSON text!")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
o.custom_cfgvalue = function(self, section, value)
|
|
||||||
local config_str = m:get(section, "config_str")
|
|
||||||
if config_str then
|
|
||||||
return api.base64Decode(config_str)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
o.custom_write = function(self, section, value)
|
|
||||||
m:set(section, "config_str", api.base64Encode(value) or "")
|
|
||||||
end
|
|
||||||
|
|
||||||
o = s:option(Flag, _n("log"), translate("Log"))
|
|
||||||
o.default = "1"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
api.luci_types(arg[1], m, s, type_name, option_prefix)
|
|
||||||
@@ -132,7 +132,7 @@ local function start()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
bin = ln_run("/usr/bin/microsocks", "microsocks_" .. id, string.format("-i :: -p %s %s", port, auth), log_path)
|
bin = ln_run("/usr/bin/microsocks", "microsocks_" .. id, string.format("-i :: -p %s %s", port, auth), log_path)
|
||||||
elseif type == "SS" or type == "SSR" then
|
elseif type == "SSR" then
|
||||||
if user.custom == "1" and user.config_str then
|
if user.custom == "1" and user.config_str then
|
||||||
config = jsonc.parse(api.base64Decode(user.config_str))
|
config = jsonc.parse(api.base64Decode(user.config_str))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -80,11 +80,7 @@ function gen_config(var)
|
|||||||
tcp_tproxy = var["tcp_tproxy"] and true or nil
|
tcp_tproxy = var["tcp_tproxy"] and true or nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if node.type == "SS" then
|
if node.type == "SSR" then
|
||||||
config.plugin = plugin_file or nil
|
|
||||||
config.plugin_opts = (plugin_file) and node.plugin_opts or nil
|
|
||||||
config.mode = mode
|
|
||||||
elseif node.type == "SSR" then
|
|
||||||
config.protocol = node.protocol
|
config.protocol = node.protocol
|
||||||
config.protocol_param = node.protocol_param
|
config.protocol_param = node.protocol_param
|
||||||
config.obfs = node.obfs
|
config.obfs = node.obfs
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ local api = require "luci.passwall.api"
|
|||||||
local appname = api.appname
|
local appname = api.appname
|
||||||
local map = self.map
|
local map = self.map
|
||||||
|
|
||||||
local has_ss = api.is_finded("ss-redir")
|
|
||||||
local has_ss_rust = api.is_finded("sslocal")
|
local has_ss_rust = api.is_finded("sslocal")
|
||||||
local has_singbox = api.finded_com("sing-box")
|
local has_singbox = api.finded_com("sing-box")
|
||||||
local has_xray = api.finded_com("xray")
|
local has_xray = api.finded_com("xray")
|
||||||
local has_hysteria2 = api.finded_com("hysteria")
|
local has_hysteria2 = api.finded_com("hysteria")
|
||||||
|
|
||||||
local ss_type = api.get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
local ss_type = api.get_core("ss_type", {{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||||
local trojan_type = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
local trojan_type = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||||
local vmess_type = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
local vmess_type = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||||
local vless_type = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
local vless_type = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||||
@@ -165,10 +164,7 @@ local current_node = map:get(section)
|
|||||||
|
|
||||||
var dom_prefix = null
|
var dom_prefix = null
|
||||||
var protocol = ""
|
var protocol = ""
|
||||||
if (v_type === "SS") {
|
if (v_type === "SS-Rust") {
|
||||||
dom_prefix = "ss_"
|
|
||||||
protocol = "ss"
|
|
||||||
} else if (v_type === "SS-Rust") {
|
|
||||||
dom_prefix = "ssrust_"
|
dom_prefix = "ssrust_"
|
||||||
protocol = "ss"
|
protocol = "ss"
|
||||||
} else if (v_type === "SSR") {
|
} else if (v_type === "SSR") {
|
||||||
@@ -196,7 +192,7 @@ local current_node = map:get(section)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var url = null;
|
var url = null;
|
||||||
if (v_type === "SS" || v_type === "SS-Rust" || ((v_type === "sing-box" || v_type === "Xray") && opt.get(dom_prefix + "protocol").value === "shadowsocks")) {
|
if (v_type === "SS-Rust" || ((v_type === "sing-box" || v_type === "Xray") && opt.get(dom_prefix + "protocol").value === "shadowsocks")) {
|
||||||
protocol = "ss"
|
protocol = "ss"
|
||||||
var v_port = opt.get(dom_prefix + "port");
|
var v_port = opt.get(dom_prefix + "port");
|
||||||
var v_method = opt.get(dom_prefix + "method") || opt.get(dom_prefix + "ss_method");
|
var v_method = opt.get(dom_prefix + "method") || opt.get(dom_prefix + "ss_method");
|
||||||
@@ -1000,17 +996,9 @@ local current_node = map:get(section)
|
|||||||
dom_prefix = "singbox_"
|
dom_prefix = "singbox_"
|
||||||
opt.set('type', "sing-box");
|
opt.set('type', "sing-box");
|
||||||
opt.set(dom_prefix + 'protocol', "shadowsocks");
|
opt.set(dom_prefix + 'protocol', "shadowsocks");
|
||||||
} else if (ss_type == "shadowsocks-rust") {
|
} else {
|
||||||
dom_prefix = "ssrust_"
|
dom_prefix = "ssrust_"
|
||||||
opt.set('type', "SS-Rust");
|
opt.set('type', "SS-Rust");
|
||||||
} else {
|
|
||||||
if (["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"].includes(method)) {
|
|
||||||
dom_prefix = "ssrust_"
|
|
||||||
opt.set('type', "SS-Rust");
|
|
||||||
} else {
|
|
||||||
dom_prefix = "ss_"
|
|
||||||
opt.set('type', "SS");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const _method = (method || "none").toLowerCase();
|
const _method = (method || "none").toLowerCase();
|
||||||
|
|||||||
@@ -463,17 +463,6 @@ run_socks() {
|
|||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||||
[ -n "$no_run" ] || ln_run "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u
|
[ -n "$no_run" ] || ln_run "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u
|
||||||
;;
|
;;
|
||||||
ss)
|
|
||||||
[ -n "$no_run" ] || {
|
|
||||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
|
||||||
json_add_string "plugin_sh" "$plugin_sh"
|
|
||||||
}
|
|
||||||
json_add_string "local_addr" "$bind"
|
|
||||||
json_add_string "local_port" "$socks_port"
|
|
||||||
json_add_string "mode" "tcp_and_udp"
|
|
||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
|
||||||
[ -n "$no_run" ] || ln_run "$(first_type ss-local)" "ss-local" $log_file -c "$config_file" -v
|
|
||||||
;;
|
|
||||||
ss-rust)
|
ss-rust)
|
||||||
[ "$http_port" != "0" ] && {
|
[ "$http_port" != "0" ] && {
|
||||||
http_flag=1
|
http_flag=1
|
||||||
@@ -632,15 +621,6 @@ run_redir() {
|
|||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||||
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v -U
|
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v -U
|
||||||
;;
|
;;
|
||||||
ss)
|
|
||||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
|
||||||
json_add_string "plugin_sh" "$plugin_sh"
|
|
||||||
json_add_string "local_addr" "0.0.0.0"
|
|
||||||
json_add_string "local_port" "$local_port"
|
|
||||||
json_add_string "mode" "udp_only"
|
|
||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
|
||||||
ln_run "$(first_type ss-redir)" "ss-redir" $log_file -c "$config_file" -v
|
|
||||||
;;
|
|
||||||
ss-rust)
|
ss-rust)
|
||||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
local plugin_sh="${config_file%.json}_plugin.sh"
|
||||||
json_add_string "plugin_sh" "$plugin_sh"
|
json_add_string "plugin_sh" "$plugin_sh"
|
||||||
@@ -889,23 +869,6 @@ run_redir() {
|
|||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
||||||
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v ${_extra_param}
|
ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v ${_extra_param}
|
||||||
;;
|
;;
|
||||||
ss)
|
|
||||||
[ "${TCP_PROXY_WAY}" = "tproxy" ] && json_add_string "tcp_tproxy" "true"
|
|
||||||
if [ "$TCP_UDP" = "1" ]; then
|
|
||||||
config_file="${config_file//TCP/TCP_UDP}"
|
|
||||||
UDP_REDIR_PORT=$TCP_REDIR_PORT
|
|
||||||
unset UDP_NODE
|
|
||||||
json_add_string "mode" "tcp_and_udp"
|
|
||||||
else
|
|
||||||
json_add_string "mode" "tcp_only"
|
|
||||||
fi
|
|
||||||
local plugin_sh="${config_file%.json}_plugin.sh"
|
|
||||||
json_add_string "plugin_sh" "$plugin_sh"
|
|
||||||
json_add_string "local_addr" "0.0.0.0"
|
|
||||||
json_add_string "local_port" "$local_port"
|
|
||||||
lua $UTIL_SS gen_config "$(json_dump)" > $config_file
|
|
||||||
ln_run "$(first_type ss-redir)" "ss-redir" $log_file -c "$config_file" -v
|
|
||||||
;;
|
|
||||||
ss-rust)
|
ss-rust)
|
||||||
json_add_string "local_tcp_redir_port" "$local_port"
|
json_add_string "local_tcp_redir_port" "$local_port"
|
||||||
[ "${TCP_PROXY_WAY}" = "tproxy" ] && json_add_string "tcp_tproxy" "true"
|
[ "${TCP_PROXY_WAY}" = "tproxy" ] && json_add_string "tcp_tproxy" "true"
|
||||||
@@ -2040,8 +2003,8 @@ get_config() {
|
|||||||
FILTER_PROXY_IPV6=$(config_t_get global filter_proxy_ipv6 0)
|
FILTER_PROXY_IPV6=$(config_t_get global filter_proxy_ipv6 0)
|
||||||
DNS_REDIRECT=$(config_t_get global dns_redirect 1)
|
DNS_REDIRECT=$(config_t_get global dns_redirect 1)
|
||||||
|
|
||||||
REDIRECT_LIST="socks ss ss-rust ssr sing-box xray naiveproxy hysteria2"
|
REDIRECT_LIST="socks ss-rust ssr sing-box xray naiveproxy hysteria2"
|
||||||
TPROXY_LIST="socks ss ss-rust ssr sing-box xray hysteria2"
|
TPROXY_LIST="socks ss-rust ssr sing-box xray hysteria2"
|
||||||
|
|
||||||
NEXT_DNS_LISTEN_PORT=15353
|
NEXT_DNS_LISTEN_PORT=15353
|
||||||
TUN_DNS="127.0.0.1#${NEXT_DNS_LISTEN_PORT}"
|
TUN_DNS="127.0.0.1#${NEXT_DNS_LISTEN_PORT}"
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ local UrlDecode = api.UrlDecode
|
|||||||
local uci = api.uci
|
local uci = api.uci
|
||||||
local fs = api.fs
|
local fs = api.fs
|
||||||
|
|
||||||
local has_ss = api.is_finded("ss-redir")
|
|
||||||
local has_ss_rust = api.is_finded("sslocal")
|
local has_ss_rust = api.is_finded("sslocal")
|
||||||
local has_ssr = api.is_finded("ssr-local") and api.is_finded("ssr-redir")
|
local has_ssr = api.is_finded("ssr-local") and api.is_finded("ssr-redir")
|
||||||
local has_singbox = api.finded_com("sing-box")
|
local has_singbox = api.finded_com("sing-box")
|
||||||
@@ -35,7 +34,7 @@ local DEFAULT_FILTER_KEYWORD_MODE = uci:get(appname, "@global_subscribe[0]", "fi
|
|||||||
local DEFAULT_FILTER_KEYWORD_DISCARD_LIST = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
|
local DEFAULT_FILTER_KEYWORD_DISCARD_LIST = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
|
||||||
local DEFAULT_FILTER_KEYWORD_KEEP_LIST = uci:get(appname, "@global_subscribe[0]", "filter_keep_list") or {}
|
local DEFAULT_FILTER_KEYWORD_KEEP_LIST = uci:get(appname, "@global_subscribe[0]", "filter_keep_list") or {}
|
||||||
-- 取节点使用core类型(节点订阅页面未设置时,自动取默认)
|
-- 取节点使用core类型(节点订阅页面未设置时,自动取默认)
|
||||||
local DEFAULT_SS_TYPE = api.get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
local DEFAULT_SS_TYPE = api.get_core("ss_type", {{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||||
local DEFAULT_TROJAN_TYPE = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
local DEFAULT_TROJAN_TYPE = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||||
local DEFAULT_VMESS_TYPE = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
local DEFAULT_VMESS_TYPE = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||||
local DEFAULT_VLESS_TYPE = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
local DEFAULT_VLESS_TYPE = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||||
@@ -43,7 +42,6 @@ local DEFAULT_HYSTERIA2_TYPE = api.get_core("hysteria2_type", {{has_hysteria2,"h
|
|||||||
local core_has = {
|
local core_has = {
|
||||||
["xray"] = has_xray,
|
["xray"] = has_xray,
|
||||||
["sing-box"] = has_singbox,
|
["sing-box"] = has_singbox,
|
||||||
["shadowsocks-libev"] = has_ss,
|
|
||||||
["shadowsocks-rust"] = has_ss_rust,
|
["shadowsocks-rust"] = has_ss_rust,
|
||||||
["hysteria2"] = has_hysteria2
|
["hysteria2"] = has_hysteria2
|
||||||
}
|
}
|
||||||
@@ -482,9 +480,7 @@ end
|
|||||||
|
|
||||||
-- 设置 ss 协议实现类型
|
-- 设置 ss 协议实现类型
|
||||||
local function set_ss_implementation(ss_type, result)
|
local function set_ss_implementation(ss_type, result)
|
||||||
if ss_type == "shadowsocks-libev" and has_ss then
|
if ss_type == "shadowsocks-rust" and has_ss_rust then
|
||||||
result.type = "SS"
|
|
||||||
elseif ss_type == "shadowsocks-rust" and has_ss_rust then
|
|
||||||
result.type = 'SS-Rust'
|
result.type = 'SS-Rust'
|
||||||
elseif ss_type == "xray" and has_xray then
|
elseif ss_type == "xray" and has_xray then
|
||||||
result.type = 'Xray'
|
result.type = 'Xray'
|
||||||
@@ -835,20 +831,6 @@ local function processData(szType, content, add_mode, group, sub_cfg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if result.type == "SS" then
|
|
||||||
local aead2022_methods = { "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" }
|
|
||||||
local aead2022 = false
|
|
||||||
for k, v in ipairs(aead2022_methods) do
|
|
||||||
if method:lower() == v:lower() then
|
|
||||||
aead2022 = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if aead2022 then
|
|
||||||
-- shadowsocks-libev 不支持2022加密
|
|
||||||
result.error_msg = "shadowsocks-libev 不支持2022加密。"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if params.type then
|
if params.type then
|
||||||
params.type = string.lower(params.type)
|
params.type = string.lower(params.type)
|
||||||
if result.type == "sing-box" and params.type == "raw" then
|
if result.type == "sing-box" and params.type == "raw" then
|
||||||
@@ -862,7 +844,7 @@ local function processData(szType, content, add_mode, group, sub_cfg)
|
|||||||
else
|
else
|
||||||
result.transport = params.type
|
result.transport = params.type
|
||||||
end
|
end
|
||||||
if result.type ~= "SS-Rust" and result.type ~= "SS" then
|
if result.type ~= "SS-Rust" then
|
||||||
if params.type == 'ws' then
|
if params.type == 'ws' then
|
||||||
result.ws_host = params.host
|
result.ws_host = params.host
|
||||||
result.ws_path = params.path
|
result.ws_path = params.path
|
||||||
|
|||||||
Reference in new issue
Block a user