<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://hg.omfa.de/prosody-modules/</link>
    <language>en-us</language>

    <title>prosody-modules: mod_compliance_2023/README.md history</title>
    <description>mod_compliance_2023/README.md revision history</description>
    <item>
    <title>mod_compliance_2023: Add 2023 Version of the compliance module, basis is the 2021 Version.</title>
    <link>http://hg.omfa.de/prosody-modules/log/1a6cd0bbb7ab/mod_compliance_2023/README.md</link>
    <description><![CDATA[mod_compliance_2023: Add 2023 Version of the compliance module, basis is the 2021 Version.<br/>
<br/>
diff --git a/mod_compliance_2023/README.md b/mod_compliance_2023/README.md<br/>
new file mode 100644<br/>
--- /dev/null<br/>
+++ b/mod_compliance_2023/README.md<br/>
@@ -0,0 +1,22 @@<br/>
+---<br/>
+summary: XMPP Compliance Suites 2023 self-test<br/>
+labels:<br/>
+- Stage-Beta<br/>
+rockspec:<br/>
+  dependencies:<br/>
+  - mod_cloud_notify<br/>
+<br/>
+...<br/>
+<br/>
+Compare the list of enabled modules with<br/>
+[XEP-0479: XMPP Compliance Suites 2023] and produce basic report to the<br/>
+Prosody log file.<br/>
+<br/>
+If installed with the Prosody plugin installer then all modules needed for a green checkmark should be included. (With prosody 0.12 only [mod_cloud_notify] is not included with prosody and we need the community module)<br/>
+<br/>
+# Compatibility<br/>
+<br/>
+  Prosody-Version Status<br/>
+  --------------- ----------------------<br/>
+  trunk           Works as of 2024-12-21<br/>
+  0.12            Works<br/>
diff --git a/mod_compliance_2023/mod_compliance_2023.lua b/mod_compliance_2023/mod_compliance_2023.lua<br/>
new file mode 100644<br/>
--- /dev/null<br/>
+++ b/mod_compliance_2023/mod_compliance_2023.lua<br/>
@@ -0,0 +1,79 @@<br/>
+-- Copyright (c) 2021 Kim Alvefur<br/>
+--<br/>
+-- This module is MIT licensed.<br/>
+<br/>
+local hostmanager = require &quot;core.hostmanager&quot;;<br/>
+<br/>
+local array = require &quot;util.array&quot;;<br/>
+local set = require &quot;util.set&quot;;<br/>
+<br/>
+local modules_enabled = module:get_option_inherited_set(&quot;modules_enabled&quot;);<br/>
+<br/>
+for host in pairs(hostmanager.get_children(module.host)) do<br/>
+	local component = module:context(host):get_option_string(&quot;component_module&quot;);<br/>
+	if component then<br/>
+		modules_enabled:add(component);<br/>
+		modules_enabled:include(module:context(host):get_option_set(&quot;modules_enabled&quot;, {}));<br/>
+	end<br/>
+end<br/>
+<br/>
+local function check(suggested, alternate, ...)<br/>
+	if set.intersection(modules_enabled, set.new({suggested; alternate; ...})):empty() then return suggested; end<br/>
+	return false;<br/>
+end<br/>
+<br/>
+local compliance = {<br/>
+	array {&quot;Server&quot;; check(&quot;tls&quot;); check(&quot;disco&quot;)};<br/>
+<br/>
+	array {&quot;Advanced Server&quot;; check(&quot;pep&quot;, &quot;pep_simple&quot;)};<br/>
+<br/>
+	array {&quot;Web&quot;; check(&quot;bosh&quot;); check(&quot;websocket&quot;)};<br/>
+<br/>
+	-- No Server requirements for Advanced Web<br/>
+<br/>
+	array {&quot;IM&quot;; check(&quot;vcard_legacy&quot;, &quot;vcard&quot;); check(&quot;carbons&quot;); check(&quot;http_file_share&quot;, &quot;http_upload&quot;)};<br/>
+<br/>
+	array {<br/>
+		&quot;Advanced IM&quot;;<br/>
+		check(&quot;vcard_legacy&quot;, &quot;vcard&quot;);<br/>
+		check(&quot;blocklist&quot;);<br/>
+		check(&quot;muc&quot;);<br/>
+		check(&quot;private&quot;);<br/>
+		check(&quot;smacks&quot;);<br/>
+		check(&quot;mam&quot;);<br/>
+		check(&quot;bookmarks&quot;);<br/>
+	};<br/>
+<br/>
+	array {&quot;Mobile&quot;; check(&quot;smacks&quot;); check(&quot;csi_simple&quot;, &quot;csi_battery_saver&quot;)};<br/>
+<br/>
+	array {&quot;Advanced Mobile&quot;; check(&quot;cloud_notify&quot;)};<br/>
+<br/>
+	array {&quot;A/V Calling&quot;; check(&quot;turn_external&quot;, &quot;external_services&quot;, &quot;turncredentials&quot;, &quot;extdisco&quot;)};<br/>
+<br/>
+};<br/>
+<br/>
+function check_compliance()<br/>
+	local compliant = true;<br/>
+	for _, suite in ipairs(compliance) do<br/>
+		local section = suite:pop(1);<br/>
+		if module:get_option_boolean(&quot;compliance_&quot; .. section:lower():gsub(&quot;%A&quot;, &quot;_&quot;), true) then<br/>
+			local missing = set.new(suite:filter(function(m) return type(m) == &quot;string&quot; end):map(function(m) return &quot;mod_&quot; .. m end));<br/>
+			if suite[1] then<br/>
+				if compliant then<br/>
+					compliant = false;<br/>
+					module:log(&quot;warn&quot;, &quot;Missing some modules for XMPP Compliance 2023&quot;);<br/>
+				end<br/>
+				module:log(&quot;info&quot;, &quot;%s Compliance: %s&quot;, section, missing);<br/>
+			end<br/>
+		end<br/>
+	end<br/>
+<br/>
+	if compliant then module:log(&quot;info&quot;, &quot;XMPP Compliance 2023: Compliant ✔️&quot;); end<br/>
+end<br/>
+<br/>
+if prosody.start_time then<br/>
+	check_compliance()<br/>
+else<br/>
+	module:hook_global(&quot;server-started&quot;, check_compliance);<br/>
+end<br/>
+]]></description>
    <author>&#77;&#101;&#110;&#101;&#108;&#32;&#60;&#109;&#101;&#110;&#101;&#108;&#64;&#115;&#110;&#105;&#107;&#107;&#101;&#116;&#46;&#100;&#101;&#62;</author>
    <pubDate>Sun, 22 Dec 2024 16:06:28 +0100</pubDate>
</item>

  </channel>
</rss>
