luci-app-passwall: sync upstream

last commit: 9b12093338
This commit is contained in:
actions 2024-06-27 11:00:07 +08:00
parent f432102c58
commit 5f58b71e22
5 changed files with 102 additions and 58 deletions

View File

@ -104,6 +104,14 @@ if #hysteria2_type > 0 then
end
end
o = s:option(ListValue, "domain_strategy", "Sing-box " .. translate("Domain Strategy"), translate("Set the default domain resolution strategy for the sing-box node."))
o.default = ""
o:value("", translate("Auto"))
o:value("prefer_ipv4", translate("Prefer IPv4"))
o:value("prefer_ipv6", translate("Prefer IPv6"))
o:value("ipv4_only", translate("IPv4 Only"))
o:value("ipv6_only", translate("IPv6 Only"))
---- Subscribe Delete All
o = s:option(Button, "_stop", translate("Delete All Subscribe Node"))
o.inputstyle = "remove"

View File

@ -125,6 +125,15 @@ if #hysteria2_type > 0 then
end
end
o = s:option(ListValue, "domain_strategy", "Sing-box " .. translate("Domain Strategy"), translate("Set the default domain resolution strategy for the sing-box node."))
o.default = "global"
o:value("global", translate("Use global config"))
o:value("", translate("Auto"))
o:value("prefer_ipv4", translate("Prefer IPv4"))
o:value("prefer_ipv6", translate("Prefer IPv6"))
o:value("ipv4_only", translate("IPv4 Only"))
o:value("ipv6_only", translate("IPv6 Only"))
---- Enable auto update subscribe
o = s:option(Flag, "auto_update", translate("Enable auto update subscribe"))
o.default = 0

View File

@ -635,11 +635,23 @@ o = s:option(Value, option_name("plugin_opts"), translate("opts"))
o:depends({ [option_name("plugin_enabled")] = true })
o = s:option(ListValue, option_name("domain_strategy"), translate("Domain Strategy"), translate("If is domain name, The requested domain name will be resolved to IP before connect."))
o.default = "prefer_ipv6"
o.default = ""
o:value("", translate("Auto"))
o:value("prefer_ipv4", translate("Prefer IPv4"))
o:value("prefer_ipv6", translate("Prefer IPv6"))
o:value("ipv4_only", translate("IPv4 Only"))
o:value("ipv6_only", translate("IPv6 Only"))
o:depends({ [option_name("protocol")] = "socks" })
o:depends({ [option_name("protocol")] = "http" })
o:depends({ [option_name("protocol")] = "shadowsocks" })
o:depends({ [option_name("protocol")] = "shadowsocksr" })
o:depends({ [option_name("protocol")] = "vmess" })
o:depends({ [option_name("protocol")] = "trojan" })
o:depends({ [option_name("protocol")] = "wireguard" })
o:depends({ [option_name("protocol")] = "hysteria" })
o:depends({ [option_name("protocol")] = "vless" })
o:depends({ [option_name("protocol")] = "tuic" })
o:depends({ [option_name("protocol")] = "hysteria2" })
o = s:option(ListValue, option_name("to_node"), translate("Landing node"), translate("Only support a layer of proxy."))
o.default = ""

View File

@ -224,22 +224,22 @@ msgid "DNS related issues:"
msgstr "DNS 相关问题:"
msgid "Certain browsers such as Chrome have built-in DNS service, which may affect DNS resolution settings. You can go to 'Settings -> Privacy and security -> Use secure DNS' menu to turn it off."
msgstr "某些浏览器如Chrome等内置此功能,这会影响设置的DNS解析。您可以进入 '设置->私隐和安全->使用安全DNS' 菜单,将其关闭。"
msgstr "某些浏览器如 Chrome 等内置此功能,这会影响设置的 DNS 解析。您可以进入 '设置->私隐和安全->使用安全 DNS' 菜单,将其关闭。"
msgid "If you are unable to access the internet after reboot, please try clearing the cache of your terminal devices (make sure to close all open browser application windows first, this step is especially important):"
msgstr "如果在重启后无法上网,请尝试清除终端设备的缓存(先关闭所有正在使用的浏览器应用程序,这一步尤其重要):"
msgstr "如果在重启后无法上网请尝试清除终端设备的缓存(先关闭所有正在使用的浏览器应用程序,这一步尤其重要):"
msgid "For Windows systems, open Command Prompt and run the command 'ipconfig /flushdns'."
msgstr "对于Windows系统,请在命令提示符中运行命令 'ipconfig /flushdns'."
msgstr "对于Windows系统请在命令提示符中运行命令 'ipconfig /flushdns'."
msgid "For Mac systems, open Terminal and run the command 'sudo killall -HUP mDNSResponder'."
msgstr "对于Mac系统在终端中运行命令 'sudo killall -HUP mDNSResponder'."
msgid "For mobile devices, you can clear it by reconnecting to the network, such as toggling Airplane Mode and reconnecting to WiFi."
msgstr "对于移动设备,可通过重新接入网络的方式清除。比如开关一次飞行模式,重新连接WiFi。"
msgstr "对于移动设备,可通过重新接入网络的方式清除。比如开关一次飞行模式,重新连接 WiFi。"
msgid "Please make sure your device's network settings point both the DNS server and default gateway to this router, to ensure DNS queries are properly routed."
msgstr "请确认您设备的网络设置,客户端DNS服务器和默认网关应均指向本路由器,以确保DNS查询正确路由。"
msgstr "请确认您设备的网络设置,客户端 DNS 服务器和默认网关应均指向本路由器,以确保 DNS 查询正确路由。"
msgid "Restore to default configuration:"
msgstr "恢复默认配置:"
@ -1067,10 +1067,10 @@ msgid "These had been joined websites will be block. Please input the domain nam
msgstr "加入的域名将屏蔽。输入网站域名twitter.com每个地址段一行。"
msgid "The list is the IPv4 LAN IP list, which represents the direct connection IP of the LAN. If you need the LAN IP in the proxy list, please clear it from the list. Do not modify this list by default."
msgstr "列表中为IPv4的局域网IP列表代表局域网直连IP。如果需要代理列表中的局域网IP请将其在该列表中清除,并将其添加到代理列表中。默认情况下不要修改这个列表。"
msgstr "列表中为 IPv4 的局域网 IP 列表,代表局域网直连 IP。如果需要代理列表中的局域网 IP请将其在该列表中清除并将其添加到代理列表中。默认情况下不要修改这个列表。"
msgid "The list is the IPv6 LAN IP list, which represents the direct connection IP of the LAN. If you need the LAN IP in the proxy list, please clear it from the list. Do not modify this list by default."
msgstr "列表中为IPv6的局域网IP列表代表局域网直连IP。如果需要代理列表中的局域网IP请将其在该列表中清除,并将其添加到代理列表中。默认情况下不要修改这个列表。"
msgstr "列表中为 IPv6 的局域网 IP 列表,代表局域网直连 IP。如果需要代理列表中的局域网 IP请将其在该列表中清除并将其添加到代理列表中。默认情况下不要修改这个列表。"
msgid "Configure routing etc/hosts file, if you don't know what you are doing, please don't change the content."
msgstr "配置路由 etc/hosts 文件,如果你不知道自己在做什么,请不要改动内容。"
@ -1647,3 +1647,6 @@ msgstr "仅支持一层代理。"
msgid "Only work with using the %s node."
msgstr "与使用 %s 节点时生效。"
msgid "Set the default domain resolution strategy for the sing-box node."
msgstr "为 sing-box 节点设置默认的域名解析策略。"

View File

@ -34,6 +34,8 @@ local trojan_type_default = uci:get(appname, "@global_subscribe[0]", "trojan_typ
local vmess_type_default = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray"
local vless_type_default = uci:get(appname, "@global_subscribe[0]", "vless_type") or "xray"
local hysteria2_type_default = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or "hysteria2"
local domain_strategy_default = uci:get(appname, "@global_subscribe[0]", "domain_strategy") or ""
local domain_strategy_node = ""
-- 判断是否过滤节点关键字
local filter_keyword_mode_default = uci:get(appname, "@global_subscribe[0]", "filter_keyword_mode") or "0"
local filter_keyword_discard_list_default = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
@ -1124,6 +1126,10 @@ local function update_node(manual)
local cfgid = uci:section(appname, "nodes", api.gen_short_uuid())
for kkk, vvv in pairs(vv) do
uci:set(appname, cfgid, kkk, vvv)
-- sing-box 域名解析策略
if kkk == "type" and vvv == "sing-box" then
uci:set(appname, cfgid, "domain_strategy", domain_strategy_node)
end
end
end
end
@ -1317,6 +1323,12 @@ local execute = function()
if hysteria2_type ~= "global" then
hysteria2_type_default = hysteria2_type
end
local domain_strategy = value.domain_strategy or "global"
if domain_strategy ~= "global" then
domain_strategy_node = domain_strategy
else
domain_strategy_node = domain_strategy_default
end
local ua = value.user_agent
log('正在订阅:【' .. remark .. '' .. url)
local raw = curl(url, "/tmp/" .. cfgid, ua)