diff options
author | onefang | 2022-01-28 05:58:19 +1000 |
---|---|---|
committer | onefang | 2022-01-28 05:58:19 +1000 |
commit | 3af7bf49de68f745876fb26392e013c873a1a8f7 (patch) | |
tree | 070451195e2e85d0656f647b0ff866dd0929ee5e | |
parent | Only do the RR check if the mirror agrees to be in the RR. (diff) | |
download | apt-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-x | apt-panopticon-report-email-web.lua | 25 | ||||
-rwxr-xr-x | apt-panopticon.lua | 2 |
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>✅</b></font>" | 211 | local inRR = "<font color='green'><b>✅</b></font>" |
212 | if nil ~= log:find("<font color='") then inRR = "<font color='red'>❌</font>" end | 212 | if nil ~= log:find("<font color='") then inRR = "<font color='red'>❌</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 |
228 | end | 228 | end |
229 | 229 | ||
@@ -321,7 +321,8 @@ local makeTable = function(web, hosts) | |||
321 | week = '<td> ' .. percentUp .. '% up</td><td> ' .. percentUpdated .. '% updated</td>' | 321 | week = '<td> ' .. percentUp .. '% up</td><td> ' .. percentUpdated .. '% updated</td>' |
322 | -- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>❌</font>" end | 322 | -- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>❌</font>" end |
323 | end | 323 | end |
324 | if "yes" ~= hosts[k].DNSRR then inRR = " " end | 324 | if "maybe" == hosts[k].DNSRR then inRR = "<font color='red'>❓</font>" end |
325 | if "no" == hosts[k].DNSRR then inRR = " " end | ||
325 | 326 | ||
326 | web:write("<td>" .. ftp .. " </td><td>" .. http .. " </td><td>" .. https .. " </td><td>" .. rsync .. " </td><td>" .. inRR .. " " .. dns .. | 327 | web:write("<td>" .. ftp .. " </td><td>" .. http .. " </td><td>" .. https .. " </td><td>" .. rsync .. " </td><td>" .. inRR .. " " .. dns .. |
327 | " </td><td>" .. protocol .. " </td><td>" .. redirects .. " </td><td>" .. sanity .. " </td><td>" .. integrity .. " </td>" .. '<td>' .. rate .. | 328 | " </td><td>" .. protocol .. " </td><td>" .. redirects .. " </td><td>" .. sanity .. " </td><td>" .. integrity .. " </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>✅</b></font>" | 376 | inRR = "<font color='green'><b>✅</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'>❓</font>" end |
389 | if "no" == hosts[k].DNSRR then inRR = "" end | ||
388 | local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] ' | 390 | local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] ' |
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>✅</b></font>" | 401 | inRR = "<font color='green'><b>✅</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'>❓</font>" end |
414 | if "no" == hosts[k].DNSRR then inRR = "" end | ||
412 | local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] ' | 415 | local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] ' |
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. |