Merge pull request #5216 from stangri/master-luci-app-https-dns-proxy

luci-app-https-dns-proxy: update to 2021-07-29-1
This commit is contained in:
Stan Grishin 2021-08-01 22:58:50 -07:00 committed by GitHub
commit 556ee696da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 96 additions and 56 deletions

View file

@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net> PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
PKG_VERSION:=2021-01-17-2 PKG_VERSION:=2021-07-29-1
LUCI_TITLE:=DNS Over HTTPS Proxy Web UI LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy LUCI_DESCRIPTION:=Provides Web UI for DNS Over HTTPS Proxy

View file

@ -1,6 +0,0 @@
return {
name = "Digitale-Gesellschaft",
label = _("Digitale Gesellschaft"),
resolver_url = "https://dns.digitale-gesellschaft.ch/dns-query",
bootstrap_dns = "185.95.218.42,185.95.218.43"
}

View file

@ -1,6 +0,0 @@
return {
name = "rubyfish.cn",
label = _("rubyfish.cn"),
resolver_url = "https://dns.rubyfish.cn/dns-query",
bootstrap_dns = "118.89.110.78,47.96.179.163"
}

View file

@ -0,0 +1,7 @@
return {
name = "Digitale-Gesellschaft",
label = _("Digitale Gesellschaft"),
resolver_url = "https://dns.digitale-gesellschaft.ch/dns-query",
bootstrap_dns = "1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844",
http2_only = true
}

View file

@ -0,0 +1,7 @@
return {
name = "rubyfish.cn",
label = _("rubyfish.cn"),
resolver_url = "https://dns.rubyfish.cn/dns-query",
bootstrap_dns = "1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844",
http2_only = true
}

View file

@ -4,5 +4,6 @@ return {
resolver_url = "https://cloudflare-dns.com/dns-query", resolver_url = "https://cloudflare-dns.com/dns-query",
bootstrap_dns = "1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001", bootstrap_dns = "1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001",
help_link = "https://one.one.one.one/family/", help_link = "https://one.one.one.one/family/",
help_link_text = "Cloudflare" help_link_text = "Cloudflare",
default = true
} }

View file

@ -2,6 +2,5 @@ return {
name = "Google", name = "Google",
label = _("Google"), label = _("Google"),
resolver_url = "https://dns.google/dns-query", resolver_url = "https://dns.google/dns-query",
bootstrap_dns = "8.8.8.8,8.8.4.4", bootstrap_dns = "8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844"
default = true
} }

View file

@ -2,7 +2,7 @@ return {
name = "LibreDNS (No Ads)", name = "LibreDNS (No Ads)",
label = _("LibreDNS (No Ads)"), label = _("LibreDNS (No Ads)"),
resolver_url = "https://doh.libredns.gr/ads", resolver_url = "https://doh.libredns.gr/ads",
bootstrap_dns = "116.202.176.26", bootstrap_dns = "116.202.176.26,1.1.1.1",
help_link = "https://libredns.gr/", help_link = "https://libredns.gr/",
help_link_text = "LibreDNS.gr" help_link_text = "LibreDNS.gr"
} }

View file

@ -2,7 +2,7 @@ return {
name = "LibreDNS", name = "LibreDNS",
label = _("LibreDNS"), label = _("LibreDNS"),
resolver_url = "https://doh.libredns.gr/dns-query", resolver_url = "https://doh.libredns.gr/dns-query",
bootstrap_dns = "116.202.176.26", bootstrap_dns = "116.202.176.26,1.1.1.1",
help_link = "https://libredns.gr/", help_link = "https://libredns.gr/",
help_link_text = "LibreDNS.gr" help_link_text = "LibreDNS.gr"
} }

View file

@ -0,0 +1,9 @@
return {
name="mullvad-adblock",
label=_("Mullvad (AdBlock)"),
resolver_url="https://adblock.doh.mullvad.net/dns-query",
bootstrap_dns="1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844",
help_link="https://mullvad.net/en/help/dns-over-https-and-dns-over-tls/",
help_link_text="Mullvad.net",
http2_only = true
}

View file

@ -0,0 +1,9 @@
return {
name="mullvad",
label=_("Mullvad"),
resolver_url="https://doh.mullvad.net/dns-query",
bootstrap_dns="1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844",
help_link="https://mullvad.net/en/help/dns-over-https-and-dns-over-tls/",
help_link_text="Mullvad.net",
http2_only = true
}

View file

@ -2,7 +2,7 @@ return {
name = "CleanBrowsing-Adult", name = "CleanBrowsing-Adult",
label = _("CleanBrowsing (Adult Filter)"), label = _("CleanBrowsing (Adult Filter)"),
resolver_url = "https://doh.cleanbrowsing.org/doh/adult-filter/", resolver_url = "https://doh.cleanbrowsing.org/doh/adult-filter/",
bootstrap_dns = "185.228.168.168", bootstrap_dns = "185.228.168.168,1.1.1.1",
help_link = "https://cleanbrowsing.org/guides/dnsoverhttps", help_link = "https://cleanbrowsing.org/guides/dnsoverhttps",
help_link_text = "CleanBrowsing.org" help_link_text = "CleanBrowsing.org"
} }

View file

@ -2,7 +2,7 @@ return {
name = "CleanBrowsing-Family", name = "CleanBrowsing-Family",
label = _("CleanBrowsing (Family Filter)"), label = _("CleanBrowsing (Family Filter)"),
resolver_url = "https://doh.cleanbrowsing.org/doh/family-filter/", resolver_url = "https://doh.cleanbrowsing.org/doh/family-filter/",
bootstrap_dns = "185.228.168.168", bootstrap_dns = "185.228.168.168,1.1.1.1",
help_link = "https://cleanbrowsing.org/guides/dnsoverhttps", help_link = "https://cleanbrowsing.org/guides/dnsoverhttps",
help_link_text = "CleanBrowsing.org" help_link_text = "CleanBrowsing.org"
} }

View file

@ -2,7 +2,7 @@ return {
name = "CleanBrowsing-Security", name = "CleanBrowsing-Security",
label = _("CleanBrowsing (Security Filter)"), label = _("CleanBrowsing (Security Filter)"),
resolver_url = "https://doh.cleanbrowsing.org/doh/security-filter/", resolver_url = "https://doh.cleanbrowsing.org/doh/security-filter/",
bootstrap_dns = "185.228.168.168", bootstrap_dns = "185.228.168.168,1.1.1.1",
help_link = "https://cleanbrowsing.org/guides/dnsoverhttps", help_link = "https://cleanbrowsing.org/guides/dnsoverhttps",
help_link_text = "CleanBrowsing.org" help_link_text = "CleanBrowsing.org"
} }

View file

@ -2,5 +2,6 @@ return {
name = "DNS.SB", name = "DNS.SB",
label = _("DNS.SB"), label = _("DNS.SB"),
resolver_url = "https://doh.dns.sb/dns-query", resolver_url = "https://doh.dns.sb/dns-query",
bootstrap_dns = "185.222.222.222,185.184.222.222" bootstrap_dns = "185.222.222.222,185.184.222.222",
http2_only = true
} }

View file

@ -9,6 +9,7 @@ local packageName = "https-dns-proxy"
local readmeURL = "https://docs.openwrt.melmac.net/" .. packageName .. "/" local readmeURL = "https://docs.openwrt.melmac.net/" .. packageName .. "/"
local providers_dir = "/usr/lib/lua/luci/" .. packageName .. "/providers/" local providers_dir = "/usr/lib/lua/luci/" .. packageName .. "/providers/"
local helperText = "" local helperText = ""
local http2Supported = false
function getPackageVersion() function getPackageVersion()
local opkgFile = "/usr/lib/opkg/status" local opkgFile = "/usr/lib/opkg/status"
@ -30,7 +31,7 @@ function createHelperText()
local p_func = loadfile(providers_dir .. filename) local p_func = loadfile(providers_dir .. filename)
setfenv(p_func, { _ = i18n.translate }) setfenv(p_func, { _ = i18n.translate })
local p = p_func() local p = p_func()
if p.help_link then if p.help_link and (not p.http2_only or http2Supported) then
local url, domain local url, domain
url = p.help_link url = p.help_link
domain = p.help_link_text or url:match('^%w+://([^/]+)') domain = p.help_link_text or url:match('^%w+://([^/]+)')
@ -102,6 +103,10 @@ else
end end
end end
if sys.call("curl --version | grep -q HTTP2") == 0 then
http2Supported = true
end
m = Map("https-dns-proxy", translate("DNS HTTPS Proxy Settings")) m = Map("https-dns-proxy", translate("DNS HTTPS Proxy Settings"))
h = m:section(TypedSection, "_dummy", translatef("Service Status [%s %s]", packageName, packageVersion)) h = m:section(TypedSection, "_dummy", translatef("Service Status [%s %s]", packageName, packageVersion))
@ -142,7 +147,9 @@ for filename in fs.dir(providers_dir) do
local p_func = loadfile(providers_dir .. filename) local p_func = loadfile(providers_dir .. filename)
setfenv(p_func, { _ = i18n.translate }) setfenv(p_func, { _ = i18n.translate })
local p = p_func() local p = p_func()
prov:value(p.resolver_url, p.label) if not p.http2_only or http2Supported then
prov:value(p.resolver_url, p.label)
end
if p.default then if p.default then
prov.default = p.resolver_url prov.default = p.resolver_url
end end
@ -157,8 +164,12 @@ prov.write = function(self, section, value)
value = value:gsub('[%p%c%s]', '') value = value:gsub('[%p%c%s]', '')
p.url_match = p.resolver_url:gsub('[%p%c%s]', '') p.url_match = p.resolver_url:gsub('[%p%c%s]', '')
if value:match(p.url_match) then if value:match(p.url_match) then
uci:set(packageName, section, "bootstrap_dns", p.bootstrap_dns) if p.bootstrap_dns then
uci:set(packageName, section, "resolver_url", p.resolver_url) uci:set(packageName, section, "bootstrap_dns", p.bootstrap_dns)
end
if p.resolver_url then
uci:set(packageName, section, "resolver_url", p.resolver_url)
end
end end
end end
uci:save(packageName) uci:save(packageName)

View file

@ -1,11 +1,11 @@
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:91 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:92
msgid "%s DoH at %s:%s" msgid "%s DoH at %s:%s"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:72 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:73
msgid "%s is not installed or not found" msgid "%s is not installed or not found"
msgstr "" msgstr ""
@ -57,7 +57,7 @@ msgstr ""
msgid "Cloudflare (Security Protection)" msgid "Cloudflare (Security Protection)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:117 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:122
msgid "Configuration" msgid "Configuration"
msgstr "" msgstr ""
@ -65,11 +65,11 @@ msgstr ""
msgid "DNS HTTPS Proxy" msgid "DNS HTTPS Proxy"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:105 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:110
msgid "DNS HTTPS Proxy Settings" msgid "DNS HTTPS Proxy Settings"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers.disabled/sb.dns.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/sb.dns.lua:3
msgid "DNS.SB" msgid "DNS.SB"
msgstr "" msgstr ""
@ -85,11 +85,11 @@ msgstr ""
msgid "DNSPod.cn Public DNS" msgid "DNSPod.cn Public DNS"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:184 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:195
msgid "DSCP Codepoint" msgid "DSCP Codepoint"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers.disabled/ch.digitale-gesellschaft.dns.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/ch.digitale-gesellschaft.dns.lua:3
msgid "Digitale Gesellschaft" msgid "Digitale Gesellschaft"
msgstr "" msgstr ""
@ -97,7 +97,7 @@ msgstr ""
msgid "Disable" msgid "Disable"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:125 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:130
msgid "Do not update configs" msgid "Do not update configs"
msgstr "" msgstr ""
@ -105,19 +105,19 @@ msgstr ""
msgid "Enable" msgid "Enable"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:28 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:29
msgid "For more information on different options check" msgid "For more information on different options check"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:127 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:132
msgid "Force Router DNS" msgid "Force Router DNS"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:129 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:134
msgid "Force Router DNS server to all local devices" msgid "Force Router DNS server to all local devices"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:127 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:132
msgid "Forces Router DNS use on local devices, also known as DNS Hijacking." msgid "Forces Router DNS use on local devices, also known as DNS Hijacking."
msgstr "" msgstr ""
@ -133,18 +133,18 @@ msgstr ""
msgid "IDNet.net (UK)" msgid "IDNet.net (UK)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:118 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:123
msgid "" msgid ""
"If update option is selected, the 'DNS forwardings' section of %sDHCP and DNS" "If update option is selected, the 'DNS forwardings' section of %sDHCP and DNS"
"%s will be automatically updated to use selected DoH providers (%smore " "%s will be automatically updated to use selected DoH providers (%smore "
"information%s)." "information%s)."
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:133 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:138
msgid "Instances" msgid "Instances"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:128 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:133
msgid "Let local devices use their own DNS servers if set" msgid "Let local devices use their own DNS servers if set"
msgstr "" msgstr ""
@ -156,11 +156,11 @@ msgstr ""
msgid "LibreDNS (No Ads)" msgid "LibreDNS (No Ads)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:167 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:178
msgid "Listen Address" msgid "Listen Address"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:180 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:191
msgid "Listen Port" msgid "Listen Port"
msgstr "" msgstr ""
@ -168,6 +168,14 @@ msgstr ""
msgid "Loading" msgid "Loading"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.mullvad.doh.lua:3
msgid "Mullvad"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.mullvad.doh.adblocker.lua:3
msgid "Mullvad (AdBlock)"
msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/io.nextdns.dns.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/io.nextdns.dns.lua:3
msgid "NextDNS.io" msgid "NextDNS.io"
msgstr "" msgstr ""
@ -184,7 +192,7 @@ msgstr ""
msgid "OpenDNS (Family Shield)" msgid "OpenDNS (Family Shield)"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:188 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:199
msgid "Proxy Server" msgid "Proxy Server"
msgstr "" msgstr ""
@ -212,19 +220,19 @@ msgstr ""
msgid "Reload" msgid "Reload"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:140 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:145
msgid "Resolver" msgid "Resolver"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:113 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:118
msgid "Service Control" msgid "Service Control"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:109 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:114
msgid "Service Status" msgid "Service Status"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:107 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:112
msgid "Service Status [%s %s]" msgid "Service Status [%s %s]"
msgstr "" msgstr ""
@ -236,34 +244,34 @@ msgstr ""
msgid "Stop" msgid "Stop"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:98 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:99
msgid "Stopped" msgid "Stopped"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:64 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:65
msgid "Unknown Provider" msgid "Unknown Provider"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:122 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:127
msgid "Update %s config" msgid "Update %s config"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:118 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:123
msgid "Update DNSMASQ Config on Start/Stop" msgid "Update DNSMASQ Config on Start/Stop"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:119 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:124
msgid "Update all configs" msgid "Update all configs"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:49 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:50
msgid "and" msgid "and"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:100 #: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:101
msgid "disabled" msgid "disabled"
msgstr "" msgstr ""
#: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers.disabled/cn.rubyfish.dns.lua:3 #: applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cn.rubyfish.dns.lua:3
msgid "rubyfish.cn" msgid "rubyfish.cn"
msgstr "" msgstr ""