From 8e9d1ba88ef3844d69ddb3483c6bc8786ef8aa7e Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Mon, 29 Jan 2024 02:16:49 +0800 Subject: [PATCH] luci: drop Brook Don't want to maintain too many Go application, please use Socks. --- luci-app-passwall/Makefile | 6 - .../model/cbi/passwall/client/type/brook.lua | 40 ----- .../cbi/passwall/client/type/trojan-go.lua | 119 ------------- .../model/cbi/passwall/server/type/brook.lua | 41 ----- .../cbi/passwall/server/type/trojan-go.lua | 159 ------------------ luci-app-passwall/luasrc/passwall/com.lua | 11 -- .../luasrc/passwall/server_app.lua | 9 - .../passwall/node_list/link_share_man.htm | 87 ---------- luci-app-passwall/po/zh-cn/passwall.po | 6 - .../root/usr/share/passwall/0_default_config | 1 - .../root/usr/share/passwall/app.sh | 38 +---- 11 files changed, 1 insertion(+), 516 deletions(-) delete mode 100644 luci-app-passwall/luasrc/model/cbi/passwall/client/type/brook.lua delete mode 100644 luci-app-passwall/luasrc/model/cbi/passwall/client/type/trojan-go.lua delete mode 100644 luci-app-passwall/luasrc/model/cbi/passwall/server/type/brook.lua delete mode 100644 luci-app-passwall/luasrc/model/cbi/passwall/server/type/trojan-go.lua diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 1e3f9001e..95b54f750 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -12,7 +12,6 @@ PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Brook \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy \ @@ -67,11 +66,6 @@ config PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy depends on PACKAGE_$(PKG_NAME) default y if PACKAGE_firewall4 -config PACKAGE_$(PKG_NAME)_INCLUDE_Brook - bool "Include Brook" - select PACKAGE_brook - default n - config PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy bool "Include Haproxy" select PACKAGE_haproxy diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/brook.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/brook.lua deleted file mode 100644 index 9755ca6ae..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/brook.lua +++ /dev/null @@ -1,40 +0,0 @@ -local m, s = ... - -local api = require "luci.passwall.api" - -if not api.finded_com("brook") then - return -end - -local type_name = "Brook" - -local option_prefix = "brook_" - -local function option_name(name) - return option_prefix .. name -end - --- [[ Brook ]] - -s.fields["type"]:value(type_name, translate("Brook")) - -o = s:option(ListValue, option_name("protocol"), translate("Protocol")) -o:value("client", translate("Brook")) -o:value("wsclient", translate("WebSocket")) - -o = s:option(Value, option_name("address"), translate("Address (Support Domain Name)")) - -o = s:option(Value, option_name("port"), translate("Port")) -o.datatype = "port" - -o = s:option(Value, option_name("ws_path"), translate("WebSocket Path")) -o.placeholder = "/" -o:depends({ [option_name("protocol")] = "wsclient" }) - -o = s:option(Flag, option_name("tls"), translate("Use TLS")) -o:depends({ [option_name("protocol")] = "wsclient" }) - -o = s:option(Value, option_name("password"), translate("Password")) -o.password = true - -api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/trojan-go.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/trojan-go.lua deleted file mode 100644 index 5e1e3d63f..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/trojan-go.lua +++ /dev/null @@ -1,119 +0,0 @@ -local m, s = ... - -local api = require "luci.passwall.api" - -if not api.finded_com("trojan-go") then - return -end - -local type_name = "Trojan-Go" - -local option_prefix = "trojan_go_" - -local function option_name(name) - return option_prefix .. name -end - -local encrypt_methods_ss_aead = { - "chacha20-ietf-poly1305", - "aes-128-gcm", - "aes-256-gcm", -} - --- [[ Trojan Go ]] - -s.fields["type"]:value(type_name, "Trojan-Go") - -o = s:option(Value, option_name("address"), translate("Address (Support Domain Name)")) - -o = s:option(Value, option_name("port"), translate("Port")) -o.datatype = "port" - -o = s:option(Value, option_name("password"), translate("Password")) -o.password = true - -o = s:option(ListValue, option_name("tcp_fast_open"), "TCP " .. translate("Fast Open"), translate("Need node support required")) -o:value("false") -o:value("true") - -o = s:option(Flag, option_name("tls"), translate("TLS")) -o.default = 1 - -o = s:option(Flag, option_name("tls_allowInsecure"), translate("allowInsecure"), translate("Whether unsafe connections are allowed. When checked, Certificate validation will be skipped.")) -o.default = "0" -o:depends({ [option_name("tls")] = true }) - -o = s:option(Value, option_name("tls_serverName"), translate("Domain")) -o:depends({ [option_name("tls")] = true }) - -o = s:option(Flag, option_name("tls_sessionTicket"), translate("Session Ticket")) -o.default = "0" -o:depends({ [option_name("tls")] = true }) - -o = s:option(ListValue, option_name("fingerprint"), translate("Finger Print")) -o:value("disable", translate("Disable")) -o:value("firefox") -o:value("chrome") -o:value("ios") -o.default = "disable" -o:depends({ [option_name("tls")] = true }) - -o = s:option(ListValue, option_name("transport"), translate("Transport")) -o:value("original", translate("Original")) -o:value("ws", "WebSocket") -o.default = "original" -o.rewrite_option = "trojan_transport" - -o = s:option(ListValue, option_name("plugin_type"), translate("Transport Plugin")) -o:value("plaintext", "Plain Text") -o:value("shadowsocks", "ShadowSocks") -o:value("other", "Other") -o.default = "plaintext" -o:depends({ [option_name("tls")] = false, [option_name("transport")] = "original" }) - -o = s:option(Value, option_name("plugin_cmd"), translate("Plugin Binary")) -o.placeholder = "eg: /usr/bin/v2ray-plugin" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(Value, option_name("plugin_option"), translate("Plugin Option")) -o.placeholder = "eg: obfs=http;obfs-host=www.baidu.com" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(DynamicList, option_name("plugin_arg"), translate("Plugin Option Args")) -o.placeholder = "eg: [\"-config\", \"test.json\"]" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(Value, option_name("ws_host"), translate("WebSocket Host")) -o:depends({ [option_name("transport")] = "ws" }) - -o = s:option(Value, option_name("ws_path"), translate("WebSocket Path")) -o.placeholder = "/" -o:depends({ [option_name("transport")] = "ws" }) - --- [[ Shadowsocks2 ]] -- -o = s:option(Flag, option_name("ss_aead"), translate("Shadowsocks secondary encryption")) -o.default = "0" - -o = s:option(ListValue, option_name("ss_aead_method"), translate("Encrypt Method")) -for _, v in ipairs(encrypt_methods_ss_aead) do o:value(v, v) end -o.default = "aes-128-gcm" -o:depends({ [option_name("ss_aead")] = true }) - -o = s:option(Value, option_name("ss_aead_pwd"), translate("Password")) -o.password = true -o:depends({ [option_name("ss_aead")] = true }) - -o = s:option(Flag, option_name("smux"), translate("Smux")) - -o = s:option(Value, option_name("mux_concurrency"), translate("Mux concurrency")) -o.default = 8 -o:depends({ [option_name("smux")] = true }) - -o = s:option(Value, option_name("smux_idle_timeout"), translate("Mux idle timeout")) -o.default = 60 -o:depends({ [option_name("smux")] = true }) - -api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/brook.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/brook.lua deleted file mode 100644 index ca7611620..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/brook.lua +++ /dev/null @@ -1,41 +0,0 @@ -local m, s = ... - -local api = require "luci.passwall.api" - -if not api.finded_com("brook") then - return -end - -local type_name = "Brook" - -local option_prefix = "brook_" - -local function option_name(name) - return option_prefix .. name -end - --- [[ Brook ]] - -s.fields["type"]:value(type_name, translate("Brook")) - -o = s:option(Value, option_name("port"), translate("Listen Port")) -o.datatype = "port" - -o = s:option(ListValue, option_name("protocol"), translate("Protocol")) -o:value("server", "Brook") -o:value("wsserver", "WebSocket") - ---o = s:option(Flag, option_name("tls"), translate("Use TLS")) ---o:depends({ [option_name("protocol")] = "wsserver" }) - -o = s:option(Value, option_name("password"), translate("Password")) -o.password = true - -o = s:option(Value, option_name("ws_path"), translate("WebSocket Path")) -o:depends({ [option_name("protocol")] = "wsserver" }) - -o = s:option(Flag, option_name("log"), translate("Log")) -o.default = "1" -o.rmempty = false - -api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/trojan-go.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/trojan-go.lua deleted file mode 100644 index 195fc2b20..000000000 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/trojan-go.lua +++ /dev/null @@ -1,159 +0,0 @@ -local m, s = ... - -local api = require "luci.passwall.api" - -if not api.finded_com("trojan-go") then - return -end - -local type_name = "Trojan-Go" - -local option_prefix = "trojan_go_" - -local function option_name(name) - return option_prefix .. name -end - -local encrypt_methods_ss_aead = { - "chacha20-ietf-poly1305", - "aes-128-gcm", - "aes-256-gcm", -} - --- [[ Trojan-Go ]] - -s.fields["type"]:value(type_name, "Trojan-Go") - -o = s:option(Value, option_name("port"), translate("Listen Port")) -o.datatype = "port" - -o = s:option(DynamicList, option_name("uuid"), translate("ID") .. "/" .. translate("Password")) -for i = 1, 3 do - o:value(api.gen_uuid(1)) -end - -o = s:option(Flag, option_name("tls"), translate("TLS")) -o.default = 0 -o.validate = function(self, value, t) - if value then - local type = s.fields["type"] and s.fields["type"]:formvalue(t) or "" - if value == "0" and type == type_name then - return nil, translate("Original Trojan only supported 'tls', please choose 'tls'.") - end - if value == "1" then - local ca = s.fields[option_name("tls_certificateFile")] and s.fields[option_name("tls_certificateFile")]:formvalue(t) or "" - local key = s.fields[option_name("tls_keyFile")] and s.fields[option_name("tls_keyFile")]:formvalue(t) or "" - if ca == "" or key == "" then - return nil, translate("Public key and Private key path can not be empty!") - end - end - return value - end -end - -o = s:option(FileUpload, option_name("tls_certificateFile"), translate("Public key absolute path"), translate("as:") .. "/etc/ssl/fullchain.pem") -o.default = m:get(s.section, "tls_certificateFile") or "/etc/config/ssl/" .. arg[1] .. ".pem" -o:depends({ [option_name("tls")] = true }) -o.validate = function(self, value, t) - if value and value ~= "" then - if not nixio.fs.access(value) then - return nil, translate("Can't find this file!") - else - return value - end - end - return nil -end - -o = s:option(FileUpload, option_name("tls_keyFile"), translate("Private key absolute path"), translate("as:") .. "/etc/ssl/private.key") -o.default = m:get(s.section, "tls_keyFile") or "/etc/config/ssl/" .. arg[1] .. ".key" -o:depends({ [option_name("tls")] = true }) -o.validate = function(self, value, t) - if value and value ~= "" then - if not nixio.fs.access(value) then - return nil, translate("Can't find this file!") - else - return value - end - end - return nil -end - -o = s:option(Flag, option_name("tls_sessionTicket"), translate("Session Ticket")) -o.default = "0" -o:depends({ [option_name("tls")] = true }) - -o = s:option(ListValue, option_name("transport"), translate("Transport")) -o:value("original", translate("Original")) -o:value("ws", "WebSocket") -o.default = "original" - -o = s:option(ListValue, option_name("plugin_type"), translate("Transport Plugin")) -o:value("plaintext", "Plain Text") -o:value("shadowsocks", "ShadowSocks") -o:value("other", "Other") -o.default = "plaintext" -o:depends({ [option_name("tls")] = false, [option_name("transport")] = "original" }) - -o = s:option(Value, option_name("plugin_cmd"), translate("Plugin Binary")) -o.placeholder = "eg: /usr/bin/v2ray-plugin" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(Value, option_name("plugin_option"), translate("Plugin Option")) -o.placeholder = "eg: obfs=http;obfs-host=www.baidu.com" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(DynamicList, option_name("plugin_arg"), translate("Plugin Option Args")) -o.placeholder = "eg: [\"-config\", \"test.json\"]" -o:depends({ [option_name("plugin_type")] = "shadowsocks" }) -o:depends({ [option_name("plugin_type")] = "other" }) - -o = s:option(Value, option_name("ws_host"), translate("WebSocket Host")) -o:depends({ [option_name("transport")] = "ws" }) - -o = s:option(Value, option_name("ws_path"), translate("WebSocket Path")) -o:depends({ [option_name("transport")] = "ws" }) - -o = s:option(Flag, option_name("ss_aead"), translate("Shadowsocks secondary encryption")) -o.default = "0" - -o = s:option(ListValue, option_name("ss_aead_method"), translate("Encrypt Method")) -for _, v in ipairs(encrypt_methods_ss_aead) do o:value(v, v) end -o.default = "aes-128-gcm" -o:depends({ [option_name("ss_aead")] = true }) - -o = s:option(Value, option_name("ss_aead_pwd"), translate("Password")) -o.password = true -o:depends({ [option_name("ss_aead")] = true }) - -o = s:option(Flag, option_name("tcp_fast_open"), translate("TCP Fast Open")) -o.default = "0" - -o = s:option(Flag, option_name("remote_enable"), translate("Enable Remote"), translate("You can forward to Nginx/Caddy/V2ray/Xray WebSocket and more.")) -o.default = "1" -o.rmempty = false - -o = s:option(Value, option_name("remote_address"), translate("Remote Address")) -o.default = "127.0.0.1" -o:depends({ [option_name("remote_enable")] = true }) - -o = s:option(Value, option_name("remote_port"), translate("Remote Port")) -o.datatype = "port" -o.default = "80" -o:depends({ [option_name("remote_enable")] = true }) - -o = s:option(Flag, option_name("log"), translate("Log")) -o.default = "1" - -o = s:option(ListValue, option_name("loglevel"), translate("Log Level")) -o.default = "2" -o:value("0", "all") -o:value("1", "info") -o:value("2", "warn") -o:value("3", "error") -o:value("4", "fatal") -o:depends({ [option_name("log")] = true }) - -api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/passwall/com.lua b/luci-app-passwall/luasrc/passwall/com.lua index 9e98b3784..0a77a0eef 100644 --- a/luci-app-passwall/luasrc/passwall/com.lua +++ b/luci-app-passwall/luasrc/passwall/com.lua @@ -8,17 +8,6 @@ local function gh_pre_release_url(self) return "https://api.github.com/repos/" .. self.repo .. "/releases?per_page=1" end -_M.brook = { - name = "Brook", - repo = "txthinking/brook", - get_url = gh_release_url, - cmd_version = "-v | awk '{print $3}'", - zipped = false, - default_path = "/usr/bin/brook", - match_fmt_str = "linux_%s$", - file_tree = {} -} - _M.hysteria = { name = "Hysteria", repo = "HyNetwork/hysteria", diff --git a/luci-app-passwall/luasrc/passwall/server_app.lua b/luci-app-passwall/luasrc/passwall/server_app.lua index 7d8d7ba64..0b667deda 100644 --- a/luci-app-passwall/luasrc/passwall/server_app.lua +++ b/luci-app-passwall/luasrc/passwall/server_app.lua @@ -155,15 +155,6 @@ local function start() elseif type == "Trojan-Go" then config = require(require_dir .. "util_trojan").gen_config_server(user) bin = ln_run(api.get_app_path("trojan-go"), "trojan-go", "-config " .. config_file, log_path) - elseif type == "Brook" then - local brook_protocol = user.protocol - local brook_password = user.password - local brook_path = user.ws_path or "/ws" - local brook_path_arg = "" - if brook_protocol == "wsserver" and brook_path then - brook_path_arg = " --path " .. brook_path - end - bin = ln_run(api.get_app_path("brook"), "brook_" .. id, string.format("--debug %s -l :%s -p %s%s", brook_protocol, port, brook_password, brook_path_arg), log_path) elseif type == "Hysteria2" then config = require(require_dir .. "util_hysteria2").gen_config_server(user) bin = ln_run(api.get_app_path("hysteria"), "hysteria", "-c " .. config_file .. " server", log_path) diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm index 762bb6e31..1577fb711 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/link_share_man.htm @@ -143,9 +143,6 @@ local api = require "luci.passwall.api" } else if (v_type === "Trojan-Go") { dom_prefix = "trojan_go_" protocol = "trojan-go" - } else if (v_type === "Brook") { - dom_prefix = "brook_" - protocol = "brook" } else if (v_type === "Hysteria2") { dom_prefix = "hysteria2_" protocol = "hysteria2" @@ -386,34 +383,6 @@ local api = require "luci.passwall.api" params = params.substring(1); } url += params; - } else if (v_type === "Brook") { - var url = ""; - var params = "?"; - var v_protocol = opt.get(dom_prefix + "protocol"); - var v_port = opt.get(dom_prefix + "port"); - var v_password = opt.get(dom_prefix + "password"); - var b_protocol_value = v_protocol.value.split('client').join('server'); - - var url_protocol = b_protocol_value; - params += opt.query("password", dom_prefix + "password"); - if (b_protocol_value == "wsserver") { - var server = ''; - var prefix = "ws://"; - if (opt.get(dom_prefix + "tls").checked) { - prefix = "wss://"; - url_protocol = 'wssserver'; - } - var v_path = opt.get(dom_prefix + "ws_path"); - var v_path_value = v_path.value || '/ws'; - if (v_path_value.length > 1 && v_path_value.indexOf('/') < 0) { - v_path_value = '/' + v_path_value; - } - params += "&" + url_protocol + "=" + encodeURIComponent(prefix + _address + ":" + v_port.value + v_path_value); - } else { - params += "&" + url_protocol + "=" + encodeURIComponent(_address + ":" + v_port.value); - } - url += url_protocol; - url += params; } else if ((v_type === "Hysteria2") || (v_type === "sing-box" && opt.get(dom_prefix + "protocol").value === "hysteria2")) { protocol = "hysteria2" var v_port = opt.get(dom_prefix + "port"); @@ -962,62 +931,6 @@ local api = require "luci.passwall.api" opt.set('remarks', decodeURI(m.hash.substr(1))); } } - if (ssu[0] === "brook") { - dom_prefix = "brook_" - var stype = "Brook"; - var m = parseNodeUrl(ssrurl); - - var from_protocol = m.host; - var protocol = from_protocol.split('server').join('client'); - - var queryParam = {}; - if (m.search.length > 1) { - var query = m.search.split('?'); - var queryParams = query[1]; - var queryArray = queryParams.split('&'); - var params; - for (i = 0; i < queryArray.length; i++) { - params = queryArray[i].split('='); - queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || ''); - } - } - - var password = queryParam.password; - if (password === "") { - s.innerHTML = "<%:Invalid Share URL Format%>"; - return false; - } - - opt.set('type', stype); - opt.set(dom_prefix + 'protocol', protocol); - opt.set(dom_prefix + 'password', password); - - if (protocol == 'wsclient' || protocol == 'wssclient') { - opt.set(dom_prefix + 'protocol', 'wsclient'); - var wsserver = queryParam[from_protocol].split('://'); - wsserver = wsserver[1].split('/'); - var path = wsserver[1] && '/' + wsserver[1] || '/ws'; - var server = wsserver[0].split(':'); - opt.set(dom_prefix + 'address', server[0]); - opt.set(dom_prefix + 'port', server[1]); - opt.set(dom_prefix + 'ws_path', path); - if (protocol == 'wssclient') { - opt.set(dom_prefix + 'tls', true); - } - } else { - var server = queryParam[from_protocol].split(':'); - if (server.length < 2) { - s.innerHTML = "<%:Invalid Share URL Format%>"; - return false; - } - opt.set(dom_prefix + 'address', server[0]); - opt.set(dom_prefix + 'port', server[1]); - } - - if (m.hash) { - opt.set('remarks', decodeURI(m.hash.substr(1))); - } - } if (ssu[0] === "hysteria2" || ssu[0] === "hy2") { var m = parseNodeUrl(ssrurl); var password = m.passwd; diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index b50916ada..7bc6bd8f1 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1120,12 +1120,6 @@ msgstr "插件名称" msgid "Plugin Arguments" msgstr "插件参数" -msgid "Brook Protocol" -msgstr "Brook协议" - -msgid "Use TLS" -msgstr "使用TLS" - msgid "Naiveproxy Protocol" msgstr "Naiveproxy协议" diff --git a/luci-app-passwall/root/usr/share/passwall/0_default_config b/luci-app-passwall/root/usr/share/passwall/0_default_config index 273fa34d4..1e0dcf3ef 100644 --- a/luci-app-passwall/root/usr/share/passwall/0_default_config +++ b/luci-app-passwall/root/usr/share/passwall/0_default_config @@ -76,7 +76,6 @@ config global_app option singbox_file '/usr/bin/sing-box' option xray_file '/usr/bin/xray' option trojan_go_file '/usr/bin/trojan-go' - option brook_file '/usr/bin/brook' option hysteria_file '/usr/bin/hysteria' option chinadns_ng '/usr/bin/chinadns-ng' diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index dd274ec40..b30411dd1 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -620,21 +620,6 @@ run_socks() { lua $UTIL_NAIVE gen_config -node $node -run_type socks -local_addr $bind -local_port $socks_port -server_host $server_host -server_port $port > $config_file ln_run "$(first_type naive)" naive $log_file "$config_file" ;; - brook) - local protocol=$(config_n_get $node protocol client) - local prefix="" - [ "$protocol" == "wsclient" ] && { - prefix="ws://" - local brook_tls=$(config_n_get $node brook_tls 0) - [ "$brook_tls" == "1" ] && { - prefix="wss://" - protocol="wssclient" - } - local ws_path=$(config_n_get $node ws_path "/ws") - } - server_host=${prefix}${server_host} - ln_run "$(first_type $(config_t_get global_app brook_file) brook)" "brook_SOCKS_${flag}" $log_file "$protocol" --socks5 "$bind:$socks_port" -s "${server_host}:${port}${ws_path}" -p "$(config_n_get $node password)" - ;; ssr) lua $UTIL_SS gen_config -node $node -local_addr "0.0.0.0" -local_port $socks_port -server_host $server_host -server_port $port > $config_file ln_run "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u @@ -746,14 +731,6 @@ run_redir() { naiveproxy) echolog "Naiveproxy不支持UDP转发!" ;; - brook) - local protocol=$(config_n_get $node protocol client) - if [ "$protocol" == "wsclient" ]; then - echolog "Brook的WebSocket不支持UDP转发!" - else - ln_run "$(first_type $(config_t_get global_app brook_file) brook)" "brook_UDP" $log_file tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" --doNotRunScripts - fi - ;; ssr) lua $UTIL_SS gen_config -node $node -local_addr "0.0.0.0" -local_port $local_port > $config_file ln_run "$(first_type ssr-redir)" "ssr-redir" $log_file -c "$config_file" -v -U @@ -923,19 +900,6 @@ run_redir() { lua $UTIL_NAIVE gen_config -node $node -run_type redir -local_addr "0.0.0.0" -local_port $local_port > $config_file ln_run "$(first_type naive)" naive $log_file "$config_file" ;; - brook) - local server_ip=$server_host - local protocol=$(config_n_get $node protocol client) - local prefix="" - [ "$protocol" == "wsclient" ] && { - prefix="ws://" - local brook_tls=$(config_n_get $node brook_tls 0) - [ "$brook_tls" == "1" ] && prefix="wss://" - local ws_path=$(config_n_get $node ws_path "/ws") - } - server_ip=${prefix}${server_ip} - ln_run "$(first_type $(config_t_get global_app brook_file) brook)" "brook_TCP" $log_file tproxy -l ":$local_port" -s "${server_ip}:${port}${ws_path}" -p "$(config_n_get $node password)" --doNotRunScripts - ;; ssr) [ "$tcp_proxy_way" = "tproxy" ] && lua_tproxy_arg="-tcp_tproxy true" [ "$TCP_UDP" = "1" ] && { @@ -1754,7 +1718,7 @@ FILTER_PROXY_IPV6=$(config_t_get global filter_proxy_ipv6 0) dns_listen_port=${DNS_PORT} REDIRECT_LIST="socks ss ss-rust ssr sing-box xray trojan-go trojan-plus naiveproxy hysteria2" -TPROXY_LIST="brook socks ss ss-rust ssr sing-box xray trojan-go trojan-plus hysteria2" +TPROXY_LIST="socks ss ss-rust ssr sing-box xray trojan-go trojan-plus hysteria2" RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto [ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/resolv.conf.auto