diff options
Diffstat (limited to '')
-rw-r--r-- | apt-panopticommon.lua | 9 | ||||
-rwxr-xr-x | apt-panopticon-report-email-web.lua | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index dddcc9c..4a1a5e7 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -113,6 +113,12 @@ APT.options = | |||
113 | -- "Prometheus", | 113 | -- "Prometheus", |
114 | }, | 114 | }, |
115 | }, | 115 | }, |
116 | cgi = | ||
117 | { | ||
118 | typ = "boolean", | ||
119 | help = "", | ||
120 | value = false, | ||
121 | }, | ||
116 | } | 122 | } |
117 | 123 | ||
118 | APT.args = {} | 124 | APT.args = {} |
@@ -149,6 +155,9 @@ APT.parseArgs = function(args) | |||
149 | elseif "-r" == a then | 155 | elseif "-r" == a then |
150 | APT.redir = true | 156 | APT.redir = true |
151 | sendArgs = sendArgs .. a .. " " | 157 | sendArgs = sendArgs .. a .. " " |
158 | elseif "--cgi" == a then | ||
159 | APT.options.cgi.value = true | ||
160 | sendArgs = sendArgs .. a .. " " | ||
152 | elseif "--low" == a then | 161 | elseif "--low" == a then |
153 | APT.options.bandwidth.value = 0 | 162 | APT.options.bandwidth.value = 0 |
154 | APT.options.timeout.value = 2 | 163 | APT.options.timeout.value = 2 |
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 1a379ec..93700ca 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua | |||
@@ -307,6 +307,9 @@ end | |||
307 | 307 | ||
308 | local makeIPlist = function(hosts) | 308 | local makeIPlist = function(hosts) |
309 | local m = {} | 309 | local m = {} |
310 | local adr = '' | ||
311 | if APT.options.cgi.value then adr = 'php.cgi/' end | ||
312 | adr = '/' .. adr .. 'apt-panopticon/apt-panopticon_cgp/host.php?h=' | ||
310 | for k, v in pairs(hosts) do | 313 | for k, v in pairs(hosts) do |
311 | local log = k | 314 | local log = k |
312 | local n = {} | 315 | local n = {} |
@@ -323,15 +326,15 @@ local makeIPlist = function(hosts) | |||
323 | if type(w) == "table" then | 326 | if type(w) == "table" then |
324 | n[l] = {} | 327 | n[l] = {} |
325 | for i, u in pairs(w) do | 328 | for i, u in pairs(w) do |
326 | local log = '[<a href="../apt-panopticon_cgp/host.php?h=' .. k .. '_' .. i .. '">graphs</a>] ' .. logCount(k, i) | 329 | local log = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] ' .. logCount(k, i) |
327 | if "" == log then n[l][i] = u else n[l][log .. " " .. revDNS(hosts, k, i)] = u end | 330 | if "" == log then n[l][i] = u else n[l][log .. " " .. revDNS(hosts, k, i)] = u end |
328 | end | 331 | end |
329 | else | 332 | else |
330 | local log = '[<a href="../apt-panopticon_cgp/host.php?h=' .. k .. '_' .. l .. '">graphs</a>] ' .. logCount(k, l) | 333 | local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] ' .. logCount(k, l) |
331 | if "" == log then n[l] = w else n[log .. " " .. revDNS(hosts, k, l)] = w end | 334 | if "" == log then n[l] = w else n[log .. " " .. revDNS(hosts, k, l)] = w end |
332 | end | 335 | end |
333 | end | 336 | end |
334 | m['[<a href="../apt-panopticon_cgp/host.php?h=' .. k .. '">graphs</a>] ' .. log .. " DNS entries -" .. redirs(hosts, k)] = n | 337 | m['[<a href="' .. adr .. k .. '">graphs</a>] ' .. log .. " DNS entries -" .. redirs(hosts, k)] = n |
335 | end | 338 | end |
336 | return m | 339 | return m |
337 | end | 340 | end |