Software / code / prosody-modules
File
mod_nodeinfo2/mod_nodeinfo2.lua @ 6296:1661f6a74141
Multible community modules: Update Readme
diff --git a/mod_admin_blocklist/README.md b/mod_admin_blocklist/README.md
--- a/mod_admin_blocklist/README.md
+++ b/mod_admin_blocklist/README.md
@@ -24,8 +24,9 @@ admin_blocklist_roles = { "prosody:opera
# Compatibility
Prosody-Version Status
- --------------- ------
- trunk* Works
- 0.12 Works
+ -------------- ------
+ trunk* Works
+ 13 Works
+ 0.12 Works
-*as of 2024-12-21
+ *as of 2025-06-13
diff --git a/mod_audit/README.md b/mod_audit/README.md
--- a/mod_audit/README.md
+++ b/mod_audit/README.md
@@ -52,6 +52,7 @@ prosodyctl mod_audit user@example.com
# Compatibilty
-Requires Prosody **trunk** as of 2025-02-11.
-
-Does not work with Prosody 0.12 or earlier.
+ Prosody-Version Status
+ ----- ------
+ 13 Works
+ 0.12 Does not work
diff --git a/mod_csi_grace_period/README.md b/mod_csi_grace_period/README.md
--- a/mod_csi_grace_period/README.md
+++ b/mod_csi_grace_period/README.md
@@ -16,9 +16,9 @@ pocket is not the best use of radio time
Works with [mod_csi_simple][doc:modules:mod_csi_simple] which is
included with Prosody.
- ------- --------------
- trunk* Works
- 0.12 Works
- ------- --------------
+ ------- -------
+ trunk* Works
+ 13 Works
+ 0.12 Works
-*as of 2024-10-22
+ *as of 2025-06-13
diff --git a/mod_http_upload_external/README.md b/mod_http_upload_external/README.md
--- a/mod_http_upload_external/README.md
+++ b/mod_http_upload_external/README.md
@@ -19,7 +19,6 @@ Implementations
* [PHP implementation](https://hg.prosody.im/prosody-modules/raw-file/tip/mod_http_upload_external/share.php)
* [Python3+Flask implementation](https://github.com/horazont/xmpp-http-upload)
* [Go implementation, Prosody Filer](https://github.com/ThomasLeister/prosody-filer)
-* [Go implementation, HMAC File Server](https://github.com/PlusOne/hmac-file-server)
* [Perl implementation for nginx](https://github.com/weiss/ngx_http_upload)
* [Rust implementation](https://gitlab.com/nyovaya/xmpp-http-upload)
@@ -88,9 +87,10 @@ Compatibility
=============
Prosody-Version Status
- ---------------- --------------------
- trunk Works as of 24-12-12
- 0.12 Works
+ ---------------- --------------------
+ trunk Works as of 25-06-13
+ 13 Works
+ 0.12 Works
Implementation
==============
diff --git a/mod_muc_moderation/README.md b/mod_muc_moderation/README.md
--- a/mod_muc_moderation/README.md
+++ b/mod_muc_moderation/README.md
@@ -27,10 +27,11 @@ modules_enabled = {
# Compatibility
- ------- ---------------
- trunk Works^[as of 2024-10-22]
- 0.12 Works
- ------- ---------------
+ ------- ---------------
+ trunk Works^[as of 2025-06-13]
+ 13 Works
+ 0.12 Works
+ ------- ---------------
## XEP version
diff --git a/mod_s2s_idle_timeout/README.md b/mod_s2s_idle_timeout/README.md
--- a/mod_s2s_idle_timeout/README.md
+++ b/mod_s2s_idle_timeout/README.md
@@ -25,9 +25,10 @@ Compatibility
=============
Prosody Version Status
- ----------------- -----------
- trunk[^1] Works
- 0.12 Works
- ----------------- -----------
+ ----------------- -----------
+ trunk[^1] Works
+ 13 Works
+ 0.12 Works
+ ----------------- -----------
-[^1]: as of 2024-10-22
+[^1]: as of 2025-06-13
diff --git a/mod_s2s_keepalive/README.md b/mod_s2s_keepalive/README.md
--- a/mod_s2s_keepalive/README.md
+++ b/mod_s2s_keepalive/README.md
@@ -34,9 +34,10 @@ Compatibility
=============
Prosody Version Status
- ----------------- -----------
- trunk[^1] Works
- 0.12 Works
- ----------------- -----------
+ ----------------- -----------
+ trunk[^1] Works
+ 13 Works
+ 0.12 Works
+ ----------------- -----------
-[^1]: as of 2024-11-11
+[^1]: as of 2025-06-13
| author | Menel <menel@snikket.de> |
|---|---|
| date | Fri, 13 Jun 2025 09:53:41 +0200 |
| parent | 4595:bac3dae031ee |
line wrap: on
line source
local json = require "util.json"; local array = require "util.array"; local add_task = require "util.timer".add_task; local get_stats = require "core.statsmanager".get_stats; local list_users = require "core.usermanager".users; local os_time = os.time; assert(get_stats, "not compatible with trunk based on openmetrics"); module:depends("http"); local expose_users = module:get_option_boolean("nodeinfo2_expose_users", true); if expose_users then module:depends("lastlog"); end local expose_posts = module:get_option_boolean("nodeinfo2_expose_posts", true); if expose_posts then module:depends("measure_message_e2ee"); end local main_store = module:open_store(); local lastlog_store = module:open_store("lastlog"); local data; if expose_posts then data = main_store:get("nodeinfo2") or { message_count = 0 }; end local total_users = 0; local week_users = 0; local month_users = 0; local half_year_users = 0; local function update_user_list() for user in list_users(module.host) do total_users = total_users + 1; local lastlog = lastlog_store:get(user); if lastlog and lastlog.timestamp then local delta = os_time() - lastlog.timestamp; if delta < 7 * 86400 then week_users = week_users + 1; end if delta < 30 * 86400 then month_users = month_users + 1; end if delta < 6 * 30 * 86400 then half_year_users = half_year_users + 1; end end end -- Remove the properties if we couldn’t find a single active user. It most likely means mod_lastlog isn’t in use. if half_year_users == 0 and month_users == 0 and week_users == 0 then week_users = nil; month_users = nil; half_year_users = nil; end end if expose_users then add_task(86400, update_user_list); update_user_list(); end module:provides("http", { default_path = "/.well-known/x-nodeinfo2"; route = { GET = function (event) local usage = {}; if expose_users then usage.users = { total = total_users; activeWeek = week_users; activeMonth = month_users; activeHalfyear = half_year_users; }; end if expose_posts then local stats, changed_only, extras = get_stats(); for stat, _ in pairs(stats) do if stat == "/"..module.host.."/mod_measure_message_e2ee/message:rate" then local new_message_count = extras[stat].total; if new_message_count ~= data.message_count then data = { message_count = new_message_count }; main_store:set("nodeinfo2", data); end end end usage.localPosts = data.message_count; -- TODO: also count PubSub replies here. usage.localComments = 0; end event.response.headers.content_type = "application/json"; return json.encode({ version = "1.0"; server = { baseUrl = module:http_url("","/"); name = module.host; software = "Prosody"; version = prosody.version; }; --[[ TODO re-use data from mod_server_contact_info ? organization = { name = ""; contact = ""; account = ""; }; --]] protocols = array { "xmpp", }; services = { inbound = array { "xmpp"; }; outbound = array { "xmpp"; }; }; openRegistrations = module:get_option_boolean("allow_registration", false); usage = usage; }); end; } });