luci-app-passwall: sync upstream

last commit: 8da28e5c42
This commit is contained in:
actions 2024-06-25 12:30:06 +08:00
parent 713228e52e
commit d68bb0c614
4 changed files with 31 additions and 15 deletions

View File

@ -384,16 +384,21 @@ o.validate = function(self, value, t)
return value
end
o = s:taboption("DNS", ListValue, "chinadns_ng_default_tag", translate("ChinaDNS-NG Domain Default Tag"))
o = s:taboption("DNS", ListValue, "chinadns_ng_default_tag", translate("Default DNS"))
o.default = "none"
o:value("none", translate("Default"))
o:value("gfw", translate("Remote DNS"))
o:value("chn", translate("Direct DNS"))
o.description = "<ul>"
o:value("none", translate("Smart, Do not accept no-ip reply from Direct DNS"))
o:value("none_noip", translate("Smart, Accept no-ip reply from Direct DNS"))
local desc = "<ul>"
.. "<li>" .. translate("When not matching any domain name list:") .. "</li>"
.. "<li>" .. translate("Default: Forward to both direct and remote DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result.") .. "</li>"
.. "<li>" .. translate("Remote DNS: Can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "</li>"
.. "<li>" .. translate("Direct DNS: Internet experience may be better, but DNS will be leaked!") .. "</li>"
o.description = desc
.. "<li>" .. translate("Smart: Forward to both direct and remote DNS, if the direct DNS resolution result is a mainland China IP, then use the direct result, otherwise use the remote result.") .. "</li>
.. "<li>" .. translate("In smart mode, no-ip reply from Direct DNS:") .. "</li>"
.. "<li>" .. translate("Do not accept: Wait and use Remote DNS Reply.") .. "</li>"
.. "<li>" .. translate("Accept: Trust the Reply, using this option can improve DNS resolution speeds for some mainland IPv4-only sites.") .. "</li>"
.. "</ul>"
o:depends({dns_shunt = "chinadns-ng", tcp_proxy_mode = "proxy", chn_list = "direct"})
@ -401,11 +406,7 @@ o = s:taboption("DNS", ListValue, "use_default_dns", translate("Default DNS"))
o.default = "direct"
o:value("remote", translate("Remote DNS"))
o:value("direct", translate("Direct DNS"))
o.description = "<ul>"
.. "<li>" .. translate("When not matching any domain name list:") .. "</li>"
.. "<li>" .. translate("Remote DNS: Can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "</li>"
.. "<li>" .. translate("Direct DNS: Internet experience may be better, but DNS will be leaked!") .. "</li>"
.. "</ul>"
o.description = desc .. "</ul>"
o:depends({dns_shunt = "dnsmasq", tcp_proxy_mode = "proxy", chn_list = "direct"})
o = s:taboption("DNS", Flag, "dns_redirect", "DNS " .. translate("Redirect"), translate("Force Router DNS server to all local devices."))

View File

@ -172,11 +172,23 @@ msgstr "远程DNS可以避免更多的DNS泄露但会导致规则列表外
msgid "Direct DNS: Internet experience may be better, but DNS will be leaked!"
msgstr "直连DNS上网体验可能会更佳但是会泄露DNS"
msgid "ChinaDNS-NG Domain Default Tag"
msgstr "ChinaDNS-NG 域名默认标签"
msgid "Smart, Do not accept no-ip reply from Direct DNS"
msgstr "智能,不接受直连 DNS 空响应"
msgid "Default: Forward to both direct and remote DNS, if the direct DNS resolution result is a mainland China ip, then use the direct result, otherwise use the remote result."
msgstr "默认同时转发给直连和远程DNS如果直连DNS解析结果是大陆ip则使用直连结果否则使用远程结果。"
msgid "Smart, Accept no-ip reply from Direct DNS"
msgstr "智能,接受直连 DNS 空响应"
msgid "Smart: Forward to both direct and remote DNS, if the direct DNS resolution result is a mainland China IP, then use the direct result, otherwise use the remote result."
msgstr "智能:同时转发给直连和远程 DNS如果直连 DNS 解析结果是大陆 IP则使用直连结果否则使用远程结果。"
msgid "In smart mode, no-ip reply from Direct DNS:"
msgstr "使用智能模式,直连 DNS 返回空响应时:"
msgid "Do not accept: Wait and use Remote DNS Reply."
msgstr "不接受:等待并使用远程 DNS 的响应。"
msgid "Accept: Trust the Reply, using this option can improve DNS resolution speeds for some mainland IPv4-only sites."
msgstr "接受:信任空响应,使用此选项可以提升部分大陆仅 IPv4 站点的 DNS 解析速度。"
msgid "Filter Proxy Host IPv6"
msgstr "过滤代理域名 IPv6"

View File

@ -585,7 +585,10 @@ run_chinadns_ng() {
[ "${_no_ipv6_trust}" = "1" ] && echo "no-ipv6" >> ${_CONF_FILE}
}
([ -z "${_default_tag}" ] || [ "${_default_tag}" = "smart" ]) && _default_tag="none"
# 是否接受直连 DNS 空响应
[ "${_default_tag}" = "none_noip" ] && echo "noip-as-chnip" >> ${_CONF_FILE}
([ -z "${_default_tag}" ] || [ "${_default_tag}" = "smart" ] || [ "${_default_tag}" = "none_noip" ]) && _default_tag="none"
echo "default-tag ${_default_tag}" >> ${_CONF_FILE}
ln_run "$(first_type chinadns-ng)" chinadns-ng "${_LOG_FILE}" -C ${_CONF_FILE}

View File

@ -24,7 +24,7 @@ index 1440118..be9dd12 100644
if code ~= 0 then
local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'")
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 13bd889..dcd414b 100644
index 521c8ff..5ca99e2 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -332,6 +332,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9-Recommended)")