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( "apt-panopticon results\n" .. '' .. - "

Welcome to the apt-opticon results page.

\n" .. - "

Check time: " .. os.date("!%Y-%m-%d %H:%M") .. " GMT

\n" .. + "

Welcome to the apt-panopticon results page.

\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" .. - "

==== mirror status: ====

\n\n" .. - "\n" + "The links in the table and DNS list go to the detailed testing logs.

\n\n" .. + "
\n

==== package mirror status " .. os.date("!%Y-%m-%d %H:%M") .. " GMT: ====

\n
HTTPHTTPSDNS round robinProtocolURL sanityIntegrityUpdated
\n" .. + + "

[FAILED] or [OK]" .. + " means the tested thing is supported for that mirror.

\n" .. + "

[FAILED] or [OK]" .. + " means the tested thing is unsupported for that mirror, but might have been tested anyway.

\n" .. + "

The DNS round robin (DNS-RR) column shows the IPs for that mirror, or [no] if it isn't part of the DNS-RR.   " .. + "The IPs link to the testing log for that IP accessed via the DNS-RR.   " .. + "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.

\n" .. + "

Mirrors with a grey background are not active.

\n" .. + "

[skip] means that the test hasn't been written yet.

\n" .. + "\n" ) for k, v in orderedPairs(mirrors) do local results = loadfile("results/" .. k .. ".lua")() - file:write(" ") + if "yes" == v.Active then + file:write(" ") + else + file:write(" ") + 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("\n") end @@ -345,17 +372,18 @@ if nil == file then C("opening mirrors file - " .. e) else m[log .. " DNS entries -"] = n end file:write( "

This lists each mirror, and the DNS entries for that mirror.   " .. - "The links point to the log files for " .. logCount("apt-panopticon") .. " for each FDQN / IP combination that was checked.   " .. + "The links point to the testing log files for " .. logCount("apt-panopticon") .. " for each domain name / IP combination that was tested.   " .. "If a mirror has a CNAME, that CNAME is listed along with that CNAMEs DNS entries.   " .. "deb.devuan.org is the DNS round robin, which points to the mirrors that are part of the DNS-RR.   " .. + "If an IP is part of the DNS-RR, it is marked with 'DNS-RR'   " .. "pkgmaster.devuan.org is the master mirror, all the others sync to it.   " .. "

\n" ) file:write(dumpTableHTML(m, "", "")) - file:write( "\n
\n\n" .. - "

The email report.

" .. - "

All the logs and other output.

" .. - "

You can get the source code here.

" .. + file:write( "\n
\n
\n\n" .. + "

The email report.   " .. + "All the logs and other output.   " .. + "You can get the source code here.

" .. "\n") file:close() end -- cgit v1.1
FTPHTTPHTTPSRSYNCDNS round robinProtocolURL sanityIntegrityUpdated
" .. k .. "
" .. k .. "
" .. k .. "" .. http .. " " .. https .. " " .. dns .. + file:write("" .. ftp .. " " .. http .. " " .. https .. " " .. rsync .. " " .. dns .. " " .. protocol .. " " .. sanity .. " " .. integrity .. " " .. updated .. "