diff options
Diffstat (limited to 'applications/luci-app-https-dns-proxy/luasrc')
6 files changed, 28 insertions, 14 deletions
diff --git a/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua b/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua index 10ce13e0cb..f7122df478 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua @@ -8,18 +8,20 @@ end function https_dns_proxy_action(name) local packageName = "https-dns-proxy" + local http = require "luci.http" + local sys = require "luci.sys" + local util = require "luci.util" if name == "start" then - luci.sys.init.start(packageName) + sys.init.start(packageName) elseif name == "action" then - luci.util.exec("/etc/init.d/" .. packageName .. " reload >/dev/null 2>&1") - luci.util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1") + util.exec("/etc/init.d/" .. packageName .. " reload >/dev/null 2>&1") elseif name == "stop" then - luci.sys.init.stop(packageName) + sys.init.stop(packageName) elseif name == "enable" then - luci.sys.init.enable(packageName) + sys.init.enable(packageName) elseif name == "disable" then - luci.sys.init.disable(packageName) + sys.init.disable(packageName) end - luci.http.prepare_content("text/plain") - luci.http.write("0") + http.prepare_content("text/plain") + http.write("0") end diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns.lua index eaa4b83703..cce097f113 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns.lua @@ -2,7 +2,7 @@ return { name = "Quad9-Recommended", label = _("Quad 9 (Recommended)"), resolver_url = "https://dns.quad9.net/dns-query", - bootstrap_dns = "9.9.9.9,149.112.112.112", + bootstrap_dns = "9.9.9.9,149.112.112.112,2620:fe::fe,2620:fe::9", help_link = "https://www.quad9.net/doh-quad9-dns-servers/", help_link_text = "Quad9.net" } diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns10.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns10.lua index 4d1914a0f6..1f281861a1 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns10.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns10.lua @@ -2,7 +2,7 @@ return { name = "Quad9-Unsecured", label = _("Quad 9 (Unsecured)"), resolver_url = "https://dns10.quad9.net/dns-query", - bootstrap_dns = "9.9.9.10,149.112.112.10", + bootstrap_dns = "9.9.9.10,149.112.112.10,2620:fe::10,2620:fe::fe:10", help_link = "https://www.quad9.net/doh-quad9-dns-servers/", help_link_text = "Quad9.net" } diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns11.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns11.lua index 36fbeb39e8..891a04974d 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns11.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns11.lua @@ -2,7 +2,7 @@ return { name = "Quad9-ECS", label = _("Quad 9 (Secured with ECS Support)"), resolver_url = "https://dns11.quad9.net/dns-query", - bootstrap_dns = "9.9.9.11,149.112.112.11", + bootstrap_dns = "9.9.9.11,149.112.112.11,2620:fe::11,2620:fe::fe:11", help_link = "https://www.quad9.net/doh-quad9-dns-servers/", help_link_text = "Quad9.net" } diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns9.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns9.lua index 61ca444eff..a497d5e3d1 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns9.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.quad9.dns9.lua @@ -2,7 +2,7 @@ return { name = "Quad9-Secured", label = _("Quad 9 (Secured)"), resolver_url = "https://dns9.quad9.net/dns-query", - bootstrap_dns = "9.9.9.9,149.112.112.9", + bootstrap_dns = "9.9.9.9,149.112.112.9,2620:fe::fe,2620:fe::9", help_link = "https://www.quad9.net/doh-quad9-dns-servers/", help_link_text = "Quad9.net" } diff --git a/applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua b/applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua index 4fdaf26a00..8842909c8c 100644 --- a/applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua +++ b/applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua @@ -6,6 +6,7 @@ local i18n = require "luci.i18n" local uci = require("luci.model.uci").cursor() local packageName = "https-dns-proxy" +local readmeURL = "https://docs.openwrt.melmac.net/" .. packageName .. "/" local providers_dir = "/usr/lib/lua/luci/" .. packageName .. "/providers/" local helperText = "" @@ -24,7 +25,7 @@ function getPackageVersion() end function createHelperText() - local initText = "<br />" .. translate("For more information on different options check") .. " " + local initText = translate("For more information on different options check") .. " " for filename in fs.dir(providers_dir) do local p_func = loadfile(providers_dir .. filename) setfenv(p_func, { _ = i18n.translate }) @@ -122,9 +123,20 @@ else buttons.template = packageName .. "/buttons" end +c = m:section(NamedSection, "config", "https-dns-proxy", translate("Configuration"), translatef("If update DNSMASQ config is selected, when you add/remove any instances below, they will be used to override the 'DNS forwardings' section of %sDHCP and DNS%s (%smore information%s).", "<a href=\"" .. dispatcher.build_url("admin/network/dhcp") .. "\">", "</a>", "<a href=\"" .. readmeURL .. "#default-settings" .. "\" target=\"_blank\">", "</a>")) +d1 = c:option(ListValue, "update_dnsmasq_config", translate("Update DNSMASQ Config on Start/Stop")) +d1:value('*', translate("Update all configs")) +local dnsmasq_num = 0 +uci:foreach("dhcp", "dnsmasq", function(s) +d1:value(tostring(dnsmasq_num), translatef("Update %s config", "dhcp.@dnsmasq[" .. tostring(dnsmasq_num) .. "]")) +dnsmasq_num = dnsmasq_num + 1 +end) +d1:value('-', translate("Do not update configs")) +d1.default = '*' + createHelperText() s3 = m:section(TypedSection, "https-dns-proxy", translate("Instances"), - translatef("When you add/remove any instances below, they will be used to override the 'DNS forwardings' section of %sDHCP and DNS%s.", "<a href=\"" .. dispatcher.build_url("admin/network/dhcp") .. "\">", "</a>") .. helperText) + helperText) s3.template = "cbi/tblsection" s3.sortable = false s3.anonymous = true |