mod_pubsub
Implements a XEP-0060 pubsub service.
Usage
Load as a component:
"pubsub.example.com" "pubsub" Component
Configuration
Various options are supported:
= {} admins
Add additional admins for this component (global admins are automatically admins)
= "owner" default_admin_affiliation
The default affiliation of admins to nodes
= false autocreate_on_subscribe
Whether to automatically create non-existent nodes when someone subscribes
= false autocreate_on_publish
Whether to automatically create non-existent nodes when someone publishes
= 256 pubsub_max_items
Limit on how many items nodes can be configured to store.
= {
pubsub_summary_templates ["http://www.w3.org/2005/Atom"] = "{summary|or{{author/name|and{{author/name} posted }}{title}}}";
}
Templates used to generate plain text version of notifications from payloads, using util.xtemplate. Available starting with 0.12.0.
Permissions
From Prosody 13.0+, two permissions are
defined in mod_pubsub
:
pubsub:service-admin
-
This permission allows being given a default affiliation set by
default_admin_affiliation
, defaulting to owner. pubsub:create-node
- This permission allows creating new nodes. The creator becomes owner of the new node.
Common permission configurations
If you are using the default authorization provider (mod_authz_internal), the following sections explain how to configure the pubsub permissions for different scenarios.
Parent VirtualHost
User accounts on the parent VirtualHost will default to the
prosody:registered
role on a component. Therefore, to grant
everyone on the parent VirtualHost permission to create nodes,
add the pubsub:create-node
permission on the Component as
follows:
"pubsub.example.com" "pubsub"
Component = {
add_permissions ["prosody:registered"] = { "pubsub:create-node" }
}
Everyone on the server
To grant everyone on the same Prosody instance permission to create
nodes, tell mod_authz_internal to assign them the
prosody:registered
role (by using the
server_user_role
option) and then configure the
pubsub:create-node
permission for this role as above.
"pubsub.example.com" "pubsub"
Component = "prosody:guest"
server_user_role = {
add_permissions ["prosody:registered"] = { "pubsub:create-node" }
}
Completely open
To grant everyone on the entire XMPP federated network permission to
create nodes, you can add the pubsub:create-node
permission
to the prosody:guest
role:
"pubsub.example.com" "pubsub"
Component = {
add_permissions ["prosody:guest"] = { "pubsub:create-node" }
}