Annotate

mod_munin/README.md @ 6110:1a6cd0bbb7ab

mod_compliance_2023: Add 2023 Version of the compliance module, basis is the 2021 Version. diff --git a/mod_compliance_2023/README.md b/mod_compliance_2023/README.md new file mode 100644 --- /dev/null +++ b/mod_compliance_2023/README.md @@ -0,0 +1,22 @@ +--- +summary: XMPP Compliance Suites 2023 self-test +labels: +- Stage-Beta +rockspec: + dependencies: + - mod_cloud_notify + +... + +Compare the list of enabled modules with +[XEP-0479: XMPP Compliance Suites 2023] and produce basic report to the +Prosody log file. + +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) + +# Compatibility + + Prosody-Version Status + --------------- ---------------------- + trunk Works as of 2024-12-21 + 0.12 Works diff --git a/mod_compliance_2023/mod_compliance_2023.lua b/mod_compliance_2023/mod_compliance_2023.lua new file mode 100644 --- /dev/null +++ b/mod_compliance_2023/mod_compliance_2023.lua @@ -0,0 +1,79 @@ +-- Copyright (c) 2021 Kim Alvefur +-- +-- This module is MIT licensed. + +local hostmanager = require "core.hostmanager"; + +local array = require "util.array"; +local set = require "util.set"; + +local modules_enabled = module:get_option_inherited_set("modules_enabled"); + +for host in pairs(hostmanager.get_children(module.host)) do + local component = module:context(host):get_option_string("component_module"); + if component then + modules_enabled:add(component); + modules_enabled:include(module:context(host):get_option_set("modules_enabled", {})); + end +end + +local function check(suggested, alternate, ...) + if set.intersection(modules_enabled, set.new({suggested; alternate; ...})):empty() then return suggested; end + return false; +end + +local compliance = { + array {"Server"; check("tls"); check("disco")}; + + array {"Advanced Server"; check("pep", "pep_simple")}; + + array {"Web"; check("bosh"); check("websocket")}; + + -- No Server requirements for Advanced Web + + array {"IM"; check("vcard_legacy", "vcard"); check("carbons"); check("http_file_share", "http_upload")}; + + array { + "Advanced IM"; + check("vcard_legacy", "vcard"); + check("blocklist"); + check("muc"); + check("private"); + check("smacks"); + check("mam"); + check("bookmarks"); + }; + + array {"Mobile"; check("smacks"); check("csi_simple", "csi_battery_saver")}; + + array {"Advanced Mobile"; check("cloud_notify")}; + + array {"A/V Calling"; check("turn_external", "external_services", "turncredentials", "extdisco")}; + +}; + +function check_compliance() + local compliant = true; + for _, suite in ipairs(compliance) do + local section = suite:pop(1); + if module:get_option_boolean("compliance_" .. section:lower():gsub("%A", "_"), true) then + local missing = set.new(suite:filter(function(m) return type(m) == "string" end):map(function(m) return "mod_" .. m end)); + if suite[1] then + if compliant then + compliant = false; + module:log("warn", "Missing some modules for XMPP Compliance 2023"); + end + module:log("info", "%s Compliance: %s", section, missing); + end + end + end + + if compliant then module:log("info", "XMPP Compliance 2023: Compliant ✔️"); end +end + +if prosody.start_time then + check_compliance() +else + module:hook_global("server-started", check_compliance); +end +
author Menel <menel@snikket.de>
date Sun, 22 Dec 2024 16:06:28 +0100
parent 6003:fe081789f7b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1803
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
1 ---
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
2 labels:
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
3 - 'Stage-Beta'
4451
f1a63271dcfc Add tag 'Statistics' to some modules to ease discoverability
Kim Alvefur <zash@zash.se>
parents: 2167
diff changeset
4 - 'Statistics'
1803
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
5 summary: Implementation of the Munin node protocol
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
6 ...
1782
29f3d6b7ad16 Import wiki pages
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
1803
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
8 Summary
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
9 =======
1782
29f3d6b7ad16 Import wiki pages
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10
1803
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
11 This module implements the Munin reporting protocol, allowing you to
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
12 collect statistics directly from Prosody into Munin.
1782
29f3d6b7ad16 Import wiki pages
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13
2009
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
14 Configuration
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
15 =============
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
16
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
17 There is only one recommended option, `munin_node_name`, which specifies
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
18 the name that Prosody will identify itself by to the Munin server. You
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
19 may want to set this to the same hostname as in the [SRV record][doc:dns]
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
20 for the machine.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
21
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
22 ```lua
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
23 modules_enabled = {
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
24 -- your other modules
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
25 "munin",
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
26 }
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
27
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
28 munin_node_name = "xmpp.example.com"
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
29 ```
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
30
2167
24dcf496df6b mod_munin/README: Mention how to enable statsmanager (pending docs for this)
Kim Alvefur <zash@zash.se>
parents: 2166
diff changeset
31 You will also want to enable statistics collection by setting:
24dcf496df6b mod_munin/README: Mention how to enable statsmanager (pending docs for this)
Kim Alvefur <zash@zash.se>
parents: 2166
diff changeset
32
24dcf496df6b mod_munin/README: Mention how to enable statsmanager (pending docs for this)
Kim Alvefur <zash@zash.se>
parents: 2166
diff changeset
33 ```lua
24dcf496df6b mod_munin/README: Mention how to enable statsmanager (pending docs for this)
Kim Alvefur <zash@zash.se>
parents: 2166
diff changeset
34 statistics_interval = 300 -- every 5 minutes, same as munin
24dcf496df6b mod_munin/README: Mention how to enable statsmanager (pending docs for this)
Kim Alvefur <zash@zash.se>
parents: 2166
diff changeset
35 ```
2009
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
36
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
37 ## Summary
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
38
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
39 All these must be in [the global section][doc:configure#overview].
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
40
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
41 Option Type Default
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
42 ----------------------- -------- ---------------------------
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
43 munin\_node\_name string `"localhost"`
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
44 munin\_ignored\_stats set `{ }`
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
45 munin\_ports set `{ 4949 }`
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
46 munin\_interfaces set `{ "0.0.0.0", "::" }`[^1]
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
47
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
48 [^1]: Varies depending on availability of IPv4 and IPv6
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
49
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
50 ## Ports and interfaces
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
51
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
52
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
53 `mod_munin` listens on port `4949` on all local interfaces by default.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
54 This can be changed with the standard [port and network configuration][doc:ports]:
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
55
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
56
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
57 ``` lua
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
58 -- defaults:
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
59 munin_ports = { 4949 }
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
60 munin_interfaces = { "::", "0.0.0.0" }
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
61 ```
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
62
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
63 If you already have a `munin-node` instance running, you can set a
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
64 different port to avoid the conflict.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
65
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
66 ## Configuring Munin
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
67
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
68 Simply add `munin_node_name` surrounded by brackets to `/etc/munin/munin.conf`:
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
69
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
70 ``` ini
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
71 [xmpp.example.com]
2166
13f8ad3293c4 mod_munin/README: Fix config file syntax (thanks mt)
Kim Alvefur <zash@zash.se>
parents: 2010
diff changeset
72 address xmpp.example.com
13f8ad3293c4 mod_munin/README: Fix config file syntax (thanks mt)
Kim Alvefur <zash@zash.se>
parents: 2010
diff changeset
73 port 4949
2009
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
74 ```
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
75
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
76 You can leave out `address` if it equal to the name in brackets, and
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
77 leave out the `port` if it is the default (`4949`).
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
78
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
79 Setting `address` to an IP address may sometimes be useful as the Munin
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
80 collection server is not delayed by DNS lookups in case of network
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
81 issues.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
82
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
83 If you set a different port, or if the hostname to connect to is
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
84 different from this hostname, make sure to add `port` and/or `address`
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
85 options.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
86
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
87 See [Munin documentation][muninconf] for more information.
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
88
1803
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
89 Compatibility
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1782
diff changeset
90 =============
1782
29f3d6b7ad16 Import wiki pages
Kim Alvefur <zash@zash.se>
parents:
diff changeset
91
2010
891a5e925ae5 mod_munin/README: Emphasis on 0.10 requirement
Kim Alvefur <zash@zash.se>
parents: 2009
diff changeset
92 **Requires** Prosody 0.10 or above
2009
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
93
4a1c1ffb4c09 mod_munin/README: Describe options and how to set up munin.conf
Kim Alvefur <zash@zash.se>
parents: 1803
diff changeset
94 [muninconf]: http://guide.munin-monitoring.org/en/stable-2.0/reference/munin.conf.html