aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-03-06 11:41:24 -0600
committerthe lemons <citrons@mondecitronne.com>2022-03-06 11:41:24 -0600
commit0588a838ce7fd91f85e91f2d53f7f9d8f81c6409 (patch)
treeb5500d33b301ad1ee0ae37e3c6b7872a0e2a1322
parente4cc8e42daf9c69dfcb264652037bc089c1790c6 (diff)
log IP addresses
-rwxr-xr-xzzcxz.cgi6
1 files changed, 6 insertions, 0 deletions
diff --git a/zzcxz.cgi b/zzcxz.cgi
index 54f2a7f..5aad998 100755
--- a/zzcxz.cgi
+++ b/zzcxz.cgi
@@ -330,6 +330,10 @@ local function new_action(page, action, result)
end
assert(old:write(('%s:%s\n'):format(new_name, action)))
+ if env "REMOTE_ADDR" then
+ new:write(('!ip %s\n'):format(env "REMOTE_ADDR"))
+ end
+
if directives.backlinks then
for _,d in ipairs(directives.backlinks) do
assert(new:write(('%s:%s\n'):format(d.page, d.action)))
@@ -631,6 +635,8 @@ map["^/g/(%w%w%w%w%w)/raw$"] = function(p)
local page = load_page(p, true)
if not page then return not_found() end
+ page = page:gsub("\n!ip [^\n]*", "")
+
return page, {
content_type = 'text/plain',
headers = { ['access-control-allow-origin'] = "*" }