summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-https-dns-proxy/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-https-dns-proxy/luasrc')
-rw-r--r--applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cz.nic.odvr.lua2
-rw-r--r--applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.idnet.doh.lua6
-rw-r--r--applications/luci-app-https-dns-proxy/luasrc/model/cbi/https-dns-proxy.lua73
-rw-r--r--applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm14
-rw-r--r--applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/status.htm4
5 files changed, 51 insertions, 48 deletions
diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cz.nic.odvr.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cz.nic.odvr.lua
index 3dfe309368..177af87717 100644
--- a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cz.nic.odvr.lua
+++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/cz.nic.odvr.lua
@@ -2,5 +2,5 @@ return {
name = "odvr-nic-cz",
label = _("ODVR (nic.cz)"),
resolver_url = "https://odvr.nic.cz/doh",
- bootstrap_dns = "193.17.47.1,185.43.135.1"
+ bootstrap_dns = "193.17.47.1,185.43.135.1,2001:148f:ffff::1,2001:148f:fffe::1"
}
diff --git a/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.idnet.doh.lua b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.idnet.doh.lua
new file mode 100644
index 0000000000..27ea3ec575
--- /dev/null
+++ b/applications/luci-app-https-dns-proxy/luasrc/https-dns-proxy/providers/net.idnet.doh.lua
@@ -0,0 +1,6 @@
+return{
+ name = "IDNet (UK)",
+ label = _("IDNet.net (UK)"),
+ resolver_url = "https://doh.idnet.net/dns-query",
+ bootstrap_dns = "212.69.36.23,212.69.40.23"
+}
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 e38e4e39b6..620c8d6c88 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
@@ -69,38 +69,36 @@ local ubusStatus = util.ubus("service", "list", { name = packageName })
local packageVersion = getPackageVersion()
if packageVersion == "" then
- packageStatusCode = -1
- packageStatus = translatef("%s is not installed or not found", packageName)
+ packageStatusCode, packageStatus = -1, translatef("%s is not installed or not found", packageName)
else
- if not ubusStatus or not ubusStatus[packageName] then
+ packageStatusCode, packageStatus = 1, ""
+ for n = 1,20 do
+ if ubusStatus and ubusStatus[packageName] and
+ ubusStatus[packageName]["instances"] and
+ ubusStatus[packageName]["instances"]["instance" .. n] and
+ ubusStatus[packageName]["instances"]["instance" .. n]["running"] then
+ local value, k, v, url, url_flag, la, la_flag, lp, lp_flag
+ for k, v in pairs(ubusStatus[packageName]["instances"]["instance" .. n]["command"]) do
+ if la_flag then la, la_flag = v, false end
+ if lp_flag then lp, lp_flag = v, false end
+ if url_flag then url, url_flag = v, false end
+ if v == "-a" then la_flag = true end
+ if v == "-p" then lp_flag = true end
+ if v == "-r" then url_flag = true end
+ end
+ la = la or "127.0.0.1"
+ lp = lp or n + 5053
+ packageStatus = packageStatus .. translatef("%s DoH at %s:%s", getProviderName(url), la, lp) .. "\n"
+ else
+ break
+ end
+ end
+ if packageStatus == "" then
packageStatusCode = 0
packageStatus = translate("Stopped")
if not sys.init.enabled(packageName) then
packageStatus = packageStatus .. " (" .. translate("disabled") .. ")"
end
- else
- packageStatusCode, packageStatus = 1, ""
- for n = 1,1000 do
- if ubusStatus and ubusStatus[packageName] and
- ubusStatus[packageName]["instances"] and
- ubusStatus[packageName]["instances"]["instance" .. n] and
- ubusStatus[packageName]["instances"]["instance" .. n]["running"] then
- local value, k, v, url, url_flag, la, la_flag, lp, lp_flag
- for k, v in pairs(ubusStatus[packageName]["instances"]["instance" .. n]["command"]) do
- if la_flag then la, la_flag = v, false end
- if lp_flag then lp, lp_flag = v, false end
- if url_flag then url, url_flag = v, false end
- if v == "-a" then la_flag = true end
- if v == "-p" then lp_flag = true end
- if v == "-r" then url_flag = true end
- end
- la = la or "127.0.0.1"
- lp = lp or n + 5053
- packageStatus = packageStatus .. translatef("Running: %s DoH at %s:%s", getProviderName(url), la, lp) .. "\n"
- else
- break
- end
- end
end
end
@@ -109,22 +107,15 @@ m = Map("https-dns-proxy", translate("DNS HTTPS Proxy Settings"))
h = m:section(TypedSection, "_dummy", translatef("Service Status [%s %s]", packageName, packageVersion))
h.template = "cbi/nullsection"
ss = h:option(DummyValue, "_dummy", translate("Service Status"))
-if packageStatusCode == -1 then
- ss.template = packageName .. "/status"
- ss.value = packageStatus
-else
- if packageStatusCode == 0 then
- ss.template = packageName .. "/status"
- else
- ss.template = packageName .. "/status-textarea"
- end
- ss.value = packageStatus
- buttons = h:option(DummyValue, "_dummy")
+ss.template = packageName .. "/status"
+ss.value = packageStatus
+if packageStatusCode ~= -1 then
+ buttons = h:option(DummyValue, "_dummy", translate("Service Control"))
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"))
+c = m:section(NamedSection, "config", "https-dns-proxy", translate("Configuration"))
+d1 = c:option(ListValue, "update_dnsmasq_config", translate("Update DNSMASQ Config on Start/Stop"), translatef("If update option is selected, the 'DNS forwardings' section of %sDHCP and DNS%s will be automatically updated to use selected DoH providers (%smore information%s).", "<a href=\"" .. dispatcher.build_url("admin/network/dhcp") .. "\">", "</a>", "<a href=\"" .. readmeURL .. "#default-settings" .. "\" target=\"_blank\">", "</a>"))
d1:value('*', translate("Update all configs"))
local dnsmasq_num = 0
uci:foreach("dhcp", "dnsmasq", function(s)
@@ -133,6 +124,10 @@ dnsmasq_num = dnsmasq_num + 1
end)
d1:value('-', translate("Do not update configs"))
d1.default = '*'
+f1 = c:option(ListValue, "force_dns", translate("Force Router DNS"), translate("Forces Router DNS use on local devices, also known as DNS Hijacking."))
+f1:value("0", translate("Let local devices use their own DNS servers if set"))
+f1:value("1", translate("Force Router DNS server to all local devices"))
+f1.default = '1'
createHelperText()
s3 = m:section(TypedSection, "https-dns-proxy", translate("Instances"),
diff --git a/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm b/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm
index b7fcd472ed..9cfd25e50e 100644
--- a/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm
+++ b/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/buttons.htm
@@ -36,29 +36,29 @@
end
-%>
-<div class="cbi-value"><label class="cbi-value-title">Service Control</label>
+<%+cbi/valueheader%>
<div class="cbi-value-field">
- <input type="button" class="cbi-button cbi-button-apply" id="btn_start" name="start" value="<%:Start%>"
+ <input type="button" class="btn cbi-button cbi-button-apply" id="btn_start" name="start" value="<%:Start%>"
onclick="button_action(this)" />
<span id="btn_start_spinner" class="btn_spinner"></span>
- <input type="button" class="cbi-button cbi-button-apply" id="btn_action" name="action" value="<%:Reload%>"
+ <input type="button" class="btn cbi-button cbi-button-apply" id="btn_action" name="action" value="<%:Reload%>"
onclick="button_action(this)" />
<span id="btn_action_spinner" class="btn_spinner"></span>
- <input type="button" class="cbi-button cbi-button-reset" id="btn_stop" name="stop" value="<%:Stop%>"
+ <input type="button" class="btn cbi-button cbi-button-reset" id="btn_stop" name="stop" value="<%:Stop%>"
onclick="button_action(this)" />
<span id="btn_stop_spinner" class="btn_spinner"></span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
- <input type="button" class="cbi-button cbi-button-apply" id="btn_enable" name="enable" value="<%:Enable%>"
+ <input type="button" class="btn cbi-button cbi-button-apply" id="btn_enable" name="enable" value="<%:Enable%>"
onclick="button_action(this)" />
<span id="btn_enable_spinner" class="btn_spinner"></span>
- <input type="button" class="cbi-button cbi-button-reset" id="btn_disable" name="disable" value="<%:Disable%>"
+ <input type="button" class="btn cbi-button cbi-button-reset" id="btn_disable" name="disable" value="<%:Disable%>"
onclick="button_action(this)" />
<span id="btn_disable_spinner" class="btn_spinner"></span>
</div>
-</div>
+<%+cbi/valuefooter%>
<%-if not btn_start_status then%>
<script type="text/javascript">document.getElementById("btn_start").disabled = true;</script>
diff --git a/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/status.htm b/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/status.htm
index c453428405..b02c7faa82 100644
--- a/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/status.htm
+++ b/applications/luci-app-https-dns-proxy/luasrc/view/https-dns-proxy/status.htm
@@ -5,6 +5,8 @@ This is free software, licensed under the Apache License, Version 2.0
<%+cbi/valueheader%>
-<input name="status" id="status" type="text" class="cbi-input-text" style="outline:none;border:none;box-shadow:none;background:transparent;font-weight:bold;line-height:30px;height:30px;width:50em;" value="<%=self:cfgvalue(section)%>" disabled="disabled" />
+<div style="font-weight:bold;">
+ <%=self:cfgvalue(section):gsub('\n', '<br />' )%>
+</div>
<%+cbi/valuefooter%>