Mercurial > prosody-modules
annotate mod_http_index/html/http_index.html @ 6082: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 |
| parents | 28b386fc7a05 |
| children |
| rev | line source |
|---|---|
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 <!DOCTYPE html> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 <html> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 <head> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 <meta charset="utf-8"> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 <meta name="viewport" content="width=device-width, initial-scale=1"> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 <meta name="generator" value="prosody/{prosody_version} mod_{mod_name}"> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 <link rel="canonical" href="{canonical}"> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 <title>{title}</title> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 <style> |
|
4194
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
10 :link,:visited{color:#3465a4;text-decoration:none;} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
11 :link:hover,:visited:hover{color:#6197df;} |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 body{background-color:#eeeeec;margin:1ex 0;padding-bottom:3em;font-family:Arial,Helvetica,sans-serif;} |
|
4194
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
13 ul,ol{padding:0;} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
14 li{list-style:none;} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
15 hr{visibility:hidden;clear:both;} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
16 br{clear:both;} |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 header,footer{margin:1ex 1em;} |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 footer{font-size:smaller;color:#babdb6;} |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 nav{font-size:large;margin:1ex 1ex;clear:both;line-height:1.5em;} |
|
4194
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
20 footer nav .up{display:none;} |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 @media screen and (min-width: 460px) { |
|
4194
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
22 nav {font-size:x-large;margin:1ex 1em;} |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 } |
|
4198
b1a5c2ee49c4
mod_http_index,muc_log: More CSS tweaks
Kim Alvefur <zash@zash.se>
parents:
4196
diff
changeset
|
24 nav a{padding:1ex} |
|
b1a5c2ee49c4
mod_http_index,muc_log: More CSS tweaks
Kim Alvefur <zash@zash.se>
parents:
4196
diff
changeset
|
25 nav li,nav dt{margin:1ex} |
|
4194
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
26 .content{background-color:white;padding:1em;list-style-position:inside;} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
27 @media (prefers-color-scheme: dark) { |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
28 html{color:#eee} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
29 body{background-color:#161616} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
30 .content{background-color:#1c1c1c} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
31 footer{color:#444} |
|
13bcdfd9c714
mod_http_index: Copy style from mod_http_muc_log (inc dark theme!)
Kim Alvefur <zash@zash.se>
parents:
3927
diff
changeset
|
32 } |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 </style> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 </head> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 <body> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 <header> |
| 3335 | 37 <h1>Prosody IM</h1> |
| 38 <h2>HTTP Services</h2> | |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 </header> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 <hr> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 <div class="content"> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 <nav> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 <ul>{items# |
|
3336
4af114684e0a
mod_http_index: Allow listed modules to include a friendlier name
Kim Alvefur <zash@zash.se>
parents:
3335
diff
changeset
|
44 <li><a href="{item.url}" title="{item.module}">{item.title?{item.name}}</a></li>} |
|
1827
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 </ul> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 </nav> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 </div> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 <hr> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 <footer> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 <br> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 <div class="powered-by">Prosody {prosody_version?}</div> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 </footer> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 </body> |
|
9376e870f0e1
mod_http_index: Move template out into a file and make it configurable
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 </html> |
