From 429ff902862de3fcce22d31ea555e1c69df1976e Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 24 Nov 2019 06:37:31 +1000 Subject: Implement DNS-RR test fully. --- apt-panopticon-report-web.lua | 8 +++++--- apt-panopticon.lua | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua index 810ac45..7ebf2d3 100755 --- a/apt-panopticon-report-web.lua +++ b/apt-panopticon-report-web.lua @@ -125,8 +125,10 @@ local mirrors = loadfile("results/mirrors.lua")() local revDNS = function(dom, IP) if "deb.devuan.org" ~= dom then - if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][IP] then - return "DNS-RR" + if nil ~= mirrors["deb.devuan.org"] then + if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][IP] then + return "DNS-RR" + end end else for k, v in pairs(mirrors) do @@ -278,7 +280,7 @@ if nil == file then C("opening mirrors file - " .. e) else local updated = "[skip]" -- DNS-RR test. - if "deb.devuan.org" ~= k then + if ("deb.devuan.org" ~= k) and (nil ~= mirrors["deb.devuan.org"]) then for l, w in pairs(mirrors[k].IPs) do if type(w) == "table" then for i, u in pairs(w) do diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 2058b4e..9f4d073 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -41,7 +41,7 @@ options = "http", "https", -- "rsync", --- "DNS-RR", + "DNSRR", "Protocol", -- "URL-Sanity", -- "Integrity", @@ -652,9 +652,11 @@ local getMirrors = function () mirrors[host] = m end end - mirrors[options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; ["https"] = true; }; ["FQDN"] = 'deb.devuan.org'; ["Active"] = 'yes'; ["BaseURL"] = 'deb.devuan.org'; } - gatherIPs(options.roundRobin.value) - mirrors[options.roundRobin.value].IPs = IP[options.roundRobin.value] + if testing("DNSRR") then + mirrors[options.roundRobin.value] = { ["Protocols"] = { ["http"] = true; ["https"] = true; }; ["FQDN"] = 'deb.devuan.org'; ["Active"] = 'yes'; ["BaseURL"] = 'deb.devuan.org'; } + gatherIPs(options.roundRobin.value) + mirrors[options.roundRobin.value].IPs = IP[options.roundRobin.value] + end local file, e = io.open("results/mirrors.lua", "w+") if nil == file then C("opening mirrors file - " .. e) else file:write(dumpTable(mirrors, "", "mirrors") .. "\nreturn mirrors\n") -- cgit v1.1