From e5e582dfdb73cd717ddc711f553f2dda2440e6e5 Mon Sep 17 00:00:00 2001
From: onefang
Date: Mon, 2 Dec 2019 02:33:36 +1000
Subject: Spruce up the web page a bit.
---
apt-panopticon-report-web.lua | 64 +++++++++++++++++++++++++++++++------------
1 file changed, 46 insertions(+), 18 deletions(-)
diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua
index 93aa70b..d20b002 100755
--- a/apt-panopticon-report-web.lua
+++ b/apt-panopticon-report-web.lua
@@ -127,7 +127,7 @@ local revDNS = function(dom, IP)
if "deb.devuan.org" ~= dom then
if nil ~= mirrors["deb.devuan.org"] then
if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][IP] then
- return "DNS-RR"
+ return "DNS-RR"
end
end
else
@@ -154,6 +154,8 @@ local status = function(host, results, typ)
local result = ""
local e = 0
local w = 0
+ local s = nil ~= mirrors[host].Protocols[typ]
+ if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end
if nil ~= results[typ] then
e = results[typ].errors
w = results[typ].warnings
@@ -179,10 +181,18 @@ local status = function(host, results, typ)
end
if 0 < e then
- result = "[FAILED]"
+ if s then
+ result = "[FAILED]"
+ else
+ result = "[FAILED]"
+ end
faulty = faulty .. host .. " (" .. typ .. ")
\n"
else
- result = "[OK]"
+ if s then
+ result = "[OK]"
+ else
+ result = "[OK]"
+ end
end
return result .. plurals(e, w)
end
@@ -249,19 +259,32 @@ local file, e = io.open("results/Report-web.html", "w+")
if nil == file then C("opening mirrors file - " .. e) else
file:write( "
Check time: " .. os.date("!%Y-%m-%d %H:%M") .. " GMT
\n" .. + "This is the status of the mirror servers in the Devuan package mirror network.
\n" .. "The full list of Devuan package mirrors is available at the URL: " .. "https://pkgmaster.devuan.org/mirror_list.txt
\n" .. "Due to the nature of the tests, some errors or warnings will be counted several times. " .. - "Refer to the logs below for details.
\n\n" .. - "Please see below the current status of the Devuan Package Mirror network:
\n" .. - "HTTP | HTTPS | DNS round robin | Protocol | URL sanity | Integrity | Updated |
---|
FTP | HTTP | HTTPS | RSYNC | DNS round robin | Protocol | URL sanity | Integrity | Updated | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
" .. k .. " | ") + if "yes" == v.Active then + file:write("||||||||||||
" .. k .. " | ") + else + file:write("||||||||||||
" .. k .. " | ") + end local IPs = v.IPs for i, u in pairs(IPs) do if "table" == type(u) then @@ -272,13 +295,17 @@ if nil == file then C("opening mirrors file - " .. e) else results = collate(k, i, results) end end + local ftp = "[skip]" local http = status(k, results, "http") local https = status(k, results, "https") + local rsync = "[skip]" local dns = "" local protocol = status(k, results, "Protocol") - local sanity = "[skip]" + local sanity = "[skip]" local integrity = status(k, results, "Integrity") local updated = status(k, results, "Updated") + local rate = v.Rate + if nil ~= rate then updated = updated .. ' ' .. rate end -- DNS-RR test. if ("deb.devuan.org" ~= k) and (nil ~= mirrors["deb.devuan.org"]) then @@ -309,10 +336,10 @@ if nil == file then C("opening mirrors file - " .. e) else end end end - if "" == dns then dns = "[no]" end + if "" == dns then dns = "[no]" end end - file:write("" .. http .. " | " .. https .. " | " .. dns .. + file:write(" | " .. ftp .. " | " .. http .. " | " .. https .. " | " .. rsync .. " | " .. dns .. " | " .. protocol .. " | " .. sanity .. " | " .. integrity .. " | " .. updated .. " |