Mercurial > prosody-modules
comparison mod_checkcerts/mod_checkcerts.lua @ 4607:c8ccaac78f64
mod_checkcerts: Notify both host-local and global admins
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 30 Jun 2021 14:33:06 +0200 |
parents | ec7f9c8f2a5f |
children |
comparison
equal
deleted
inserted
replaced
4606:d6eb2b722b90 | 4607:c8ccaac78f64 |
---|---|
75 end | 75 end |
76 timediff = humantime(timediff); | 76 timediff = humantime(timediff); |
77 module:log(log_warn and "warn" or "info", fmt, certfile, timediff); | 77 module:log(log_warn and "warn" or "info", fmt, certfile, timediff); |
78 if nag_admin then | 78 if nag_admin then |
79 local body = fmt:format("for host ".. module.host, timediff); | 79 local body = fmt:format("for host ".. module.host, timediff); |
80 for _,admin in ipairs(module:get_option_array("admins", {})) do | 80 for admin in module:get_option_inherited_set("admins", {}) do |
81 module:send(st.message({ from = module.host, to = admin, type = "chat" }, body)); | 81 module:send(st.message({ from = module.host, to = admin, type = "chat" }, body)); |
82 end | 82 end |
83 end | 83 end |
84 return math.max(86400, expires_in / 3); | 84 return math.max(86400, expires_in / 3); |
85 end | 85 end |