#1890 Trouble getting mod_audit working - using debian stable (prosody version .12.3)

Reporter Jamie
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Component-Community
  • Status-WontFix
  • Type-Defect
  • Priority-Medium
  1. Jamie on

    I'm having trouble getting mod_audit to work properly with prosody version .12.3 (from Debian Bookworm). After some experimentation I got it working with the following changes: --- 5.4/mod_audit.lua 2025-01-20 13:49:53.308000000 +0000 +++ 5.4.good/mod_audit.lua 2025-01-20 13:50:44.092000000 +0000 @@ -7,7 +7,7 @@ local host_wide_user = "@"; -local cleanup_after = module:get_option_period("audit_log_expires_after", "28d"); +local cleanup_after = 86400; local attach_ips = module:get_option_boolean("audit_log_ips", true); local attach_ipv4_prefix = module:get_option_number("audit_log_ipv4_prefix", nil); @@ -222,13 +222,13 @@ local colspec = { { title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", math.floor(when)); end }; - { title = "Source", key = "source", width = "2p" }; - { title = "Event", key = "event_type", width = "2p" }; + { title = "Source", key = "source", width = "14" }; + { title = "Event", key = "event_type", width = "23" }; }; if arg.show_user ~= false and (not arg.global and not query_jid) or arg.show_user then table.insert(colspec, { - title = "User", key = "username", width = "2p", + title = "User", key = "username", width = "20", mapper = function (user) if user == "@" then return ""; end if user:sub(-#host-1, -1) == ("@"..host) then @@ -239,7 +239,7 @@ end if arg.show_ip ~= false and (not arg.global and attach_ips) or arg.show_ip then table.insert(colspec, { - title = "IP", key = "ip", width = "2p"; + title = "IP", key = "ip", width = "30"; }); end if arg.show_location ~= false and (not arg.global and attach_location) or arg.show_location then @@ -256,6 +256,7 @@ local row, width = require "util.human.io".table(colspec); + width = 100; print(string.rep("-", width)); print(row()); print(string.rep("-", width)); I think these changes are all hacks working around things I don't understand or am doing wrong. 1. get_option_period - the first problem seems to be that this function is not in the version of prosody I'm running. Is there a version of mod_audit that will work with prosody .12.3? Maybe I just have to wait for the next upgrade? 2. The second problem seems to be that width is passed in as "2p" but util.human.io.table() is expecting a number instead. 3. And I'm not sure why the final width variable is coming back as nil instead of a number. Maybe the answer is just: wait til a supported version of prosody is released? But posting in case it's helpful for debugging purposes.

  2. Zash on

    mod_audit is intended for trunk and may depend on other other trunk-only features. I spotted some IP address handling that also relies on changes in trunk for example, there may be others. I have added a Compatibility section to the module page: https://hg.prosody.im/prosody-modules/rev/0781470db737

    Changes
    • tags Status-WontFix Component-Community

New comment

Not published. Used for spam prevention and optional update notifications.