summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-unbound/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-unbound/luasrc')
-rw-r--r--applications/luci-app-unbound/luasrc/controller/unbound.lua30
-rw-r--r--applications/luci-app-unbound/luasrc/model/cbi/unbound/zones.lua6
2 files changed, 26 insertions, 10 deletions
diff --git a/applications/luci-app-unbound/luasrc/controller/unbound.lua b/applications/luci-app-unbound/luasrc/controller/unbound.lua
index 734476acae..32879cb9f2 100644
--- a/applications/luci-app-unbound/luasrc/controller/unbound.lua
+++ b/applications/luci-app-unbound/luasrc/controller/unbound.lua
@@ -53,7 +53,7 @@ function index()
call("QueryLocalZone"), _("Local Zones"), 30).leaf = true
entry({"admin", "services", "unbound", "status", "dumpcache"},
- call("QueryCacheDump"), _("Cache Dump"), 40).leaf = true
+ call("QueryDumpCache"), _("DNS Cache"), 40).leaf = true
else
entry({"admin", "services", "unbound", "status", "statistics"},
call("ShowEmpty"), _("Statistics"), 10).leaf = true
@@ -153,17 +153,33 @@ function QueryLocalZone()
{heading = "", description = lcldesc, content = lcldata})
end
-function QueryCacheDump()
+
+function QueryDumpCache()
+ local tp = require "luci.template"
+ local tr = require "luci.i18n"
+ local lcldesc
local lcldata = luci.util.exec(
"unbound-control -c /var/lib/unbound/unbound.conf dump_cache")
- local lcldesc = luci.i18n.translate(
- "This shows Unbound 'cache_dump'. Usefull to check if unbound is actually caching dns entities.")
- luci.template.render("unbound/show-textbox",
- {heading = "", description = lcldesc, content = lcldata})
+ if #lcldata > 262144 then
+ lcldesc = tr.translate(
+ "Unbound cache is too large to display in LuCI.")
+
+ tp.render("unbound/show-empty",
+ {heading = "", description = lcldesc})
+
+ else
+ lcldesc = tr.translate(
+ "This shows 'ubound-control dump_cache' for auditing records including DNSSEC.")
+
+ tp.render("unbound/show-textbox",
+ {heading = "", description = lcldesc, content = lcldata})
+ end
+
end
+
function ShowUnboundConf()
local unboundfile = "/var/lib/unbound/unbound.conf"
local lcldata = nixio.fs.readfile(unboundfile)
@@ -196,7 +212,7 @@ function ShowAdblock()
if fs.stat(adblockfile).size > 262144 then
lcldesc = tr.translate(
- "Adblock domain list '" .. adblockfile .. "' is too large for LuCI.")
+ "Adblock domain list is too large to display in LuCI.")
tp.render("unbound/show-empty",
{heading = "", description = lcldesc})
diff --git a/applications/luci-app-unbound/luasrc/model/cbi/unbound/zones.lua b/applications/luci-app-unbound/luasrc/model/cbi/unbound/zones.lua
index 798ca6a45c..3a13c23df9 100644
--- a/applications/luci-app-unbound/luasrc/model/cbi/unbound/zones.lua
+++ b/applications/luci-app-unbound/luasrc/model/cbi/unbound/zones.lua
@@ -58,7 +58,7 @@ end
function ztype.cfgvalue(self, s)
- -- Format a meaninful tile for the Zone Type column
+ -- Format a meaningful tile for the Zone Type column
local itxt = self.map:get(s, "zone_type")
local itls = self.map:get(s, "tls_upstream")
@@ -84,7 +84,7 @@ end
function zones.cfgvalue(self, s)
- -- Format a meaninful sentence for the Zones viewed column
+ -- Format a meaningful sentence for the Zones viewed column
local xtxt, otxt
local itxt = self.map:get(s, "zone_name")
local itype = self.map:get(s, "zone_type")
@@ -131,7 +131,7 @@ end
function servers.cfgvalue(self, s)
- -- Format a meaninful sentence for the Servers (and URL) column
+ -- Format a meaningful sentence for the Servers (and URL) column
local xtxt, otxt, rtxt, found
local itxt = self.map:get(s, "server")
local iurl = self.map:get(s, "url_dir")