mod_pubsub

Implements a XEP-0060 pubsub service.

Usage

Load as a component:

Component "pubsub.example.com" "pubsub"

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}}}";
}

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:

Component "pubsub.example.com" "pubsub"
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:

Component "pubsub.example.com" "pubsub"
server_user_role = "prosody:guest"
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:

Component "pubsub.example.com" "pubsub"
server_user_role = "prosody:guest"
public_user_role = "prosody:guest"
add_permissions = {
    ["prosody:guest"] = { "pubsub:create-node" }
}