From bf5ee4b51368d8ea4746958236a1d2449b3ae57d Mon Sep 17 00:00:00 2001
From: onefang
Date: Fri, 17 Jul 2020 05:30:44 +1000
Subject: Use the new DNSRR field from mirror_list.txt to do the correct thing.
---
apt-panopticon-report-email-web.lua | 42 ++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 19 deletions(-)
(limited to 'apt-panopticon-report-email-web.lua')
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index b8b487e..a9852c1 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -346,28 +346,32 @@ local makeIPlist = function(hosts)
if nil ~= hosts[k].IPs then
for l, w in pairs(hosts[k].IPs) do
if type(w) == "table" then
- n[l] = {}
- for i, u in pairs(w) do
- if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then
- local inRR = ""
- local lc = logCount(k, i)
- if checkRR then
- -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
- inRR = "✅"
- if nil ~= lc:find("❌"
- if nil ~= RRbfile then
- local f, e = RRbfile:write(i, '\n')
- if f == nil then C("writing DNS-RR_bad.txt file - " .. e) end
+-- TODO - don't hard code deb.roundr.devuan.org.
+ -- Don't output the extra DNS-RR entries that are for admin reasons.
+ if ((APT.options.roundRobin.value == k) and ("deb.roundr.devuan.org" == l)) or (APT.options.roundRobin.value ~= k) then
+ n[l] = {}
+ for i, u in pairs(w) do
+ if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then
+ local inRR = ""
+ local lc = logCount(k, i)
+ if checkRR then
+ -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
+ inRR = "✅"
+ if nil ~= lc:find("❌"
+ if nil ~= RRbfile then
+ local f, e = RRbfile:write(i, '\n')
+ if f == nil then C("writing DNS-RR_bad.txt file - " .. e) end
+ end
+ elseif nil ~= RRgfile then
+ local f, e = RRgfile:write(i, '\n')
+ if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
end
- elseif nil ~= RRgfile then
- local f, e = RRgfile:write(i, '\n')
- if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
end
+ if "yes" ~= hosts[k].DNSRR then inRR = "" end
+ local log = '[graphs] '
+ if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end
end
- if "yes" ~= hosts[k].DNSRR then inRR = "" end
- local log = '[graphs] '
- if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end
end
end
else
--
cgit v1.1