luci-app-https-dns-proxy: WebUI for dnsmasq config update, quad9 bootstrap IPv6
Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
parent
893482eb2a
commit
7184b96f47
9 changed files with 72 additions and 36 deletions
|
@ -10,7 +10,7 @@ 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
|
||||||
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy
|
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +https-dns-proxy
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_RELEASE:=12
|
PKG_RELEASE:=13
|
||||||
|
|
||||||
include ../../luci.mk
|
include ../../luci.mk
|
||||||
|
|
||||||
|
|
|
@ -8,18 +8,20 @@ end
|
||||||
|
|
||||||
function https_dns_proxy_action(name)
|
function https_dns_proxy_action(name)
|
||||||
local packageName = "https-dns-proxy"
|
local packageName = "https-dns-proxy"
|
||||||
|
local http = require "luci.http"
|
||||||
|
local sys = require "luci.sys"
|
||||||
|
local util = require "luci.util"
|
||||||
if name == "start" then
|
if name == "start" then
|
||||||
luci.sys.init.start(packageName)
|
sys.init.start(packageName)
|
||||||
elseif name == "action" then
|
elseif name == "action" then
|
||||||
luci.util.exec("/etc/init.d/" .. packageName .. " reload >/dev/null 2>&1")
|
util.exec("/etc/init.d/" .. packageName .. " reload >/dev/null 2>&1")
|
||||||
luci.util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
|
|
||||||
elseif name == "stop" then
|
elseif name == "stop" then
|
||||||
luci.sys.init.stop(packageName)
|
sys.init.stop(packageName)
|
||||||
elseif name == "enable" then
|
elseif name == "enable" then
|
||||||
luci.sys.init.enable(packageName)
|
sys.init.enable(packageName)
|
||||||
elseif name == "disable" then
|
elseif name == "disable" then
|
||||||
luci.sys.init.disable(packageName)
|
sys.init.disable(packageName)
|
||||||
end
|
end
|
||||||
luci.http.prepare_content("text/plain")
|
http.prepare_content("text/plain")
|
||||||
luci.http.write("0")
|
http.write("0")
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
name = "Quad9-Recommended",
|
name = "Quad9-Recommended",
|
||||||
label = _("Quad 9 (Recommended)"),
|
label = _("Quad 9 (Recommended)"),
|
||||||
resolver_url = "https://dns.quad9.net/dns-query",
|
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 = "https://www.quad9.net/doh-quad9-dns-servers/",
|
||||||
help_link_text = "Quad9.net"
|
help_link_text = "Quad9.net"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
name = "Quad9-Unsecured",
|
name = "Quad9-Unsecured",
|
||||||
label = _("Quad 9 (Unsecured)"),
|
label = _("Quad 9 (Unsecured)"),
|
||||||
resolver_url = "https://dns10.quad9.net/dns-query",
|
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 = "https://www.quad9.net/doh-quad9-dns-servers/",
|
||||||
help_link_text = "Quad9.net"
|
help_link_text = "Quad9.net"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
name = "Quad9-ECS",
|
name = "Quad9-ECS",
|
||||||
label = _("Quad 9 (Secured with ECS Support)"),
|
label = _("Quad 9 (Secured with ECS Support)"),
|
||||||
resolver_url = "https://dns11.quad9.net/dns-query",
|
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 = "https://www.quad9.net/doh-quad9-dns-servers/",
|
||||||
help_link_text = "Quad9.net"
|
help_link_text = "Quad9.net"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
name = "Quad9-Secured",
|
name = "Quad9-Secured",
|
||||||
label = _("Quad 9 (Secured)"),
|
label = _("Quad 9 (Secured)"),
|
||||||
resolver_url = "https://dns9.quad9.net/dns-query",
|
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 = "https://www.quad9.net/doh-quad9-dns-servers/",
|
||||||
help_link_text = "Quad9.net"
|
help_link_text = "Quad9.net"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ local i18n = require "luci.i18n"
|
||||||
local uci = require("luci.model.uci").cursor()
|
local uci = require("luci.model.uci").cursor()
|
||||||
|
|
||||||
local packageName = "https-dns-proxy"
|
local packageName = "https-dns-proxy"
|
||||||
|
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 = ""
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ function getPackageVersion()
|
||||||
end
|
end
|
||||||
|
|
||||||
function createHelperText()
|
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
|
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 })
|
||||||
|
@ -122,9 +123,20 @@ else
|
||||||
buttons.template = packageName .. "/buttons"
|
buttons.template = packageName .. "/buttons"
|
||||||
end
|
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()
|
createHelperText()
|
||||||
s3 = m:section(TypedSection, "https-dns-proxy", translate("Instances"),
|
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.template = "cbi/tblsection"
|
||||||
s3.sortable = false
|
s3.sortable = false
|
||||||
s3.anonymous = true
|
s3.anonymous = true
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
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: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 ""
|
||||||
|
|
||||||
|
@ -53,11 +53,15 @@ msgstr ""
|
||||||
msgid "Cloudflare (Security Protection)"
|
msgid "Cloudflare (Security Protection)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:126
|
||||||
|
msgid "Configuration"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua:4
|
#: applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua:4
|
||||||
msgid "DNS HTTPS Proxy"
|
msgid "DNS HTTPS Proxy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:106
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:107
|
||||||
msgid "DNS HTTPS Proxy Settings"
|
msgid "DNS HTTPS Proxy Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -77,11 +81,15 @@ msgstr ""
|
||||||
msgid "Disable"
|
msgid "Disable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:134
|
||||||
|
msgid "Do not update configs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:54
|
#: applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm:54
|
||||||
msgid "Enable"
|
msgid "Enable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:27
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:28
|
||||||
msgid "For more information on different options check"
|
msgid "For more information on different options check"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -89,7 +97,18 @@ msgstr ""
|
||||||
msgid "Google"
|
msgid "Google"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/root/usr/share/rpcd/acl.d/luci-app-https-dns-proxy.json:3
|
||||||
|
msgid "Grant UCI and file access for luci-app-https-dns-proxy"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:126
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:126
|
||||||
|
msgid ""
|
||||||
|
"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)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:138
|
||||||
msgid "Instances"
|
msgid "Instances"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -101,11 +120,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:160
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:172
|
||||||
msgid "Listen address"
|
msgid "Listen address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:173
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:185
|
||||||
msgid "Listen port"
|
msgid "Listen port"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -125,7 +144,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:177
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:189
|
||||||
msgid "Proxy server"
|
msgid "Proxy server"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -149,19 +168,19 @@ msgstr ""
|
||||||
msgid "Reload"
|
msgid "Reload"
|
||||||
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:145
|
||||||
msgid "Resolver"
|
msgid "Resolver"
|
||||||
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 "Running: %s DoH at %s:%s"
|
msgid "Running: %s DoH at %s:%s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:110
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:111
|
||||||
msgid "Service Status"
|
msgid "Service Status"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:108
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:109
|
||||||
msgid "Service Status [%s %s]"
|
msgid "Service Status [%s %s]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -173,25 +192,31 @@ msgstr ""
|
||||||
msgid "Stop"
|
msgid "Stop"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:76
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:77
|
||||||
msgid "Stopped"
|
msgid "Stopped"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:63
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:64
|
||||||
msgid "Unknown Provider"
|
msgid "Unknown Provider"
|
||||||
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:131
|
||||||
msgid ""
|
msgid "Update %s config"
|
||||||
"When you add/remove any instances below, they will be used to override the "
|
|
||||||
"'DNS forwardings' section of %sDHCP and DNS%s."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:48
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:127
|
||||||
|
msgid "Update DNSMASQ Config on Start/Stop"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:128
|
||||||
|
msgid "Update all configs"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:49
|
||||||
msgid "and"
|
msgid "and"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:78
|
#: applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua:79
|
||||||
msgid "disabled"
|
msgid "disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
"/usr/lib/lua/luci/https-dns-proxy/providers/*": [
|
"/usr/lib/lua/luci/https-dns-proxy/providers/*": [
|
||||||
"read"
|
"read"
|
||||||
],
|
],
|
||||||
"/etc/init.d/dnsmasq *": [
|
|
||||||
"exec"
|
|
||||||
],
|
|
||||||
"/etc/init.d/https-dns-proxy *": [
|
"/etc/init.d/https-dns-proxy *": [
|
||||||
"exec"
|
"exec"
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue