aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-web.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xapt-panopticon-report-web.lua36
1 files changed, 26 insertions, 10 deletions
diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua
index 61102c8..fb41341 100755
--- a/apt-panopticon-report-web.lua
+++ b/apt-panopticon-report-web.lua
@@ -155,24 +155,27 @@ local status = function(host, results, typ)
155 local e = 0 155 local e = 0
156 local w = 0 156 local w = 0
157 local s = nil ~= mirrors[host].Protocols[typ] 157 local s = nil ~= mirrors[host].Protocols[typ]
158 local to = false
158 if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end 159 if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end
159 if nil ~= results[typ] then 160 if nil ~= results[typ] then
160 e = results[typ].errors 161 e = results[typ].errors
161 w = results[typ].warnings 162 w = results[typ].warnings
163--[[
162 for k, v in pairs(results[typ]) do 164 for k, v in pairs(results[typ]) do
163 if "table" == type(v) then 165 if "table" == type(v) then
164 e = e + v.errors 166 if 0 <= v.errors then e = e + v.errors else to = true end
165 w = w + v.warnings 167 if 0 <= v.warnings then w = w + v.warnings else to = true end
166 end 168 end
167 end 169 end
170]]
168 else 171 else
169 for k, v in pairs(results) do 172 for k, v in pairs(results) do
170 if "table" == type(v) then 173 if "table" == type(v) then
171 for i, u in pairs(v) do 174 for i, u in pairs(v) do
172 if "table" == type(u) then 175 if "table" == type(u) then
173 if typ == i then 176 if typ == i then
174 e = e + u.errors 177 if 0 <= u.errors then e = e + u.errors else to = true end
175 w = w + u.warnings 178 if 0 <= u.warnings then w = w + u.warnings else to = true end
176 end 179 end
177 end 180 end
178 end 181 end
@@ -180,18 +183,24 @@ local status = function(host, results, typ)
180 end 183 end
181 end 184 end
182 185
183 if 0 < e then 186 if to then
187 if s then
188 result = "[<font color='blue'><b>TIMEOUT</b></font>]"
189 else
190 result = "[<font color='darkblue'><b>TIMEOUT *</b></font>]"
191 end
192 elseif 0 < e then
184 if s then 193 if s then
185 result = "[<font color='red'><b>FAILED</b></font>]" 194 result = "[<font color='red'><b>FAILED</b></font>]"
186 else 195 else
187 result = "[<font color='darkred'><b>FAILED</b></font>]" 196 result = "[<font color='darkred'><b>FAILED *</b></font>]"
188 end 197 end
189 faulty = faulty .. host .. " (" .. typ .. ")<br>\n" 198 faulty = faulty .. host .. " (" .. typ .. ")<br>\n"
190 else 199 else
191 if s then 200 if s then
192 result = "[<font color='lime'><b>OK</b></font>]" 201 result = "[<font color='lime'><b>OK</b></font>]"
193 else 202 else
194 result = "[<font color='darkgreen'><b>OK</b></font>]" 203 result = "[<font color='darkgreen'><b>OK *</b></font>]"
195 end 204 end
196 end 205 end
197 return result .. plurals(e, w) 206 return result .. plurals(e, w)
@@ -258,7 +267,7 @@ end
258local file, e = io.open("results/Report-web.html", "w+") 267local file, e = io.open("results/Report-web.html", "w+")
259if nil == file then C("opening mirrors file - " .. e) else 268if nil == file then C("opening mirrors file - " .. e) else
260 file:write( "<html><head><title>apt-panopticon results</title>\n" .. 269 file:write( "<html><head><title>apt-panopticon results</title>\n" ..
261 '</head><body bgcolor="black" text="white" alink="red" link="blue" vlink="purple">' .. 270 '</head><body bgcolor="black" text="white">' ..
262 "<h1>Welcome to the apt-panopticon results page.</h1>\n" .. 271 "<h1>Welcome to the apt-panopticon results page.</h1>\n" ..
263 "<p>This is the status of the mirror servers in the Devuan package mirror network.</p>\n" .. 272 "<p>This is the status of the mirror servers in the Devuan package mirror network.</p>\n" ..
264 "<p>The full list of Devuan package mirrors is available at the URL: " .. 273 "<p>The full list of Devuan package mirrors is available at the URL: " ..
@@ -269,21 +278,25 @@ if nil == file then C("opening mirrors file - " .. e) else
269 278
270 "<p>[<font color='red'><b>FAILED</b></font>] or [<font color='lime'><b>OK</b></font>]" .. 279 "<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" .. 280 " 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>]" .. 281 "<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" .. 282 " means the tested thing is unsupported for that mirror, but might have been tested anyway.</p>\n" ..
283 "<p>[<font color='blue'><b>TIMEOUT</b></font>] or [<font color='darkblue'><b>TIMEOUT</b></font>]" ..
284 " means the server had too many timeouts, and tests where aborted, so there is no result for this test.</p>" ..
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. &nbsp; " .. 285 "<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. &nbsp; " ..
275 "The IPs link to the testing log for that IP accessed via the DNS-RR. &nbsp; " .. 286 "The IPs link to the testing log for that IP accessed via the DNS-RR. &nbsp; " ..
276 "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.</p>\n" .. 287 "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.</p>\n" ..
277 "<p>The time in the Updated column is how often the mirror updates itself.</p>" .. 288 "<p>The time in the Updated column is how often the mirror updates itself.</p>" ..
278 "<p>Mirrors with a <font style='background-color:dimgrey'>grey background</font> are not active.</p>\n" .. 289 "<p>Mirrors with a <font style='background-color:dimgrey'>grey background</font> are not active (though may be usable as part of the DNS-RR).</p>\n" ..
279 "<p>[<font color='grey'><b>skip</b></font>] means that the test hasn't been written yet.</p>\n" .. 290 "<p>[<font color='grey'><b>skip</b></font>] means that the test hasn't been written yet.</p>\n" ..
280 "<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" 291 "<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"
281 ) 292 )
282 for k, v in orderedPairs(mirrors) do 293 for k, v in orderedPairs(mirrors) do
283 local results = loadfile("results/" .. k .. ".lua")() 294 local results = loadfile("results/" .. k .. ".lua")()
295 local active = ""
284 if "yes" == v.Active then 296 if "yes" == v.Active then
285 file:write(" <tr><th>" .. k .. "</th> ") 297 file:write(" <tr><th>" .. k .. "</th> ")
286 else 298 else
299 if nil == v.Active then active = 'nil' else active = v.Active end
287 file:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") 300 file:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ")
288 end 301 end
289 local IPs = v.IPs 302 local IPs = v.IPs
@@ -343,6 +356,9 @@ if nil == file then C("opening mirrors file - " .. e) else
343 file:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. dns .. 356 file:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. dns ..
344 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. sanity .. 357 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. sanity ..
345 "&nbsp;</td><td>" .. integrity .. "&nbsp;</td><td>" .. updated .. "</td></tr>\n") 358 "&nbsp;</td><td>" .. integrity .. "&nbsp;</td><td>" .. updated .. "</td></tr>\n")
359 if "" ~= v.Active then
360 file:write("<tr><td style='background-color:dimgrey'>" .. active .. "</td></tr>\n")
361 end
346 end 362 end
347 file:write( "</table>\n<br>\n<h2>==== faulty mirrors: ====</h2>\n" .. faulty) 363 file:write( "</table>\n<br>\n<h2>==== faulty mirrors: ====</h2>\n" .. faulty)
348 file:write( "<br>\n<br>\n<h2>==== DNS and logs: ====</h2>\n") 364 file:write( "<br>\n<br>\n<h2>==== DNS and logs: ====</h2>\n")