diff options
author | the lemons <citrons@mondecitronne.com> | 2022-03-06 11:41:24 -0600 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2022-03-06 11:41:24 -0600 |
commit | 0588a838ce7fd91f85e91f2d53f7f9d8f81c6409 (patch) | |
tree | b5500d33b301ad1ee0ae37e3c6b7872a0e2a1322 | |
parent | e4cc8e42daf9c69dfcb264652037bc089c1790c6 (diff) |
log IP addresses
-rwxr-xr-x | zzcxz.cgi | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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'] = "*" } |