diff options
author | onefang | 2019-12-02 02:33:36 +1000 |
---|---|---|
committer | onefang | 2019-12-02 02:33:36 +1000 |
commit | e5e582dfdb73cd717ddc711f553f2dda2440e6e5 (patch) | |
tree | 6f7308c61f51e0a8944a51103e1e575e68247dd1 | |
parent | Add the timezone. (diff) | |
download | apt-panopticon-e5e582dfdb73cd717ddc711f553f2dda2440e6e5.zip apt-panopticon-e5e582dfdb73cd717ddc711f553f2dda2440e6e5.tar.gz apt-panopticon-e5e582dfdb73cd717ddc711f553f2dda2440e6e5.tar.bz2 apt-panopticon-e5e582dfdb73cd717ddc711f553f2dda2440e6e5.tar.xz |
Spruce up the web page a bit.
-rwxr-xr-x | apt-panopticon-report-web.lua | 64 |
1 files 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) | |||
127 | if "deb.devuan.org" ~= dom then | 127 | if "deb.devuan.org" ~= dom then |
128 | if nil ~= mirrors["deb.devuan.org"] then | 128 | if nil ~= mirrors["deb.devuan.org"] then |
129 | if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][IP] then | 129 | if nil ~= mirrors["deb.devuan.org"].IPs["deb.roundr.devuan.org"][IP] then |
130 | return "DNS-RR" | 130 | return "<font color='purple'><b>DNS-RR</b></font>" |
131 | end | 131 | end |
132 | end | 132 | end |
133 | else | 133 | else |
@@ -154,6 +154,8 @@ local status = function(host, results, typ) | |||
154 | local result = "" | 154 | local result = "" |
155 | local e = 0 | 155 | local e = 0 |
156 | local w = 0 | 156 | local w = 0 |
157 | local s = nil ~= mirrors[host].Protocols[typ] | ||
158 | if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end | ||
157 | if nil ~= results[typ] then | 159 | if nil ~= results[typ] then |
158 | e = results[typ].errors | 160 | e = results[typ].errors |
159 | w = results[typ].warnings | 161 | w = results[typ].warnings |
@@ -179,10 +181,18 @@ local status = function(host, results, typ) | |||
179 | end | 181 | end |
180 | 182 | ||
181 | if 0 < e then | 183 | if 0 < e then |
182 | result = "[<font color='red'><b>FAILED</b></font>]" | 184 | if s then |
185 | result = "[<font color='red'><b>FAILED</b></font>]" | ||
186 | else | ||
187 | result = "[<font color='darkred'><b>FAILED</b></font>]" | ||
188 | end | ||
183 | faulty = faulty .. host .. " (" .. typ .. ")<br>\n" | 189 | faulty = faulty .. host .. " (" .. typ .. ")<br>\n" |
184 | else | 190 | else |
185 | result = "[<font color='green'><b>OK</b></font>]" | 191 | if s then |
192 | result = "[<font color='lime'><b>OK</b></font>]" | ||
193 | else | ||
194 | result = "[<font color='darkgreen'><b>OK</b></font>]" | ||
195 | end | ||
186 | end | 196 | end |
187 | return result .. plurals(e, w) | 197 | return result .. plurals(e, w) |
188 | end | 198 | end |
@@ -249,19 +259,32 @@ local file, e = io.open("results/Report-web.html", "w+") | |||
249 | if nil == file then C("opening mirrors file - " .. e) else | 259 | if nil == file then C("opening mirrors file - " .. e) else |
250 | file:write( "<html><head><title>apt-panopticon results</title>\n" .. | 260 | file:write( "<html><head><title>apt-panopticon results</title>\n" .. |
251 | '</head><body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">' .. | 261 | '</head><body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">' .. |
252 | "<h1>Welcome to the apt-opticon results page.</h1>\n" .. | 262 | "<h1>Welcome to the apt-panopticon results page.</h1>\n" .. |
253 | "<p>Check time: " .. os.date("!%Y-%m-%d %H:%M") .. " GMT</p>\n" .. | 263 | "<p>This is the status of the mirror servers in the Devuan package mirror network.</p>\n" .. |
254 | "<p>The full list of Devuan package mirrors is available at the URL: " .. | 264 | "<p>The full list of Devuan package mirrors is available at the URL: " .. |
255 | "<a href='https://pkgmaster.devuan.org/mirror_list.txt'>https://pkgmaster.devuan.org/mirror_list.txt</a></p>\n" .. | 265 | "<a href='https://pkgmaster.devuan.org/mirror_list.txt'>https://pkgmaster.devuan.org/mirror_list.txt</a></p>\n" .. |
256 | "<p>Due to the nature of the tests, some errors or warnings will be counted several times. " .. | 266 | "<p>Due to the nature of the tests, some errors or warnings will be counted several times. " .. |
257 | "Refer to the logs below for details.</p>\n\n" .. | 267 | "The links in the table and DNS list go to the detailed testing logs.</p>\n\n" .. |
258 | "<p>Please see below the current status of the Devuan Package Mirror network:</p>\n" .. | 268 | "<hr>\n<h2>==== package mirror status " .. os.date("!%Y-%m-%d %H:%M") .. " GMT: ====</h2>\n<table>\n" .. |
259 | "<h2>==== mirror status: ====</h2>\n<table>\n" .. | 269 | |
260 | "<tr><th></th><th>HTTP</th><th>HTTPS</th><th>DNS round robin</th><th>Protocol</th><th>URL sanity</th><th>Integrity</th><th>Updated</th></tr>\n" | 270 | "<p>[<font color='red'><b>FAILED</b></font>] or [<font color='lime'><b>OK</b></font>]" .. |
271 | " means the tested thing is supported for that mirror.</p>\n" .. | ||
272 | "<p>[<font color='darkred'><b>FAILED</b></font>] or [<font color='darkgreen'><b>OK</b></font>]" .. | ||
273 | " means the tested thing is unsupported for that mirror, but might have been tested anyway.</p>\n" .. | ||
274 | "<p>The DNS round robin (DNS-RR) column shows the IPs for that mirror, or [<font color='grey'><b>no</b></font>] if it isn't part of the DNS-RR. " .. | ||
275 | "The IPs link to the testing log for that IP accessed via the DNS-RR. " .. | ||
276 | "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.</p>\n" .. | ||
277 | "<p>Mirrors with a <font style='background-color:dimgrey'>grey background</font> are not active.</p>\n" .. | ||
278 | "<p>[<font color='grey'><b>skip</b></font>] means that the test hasn't been written yet.</p>\n" .. | ||
279 | "<tr><th></th><th>FTP</th><th>HTTP</th><th>HTTPS</th><th>RSYNC</th><th>DNS round robin</th><th>Protocol</th><th>URL sanity</th><th>Integrity</th><th>Updated</th></tr>\n" | ||
261 | ) | 280 | ) |
262 | for k, v in orderedPairs(mirrors) do | 281 | for k, v in orderedPairs(mirrors) do |
263 | local results = loadfile("results/" .. k .. ".lua")() | 282 | local results = loadfile("results/" .. k .. ".lua")() |
264 | file:write(" <tr><th>" .. k .. "</th> ") | 283 | if "yes" == v.Active then |
284 | file:write(" <tr><th>" .. k .. "</th> ") | ||
285 | else | ||
286 | file:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") | ||
287 | end | ||
265 | local IPs = v.IPs | 288 | local IPs = v.IPs |
266 | for i, u in pairs(IPs) do | 289 | for i, u in pairs(IPs) do |
267 | if "table" == type(u) then | 290 | if "table" == type(u) then |
@@ -272,13 +295,17 @@ if nil == file then C("opening mirrors file - " .. e) else | |||
272 | results = collate(k, i, results) | 295 | results = collate(k, i, results) |
273 | end | 296 | end |
274 | end | 297 | end |
298 | local ftp = "[<font color='grey'><b>skip</b></font>]" | ||
275 | local http = status(k, results, "http") | 299 | local http = status(k, results, "http") |
276 | local https = status(k, results, "https") | 300 | local https = status(k, results, "https") |
301 | local rsync = "[<font color='grey'><b>skip</b></font>]" | ||
277 | local dns = "" | 302 | local dns = "" |
278 | local protocol = status(k, results, "Protocol") | 303 | local protocol = status(k, results, "Protocol") |
279 | local sanity = "[<font color='gray'><b>skip</b></font>]" | 304 | local sanity = "[<font color='grey'><b>skip</b></font>]" |
280 | local integrity = status(k, results, "Integrity") | 305 | local integrity = status(k, results, "Integrity") |
281 | local updated = status(k, results, "Updated") | 306 | local updated = status(k, results, "Updated") |
307 | local rate = v.Rate | ||
308 | if nil ~= rate then updated = updated .. ' ' .. rate end | ||
282 | 309 | ||
283 | -- DNS-RR test. | 310 | -- DNS-RR test. |
284 | if ("deb.devuan.org" ~= k) and (nil ~= mirrors["deb.devuan.org"]) then | 311 | 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 | |||
309 | end | 336 | end |
310 | end | 337 | end |
311 | end | 338 | end |
312 | if "" == dns then dns = "[<font color='gray'><b>no</b></font>]" end | 339 | if "" == dns then dns = "[<font color='grey'><b>no</b></font>]" end |
313 | end | 340 | end |
314 | 341 | ||
315 | file:write("<td>" .. http .. " </td><td>" .. https .. " </td><td>" .. dns .. | 342 | file:write("<td>" .. ftp .. " </td><td>" .. http .. " </td><td>" .. https .. " </td><td>" .. rsync .. " </td><td>" .. dns .. |
316 | " </td><td>" .. protocol .. " </td><td>" .. sanity .. | 343 | " </td><td>" .. protocol .. " </td><td>" .. sanity .. |
317 | " </td><td>" .. integrity .. " </td><td>" .. updated .. "</td></tr>\n") | 344 | " </td><td>" .. integrity .. " </td><td>" .. updated .. "</td></tr>\n") |
318 | end | 345 | end |
@@ -345,17 +372,18 @@ if nil == file then C("opening mirrors file - " .. e) else | |||
345 | m[log .. " DNS entries -"] = n | 372 | m[log .. " DNS entries -"] = n |
346 | end | 373 | end |
347 | file:write( "<p>This lists each mirror, and the DNS entries for that mirror. " .. | 374 | file:write( "<p>This lists each mirror, and the DNS entries for that mirror. " .. |
348 | "The links point to the log files for " .. logCount("apt-panopticon") .. " for each FDQN / IP combination that was checked. " .. | 375 | "The links point to the testing log files for " .. logCount("apt-panopticon") .. " for each domain name / IP combination that was tested. " .. |
349 | "If a mirror has a CNAME, that CNAME is listed along with that CNAMEs DNS entries. " .. | 376 | "If a mirror has a CNAME, that CNAME is listed along with that CNAMEs DNS entries. " .. |
350 | "deb.devuan.org is the DNS round robin, which points to the mirrors that are part of the DNS-RR. " .. | 377 | "deb.devuan.org is the DNS round robin, which points to the mirrors that are part of the DNS-RR. " .. |
378 | "If an IP is part of the DNS-RR, it is marked with '<font color='purple'><b>DNS-RR</b></font>' " .. | ||
351 | "pkgmaster.devuan.org is the master mirror, all the others sync to it. " .. | 379 | "pkgmaster.devuan.org is the master mirror, all the others sync to it. " .. |
352 | "</p>\n" | 380 | "</p>\n" |
353 | ) | 381 | ) |
354 | file:write(dumpTableHTML(m, "", "")) | 382 | file:write(dumpTableHTML(m, "", "")) |
355 | file:write( "\n<br>\n\n" .. | 383 | file:write( "\n<br>\n<hr>\n\n" .. |
356 | "<p>The <a href='Report-email.txt'>email report</a>.</p>" .. | 384 | "<p>The <a href='Report-email.txt'>email report</a>. " .. |
357 | "<p>All <a href='../results'>the logs and other output</a>.</p>" .. | 385 | "All <a href='../results'>the logs and other output</a>. " .. |
358 | "<p>You can get the <a href='https://sledjhamr.org/cgit/apt-panopticon/about/'>source code here</a>.</p>" .. | 386 | "You can get the <a href='https://sledjhamr.org/cgit/apt-panopticon/about/'>source code here</a>.</p>" .. |
359 | "</body></html>\n") | 387 | "</body></html>\n") |
360 | file:close() | 388 | file:close() |
361 | end | 389 | end |