Changeset

5338:03044a6f5f4c

mod_service_outage_status: XEP-0455: Service Outage Status Only the out of band part so far. The in-band pubsub part would need '+notify' support in mod_pubsub, since mod_pep does not serve the bare-host-JID. All the hard parts of this XEP is elsewhere, i.e. hosting the document somewhere reliable.
author Kim Alvefur <zash@zash.se>
date Mon, 10 Apr 2023 13:24:03 +0200
parents 5337:8d8e85d6dc91
children 5339:6d99ddd99694
files mod_service_outage_status/README.markdown mod_service_outage_status/mod_service_outage_status.lua
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_service_outage_status/README.markdown	Mon Apr 10 13:24:03 2023 +0200
@@ -0,0 +1,19 @@
+This module allows advertising a machine-readable document were outages,
+planned or otherwise, may be reported.
+
+See [XEP-0455: Service Outage Status] for further details, including
+the format of the outage status document.
+
+```lua
+modules_enabled = {
+    -- other modules
+    "service_outage_status",
+}
+
+outage_status_urls = {
+    "https://uptime.example.net/status.json",
+}
+```
+
+The outage status document should be hosted on a separate server to
+ensure availability even if the XMPP server is unreachable.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_service_outage_status/mod_service_outage_status.lua	Mon Apr 10 13:24:03 2023 +0200
@@ -0,0 +1,9 @@
+local dataforms = require "util.dataforms";
+
+local form_layout = dataforms.new({
+	{ type = "hidden"; var = "FORM_TYPE"; value = "urn:xmpp:sos:0" };
+	{ type = "list-multi"; name = "addrs"; var = "external-status-addresses" };
+});
+
+local addresses = module:get_option_array("outage_status_urls");
+module:add_extension(form_layout:form({ addrs = addresses }, "result"));