Mercurial > prosody-modules
annotate mod_s2s_failclose/mod_s2s_failclose.lua @ 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 | 83355cfcad1d |
| children |
| rev | line source |
|---|---|
|
6353
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 module:set_global(); |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 local errors = require "prosody.util.error"; |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 local incoming_s2s = prosody.incoming_s2s; |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 -- When an outgoing connection fails, close a corresponding incoming connection with a stream error to indicate the problem to the remote |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 module:hook("s2s-destroyed", function(event) |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 local s2sout = event.session; |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 if s2sout.type ~= "s2sout_unauthed" then return end |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 for s2sin in pairs(incoming_s2s) do |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 if s2sin.from_host == s2sout.to_host and s2sin.to_host == s2sout.from_host then |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 s2sin:close(errors.new({ condition = "reset", text = "Could not deliver return stanzas, please check your DNS and firewall" })); |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 end |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 end |
|
83355cfcad1d
mod_s2s_failclose: Report outgoing connection failures to remote servers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 end); |
