From c9995f5dbcbd739151e39c24cee088ff75495652 Mon Sep 17 00:00:00 2001 From: action Date: Sun, 23 Aug 2026 16:22:34 +0800 Subject: [PATCH] update 2026-08-23 16:22:34 --- .../model/cbi/passwall/client/global.lua | 5 +- .../model/cbi/passwall/client/haproxy.lua | 5 +- .../cbi/passwall/client/socks_config.lua | 2 +- .../view/passwall/node_list/node_list.htm | 38 +- luci-app-passwall/po/zh-cn/passwall.po | 6 + luci-app-passwall2/Makefile | 6 - .../luasrc/controller/passwall2.lua | 20 +- .../luasrc/model/cbi/passwall2/client/acl.lua | 21 +- .../model/cbi/passwall2/client/acl_config.lua | 138 +++-- .../model/cbi/passwall2/client/global.lua | 4 +- .../cbi/passwall2/client/node_subscribe.lua | 5 - .../client/node_subscribe_config.lua | 5 - .../model/cbi/passwall2/client/other.lua | 10 +- .../cbi/passwall2/client/type/5_hysteria2.lua | 106 ---- .../cbi/passwall2/server/type/5_hysteria2.lua | 143 ----- luci-app-passwall2/luasrc/passwall2/api.lua | 10 +- luci-app-passwall2/luasrc/passwall2/com.lua | 15 - .../luasrc/passwall2/server_app.lua | 7 - .../luasrc/passwall2/util_hysteria2.lua | 197 ------- .../luasrc/view/passwall2/global/footer.htm | 2 +- .../passwall2/node_config/link_share_man.htm | 59 +-- .../view/passwall2/rule/shunt_rule_list.htm | 20 +- luci-app-passwall2/po/fa/passwall2.po | 4 +- luci-app-passwall2/po/ru/passwall2.po | 4 +- luci-app-passwall2/po/zh-cn/passwall2.po | 4 +- luci-app-passwall2/po/zh-tw/passwall2.po | 4 +- .../root/etc/uci-defaults/luci-app-passwall2 | 35 -- .../root/usr/share/passwall2/0_default_config | 5 +- .../root/usr/share/passwall2/app.sh | 490 ++++-------------- .../root/usr/share/passwall2/app_acl.lua | 227 ++++++++ .../root/usr/share/passwall2/iptables.sh | 428 ++++++--------- .../root/usr/share/passwall2/monitor.sh | 4 +- .../root/usr/share/passwall2/nftables.sh | 441 ++++++---------- .../usr/share/passwall2/socks_auto_switch.sh | 2 +- .../root/usr/share/passwall2/subscribe.lua | 13 +- .../root/usr/share/passwall2/tasks.sh | 8 +- .../root/usr/share/passwall2/test.sh | 4 +- .../root/usr/share/passwall2/utils.sh | 22 +- 38 files changed, 841 insertions(+), 1678 deletions(-) delete mode 100644 luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/5_hysteria2.lua delete mode 100644 luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/5_hysteria2.lua delete mode 100644 luci-app-passwall2/luasrc/passwall2/util_hysteria2.lua create mode 100644 luci-app-passwall2/root/usr/share/passwall2/app_acl.lua diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 1c913bb9..10b6c869 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -149,7 +149,8 @@ end o = s:taboption("Main", Value, "node_socks_port", translate("Node") .. " Socks " .. translate("Listen Port")) o.default = 1070 -o.datatype = "port" +o.datatype = "range(1,65535)" +o.rmempty = false o:depends({ node = "", ["!reverse"] = true }) --[[ if has_singbox or has_xray then @@ -727,7 +728,7 @@ end) o = s2:option(Value, "port", "Socks " .. translate("Listen Port")) o.default = n + 1080 -o.datatype = "port" +o.datatype = "range(1,65535)" o.rmempty = false --[[ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua index 71b5bacc..8d8cdf92 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua @@ -46,8 +46,9 @@ o:depends("console_auth", true) ---- Console Port o = s:option(Value, "console_port", translate("Console Port"), translate("In the browser input routing IP plus port access, such as:192.168.1.1:1188")) -o.datatype = "port" o.default = 1188 +o.datatype = "range(1,65535)" +o.rmempty = false o:depends("balancing_enable", true) o = s:option(Flag, "bind_local", translate("Haproxy Port") .. " " .. translate("Bind Local"), translate("When selected, it can only be accessed localhost.")) @@ -151,8 +152,8 @@ end ---- Haproxy Port o = s:option(Value, "haproxy_port", translate("Haproxy Port")) -o.datatype = "port" o.default = 1181 +o.datatype = "range(1,65535)" o.rmempty = false ---- Node Weight diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua index b9707722..f4453447 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/socks_config.lua @@ -63,7 +63,7 @@ end) o = s:option(Value, "port", "Socks " .. translate("Listen Port")) o.default = n + 1080 -o.datatype = "port" +o.datatype = "range(1,65535)" o.rmempty = false if has_singbox or has_xray then diff --git a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index dc30ec04..2340e0b1 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -1215,11 +1215,15 @@ table td, .table .td { const set_node_div = { section: '', - open(cbi_id) { + open(cbi_id, protocol) { this.section = cbi_id; document.getElementById("set_node_div").style.display="block"; const node_name = document.getElementById("cbid.<%=appname%>." + cbi_id + ".remarks").value; document.getElementById("set_node_name").textContent = node_name; + const shunt_div = document.getElementById("set_node_shunt_div"); + if (shunt_div) { + shunt_div.style.display = protocol === "_shunt" ? "none" : ""; + } }, close() { document.getElementById("set_node_div").style.display="none"; @@ -1286,7 +1290,7 @@ table td, .table .td {
- + @@ -1432,6 +1436,7 @@ table td, .table .td { innerHTML = innerHTML.split("{{remarks_val}}").join(o["remarks"]); innerHTML = innerHTML.split("{{address_val}}").join(o["address"] || ""); innerHTML = innerHTML.split("{{port_val}}").join(o["port"] || ""); + innerHTML = innerHTML.split("{{protocol}}").join(o["protocol"] || ""); node_tr_html += innerHTML } @@ -1620,20 +1625,27 @@ table td, .table .td {
-
+
<%:You choose node is:%>
-
- <%- if default_node_type == "_shunt" then - for i, v in ipairs(shunt_rule_list) do - -%> - ')" value="<%=v.remarks%>" /> - <%- - end - -%> - <% else %> - +
+ + <% if default_node_type == "_shunt" then %> +
+ +
+ <% for i, v in ipairs(shunt_rule_list) do %> + ')" value="<%=v.remarks%>" /> + <% end %> + +
+
<% end %>
diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index dfd100fb..931cfb76 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -427,6 +427,12 @@ msgstr "你确定要删除选择的节点吗?" msgid "You no select nodes !" msgstr "你没有选择任何节点!" +msgid "Set as the main proxy node:" +msgstr "应用为主代理节点:" + +msgid "Set as the routing rule node:" +msgstr "应用为分流规则节点:" + msgid "Are you sure set this node?" msgstr "你确定要设置这个节点吗?" diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index 18590d9f..f208e3b4 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -14,7 +14,6 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy \ - CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client \ @@ -85,11 +84,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy select PACKAGE_haproxy default y if aarch64||arm||i386||x86_64 -config PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria - bool "Include Hysteria" - select PACKAGE_hysteria - default n - config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client bool "Include Shadowsocks Rust Client" depends on !i386 diff --git a/luci-app-passwall2/luasrc/controller/passwall2.lua b/luci-app-passwall2/luasrc/controller/passwall2.lua index c19167a4..ec153821 100644 --- a/luci-app-passwall2/luasrc/controller/passwall2.lua +++ b/luci-app-passwall2/luasrc/controller/passwall2.lua @@ -71,7 +71,6 @@ function index() entry({"admin", "services", appname, "get_now_use_node"}, call("get_now_use_node")).leaf = true entry({"admin", "services", appname, "get_redir_log"}, call("get_redir_log")).leaf = true entry({"admin", "services", appname, "get_socks_log"}, call("get_socks_log")).leaf = true - entry({"admin", "services", appname, "get_acl_log"}, call("get_acl_log")).leaf = true entry({"admin", "services", appname, "get_log"}, call("get_log")).leaf = true entry({"admin", "services", appname, "clear_log"}, call("clear_log")).leaf = true entry({"admin", "services", appname, "index_status"}, call("index_status")).leaf = true @@ -248,10 +247,9 @@ end function get_redir_log() local id = http.formvalue("id") - local name = http.formvalue("name") - local file_path = api.TMP_PATH .. "/acl/" .. id .. "/" .. name .. ".log" + local file_path = api.TMP_PATH .. "/acl/" .. id .. ".log" if nixio.fs.access(file_path) then - local content = luci.sys.exec("tail -n 19999 '" .. file_path .. "'") + local content = luci.sys.exec("tail -n 5000 '" .. file_path .. "'") content = content:gsub("\n", "
") http.write(content) else @@ -271,18 +269,6 @@ function get_socks_log() end end -function get_acl_log() - local id = http.formvalue("id") - local path = api.TMP_PATH .. "/acl/" .. id .. "/node.log" - if nixio.fs.access(path) then - local content = luci.sys.exec("tail -n 5000 '" .. path .. "'") - content = content:gsub("\n", "
") - http.write(content) - else - http.write(string.format("", i18n.translate("Not enabled log"))) - end -end - function get_log() -- luci.sys.exec("[ -f /tmp/log/passwall2.log ] && sed '1!G;h;$!d' /tmp/log/passwall2.log > /tmp/log/passwall2_show.log") http.write(luci.sys.exec("[ -f '/tmp/log/passwall2.log' ] && cat /tmp/log/passwall2.log")) @@ -294,7 +280,7 @@ end function index_status() local e = {} - e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '%s/bin/' | grep 'default' | grep 'global' >/dev/null" % api.TMP_PATH) == 0 + e["global_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '%s/bin/' | grep '/acl/default' >/dev/null" % api.TMP_PATH) == 0 http_write_json(e) end diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua index 49b5e9aa..2c00525d 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl.lua @@ -50,20 +50,11 @@ end o = s:option(DummyValue, "sources", translate("Source")) o.rawhtml = true -o.cfgvalue = function(t, n) - local e = '' - local v = Value.cfgvalue(t, n) or '-' - string.gsub(v, '[^' .. " " .. ']+', function(w) - local a = w - if mac_t[w] then - a = a .. ' (' .. mac_t[w].ip .. ')' - end - if #e > 0 then - e = e .. "
" - end - e = e .. a - end) - return e +o.cfgvalue = function(self, section) + local v = self.map:get(section, self.option) or {} + if type(v) == "table" then + return table.concat(v, "
") + end end i = s:option(DummyValue, "mode", translate("Mode")) @@ -71,6 +62,8 @@ i.cfgvalue = function(t, n) local v = Value.cfgvalue(t, n) or '0' if v == "1" then return translate("Proxy") + elseif v == "2" then + return translate("Proxy") .. " " .. translate("Use global config") end return translate("No Proxy") end diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua index cdf7870e..3c9cc084 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua @@ -98,25 +98,9 @@ sources.description = "
  • " .. translate("Example:") .. "
  • " .. translate("IP range") .. ": 192.168.1.100-192.168.1.200" .. "
  • " .. translate("IPSet") .. ": ipset:lanlist" .. "
" -sources.cast = "string" for _, key in pairs(mac_t) do sources:value(key.mac, "%s (%s)" % {key.mac, key.ip}) end - -sources.cfgvalue = function(self, section) - local value - if self.tag_error[section] then - value = self:formvalue(section) - else - value = self.map:get(section, self.option) - if type(value) == "string" then - local value2 = {} - string.gsub(value, '[^' .. " " .. ']+', function(w) table.insert(value2, w) end) - value = value2 - end - end - return value -end sources.validate = function(self, value, t) local err = {} for _, v in ipairs(value) do @@ -155,47 +139,75 @@ sources.validate = function(self, value, t) return value end +local NODE = m:get("@global[0]", "node") o = s:option(ListValue, "mode", translate("Mode")) o:value("0", translate("No Proxy")) o:value("1", translate("Proxy")) +o:value("2", translate("Proxy") .. " " .. translate("Use global config") .. "(" .. api.get_node_name(NODE) .. ")") ----- TCP No Redir Ports -local TCP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_no_redir_ports") o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) -o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")") -o:value("disable", translate("No patterns are used")) +o:value("", translate("No patterns are used")) o:value("1:65535", translate("All")) o:depends("mode", "1") +o:depends("mode", "2") o.validate = port_validate ----- UDP No Redir Ports -local UDP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_no_redir_ports") o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports")) -o:value("", translate("Use global config") .. "(" .. UDP_NO_REDIR_PORTS .. ")") -o:value("disable", translate("No patterns are used")) +o:value("", translate("No patterns are used")) o:value("1:65535", translate("All")) o:depends("mode", "1") +o:depends("mode", "2") o.validate = port_validate -o = s:option(DummyValue, "_hide_node_option", "") +o = s:option(DummyValue, "_show_tcp_redir", "") +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" +o:depends({ tcp_no_redir_ports = "1:65535", ['!reverse'] = true }) + +o = s:option(DummyValue, "_show_udp_redir", "") +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" +o:depends({ udp_no_redir_ports = "1:65535", ['!reverse'] = true }) + +o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports")) +o:value("1:65535", translate("All")) +o:value("22,25,53,80,143,443,465,587,853,873,993,995,5222,8080,8443,9418", translate("Common Use")) +o:value("80,443", "80,443") +o.default = o.keylist[1] +o.validate = port_validate +o:depends({ _node = "1", _show_tcp_redir = "1" }) +o:depends({ mode = "2", _show_tcp_redir = "1" }) + +o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports")) +o:value("1:65535", translate("All")) +o.default = o.keylist[1] +o.validate = port_validate +o:depends({ _node = "1", _show_udp_redir = "1" }) +o:depends({ mode = "2", _show_udp_redir = "1" }) + +o = s:option(DummyValue, "tips", " ") +o.rawhtml = true +o.cfgvalue = function(t, n) + return string.format('%s', + translate("The port settings support single ports and ranges.
Separate multiple ports with commas (,).
Example: 21,80,443,1000:2000.")) +end +o:depends("mode", "1") +o:depends("mode", "2") + +o = s:option(DummyValue, "_no_proxy", "") o.template = m:template_path("/cbi/hidevalue") o.value = "1" o:depends("mode", "0") o:depends({ tcp_no_redir_ports = "1:65535", udp_no_redir_ports = "1:65535" }) -if TCP_NO_REDIR_PORTS == "1:65535" and UDP_NO_REDIR_PORTS == "1:65535" then - o:depends({ tcp_no_redir_ports = "", udp_no_redir_ports = "" }) -end -local GLOBAL_ENABLED = m:get("@global[0]", "enabled") -local NODE = m:get("@global[0]", "node") +o = s:option(DummyValue, "_show_node_option", "") +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" +o:depends({ mode = "1", _no_proxy = "" }) + o = s:option(ListValue, "node", "" .. translate("Node") .. "") -if GLOBAL_ENABLED == "1" and NODE then - o:value("", translate("Use global config") .. "(" .. api.get_node_name(NODE) .. ")") - o.group = {""} -else - o.group = {} -end -o:depends({ _hide_node_option = "1", ['!reverse'] = true }) +o.group = {} +o:depends("_show_node_option", "1") o.template = m:template_path("/cbi/nodes_listvalue") current_node_id = o:formvalue(arg[1]) @@ -204,9 +216,14 @@ if not current_node_id then end current_node = current_node_id and m:get(current_node_id) or {} -o = s:option(Flag, "log", translate("Enable Node Log")) +o = s:option(DummyValue, "_node", "") +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" o:depends({ node = "", ['!reverse'] = true }) +o = s:option(Flag, "log", translate("Enable Node Log")) +o:depends("_node", "1") + o = s:option(ListValue, "loglevel", translate("Log Level")) o.default = "warn" o:value("debug", "Debug") @@ -218,8 +235,8 @@ o:depends("log", "1") o = s:option(DummyValue, "_acl_log", translate("Log File")) o.rawhtml = true o.cfgvalue = function(t, n) - local log_path = api.TMP_PATH .. "/acl/" .. arg[1] .. "/node.log" - local log_url = api.url("get_acl_log") .. "?id=" .. arg[1] + local log_path = api.TMP_PATH .. "/acl/" .. arg[1] .. ".log" + local log_url = api.url("get_redir_log") .. "?id=" .. arg[1] return string.format( '%s  ', log_path, @@ -229,46 +246,17 @@ o.cfgvalue = function(t, n) end o:depends("log", "1") ----- TCP Redir Ports -local TCP_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_redir_ports") -o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports")) -o:value("", translate("Use global config") .. "(" .. TCP_REDIR_PORTS .. ")") -o:value("1:65535", translate("All")) -o:value("22,25,53,80,143,443,465,587,853,873,993,995,5222,8080,8443,9418", translate("Common Use")) -o:value("80,443", "80,443") -o.validate = port_validate -o:depends({ _hide_node_option = "1", ['!reverse'] = true }) - ----- UDP Redir Ports -local UDP_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_redir_ports") -o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports")) -o:value("", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. ")") -o:value("1:65535", translate("All")) -o.validate = port_validate -o:depends({ _hide_node_option = "1", ['!reverse'] = true }) - -o = s:option(DummyValue, "tips", " ") -o.rawhtml = true -o.cfgvalue = function(t, n) - return string.format('%s', - translate("The port settings support single ports and ranges.
Separate multiple ports with commas (,).
Example: 21,80,443,1000:2000.")) -end -o:depends({ _hide_node_option = "1", ['!reverse'] = true }) - -o = s:option(DummyValue, "_hide_dns_option", "") +o = s:option(DummyValue, "_show_dns_option", "") o.template = m:template_path("/cbi/hidevalue") o.value = "1" -o:depends({ node = "" }) -if GLOBAL_ENABLED == "1" and NODE then - o:depends({ node = NODE }) -end +o:depends("_hide", "1") o = s:option(ListValue, "direct_dns_query_strategy", translate("Direct Query Strategy")) o.default = "UseIP" o:value("UseIP") o:value("UseIPv4") o:value("UseIPv6") -o:depends({ _hide_dns_option = "1", ['!reverse'] = true }) +o:depends("_show_dns_option", "1") o = s:option(ListValue, "remote_dns_protocol", translate("Remote DNS Protocol")) o:value("tcp", "TCP") @@ -279,7 +267,7 @@ if current_node.type == "sing-box" then o:value("quic", "QUIC(DoQ)") o:value("http3", "HTTP3(DoH3)") end -o:depends({ _hide_dns_option = "1", ['!reverse'] = true }) +o:depends("_show_dns_option", "1") ---- DNS over TCP or UDP or TLS (DoT) or QUIC (DoQ) o = s:option(Value, "remote_dns", translate("Remote DNS")) @@ -356,12 +344,13 @@ o:depends("remote_dns_protocol", "tls") o = s:option(Value, "remote_rewrite_ttl", translate("Remote DNS") .. " TTL") o.datatype = "min(1)" o.default = "30" +o:depends("_hide", "1") o = s:option(ListValue, "dns_hosts_mode", translate("Domain Override")) o:value("default", translate("Use global config")) o:value("disable", translate("No patterns are used")) o:value("custom", translate("-- custom --")) -o:depends({ _hide_dns_option = "1", ['!reverse'] = true }) +o:depends("_show_dns_option", "1") o = s:option(TextValue, "dns_hosts", translate("Domain Override")) o.rows = 5 @@ -385,6 +374,7 @@ for k, v in pairs(nodes_table) do if v.type == "sing-box" then s.fields["remote_rewrite_ttl"]:depends({ node = v.id }) end + s.fields["_show_dns_option"]:depends({ mode = "1", node = v.id }) if v.node_type == "normal" or v.protocol == "_balancing" or v.protocol == "_urltest" then --Shunt node has its own separate options. s.fields["remote_fakedns"]:depends({ node = v.id, remote_dns_protocol = "tcp" }) diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua index 3173579a..92e6c13e 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua @@ -282,8 +282,8 @@ loglevel:value("error") o = s:taboption("log", DummyValue, "_log", translate("Log File")) o.rawhtml = true o.cfgvalue = function(t, n) - local log_path = api.TMP_PATH .. "/acl/default/global.log" - local log_url = api.url("get_redir_log") .. "?id=default&name=global" + local log_path = api.TMP_PATH .. "/acl/default.log" + local log_url = api.url("get_redir_log") .. "?id=default" return string.format( '%s  ', log_path, diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe.lua index 4d401b0e..dd4ba20a 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe.lua @@ -4,7 +4,6 @@ api.set_default_cbi() local has_ss_rust = api.is_finded("sslocal") local has_singbox = api.finded_com("sing-box") local has_xray = api.finded_com("xray") -local has_hysteria2 = api.finded_com("hysteria") local ss_type = {} local trojan_type = {} local vmess_type = {} @@ -33,10 +32,6 @@ if has_xray then table.insert(hysteria2_type, s) end end -if has_hysteria2 then - local s = "hysteria2" - table.insert(hysteria2_type, s) -end m = Map() diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe_config.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe_config.lua index a748281d..2bc93b48 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe_config.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/node_subscribe_config.lua @@ -17,7 +17,6 @@ m:appendTemplate("/cbi/nodes_listvalue_com") local has_ss_rust = api.is_finded("sslocal") local has_singbox = api.finded_com("sing-box") local has_xray = api.finded_com("xray") -local has_hysteria2 = api.finded_com("hysteria") local ss_type = {} local trojan_type = {} local vmess_type = {} @@ -46,10 +45,6 @@ if has_xray then table.insert(hysteria2_type, s) end end -if has_hysteria2 then - local s = "hysteria2" - table.insert(hysteria2_type, s) -end local nodes_table = {} for k, e in ipairs(api.get_valid_nodes()) do if e.node_type == "normal" then diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua index f076e3c7..f622f076 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/other.lua @@ -72,8 +72,7 @@ s = m:section(NamedSection, "@global_forwarding[0]", "global_forwarding", transl ---- TCP No Redir Ports o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) -o.default = "disable" -o:value("disable", translate("No patterns are used")) +o:value("", translate("No patterns are used")) o:value("1:65535", translate("All")) o.validate = port_validate @@ -82,23 +81,22 @@ o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"), "" .. translate("Fill in the ports you don't want to be forwarded by the agent, with the highest priority.") .. "") -o.default = "disable" -o:value("disable", translate("No patterns are used")) +o:value("", translate("No patterns are used")) o:value("1:65535", translate("All")) o.validate = port_validate ---- TCP Redir Ports o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports")) -o.default = "22,25,53,80,143,443,465,587,853,873,993,995,5222,8080,8443,9418" o:value("1:65535", translate("All")) o:value("22,25,53,80,143,443,465,587,853,873,993,995,5222,8080,8443,9418", translate("Common Use")) o:value("80,443", translate("Only Web")) +o.default = o.keylist[1] o.validate = port_validate ---- UDP Redir Ports o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports")) -o.default = "1:65535" o:value("1:65535", translate("All")) +o.default = o.keylist[1] o.validate = port_validate o = s:option(DummyValue, "tips", " ") diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/5_hysteria2.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/5_hysteria2.lua deleted file mode 100644 index 753c748a..00000000 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/5_hysteria2.lua +++ /dev/null @@ -1,106 +0,0 @@ -if not api.finded_com("hysteria") then - return -end - --- [[ Hysteria2 ]] -local m, s1 = ... -local type_name = "Hysteria2" - -s1.fields["type"]:value(type_name, "Hysteria2") - -if s1.val["type"] ~= type_name then - return -end - -local s = NamedSection(m, arg[1], "server") -s.type_name = type_name -s.option_prefix = "hysteria2_" - -o = s:option(Value, "address", translate("Address (Support Domain Name)")) -o:depends({ realms = false }) - -o = s:option(Value, "port", translate("Port")) -o.datatype = "port" -o:depends({ realms = false }) - -o = s:option(Value, "hop", translate("Port hopping range")) -o.description = translate("Format as 1000:2000 or 1000-2000 Multiple groups are separated by commas (,).") -o:depends({ realms = false }) - -o = s:option(Value, "hop_interval", translate("Hop Interval(second)"), translate("Supports a fixed value or a random range (e.g., 30, 5-30), minimum 5.")) -o.datatype = "or(uinteger,portrange)" -o.placeholder = "30" -o.default = "30" -o:depends({ realms = false }) - -o = s:option(Flag, "realms", translate("Realms")) -o.default = "0" - -o = s:option(Value, "realm_url", translate("Realm URL"), translate("Example:") .. "realm://public@realm.hy2.io/your-realm-name") -o:depends({ realms = "1" }) -o.validate = function(self, value) - value = api.trim(value) - local realm = api.parse_realm_uri(value) - if realm then return value end - return nil, translate("Invalid Realm URL.") -end - -o = s:option(DynamicList, "realm_stun", translate("Realm STUN")) -o.default = { "stun.sip.us:3478", "stun.nextcloud.com:3478", "global.stun.twilio.com:3478" } -o:depends({ realms = "1" }) - -o = s:option(Value, "auth_password", translate("Auth Password")) -o.password = true - -o = s:option(ListValue, "obfs_type", translate("Obfs Type")) -o:value("", translate("Disable")) -o:value("salamander") -o:value("gecko") - -o = s:option(Value, "obfs_password", translate("Obfs Password")) -o:depends({ obfs_type = "salamander" }) -o:depends({ obfs_type = "gecko" }) - -o = s:option(Value, "obfs_MinPacketSize", translate("Gecko Packet Size (min)")) -o.datatype = "uinteger" -o.placeholder = "512" -o.default = "512" -o:depends({ obfs_type = "gecko" }) - -o = s:option(Value, "obfs_MaxPacketSize", translate("Gecko Packet Size (max)")) -o.datatype = "uinteger" -o.placeholder = "1200" -o.default = "1200" -o:depends({ obfs_type = "gecko" }) - -o = s:option(Flag, "fast_open", translate("Fast Open")) -o.default = "0" - -o = s:option(Value, "tls_serverName", translate("Domain")) - -o = s:option(Flag, "tls_allowInsecure", translate("allowInsecure"), translate("Whether unsafe connections are allowed. When checked, Certificate validation will be skipped.")) -o.default = "0" - -o = s:option(Value, "tls_pinSHA256", translate("PinSHA256"),translate("Certificate fingerprint")) - -o = s:option(Value, "up_mbps", translate("Max upload Mbps")) - -o = s:option(Value, "down_mbps", translate("Max download Mbps")) - -o = s:option(Value, "recv_window", translate("QUIC stream receive window")) - -o = s:option(Value, "recv_window_conn", translate("QUIC connection receive window")) - -o = s:option(Value, "idle_timeout", translate("Idle Timeout"), translate("Units:seconds") .. " (4~120)") -o.datatype = "range(4,120)" - -o = s:option(Value, "keep_alive_period", translate("QUIC KeepAlive interval"), translate("Units:seconds") .. " (2~60)") -o.datatype = "range(2,60)" - -o = s:option(Flag, "disable_mtu_discovery", translate("Disable MTU detection")) -o.default = "0" - -o = s:option(Flag, "lazy_start", translate("Lazy Start")) -o.default = "0" - -api.luci_types(s1, s) \ No newline at end of file diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/5_hysteria2.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/5_hysteria2.lua deleted file mode 100644 index bd6c5c1d..00000000 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/5_hysteria2.lua +++ /dev/null @@ -1,143 +0,0 @@ -if not api.finded_com("hysteria") then - return -end - --- [[ Hysteria2 ]] -local m, s1 = ... -local type_name = "Hysteria2" - -s1.fields["type"]:value(type_name, "Hysteria2") - -if not s1.val["type"] then - s1.val["type"] = type_name -end - -if s1.val["type"] and s1.val["type"] ~= type_name then - return -end - -local s = NamedSection(m, arg[1], "server") -s.type_name = type_name -s.option_prefix = "hysteria2_" - -o = s:option(Flag, "custom", translate("Use Custom Config")) - -o = s:option(TextValue, "custom_config", translate("Custom Config")) -o.rows = 10 -o.wrap = "off" -o:depends({ custom = true }) -o.datatype = "json" -local o_validate = o.validate -o.validate = function(self, value) - local v = o_validate(self, value) - if v then return v end - return nil, translate("Custom Config") .. " " .. translate("Must be JSON text!") -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(Value, "port", translate("Listen Port")) -o.datatype = "port" -o:depends({ custom = false }) - -o = s:option(DynamicList, "users", translate("User")) -for i, v in ipairs(user_list) do - o:value(v[".name"], v.username) -end -o:depends({ custom = false }) - -o = s:option(Flag, "realms", translate("Realms")) -o.default = "0" -o:depends({ custom = false }) - -o = s:option(Value, "realm_url", translate("Realm URL"), translate("Example:") .. "realm://public@realm.hy2.io/your-realm-name") -o:depends({ realms = true }) -o.validate = function(self, value) - value = api.trim(value) - local realm = api.parse_realm_uri(value) - if realm then return value end - return nil, translate("Invalid Realm URL.") -end - -o = s:option(DynamicList, "realm_stun", translate("Realm STUN")) -o.default = { "stun.sip.us:3478", "stun.nextcloud.com:3478", "global.stun.twilio.com:3478" } -o:depends({ realms = true }) - -o = s:option(ListValue, "obfs_type", translate("Obfs Type")) -o:value("", translate("Disable")) -o:value("salamander") -o:value("gecko") -o:depends({ custom = false }) - -o = s:option(Value, "obfs_password", translate("Obfs Password")) -o:depends({ obfs_type = "salamander" }) -o:depends({ obfs_type = "gecko" }) - -o = s:option(Value, "obfs_MinPacketSize", translate("Gecko Packet Size (min)")) -o.datatype = "uinteger" -o.placeholder = "512" -o.default = "512" -o:depends({ obfs_type = "gecko" }) - -o = s:option(Value, "obfs_MaxPacketSize", translate("Gecko Packet Size (max)")) -o.datatype = "uinteger" -o.placeholder = "1200" -o.default = "1200" -o:depends({ obfs_type = "gecko" }) - -o = s:option(Flag, "udp", translate("UDP")) -o.default = "1" -o:depends({ custom = false }) - -o = s:option(Value, "up_mbps", translate("Max upload Mbps")) -o:depends({ custom = false }) - -o = s:option(Value, "down_mbps", translate("Max download Mbps")) -o:depends({ custom = false }) - -o = s:option(Flag, "ignoreClientBandwidth", translate("ignoreClientBandwidth")) -o.default = "0" -o:depends({ custom = false }) - -o = s:option(FileUpload, "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" -if o and o:formvalue(arg[1]) then o.default = o:formvalue(arg[1]) end -o.validate = function(self, value, t) - if value and value ~= "" then - if not api.fs.access(value) then - return nil, translate("Can't find this file!") - else - return value - end - end - return nil -end -o:depends({ custom = false }) - -o = s:option(FileUpload, "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" -if o and o:formvalue(arg[1]) then o.default = o:formvalue(arg[1]) end -o.validate = function(self, value, t) - if value and value ~= "" then - if not api.fs.access(value) then - return nil, translate("Can't find this file!") - else - return value - end - end - return nil -end -o:depends({ custom = false }) - -o = s:option(Flag, "log", translate("Log")) -o.default = "1" -o.rmempty = false - -api.luci_types(s1, s) \ No newline at end of file diff --git a/luci-app-passwall2/luasrc/passwall2/api.lua b/luci-app-passwall2/luasrc/passwall2/api.lua index 755bd2e6..491d402f 100644 --- a/luci-app-passwall2/luasrc/passwall2/api.lua +++ b/luci-app-passwall2/luasrc/passwall2/api.lua @@ -26,6 +26,7 @@ TMP_PATH = "/tmp/etc/" .. c_config CACHE_PATH = TMP_PATH .. "_tmp" S_TMP_PATH = "/tmp/etc/" .. s_config TMP_IFACE_PATH = TMP_PATH .. "/iface" +TMP_ACL_PATH = TMP_PATH .. "/acl" local lang = uci:get("luci", "main", "lang") or "auto" if lang == "auto" then @@ -201,9 +202,10 @@ function get_cache_var(key) return val end -function get_new_port() +function get_new_port(p) + if not p then p = "auto" end local cmd_format = ". /usr/share/passwall2/utils.sh ; echo -n $(get_new_port %s tcp,udp)" - return tonumber(sys.exec(string.format(cmd_format, "auto"))) + return tonumber(sys.exec(string.format(cmd_format, p))) end function exec_call(cmd) @@ -613,7 +615,7 @@ function get_valid_nodes() end end local port = e.port or e.hysteria_hop or e.hysteria2_hop - local is_realm = (e.type == "Hysteria2" or e.protocol == 'hysteria2') and e.hysteria2_realms or nil + local is_realm = e.protocol == 'hysteria2' and e.hysteria2_realms or nil if (port and e.address) or is_realm then local address = e.address if is_ip(address) or datatypes.hostname(address) or is_realm then @@ -739,7 +741,7 @@ function get_node_remarks(n) end type_name = type_name .. " " .. protocol end - if (n.type == "Hysteria2" or n.protocol == 'hysteria2') and n.hysteria2_realms then + if n.protocol == "hysteria2" and n.hysteria2_realms then type_name = type_name .. " Realm" end remarks = trim("%s:[%s]" % {type_name, n.remarks}) diff --git a/luci-app-passwall2/luasrc/passwall2/com.lua b/luci-app-passwall2/luasrc/passwall2/com.lua index aefc5459..1327e3f5 100644 --- a/luci-app-passwall2/luasrc/passwall2/com.lua +++ b/luci-app-passwall2/luasrc/passwall2/com.lua @@ -10,21 +10,6 @@ local function gh_pre_release_url(self) return "https://github.com/Openwrt-Passwall/openwrt-passwall-packages/releases/download/api-cache/" .. string.lower(self.name) .. "-pre-release-api.json" end -_M.hysteria = { - name = "Hysteria", - repo = "HyNetwork/hysteria", - get_url = gh_release_url, - cmd_version = "version | awk '/^Version:/ {print $2}'", - remote_version_str_replace = "app/", - zipped = false, - default_path = "/usr/bin/hysteria", - match_fmt_str = "linux%%-%s$", - file_tree = { - armv6 = "arm", - armv7 = "arm" - } -} - _M["sing-box"] = { name = "Sing-Box", repo = "SagerNet/sing-box", diff --git a/luci-app-passwall2/luasrc/passwall2/server_app.lua b/luci-app-passwall2/luasrc/passwall2/server_app.lua index 783ee4f9..06420241 100644 --- a/luci-app-passwall2/luasrc/passwall2/server_app.lua +++ b/luci-app-passwall2/luasrc/passwall2/server_app.lua @@ -169,13 +169,6 @@ local function start() config = require(require_dir .. "util_sing-box").gen_config_server(server) end bin = ln_run(api.get_app_path("sing-box"), "sing-box", "run -c " .. config_file, log_path) - elseif type == "Hysteria2" then - if server.custom == "1" and server.config_str then - config = jsonc.parse(api.base64Decode(server.config_str)) - else - config = require(require_dir .. "util_hysteria2").gen_config_server(server) - end - bin = ln_run(api.get_app_path("hysteria"), "hysteria", "-c " .. config_file .. " server", log_path) end if next(config) then diff --git a/luci-app-passwall2/luasrc/passwall2/util_hysteria2.lua b/luci-app-passwall2/luasrc/passwall2/util_hysteria2.lua deleted file mode 100644 index 2d557bcd..00000000 --- a/luci-app-passwall2/luasrc/passwall2/util_hysteria2.lua +++ /dev/null @@ -1,197 +0,0 @@ -module("luci.passwall2.util_hysteria2", package.seeall) -local api = require "luci.passwall2.api" -local jsonc = api.jsonc - -function gen_config_server(node) - local users = nil - if node.users and #node.users > 0 then - users = {} - for i, v in ipairs(node.users) do - local user = api.uci_get_s(v) or {} - if user[".type"] == "user" then - users[user.username] = user.password - end - end - if not next(users) then - users = nil - end - end - local config = { - listen = (function() - if node.realms and node.realm_url then - local url = node.realm_url:gsub("/+$", "") - if node.port then - url = url .. (url:find("?") and "&lport=" or "?lport=") .. node.port - end - return url - end - return ":" .. (node.port or "0") - end)(), - tls = { - cert = node.tls_certificateFile, - key = node.tls_keyFile, - }, - obfs = (node.obfs_type and node.obfs_password) and { - type = node.obfs_type, - [node.obfs_type] = { - password = node.obfs_password - } - } or nil, - auth = users and { - type = "userpass", - userpass = users - } or nil, - bandwidth = (node.up_mbps or node.down_mbps) and { - up = node.up_mbps and node.up_mbps .. " mbps" or nil, - down = node.down_mbps and node.down_mbps .. " mbps" or nil - } or nil, - ignoreClientBandwidth = (node.ignoreClientBandwidth == "1") and true or false, - disableUDP = (node.udp == "0") and true or false, - realm = (node.realms and node.realm_stun) and { - stunServers = node.realm_stun - } or nil - } - - if config.obfs and config.obfs.gecko then - local min = tonumber(node.obfs_MinPacketSize) or 512 - local max = tonumber(node.obfs_MaxPacketSize) or 1200 - if min <= 0 or min > max or max > 2048 then - min = 512 - max = 1200 - end - config.obfs.gecko.minPacketSize = min - config.obfs.gecko.maxPacketSize = max - end - - return config -end - -function gen_config(var) - local node_id = var["node"] - if not node_id then - print("node Cannot be empty!") - return - end - local node = api.uci_get_c(node_id) - local local_socks_address = var["local_socks_address"] or "0.0.0.0" - local local_socks_port = var["local_socks_port"] - local local_socks_username = var["local_socks_username"] - local local_socks_password = var["local_socks_password"] - local local_http_address = var["local_http_address"] or "0.0.0.0" - local local_http_port = var["local_http_port"] - local local_http_username = var["local_http_username"] - local local_http_password = var["local_http_password"] - local server_host = var["server_host"] or (node.address or ""):lower() - local server_port = var["server_port"] or node.port - - if api.is_ipv6(server_host) then - server_host = api.get_ipv6_full(server_host) - end - - local port_hop = ((server_port or "") .. "," .. (node.hysteria2_hop or "")):gsub("^[%s,]+", ""):gsub("[%s,]+$", ""):gsub(":", "-") - local server = server_host .. ":" .. (port_hop ~= "" and port_hop or "443") - - local config = { - server = (function() - if node.hysteria2_realms and node.hysteria2_realm_url then - return node.hysteria2_realm_url:gsub("/+$", "") - end - return server - end)(), - realm = (node.hysteria2_realms and node.hysteria2_realm_stun) and { - stunServers = node.hysteria2_realm_stun - } or nil, - transport = { - type = "udp", - udp = node.hysteria2_hop and (function() - local udp = {} - local t = node.hysteria2_hop_interval - if not t then return nil end - if t:find("-", 1, true) then - local min, max = t:match("^(%d+)%-(%d+)$") - min = tonumber(min) - max = tonumber(max) - if min and max then - min = (min >= 5) and min or 5 - max = (max >= min) and max or min - udp.minHopInterval = min .. "s" - udp.maxHopInterval = max .. "s" - return udp - end - end - t = tonumber((t or "30"):match("^%d+")) - t = (t and t >= 5) and t or 30 - udp.hopInterval = t .. "s" - return udp - end)() or nil - }, - obfs = (node.hysteria2_obfs_type and node.hysteria2_obfs_password) and { - type = node.hysteria2_obfs_type, - [node.hysteria2_obfs_type] = { - password = node.hysteria2_obfs_password - } - } or nil, - auth = node.hysteria2_auth_password, - tls = { - sni = node.tls_serverName, - insecure = (node.tls_allowInsecure == "1") and true or false, - pinSHA256 = (node.tls_pinSHA256) and node.tls_pinSHA256 or nil, - }, - quic = { - initStreamReceiveWindow = (node.hysteria2_recv_window) and tonumber(node.hysteria2_recv_window) or nil, - initConnReceiveWindow = (node.hysteria2_recv_window_conn) and tonumber(node.hysteria2_recv_window_conn) or nil, - maxIdleTimeout = (function(t) - t = tonumber(tostring(t or "30"):match("^%d+")) - return (t and t >= 4 and t <= 120) and t .. "s" or "30s" - end)(node.hysteria2_idle_timeout), - keepAlivePeriod = (function(t) - t = tonumber(tostring(t or "0"):match("^%d+")) - return (t and t >= 2 and t <= 60) and t .. "s" or nil - end)(node.hysteria2_keep_alive_period), - disablePathMTUDiscovery = (node.hysteria2_disable_mtu_discovery) and true or false, - }, - bandwidth = (node.hysteria2_up_mbps or node.hysteria2_down_mbps) and { - up = node.hysteria2_up_mbps and node.hysteria2_up_mbps .. " mbps" or nil, - down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or nil - } or nil, - fast_open = (node.fast_open == "1") and true or false, - lazy = (node.hysteria2_lazy_start == "1") and true or false, - socks5 = (local_socks_address and local_socks_port) and { - listen = local_socks_address .. ":" .. local_socks_port, - username = (local_socks_username and local_socks_password) and local_socks_username or nil, - password = (local_socks_username and local_socks_password) and local_socks_password or nil, - disableUDP = false, - } or nil, - http = (local_http_address and local_http_port) and { - listen = local_http_address .. ":" .. local_http_port, - username = (local_http_username and local_http_password) and local_http_username or nil, - password = (local_http_username and local_http_password) and local_http_password or nil, - } or nil - } - - if config.obfs and config.obfs.gecko then - local min = tonumber(node.hysteria2_obfs_MinPacketSize) or 512 - local max = tonumber(node.hysteria2_obfs_MaxPacketSize) or 1200 - if min <= 0 or min > max or max > 2048 then - min = 512 - max = 1200 - end - config.obfs.gecko.minPacketSize = min - config.obfs.gecko.maxPacketSize = max - end - - return jsonc.stringify(config, 1) -end - -_G.gen_config = gen_config - -if arg[1] then - local func =_G[arg[1]] - if func then - local var = nil - if arg[2] then - var = jsonc.parse(arg[2]) - end - print(func(var)) - end -end diff --git a/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm b/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm index a279f3b7..0312b6b3 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/global/footer.htm @@ -133,7 +133,7 @@ local sid = "@global[0]" const m = cbid.match(/\.node$/); if (m) { - html += '?id=default&name=' + 'global' + '\', \'_blank\')"><%:Log%>'; + html += '?id=default' + '\', \'_blank\')"><%:Log%>'; } html = '
' + html + '
' diff --git a/luci-app-passwall2/luasrc/view/passwall2/node_config/link_share_man.htm b/luci-app-passwall2/luasrc/view/passwall2/node_config/link_share_man.htm index 7d18cac3..6211a78f 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/node_config/link_share_man.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/node_config/link_share_man.htm @@ -7,13 +7,12 @@ local map = self.map local has_ss_rust = api.is_finded("sslocal") local has_singbox = api.finded_com("sing-box") local has_xray = api.finded_com("xray") -local has_hysteria2 = api.finded_com("hysteria") 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 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 hysteria2_type = api.get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{has_singbox,"sing-box"}, {has_xray,"xray"}}) +local hysteria2_type = api.get_core("hysteria2_type", {{has_singbox,"sing-box"}, {has_xray,"xray"}}) local current_node = map:get(section) -%> @@ -21,7 +20,6 @@ local current_node = map:get(section)