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)
default_admin_affiliation = "owner"
The default affiliation of admins to nodes
autocreate_on_subscribe = false
Whether to automatically create non-existent nodes when someone subscribes
autocreate_on_publish = false
Whether to automatically create non-existent nodes when someone publishes
pubsub_max_items = 256
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}}}";
}
Starting with 0.12.0, nodes with
the pubsub#include_body
setting set to true
can have a plain text version of the payload generated based on a
template, using the util.xtemplate format.
The template is selected based on the pubsub#type
config
option. If that is unset, the namespace of the payload is used.
After Prosody 13.0.0, the following properties from the node configuration can be used:
@pubsub:node
- the name of the node itself.@pubsub:title
- the value of thepubsub#title
node configuration option.@pubsub:description
- the value of thepubsub#description
node configuration option.
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 server_user_role = "prosody:registered"
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" }
}