aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-11-24 05:26:04 +1000
committeronefang2019-11-24 05:26:04 +1000
commitf3eeefbe85dfddded148b28817a0306768cb7e75 (patch)
treece7bc407d3b2668bb49018cd1ffa37eb2db4ca63
parentMissing DNS-RR IPs is a warningish, so make it maroon. (diff)
downloadapt-panopticon-f3eeefbe85dfddded148b28817a0306768cb7e75.zip
apt-panopticon-f3eeefbe85dfddded148b28817a0306768cb7e75.tar.gz
apt-panopticon-f3eeefbe85dfddded148b28817a0306768cb7e75.tar.bz2
apt-panopticon-f3eeefbe85dfddded148b28817a0306768cb7e75.tar.xz
Reverese lookup the DNS-RR names.
-rwxr-xr-xapt-panopticon-report-web.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua
index 251aa89..f17bf54 100755
--- a/apt-panopticon-report-web.lua
+++ b/apt-panopticon-report-web.lua
@@ -121,6 +121,27 @@ local W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end
121local E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end 121local E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end
122local C = function(s) log(-1, "CRITICAL", s) end 122local C = function(s) log(-1, "CRITICAL", s) end
123 123
124local mirrors = loadfile("results/mirrors.lua")()
125
126local revDNS = function(dom, IP)
127 if "deb.devuan.org" ~= dom then return "" end
128 for k, v in pairs(mirrors) do
129 if "deb.devuan.org" ~= k then
130 local IPs = v.IPs
131 for i, u in pairs(IPs) do
132 if "table" == type(u) then
133 for h, t in pairs(u) do
134 if IP == h then return k end
135 end
136 else
137 if IP == i then return k end
138 end
139 end
140 end
141 end
142 return ""
143end
144
124local faulty = "" 145local faulty = ""
125local status = function(host, results, typ) 146local status = function(host, results, typ)
126 local result = "" 147 local result = ""
@@ -190,7 +211,6 @@ local collate = function(host, ip, results)
190 return results 211 return results
191end 212end
192 213
193local mirrors = loadfile("results/mirrors.lua")()
194local m = {} 214local m = {}
195 215
196local logCount = function(domain, ip) 216local logCount = function(domain, ip)
@@ -307,11 +327,11 @@ if nil == file then C("opening mirrors file - " .. e) else
307 n[l] = {} 327 n[l] = {}
308 for i, u in pairs(w) do 328 for i, u in pairs(w) do
309 local log = logCount(k, i) 329 local log = logCount(k, i)
310 if "" == log then n[l][i] = u else n[l][log] = u end 330 if "" == log then n[l][i] = u else n[l][log .. " " .. revDNS(k, i)] = u end
311 end 331 end
312 else 332 else
313 local log = logCount(k, l) 333 local log = logCount(k, l)
314 if "" == log then n[l] = w else n[log] = w end 334 if "" == log then n[l] = w else n[log .. " " .. revDNS(k, l)] = w end
315 end 335 end
316 end 336 end
317 m[log .. " DNS entries -"] = n 337 m[log .. " DNS entries -"] = n