From 8eae22d30f35aea0f03338f01f88a4afe8af5c46 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Apr 2026 23:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=88=20Sync=202026-04-05=2023:43:12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../luasrc/passwall/util_sing-box.lua | 2 +- .../luasrc/passwall/util_xray.lua | 22 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 5ee76b87..4abd6627 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -1955,7 +1955,7 @@ function gen_config(var) } }) for index, value in ipairs(config.outbounds) do - if not value["_flag_proxy_tag"] and not value.detour and value["_id"] and value.server and value.server_port and not no_run then + if not value["_flag_proxy_tag"] and not value.detour and value["_id"] and value.server and (value.server_port or value.server_ports) and not no_run then sys.call(string.format("echo '%s' >> %s", value["_id"], api.TMP_PATH .. "/direct_node_list")) end for k, v in pairs(config.outbounds[index]) do diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 730ce803..a44259ed 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -1064,17 +1064,17 @@ function gen_config(var) local to_node = get_node_by_id(node.to_node) if to_node then -- Landing Node not support use special node. - if to_node.protocol:find("^_") then + if to_node.protocol and to_node.protocol:find("^_") then to_node = nil end end if to_node then local to_outbound if to_node.type ~= "Xray" then - local tag = to_node[".name"] + local in_tag = "inbound_" .. to_node[".name"] .. "_" .. tostring(outbound.tag) local new_port = api.get_new_port() table.insert(inbounds, { - tag = tag, + tag = in_tag, listen = "127.0.0.1", port = new_port, protocol = "dokodemo-door", @@ -1086,11 +1086,11 @@ function gen_config(var) to_node.address = "127.0.0.1" to_node.port = new_port table.insert(rules, 1, { - inboundTag = {tag}, + inboundTag = {in_tag}, outboundTag = outbound.tag }) - to_outbound = gen_outbound(node[".name"], to_node, tag, { - tag = tag, + to_outbound = gen_outbound(node[".name"], to_node, to_node[".name"], { + tag = to_node[".name"], run_socks_instance = not no_run }) else @@ -1734,14 +1734,10 @@ function gen_config(var) else table.insert(outbounds, blackhole_outbound) end - for index, value in ipairs(config.outbounds) do - local s = value.settings - if not value["_flag_proxy_tag"] and value["_id"] and s and not no_run and - ((s.vnext and s.vnext[1] and s.vnext[1].address and s.vnext[1].port) or - (s.servers and s.servers[1] and s.servers[1].address and s.servers[1].port) or - (s.peers and s.peers[1] and s.peers[1].endpoint) or - (s.address and s.port)) then + local pt = value.protocol + local exclude = { blackhole=1, dns=1, freedom=1, loopback=1 } + if not value["_flag_proxy_tag"] and value["_id"] and pt and not exclude[pt] and not no_run then sys.call(string.format("echo '%s' >> %s", value["_id"], api.TMP_PATH .. "/direct_node_list")) end for k, v in pairs(config.outbounds[index]) do