aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2022-01-28 05:58:19 +1000
committeronefang2022-01-28 05:58:19 +1000
commit3af7bf49de68f745876fb26392e013c873a1a8f7 (patch)
tree070451195e2e85d0656f647b0ff866dd0929ee5e
parentOnly do the RR check if the mirror agrees to be in the RR. (diff)
downloadapt-panopticon-3af7bf49de68f745876fb26392e013c873a1a8f7.zip
apt-panopticon-3af7bf49de68f745876fb26392e013c873a1a8f7.tar.gz
apt-panopticon-3af7bf49de68f745876fb26392e013c873a1a8f7.tar.bz2
apt-panopticon-3af7bf49de68f745876fb26392e013c873a1a8f7.tar.xz
Include DNSRR: maybe in the DNSRR checks.
-rwxr-xr-xapt-panopticon-report-email-web.lua25
-rwxr-xr-xapt-panopticon.lua2
2 files changed, 15 insertions, 12 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index 071771b..2b29cdf 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -202,11 +202,11 @@ local DNSrrTest = function(hosts, k)
202 space = '   ' 202 space = '   '
203 no = "<font color='grey'><b>no</b></font>" 203 no = "<font color='grey'><b>no</b></font>"
204 end 204 end
205 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) then 205 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) and ("no" ~= hosts[k].DNSRR) then
206 APT.allpairs(hosts[k].IPs, 206 APT.allpairs(hosts[k].IPs,
207 function(i, w, k, v) 207 function(i, w, k, v)
208 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value] then 208-- if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value] then
209 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value][i] then 209-- if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value][i] then
210 local log = logCount(APT.options.roundRobin.value, i) 210 local log = logCount(APT.options.roundRobin.value, i)
211 local inRR = "<font color='green'><b>&#x2705;</b></font>" 211 local inRR = "<font color='green'><b>&#x2705;</b></font>"
212 if nil ~= log:find("<font color='") then inRR = "<font color='red'>&#x274c;</font>" end 212 if nil ~= log:find("<font color='") then inRR = "<font color='red'>&#x274c;</font>" end
@@ -218,12 +218,12 @@ local DNSrrTest = function(hosts, k)
218 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end 218 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end
219 dns = dns .. inRR .. i 219 dns = dns .. inRR .. i
220 end 220 end
221 end 221-- end
222 end 222-- end
223 end 223 end
224 ) 224 )
225 if "" == dns then dns = no end
226 end 225 end
226 if "" == dns then dns = no end
227 return dns 227 return dns
228end 228end
229 229
@@ -321,7 +321,8 @@ local makeTable = function(web, hosts)
321 week = '<td>&nbsp;' .. percentUp .. '% up</td><td>&nbsp;' .. percentUpdated .. '% updated</td>' 321 week = '<td>&nbsp;' .. percentUp .. '% up</td><td>&nbsp;' .. percentUpdated .. '% updated</td>'
322-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>&#x274c;</font>" end 322-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>&#x274c;</font>" end
323 end 323 end
324 if "yes" ~= hosts[k].DNSRR then inRR = " &nbsp; &nbsp; " end 324 if "maybe" == hosts[k].DNSRR then inRR = "<font color='red'>&#x2753;</font>" end
325 if "no" == hosts[k].DNSRR then inRR = " &nbsp; &nbsp; " end
325 326
326 web:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. inRR .. " " .. dns .. 327 web:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. inRR .. " " .. dns ..
327 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. redirects .. "&nbsp;</td><td>" .. sanity .. "&nbsp;</td><td>" .. integrity .. "&nbsp;</td>" .. '<td>' .. rate .. 328 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. redirects .. "&nbsp;</td><td>" .. sanity .. "&nbsp;</td><td>" .. integrity .. "&nbsp;</td>" .. '<td>' .. rate ..
@@ -370,7 +371,7 @@ local makeIPlist = function(hosts)
370 if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then 371 if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then
371 local inRR = "" 372 local inRR = ""
372 local lc = logCount(k, i) 373 local lc = logCount(k, i)
373 if checkRR and ('yes' == hosts[k].DNSRR) then 374 if checkRR and ('no' ~= hosts[k].DNSRR) then
374 -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags. 375 -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
375 inRR = "<font color='green'><b>&#x2705;</b></font>" 376 inRR = "<font color='green'><b>&#x2705;</b></font>"
376 if nil ~= lc:find("<font color='") then 377 if nil ~= lc:find("<font color='") then
@@ -384,7 +385,8 @@ local makeIPlist = function(hosts)
384 if f == nil then C("writing DNS-RR_good.txt file - " .. e) end 385 if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
385 end 386 end
386 end 387 end
387 if "yes" ~= hosts[k].DNSRR then inRR = "" end 388 if "maybe" == hosts[k].DNSRR then inRR = "<font color='red'>&#x2753;</font>" end
389 if "no" == hosts[k].DNSRR then inRR = "" end
388 local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; ' 390 local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; '
389 if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end 391 if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end
390 end 392 end
@@ -394,7 +396,7 @@ local makeIPlist = function(hosts)
394 if (APT.testing("IPv6") and ("AAAA" == w)) or ("A" == w) then 396 if (APT.testing("IPv6") and ("AAAA" == w)) or ("A" == w) then
395 local inRR = "" 397 local inRR = ""
396 local lc = logCount(k, l) 398 local lc = logCount(k, l)
397 if checkRR and ('yes' == hosts[k].DNSRR) then 399 if checkRR and ('no' ~= hosts[k].DNSRR) then
398 -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags. 400 -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
399 inRR = "<font color='green'><b>&#x2705;</b></font>" 401 inRR = "<font color='green'><b>&#x2705;</b></font>"
400 if nil ~= lc:find("<font color='") then 402 if nil ~= lc:find("<font color='") then
@@ -408,7 +410,8 @@ local makeIPlist = function(hosts)
408 if f == nil then C("writing DNS-RR_good.txt file - " .. e) end 410 if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
409 end 411 end
410 end 412 end
411 if "yes" ~= hosts[k].DNSRR then inRR = "" end 413 if "maybe" == hosts[k].DNSRR then inRR = "<font color='red'>&#x2753;</font>" end
414 if "no" == hosts[k].DNSRR then inRR = "" end
412 local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; ' 415 local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; '
413 if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end 416 if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end
414 end 417 end
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index cf40ce4..83f119a 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -195,7 +195,7 @@ gatherIPs = function (host)
195 -- If this is the DNS-RR domain name, gather the IPs for the mirrors that mirror_list.txt says should be in it. 195 -- If this is the DNS-RR domain name, gather the IPs for the mirrors that mirror_list.txt says should be in it.
196 if host == APT.options.roundRobin.value then 196 if host == APT.options.roundRobin.value then
197 for k, m in pairs(APT.mirrors) do 197 for k, m in pairs(APT.mirrors) do
198 if "yes" == m.DNSRR then 198 if ("yes" == m.DNSRR) or ("maybe" == m.DNSRR) then
199 gatherIPs(m.FQDN) 199 gatherIPs(m.FQDN)
200 IP[host][m.FQDN] = IP[m.FQDN] 200 IP[host][m.FQDN] = IP[m.FQDN]
201 -- Strip them out so we don't test them twice. 201 -- Strip them out so we don't test them twice.