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.
New trunk permission framework
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.
Parent VirtualHost
To grant everyone on the parent VirtualHost permission to create nodes, add permissions 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, assign a role via the server_user_role
setting of
mod_authz_internal
and then give that role permission to
pubsub:create-node
:
"pubsub.example.com" "pubsub"
Component = "prosody:guest"
server_user_role = {
add_permissions ["prosody:guest"] = { "pubsub:create-node" }
}
Completely Open
To grant everyone on the entire XMPP federated network permission to
create nodes, assign a role for public users via the
public_user_role
setting of
mod_authz_internal
, in addition to
server_user_role
as above, and then add the permission of
pubsub:create-node
:
"pubsub.example.com" "pubsub"
Component = "prosody:guest"
server_user_role = "prosody:guest"
public_user_role = {
add_permissions ["prosody:guest"] = { "pubsub:create-node" }
}