Software /
code /
prosody
File
plugins/mod_server_contact_info.lua @ 12191:8b57362f1176
mod_http: Skip querying portmanager when http_external_url when is set
When http_external_url is set then the portmanager usage only really
serves as a check of whether any http service is enabled at all.
Should allow generating an URL from prosodyctl when http_external_url is
set.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 27 Nov 2021 12:26:15 +0100 |
parent | 11584:8bea29d1f82d |
child | 12977:74b9e05af71e |
line wrap: on
line source
-- XEP-0157: Contact Addresses for XMPP Services for Prosody -- -- Copyright (C) 2011-2018 Kim Alvefur -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- local array = require "util.array"; local jid = require "util.jid"; local url = require "socket.url"; -- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo local form_layout = require "util.dataforms".new({ { var = "FORM_TYPE"; type = "hidden"; value = "http://jabber.org/network/serverinfo"; }; { name = "abuse", var = "abuse-addresses", type = "list-multi" }, { name = "admin", var = "admin-addresses", type = "list-multi" }, { name = "feedback", var = "feedback-addresses", type = "list-multi" }, { name = "sales", var = "sales-addresses", type = "list-multi" }, { name = "security", var = "security-addresses", type = "list-multi" }, { name = "status", var = "status-addresses", type = "list-multi" }, { name = "support", var = "support-addresses", type = "list-multi" }, }); -- JIDs of configured service admins are used as fallback local admins = module:get_option_inherited_set("admins", {}); local contact_config = module:get_option("contact_info", { admin = array.collect(admins / jid.prep / function(admin) return url.build({scheme = "xmpp"; path = admin}); end); }); module:add_extension(form_layout:form(contact_config, "result"));