From fe8fc1dee06b74217d5a025707720553dd2a2368 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 17 Dec 2021 14:58:46 +1000 Subject: 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. --- apt-panopticon-report-email-web.lua | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 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 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")() local revDNS = function(hosts, dom, IP) if APT.options.roundRobin.value ~= dom then if nil ~= hosts[APT.options.roundRobin.value] then - if nil ~= hosts[APT.options.roundRobin.value].IPs["deb.roundr.devuan.org"][IP] then - if APT.html then - return "DNS-RR" - else - return "DNS-RR" + if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname] then + if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname][IP] then + if APT.html then + return "DNS-RR" + else + return "DNS-RR" + end end end end @@ -201,15 +203,17 @@ local DNSrrTest = function(hosts, k) if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) and (nil ~= hosts[k].IPs) then APT.allpairs(hosts[k].IPs, function(i, w, k, v) - if nil ~= hosts[APT.options.roundRobin.value].IPs["deb.roundr.devuan.org"][i] then - local log = logCount(APT.options.roundRobin.value, i) - if "" ~= log then - if "" == dns then dns = " " else dns = dns .. space end - dns = dns .. logCount(APT.options.roundRobin.value, i) - else - if "" == dns then dns = " " else dns = dns .. space end - if APT.html then i = "" .. i .. "" end - dns = dns .. i + if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname] then + if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname][i] then + local log = logCount(APT.options.roundRobin.value, i) + if "" ~= log then + if "" == dns then dns = " " else dns = dns .. space end + dns = dns .. logCount(APT.options.roundRobin.value, i) + else + if "" == dns then dns = " " else dns = dns .. space end + if APT.html then i = "" .. i .. "" end + dns = dns .. i + end end end end @@ -360,9 +364,8 @@ local makeIPlist = function(hosts) if nil ~= hosts[k].IPs then for l, w in pairs(hosts[k].IPs) do if type(w) == "table" then --- 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 + if ((APT.options.roundRobin.value == k) and (APT.options.roundRobinCname == 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 -- cgit v1.1