aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2021-12-17 14:58:46 +1000
committeronefang2021-12-17 14:58:46 +1000
commitfe8fc1dee06b74217d5a025707720553dd2a2368 (patch)
tree49155795c20ec1ba6f3656bb75c1aee60b5652bc
parentDon't crash if a DNS-RR mirror fails to resolve. (diff)
downloadapt-panopticon-fe8fc1dee06b74217d5a025707720553dd2a2368.zip
apt-panopticon-fe8fc1dee06b74217d5a025707720553dd2a2368.tar.gz
apt-panopticon-fe8fc1dee06b74217d5a025707720553dd2a2368.tar.bz2
apt-panopticon-fe8fc1dee06b74217d5a025707720553dd2a2368.tar.xz
Don't hard code deb.roundr.devuan.org all over the place, and check the results.
Coz it got changed to deb.rr.devuan.org.
-rw-r--r--apt-panopticommon.lua6
-rwxr-xr-xapt-panopticon-report-email-web.lua35
-rwxr-xr-xapt-panopticon.lua7
3 files changed, 29 insertions, 19 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua
index f2a7fee..3e2dc08 100644
--- a/apt-panopticommon.lua
+++ b/apt-panopticommon.lua
@@ -53,6 +53,12 @@ APT.options =
53 help = "The round robin DNS name.", 53 help = "The round robin DNS name.",
54 value = "deb.devuan.org", 54 value = "deb.devuan.org",
55 }, 55 },
56 roundRobinCname =
57 {
58 typ = "string",
59 help = "The round robin DNS name.",
60 value = "deb.rr.devuan.org",
61 },
56 tests = 62 tests =
57 { 63 {
58 typ = "table", 64 typ = "table",
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index d6c866d..73e0338 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -18,11 +18,13 @@ APT.debians = loadfile("results/debians.lua")()
18local revDNS = function(hosts, dom, IP) 18local revDNS = function(hosts, dom, IP)
19 if APT.options.roundRobin.value ~= dom then 19 if APT.options.roundRobin.value ~= dom then
20 if nil ~= hosts[APT.options.roundRobin.value] then 20 if nil ~= hosts[APT.options.roundRobin.value] then
21 if nil ~= hosts[APT.options.roundRobin.value].IPs["deb.roundr.devuan.org"][IP] then 21 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname] then
22 if APT.html then 22 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname][IP] then
23 return "<font color='purple'><b>DNS-RR</b></font>" 23 if APT.html then
24 else 24 return "<font color='purple'><b>DNS-RR</b></font>"
25 return "DNS-RR" 25 else
26 return "DNS-RR"
27 end
26 end 28 end
27 end 29 end
28 end 30 end
@@ -201,15 +203,17 @@ local DNSrrTest = function(hosts, k)
201 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) then 203 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) then
202 APT.allpairs(hosts[k].IPs, 204 APT.allpairs(hosts[k].IPs,
203 function(i, w, k, v) 205 function(i, w, k, v)
204 if nil ~= hosts[APT.options.roundRobin.value].IPs["deb.roundr.devuan.org"][i] then 206 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname] then
205 local log = logCount(APT.options.roundRobin.value, i) 207 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname][i] then
206 if "" ~= log then 208 local log = logCount(APT.options.roundRobin.value, i)
207 if "" == dns then dns = " " else dns = dns .. space end 209 if "" ~= log then
208 dns = dns .. logCount(APT.options.roundRobin.value, i) 210 if "" == dns then dns = " " else dns = dns .. space end
209 else 211 dns = dns .. logCount(APT.options.roundRobin.value, i)
210 if "" == dns then dns = " " else dns = dns .. space end 212 else
211 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end 213 if "" == dns then dns = " " else dns = dns .. space end
212 dns = dns .. i 214 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end
215 dns = dns .. i
216 end
213 end 217 end
214 end 218 end
215 end 219 end
@@ -360,9 +364,8 @@ local makeIPlist = function(hosts)
360 if nil ~= hosts[k].IPs then 364 if nil ~= hosts[k].IPs then
361 for l, w in pairs(hosts[k].IPs) do 365 for l, w in pairs(hosts[k].IPs) do
362 if type(w) == "table" then 366 if type(w) == "table" then
363-- TODO - don't hard code deb.roundr.devuan.org.
364 -- Don't output the extra DNS-RR entries that are for admin reasons. 367 -- Don't output the extra DNS-RR entries that are for admin reasons.
365 if ((APT.options.roundRobin.value == k) and ("deb.roundr.devuan.org" == l)) or (APT.options.roundRobin.value ~= k) then 368 if ((APT.options.roundRobin.value == k) and (APT.options.roundRobinCname == l)) or (APT.options.roundRobin.value ~= k) then
366 n[l] = {} 369 n[l] = {}
367 for i, u in pairs(w) do 370 for i, u in pairs(w) do
368 if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then 371 if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index a524260..1a00fc7 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -199,11 +199,11 @@ gatherIPs = function (host)
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.
202 if nil ~= IP[m.FQDN] then 202 if (nil ~= IP[m.FQDN]) and (nil ~= IP[host][APT.options.roundRobinCname]) then
203 for l, n in pairs(IP[m.FQDN]) do 203 for l, n in pairs(IP[m.FQDN]) do
204 if type(n) == 'table' then 204 if type(n) == 'table' then
205 for h, p in pairs(n) do 205 for h, p in pairs(n) do
206 for j, o in pairs(IP[host]['deb.roundr.devuan.org']) do 206 for j, o in pairs(IP[host][APT.options.roundRobinCname]) do
207 if h == j then IP[host][m.FQDN][l][h] = nil end 207 if h == j then IP[host][m.FQDN][l][h] = nil end
208 end 208 end
209 o = 0 209 o = 0
@@ -211,7 +211,7 @@ gatherIPs = function (host)
211 if 0 == o then IP[host][m.FQDN][l] = nil end 211 if 0 == o then IP[host][m.FQDN][l] = nil end
212 end 212 end
213 else 213 else
214 for j, o in pairs(IP[host]['deb.roundr.devuan.org']) do 214 for j, o in pairs(IP[host][APT.options.roundRobinCname]) do
215 if l == j then IP[host][m.FQDN][l] = nil end 215 if l == j then IP[host][m.FQDN][l] = nil end
216 end 216 end
217 end 217 end
@@ -1009,6 +1009,7 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them.
1009 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to devuan.bio.lmu.de (141.84.43.19) port 80 (#0) 1009 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to devuan.bio.lmu.de (141.84.43.19) port 80 (#0)
1010 curl: (22) The requested URL returned error: 404 Not Found 1010 curl: (22) The requested URL returned error: 404 Not Found
1011]] 1011]]
1012 local trace = {}
1012 local min, max, spd = 999999999999, 0 1013 local min, max, spd = 999999999999, 0
1013 local num = '[%d%.]+[kM]?' 1014 local num = '[%d%.]+[kM]?'
1014 if APT.checkFile(f) then 1015 if APT.checkFile(f) then