aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email.lua
diff options
context:
space:
mode:
authoronefang2019-11-13 01:35:44 +1000
committeronefang2019-11-13 01:35:44 +1000
commit0ca88dc140a504f123505438ead598d4e5f02025 (patch)
treedc8d4c0772f22debfbe420642fd8d44c8612a595 /apt-panopticon-report-email.lua
parentRewrite execute(), and also write a fork(). Now execute() properly returns t... (diff)
downloadapt-panopticon-0ca88dc140a504f123505438ead598d4e5f02025.zip
apt-panopticon-0ca88dc140a504f123505438ead598d4e5f02025.tar.gz
apt-panopticon-0ca88dc140a504f123505438ead598d4e5f02025.tar.bz2
apt-panopticon-0ca88dc140a504f123505438ead598d4e5f02025.tar.xz
Make the email and web reports similar, reporting the same tests.
Diffstat (limited to 'apt-panopticon-report-email.lua')
-rwxr-xr-xapt-panopticon-report-email.lua36
1 files changed, 27 insertions, 9 deletions
diff --git a/apt-panopticon-report-email.lua b/apt-panopticon-report-email.lua
index 5651f71..e157dc1 100755
--- a/apt-panopticon-report-email.lua
+++ b/apt-panopticon-report-email.lua
@@ -83,12 +83,29 @@ local C = function(s) log(-1, "CRITICAL", s) end
83local faulty = "" 83local faulty = ""
84local status = function(host, results, typ) 84local status = function(host, results, typ)
85 local result = "" 85 local result = ""
86 local e = results[typ].errors 86 local e = 0
87 local w = results[typ].warnings 87 local w = 0
88 for i, u in pairs(results[typ]) do 88 if nil ~= results[typ] then
89 if "table" == type(u) then 89 e = results[typ].errors
90 e = e + u.errors 90 w = results[typ].warnings
91 w = w + u.warnings 91 for k, v in pairs(results[typ]) do
92 if "table" == type(v) then
93 e = e + v.errors
94 w = w + v.warnings
95 end
96 end
97 else
98 for k, v in pairs(results) do
99 if "table" == type(v) then
100 for i, u in pairs(v) do
101 if "table" == type(u) then
102 if typ == i then
103 e = e + u.errors
104 w = w + u.warnings
105 end
106 end
107 end
108 end
92 end 109 end
93 end 110 end
94 111
@@ -146,7 +163,6 @@ local collate = function(host, ip, results)
146 return results 163 return results
147end 164end
148 165
149
150local mirrors = loadfile("results/mirrors.lua")() 166local mirrors = loadfile("results/mirrors.lua")()
151 167
152local file, e = io.open("results/Report-email.txt", "w+") 168local file, e = io.open("results/Report-email.txt", "w+")
@@ -173,9 +189,11 @@ if nil == file then C("opening mirrors file - " .. e) else
173 local http = status(k, results, "http") 189 local http = status(k, results, "http")
174 local https = status(k, results, "https") 190 local https = status(k, results, "https")
175 local dns = "[skip]" 191 local dns = "[skip]"
176 local updated = "[skip]" 192 local protocol = status(k, results, "Protocol")
193 local sanity = "[skip]"
177 local integrity = "[skip]" 194 local integrity = "[skip]"
178 file:write(" http: " .. http .. " https: " .. https .. " DNS-RR: " .. dns .. " Updated: " .. updated .. " Integrity: " .. integrity .. "\n") 195 local updated = "[skip]"
196 file:write(" http: " .. http .. " https: " .. https .. " DNS-RR: " .. dns .. " Protocol: " .. protocol .. " URL-sanity: " .. sanity .. " Integrity: " .. integrity .. " Updated: " .. updated .. "\n")
179 end 197 end
180 file:write( "==== faulty mirrors: ====\n\n" .. faulty) 198 file:write( "==== faulty mirrors: ====\n\n" .. faulty)
181 file:write( "---- END MIRROR-STATUS ----\n\n" .. 199 file:write( "---- END MIRROR-STATUS ----\n\n" ..