diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index f57cc0ab1..56f563bfd 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.78-2 +PKG_VERSION:=4.78-3 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ 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 c2b16f1dd..cab712bea 100644 --- a/luci-app-passwall/root/usr/share/passwall/0_default_config +++ b/luci-app-passwall/root/usr/share/passwall/0_default_config @@ -105,8 +105,7 @@ config nodes 'myshunt' config shunt_rules 'DirectGame' option remarks 'DirectGame' - option domain_list 'api.steampowered.com -regexp:\.cm.steampowered.com$ + option domain_list 'regexp:\.cm.steampowered.com$ regexp:\.steamserver.net$ geosite:category-games@cn' option ip_list '103.10.124.0/24 diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 184eae752..4a90994b4 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -890,6 +890,7 @@ run_redir() { esac ;; TCP) + [ "$TCP_UDP" = "1" ] && echolog "UDP节点:与TCP节点相同" tcp_node_socks=1 tcp_node_socks_bind_local=$(config_t_get global tcp_node_socks_bind_local 1) tcp_node_socks_bind="127.0.0.1" @@ -2008,10 +2009,12 @@ TCP_NODE=$(config_t_get global tcp_node nil) UDP_REDIR_PORT=1051 UDP_NODE=$(config_t_get global udp_node nil) TCP_UDP=0 -[ "$UDP_NODE" == "tcp" ] && { +if [ "$UDP_NODE" == "tcp" ]; then UDP_NODE=$TCP_NODE TCP_UDP=1 -} +elif [ "$UDP_NODE" == "$TCP_NODE" ]; then + TCP_UDP=1 +fi [ "$ENABLED" == 1 ] && { [ "$TCP_NODE" != "nil" ] && [ "$(config_get_type $TCP_NODE nil)" != "nil" ] && ENABLED_DEFAULT_ACL=1 [ "$UDP_NODE" != "nil" ] && [ "$(config_get_type $UDP_NODE nil)" != "nil" ] && ENABLED_DEFAULT_ACL=1 diff --git a/luci-app-passwall/root/usr/share/passwall/rules/direct_ip b/luci-app-passwall/root/usr/share/passwall/rules/direct_ip index cb10e785f..d48bc4a0f 100644 --- a/luci-app-passwall/root/usr/share/passwall/rules/direct_ip +++ b/luci-app-passwall/root/usr/share/passwall/rules/direct_ip @@ -5,7 +5,7 @@ 119.29.29.29 180.76.76.76 34.149.0.0/16 -148.135.119.0/24 +72.18.83.0/24 1.12.12.12 120.53.53.53 203.208.39.192/28 diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index b2d4154bb..bc5bf993c 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -144,6 +144,9 @@ do if true then local i = 0 local option = "lbss" + local function is_ip_port(str) + return str:match("^%d+%.%d+%.%d+%.%d+:%d+$") ~= nil + end uci:foreach(appname, "haproxy_config", function(t) i = i + 1 local node_id = t[option] @@ -153,11 +156,17 @@ do remarks = "HAProxy负载均衡节点列表[" .. i .. "]", currentNode = node_id and uci:get_all(appname, node_id) or nil, set = function(o, server) - uci:set(appname, t[".name"], option, server) - o.newNodeId = server + -- 如果当前 lbss 值不是 ip:port 格式,才进行修改 + if not is_ip_port(t[option]) then + uci:set(appname, t[".name"], option, server) + o.newNodeId = server + end end, delete = function(o) - uci:delete(appname, t[".name"]) + -- 如果当前 lbss 值不是 ip:port 格式,才进行删除 + if not is_ip_port(t[option]) then + uci:delete(appname, t[".name"]) + end end } end) diff --git a/patch-luci-app-passwall.patch b/patch-luci-app-passwall.patch index 7d9c76847..474302aa6 100644 --- a/patch-luci-app-passwall.patch +++ b/patch-luci-app-passwall.patch @@ -1,5 +1,5 @@ diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile -index 51ec2b6..f57cc0a 100644 +index e4be5cc..56f563b 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -171,7 +171,6 @@ define Package/$(PKG_NAME)/conffiles @@ -185,7 +185,7 @@ index 24662de..77b6a0b 100644 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 58f56ac..c2b16f1 100644 +index 1bdbb35..cab712b 100644 --- a/luci-app-passwall/root/usr/share/passwall/0_default_config +++ b/luci-app-passwall/root/usr/share/passwall/0_default_config @@ -32,7 +32,7 @@ config global_haproxy @@ -232,7 +232,7 @@ index a3b1464..2aed721 100644 dns.alidns.com doh.pub diff --git a/luci-app-passwall/root/usr/share/passwall/rules/direct_ip b/luci-app-passwall/root/usr/share/passwall/rules/direct_ip -index b73edaa..cb10e78 100644 +index b73edaa..d48bc4a 100644 --- a/luci-app-passwall/root/usr/share/passwall/rules/direct_ip +++ b/luci-app-passwall/root/usr/share/passwall/rules/direct_ip @@ -4,7 +4,11 @@ @@ -240,7 +240,7 @@ index b73edaa..cb10e78 100644 119.29.29.29 180.76.76.76 +34.149.0.0/16 -+148.135.119.0/24 ++72.18.83.0/24 1.12.12.12 120.53.53.53 +203.208.39.192/28