Mercurial > prosody-modules
view mod_restrict_federation/README.md @ 6352:525655adfd3e
mod_report_affiliations: Fix traceback a non-user is sending a presence
For now we won’t touch their presence instead of emiting this traceback:
error Traceback[s2s]: /usr/lib/prosody/core/rostermanager.lua:275: attempt to concatenate a nil value (local 'username')
stack traceback:
/usr/lib/prosody/core/rostermanager.lua:275: in function 'prosody.core.rostermanager.is_user_subscribed'
...ules/mod_report_affiliations/mod_report_affiliations.lua:116: in field '?'
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
(...tail calls...)
/usr/lib/prosody/core/stanza_router.lua:184: in upvalue 'core_post_stanza'
/usr/lib/prosody/modules/mod_presence.lua:244: in function </usr/lib/prosody/modules/mod_presence.lua:231>
(...tail calls...)
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
(...tail calls...)
/usr/lib/prosody/core/stanza_router.lua:188: in upvalue 'core_post_stanza'
/usr/lib/prosody/core/stanza_router.lua:128: in upvalue 'core_process_stanza'
/usr/lib/prosody/modules/mod_s2s.lua:818: in upvalue 'func'
/usr/lib/prosody/util/async.lua:149: in function </usr/lib/prosody/util/async.lua:147>
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Tue, 30 Dec 2025 13:19:43 +0100 |
| parents | ba2c344e1bdd |
| children |
line wrap: on
line source
--- labels: - 'Stage-Beta' summary: Restrict federation for some user roles ... Introduction ============ This module allows you to control which user roles have permission to communicate with remote servers. Details ======= There are quite a few modules that have similar functionality. The properties of this one are: - Uses the new [permissions and roles](https://prosody.im/doc/roles) feature introduced in Prosody 13.0 - Blocks both incoming and outgoing traffic - Permits server-originated traffic (such as push notifications) - Permits traffic between hosts on the same server Configuration ============= Simply load the module as usual: ``` {.lua} modules_enabled = { ... "restrict_federation"; ... } ``` Any user without the `xmpp:federate` permission will be unable to communicate with remote domains. By default this module does not grant this permission to any role, meaning all users will be restricted. To grant permission to certain roles, you can use the `add_permission` configuration option (assuming you are using Prosody's [default authorization module](https://prosody.im/doc/modules/mod_authz_internal)): ``` {.lua} -- Allow registered users to federate (i.e. this excludes prosody:guest) -- As prosody:admin inherits all permissions from this role too, admins will -- also be able to communicate with other servers. add_permissions = { ["prosody:registered"] = { "xmpp:federate"; }; } ``` Compatibility ============= ----- ------- 13.0 Works ----- -------
