ejabberd 16.09

We are happy to introduce our new ejabberd release, ejabberd 16.09. As usual it includes many bug fixes and improvements. But most of all, it includes excellent student work done for Google Summer of Code program.

More specifically, this release adds the following major features:

  • Support for Elixir configuration file. It means it is possible to configure ejabberd using an Elixir script file instead of ejabberd YAML format.
  • Support XEP-0355 – Namespace Delegation
    This allows to use an external entity to manage some of the server features. This XEP is working with Privileged Entity (XEP-0356).
  • Support XEP-0356 – Privileged Entity
    This allows a component or any entity to have a “privileged” status. As a result, it can manage an entity roster on its behalf, send or receive stanzas in the name of the server. The main goal of XEP-0356 is to create an external, server agnostic, PEP service.

Thanks to Anna Mukharram and Gabriel Gatu for their contributions.

Namespace Delegation and Privileged Entity

Thanks to Anna Mukharram, it’s now possible to delegate features to a component with a privileged status, allowing components to get access to some ejabberd’s internal data and to perform some actions. This allows developing advanced components that were previously not possible to create with XEP-0114 – Jabber Component Protocol.

On a typical setup, you’ll use both XEP-0355 and XEP-0356. To do so, you need to add mod_delegation to your modules section in ejabberd’s configuration, and delegate namespace to a component by adding a component in your listener section. You may also grant some access to this component. Here is an example of such configuration:

listen:
  ...
  -
    port: 8888
    module: ejabberd_service
    hosts:
      "sat-pubsub.example.org":
        password: "secret"
    delegations:
      "urn:xmpp:mam:1":
        filtering: ["node"]
      "https://jabber.org/protocol/pubsub":
        filtering: []
  ...

In the example above, a component serving sat-pubsub.example.org will receive all pubsub requests and all MAM requests with the node filtering attribute presented in a query packet. The component is also allowed to get the roster of every user of the server and send messages on behalf of the server.

Compliance with Salut à Toi project components have been tested: We can now run SàT components directly on top of ejabberd.

Please, let us know if you write components for XMPP using this new feature :)

Ejabberd configuration in Elixir

Thanks Gabriel Gatu, you now have choice when it comes to configure ejabberd. While YAML configuration file is the default way to configure ejabberd, it’s now possible to write configuration as an Elixir script which will be evaluated. The most notable benefit is the ability to add some logic and get unlimited number of possibilities for a dynamic configuration.

Here is an example of such configuration: ejabberd.exs

It also gives opportunity to apply a custom function for a given hook to customize ejabberd behavior without need to write your own ejabberd module. The following example adds an entry in the log when a user is registered:

hook :register_user, [host: "localhost"], fn(user, server) ->
   info("User registered: #{user} on #{server}")
end

Elixir configuration files are expected to have .exs extensions.

Check config/ejabberd.exs for a complete default configuration, and give it a try !

This is a work in progress, and you can expect more features soon. For example, you cannot yet define different module or listener configurations for different domains, but this is something we are aware of and that is on our roadmap.

Changes

This is a selection of the most important changes:

New XMPP Extension support

Elixir support

  • Support for Elixir-based configuration files

MUC/Sub

  • Add a new request to list MUC room subscribers
  • Link MUC subscription to bare JID
  • New commands unsubscribe_room and unsubscribe_room for MUC subscriptions management through API
  • Fix nick-to-jid mapping for MUC subscribers
  • Fix subscribed rooms list retrieval
  • Fix message routing from subscribers
  • Do not update muc_online_users table on MUC/Sub operations

MUC

  • Support multiple JIDs in room invitations
  • Create room on configuration request as per XEP-0045, 10.1.3

PubSub

  • Add SQL support for microblogging node plugin
  • Fix publish with subscriber publish model and SQL backend
  • node_mb: Call node_pep instead of node_hometree

Stream Management

  • New Stream Management option: ack_timeout
  • Fix Stream Management feature for the websocket connections
  • Cancel timer when waiting for resumption

MAM and Offline

  • Don’t store messages of type “headline”
  • Simplify “assume_mam_usage” option
  • Honor hint for any non-“error” message
  • Store announcements for offline users

Database

  • Session backend: fix clean Redis table
  • mod_shared_roster: Support SQL backend

ejabberdctcl admin tool

  • ejabberdctl: do not force access rules check on register command
  • ejabberdctl: do not force command line to pass a credential
  • New commands unsubscribe_room and unsubscribe_room for MUC subscriptions management
  • New command create_room_with_opts to create room with custom config

ejabberd API

  • New commands unsubscribe_room and unsubscribe_room for MUC subscriptions management
  • New command create_room_with_opts to create room with custom config
  • Add X-Admin and basic auth header to CORS allowed headers in http_api
  • Properly process OPTIONS header in http_api for all paths
  • Expand parsing of JSON input to be able to handle update_roster command
  • Provide proper args_desc in oauth_issue_token command

Developer features: ejabberd Hooks

  • Add hooks c2s_session_pending, c2s_session_resumed, store_offline_message, store_mam_message
  • Add CSI user’s JID argument to csi_filter_stanza and csi_flush_queue hooks
  • Add functions to get/set some c2s #state elements from external modules
  • mod_client_state: Let other modules filter stanzas
  • rework c2s API to simplify push modules integration

Installers

  • Fix several issues on Windows installer

Feedback

As usual, the release is tagged in the Git source code repository on Github.

The source package and binary installers are available at ProcessOne.

If you suspect that you’ve found a bug, please search or fill a bug report on Github.


Let us know what you think 💬


Leave a Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.