Mercurial > prosody-modules
changeset 6403:13c61a068c71
mod_pubsub_serverinfo: Include hostname in default pubsub node name
This change ensures that every host publishes to a unique node by default,
which is important when publishing info about multiple hosts.
The old default node name was "serverinfo"
The new default node name is in the format "serverinfo/example.com" where
example.com is automatically replaced by the publishing host's name.
This affects existing deployments in the following ways:
- If you already configured pubsub_serverinfo_node explicitly in your config,
then nothing will change, your current configuration will still be used.
- If you did not specify it in your config (i.e. used the default) then the
module will switch to publishing to the new node. If your configuration is
correct this shouldn't be noticed, because the new node will automatically
be created and configured by the module. If you want, you can clean up the
old 'serverinfo' node using:
prosodyctl shell pubsub delete_node pubsub.example.com serverinfo
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 11 Feb 2026 09:40:30 +0000 |
| parents | 4ddb5c69bc89 |
| children | a1df76ba4f68 |
| files | mod_pubsub_serverinfo/README.md mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua |
| diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_pubsub_serverinfo/README.md Mon Feb 09 18:49:58 2026 -0500 +++ b/mod_pubsub_serverinfo/README.md Wed Feb 11 09:40:30 2026 +0000 @@ -56,8 +56,9 @@ `pubsub` subdomain of the host it is publishing about. For example, if you load the module on `example.com` it will default to publishing to `pubsub.example.com`. If this is incorrect, you should set `pubsub_serverinfo_service` to a valid pubsub service address. -The `pubsub_serverinfo_node` option defaults to `"serverinfo"`. Note that if you have multiple hosts publishing to the same pubsub service, you -*must* set this to something unique for each one, otherwise they will overwrite each other. +The `pubsub_serverinfo_node` option defaults to `serverinfo/<host>` where `<host>` is replaced by the name of the publishing host. Note that +if you override this default, you *must* set it to something unique for each host you publish from, otherwise they will conflict or overwrite +each other. ### Pubsub service configuration
--- a/mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua Mon Feb 09 18:49:58 2026 -0500 +++ b/mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua Wed Feb 11 09:40:30 2026 +0000 @@ -5,7 +5,7 @@ local local_domain = module:get_host(); local service = module:get_option_string(module.name .. "_service"); -local node = module:get_option_string(module.name .. "_node", "serverinfo"); +local node = module:get_option_string(module.name .. "_node", "serverinfo/"..module.host); local actor = module.host .. "/modules/" .. module.name; local publication_interval = module:get_option_number(module.name .. "_publication_interval", 300); local cache_ttl = module:get_option_number(module.name .. "_cache_ttl", 3600);
