luci-app-passwall: sync upstream

last commit: 419af4561d
This commit is contained in:
gitea-action 2025-05-08 22:00:21 +08:00
parent d83dfa27b1
commit 029f48c7ca
3 changed files with 18 additions and 9 deletions

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall PKG_NAME:=luci-app-passwall
PKG_VERSION:=25.5.2 PKG_VERSION:=25.5.8
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \

View File

@ -180,8 +180,17 @@ listen %s
]], port, port)) ]], port, port))
end end
local count_M, count_B = 1, 1
for i, o in ipairs(listens[port]) do for i, o in ipairs(listens[port]) do
local remark = o.server_remark local remark = o.server_remark or ""
-- 防止重名导致无法运行
if tostring(o.backup) ~= "1" then
remark = "M" .. count_M .. "-" .. remark
count_M = count_M + 1
else
remark = "B" .. count_B .. "-" .. remark
count_B = count_B + 1
end
local server = o.server_address .. ":" .. o.server_port local server = o.server_address .. ":" .. o.server_port
local server_conf = "server {{remark}} {{server}} weight {{weight}} {{resolvers}} check inter {{inter}} rise 1 fall 3 {{backup}}" local server_conf = "server {{remark}} {{server}} weight {{weight}} {{resolvers}} check inter {{inter}} rise 1 fall 3 {{backup}}"
server_conf = server_conf:gsub("{{remark}}", remark) server_conf = server_conf:gsub("{{remark}}", remark)
@ -193,7 +202,7 @@ listen %s
end end
server_conf = server_conf:gsub("{{resolvers}}", resolvers) server_conf = server_conf:gsub("{{resolvers}}", resolvers)
server_conf = server_conf:gsub("{{inter}}", tonumber(health_check_inter) .. "s") server_conf = server_conf:gsub("{{inter}}", tonumber(health_check_inter) .. "s")
server_conf = server_conf:gsub("{{backup}}", o.backup == "1" and "backup" or "") server_conf = server_conf:gsub("{{backup}}", tostring(o.backup) == "1" and "backup" or "")
f_out:write(" " .. server_conf .. "\n") f_out:write(" " .. server_conf .. "\n")

View File

@ -1,5 +1,5 @@
diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile
index b0a2282..bab556b 100644 index 184c14a..2185060 100644
--- a/luci-app-passwall/Makefile --- a/luci-app-passwall/Makefile
+++ b/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile
@@ -67,7 +67,7 @@ config PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy @@ -67,7 +67,7 @@ config PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy