Skip to content

Commit

Permalink
update 2024-11-19 04:21:50
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzok8 committed Nov 18, 2024
1 parent eb4acec commit 164311d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion luci-app-passwall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-passwall
PKG_VERSION:=24.11.18
PKG_RELEASE:=2
PKG_RELEASE:=3

PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \
Expand Down
26 changes: 9 additions & 17 deletions luci-app-passwall/luasrc/passwall/util_xray.lua
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,15 @@ function gen_config(var)
if #valid_nodes == 0 then return nil end

-- fallback node
local fallback_node_tag = nil
local fallback_node_id = _node.fallback_node
if fallback_node_id == "" then fallback_node_id = nil end
if fallback_node_id == "" or fallback_node_id == "nil" then fallback_node_id = nil end
if fallback_node_id then
local is_new_node = true
for _, outbound in ipairs(outbounds) do
if outbound.tag == fallback_node_id then
if outbound.tag:find("^" .. fallback_node_id) == 1 then
is_new_node = false
fallback_node_tag = outbound.tag
break
end
end
Expand All @@ -800,23 +802,18 @@ function gen_config(var)
if outbound then
outbound.tag = outbound.tag .. ":" .. fallback_node.remarks
table.insert(outbounds, outbound)
else
fallback_node_id = nil
end
else
if not gen_balancer(fallback_node) then
fallback_node_id = nil
fallback_node_tag = outbound.tag
end
end
end
end
table.insert(balancers, {
tag = balancer_tag,
selector = valid_nodes,
fallbackTag = fallback_node_id,
fallbackTag = fallback_node_tag,
strategy = { type = _node.balancingStrategy or "random" }
})
if _node.balancingStrategy == "leastPing" or fallback_node_id then
if _node.balancingStrategy == "leastPing" or fallback_node_tag then
if not observatory then
observatory = {
subjectSelector = { "blc-" },
Expand Down Expand Up @@ -1191,13 +1188,8 @@ function gen_config(var)

--[[
local default_dns_flag = "remote"
if node_id and tcp_redir_port then
local node = uci:get_all(appname, node_id)
if node.protocol == "_shunt" then
if node.default_node == "_direct" then
default_dns_flag = "direct"
end
end
if (not COMMON.default_balancer_tag and not COMMON.default_outbound_tag) or COMMON.default_outbound_tag == "direct" then
default_dns_flag = "direct"
end
if dns.servers and #dns.servers > 0 then
Expand Down
2 changes: 1 addition & 1 deletion luci-app-passwall2/luasrc/passwall2/util_xray.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ function gen_config(var)
end

local default_dns_flag = "remote"
if (not COMMON.default_balancer_tag and COMMON.default_balancer_tag) or COMMON.default_outbound_tag == "direct" then
if (not COMMON.default_balancer_tag and not COMMON.default_outbound_tag) or COMMON.default_outbound_tag == "direct" then
default_dns_flag = "direct"
end

Expand Down

0 comments on commit 164311d

Please sign in to comment.