luci-app-passwall: sync upstream

last commit: 3e268e1f31
This commit is contained in:
gitea-action 2025-04-13 18:00:25 +08:00
parent eeca4fa964
commit 05b0c3eb61
4 changed files with 7 additions and 16 deletions

View File

@ -13,7 +13,6 @@ local fs = api.fs
local sys = api.sys local sys = api.sys
local has_singbox = api.finded_com("sing-box") local has_singbox = api.finded_com("sing-box")
local has_xray = api.finded_com("xray") local has_xray = api.finded_com("xray")
local has_geoview = api.is_finded("geoview")
local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist") local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist")
local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist") local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist")
local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute") local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute")
@ -24,9 +23,7 @@ end
local nodes_table = {} local nodes_table = {}
for k, e in ipairs(api.get_valid_nodes()) do for k, e in ipairs(api.get_valid_nodes()) do
if not(e.type == "sing-box" and e.protocol == "_shunt" and not has_geoview) then --Sing-Box分流节点缺少geoview组件时不允许使用
nodes_table[#nodes_table + 1] = e nodes_table[#nodes_table + 1] = e
end
end end
local dynamicList_write = function(self, section, value) local dynamicList_write = function(self, section, value)

View File

@ -4,7 +4,6 @@ local datatypes = api.datatypes
local fs = api.fs local fs = api.fs
local has_singbox = api.finded_com("sing-box") local has_singbox = api.finded_com("sing-box")
local has_xray = api.finded_com("xray") local has_xray = api.finded_com("xray")
local has_geoview = api.is_finded("geoview")
local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist") local has_gfwlist = fs.access("/usr/share/passwall/rules/gfwlist")
local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist") local has_chnlist = fs.access("/usr/share/passwall/rules/chnlist")
local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute") local has_chnroute = fs.access("/usr/share/passwall/rules/chnroute")
@ -15,9 +14,7 @@ api.set_apply_on_parse(m)
local nodes_table = {} local nodes_table = {}
for k, e in ipairs(api.get_valid_nodes()) do for k, e in ipairs(api.get_valid_nodes()) do
if not(e.type == "sing-box" and e.protocol == "_shunt" and not has_geoview) then --Sing-Box分流节点缺少geoview组件时不允许使用
nodes_table[#nodes_table + 1] = e nodes_table[#nodes_table + 1] = e
end
end end
local normal_list = {} local normal_list = {}
@ -168,7 +165,7 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
local vid = v.id local vid = v.id
-- shunt node type, Sing-Box or Xray -- shunt node type, Sing-Box or Xray
local type = s:taboption("Main", ListValue, vid .. "-type", translate("Type")) local type = s:taboption("Main", ListValue, vid .. "-type", translate("Type"))
if has_singbox and has_geoview then if has_singbox then
type:value("sing-box", "Sing-Box") type:value("sing-box", "Sing-Box")
end end
if has_xray then if has_xray then

View File

@ -3,7 +3,6 @@ local m, s = ...
local api = require "luci.passwall.api" local api = require "luci.passwall.api"
local singbox_bin = api.finded_com("sing-box") local singbox_bin = api.finded_com("sing-box")
local geoview_bin = api.is_finded("geoview")
if not singbox_bin then if not singbox_bin then
return return
@ -58,9 +57,7 @@ if singbox_tags:find("with_quic") then
o:value("hysteria2", "Hysteria2") o:value("hysteria2", "Hysteria2")
end end
o:value("_urltest", translate("URLTest")) o:value("_urltest", translate("URLTest"))
if geoview_bin then --缺少geoview时禁用分流 o:value("_shunt", translate("Shunt"))
o:value("_shunt", translate("Shunt"))
end
o:value("_iface", translate("Custom Interface")) o:value("_iface", translate("Custom Interface"))
o = s:option(Value, _n("iface"), translate("Interface")) o = s:option(Value, _n("iface"), translate("Interface"))

View File

@ -20,10 +20,10 @@ index 485b59c..6d2ddf4 100644
define Package/$(PKG_NAME)/postrm define Package/$(PKG_NAME)/postrm
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.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 7bdfb3e..4cf5159 100644 index 425cd70..f8f2d9b 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -509,6 +509,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)") @@ -506,6 +506,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)")
o:value("149.112.112.112", "149.112.112.112 (Quad9)") o:value("149.112.112.112", "149.112.112.112 (Quad9)")
o:value("208.67.220.220", "208.67.220.220 (OpenDNS)") o:value("208.67.220.220", "208.67.220.220 (OpenDNS)")
o:value("208.67.222.222", "208.67.222.222 (OpenDNS)") o:value("208.67.222.222", "208.67.222.222 (OpenDNS)")
@ -36,7 +36,7 @@ index 7bdfb3e..4cf5159 100644
o:depends({dns_mode = "dns2socks"}) o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "tcp"}) o:depends({dns_mode = "tcp"})
o:depends({dns_mode = "udp"}) o:depends({dns_mode = "udp"})
@@ -608,7 +614,7 @@ if api.is_finded("smartdns") then @@ -605,7 +611,7 @@ if api.is_finded("smartdns") then
end end
o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translate("Force special DNS server to need proxy devices.")) o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translate("Force special DNS server to need proxy devices."))