> ## Content Index
> Fetch the complete content index at: https://www.process-one.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# ejabberd 21.12
- URL: https://www.process-one.net/blog/ejabberd-21-12/
- Published: 2021-12-09T14:44:00.000Z
- Updated: 2024-09-16T13:44:41.000Z
- Description: This new ejabberd 21.12 release comes after five months of work, contains more than one hundred changes, many of them are major improvements or features, and several bug fixes.
- Author: Jérôme Sautret

When upgrading from previous versions, please notice: there’s a change in `mod_register_web` behaviour, and PosgreSQL database, please take a look if they affect your installation.

A more detailed explanation of those topics:

### Optimized MucSub and Multicast processing

More efficient processing of [MucSub](https://docs.ejabberd.im/developer/xmpp-clients-bots/extensions/muc-sub/?ref=process-one.net) and Multicast ([XEP-0033](https://xmpp.org/extensions/xep-0033.html?ref=process-one.net)) messages addressed to big number of addresses.

### Support MUC Hats

MUC Hats ([XEP-0317](https://xmpp.org/extensions/xep-0317.html?ref=process-one.net)) defines a more extensible model for roles and affiliations in Multi-User Chat rooms. This protocol was deferred, but it is supported by several clients and servers. ejabberd’s implementation supports both the XEP schema, and also the Conversejs/Prosody custom schema.

### New `mod_conversejs`

This module serves a simple page to allow the [Converse.js](https://conversejs.org/?ref=process-one.net) XMPP web browser client connect to ejabberd. It can use ejabberd’s Websockets or BOSH (HTTP-Bind).

By default this module points to the public online client available at converse.js. Alternatively, you can download the client and host it locally with a configuration like this:

```yaml
hosts:
  - localhost

listen:
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    tls: false
    request_handlers:
      /websocket: ejabberd_http_ws
      /conversejs: mod_conversejs
      /conversejs_files: mod_http_fileserver

modules:
  mod_conversejs:
    websocket_url: "ws://localhost:5280/websocket"
    conversejs_script: "http://localhost:5280/conversejs_files/converse.min.js"
    conversejs_css: "http://localhost:5280/conversejs_files/converse.min.css"
  mod_http_fileserver:
    docroot: "/home/ejabberd/conversejs-9.0.0/package/dist"
    accesslog: "/var/log/ejabberd/fileserver-access.log"

```

### Many PubSub improvements

Add `delete_old_pubsub_items` command.  
Add a command for keeping only the specified number of items on each node and removing all older items. This might be especially useful if nodes may be configured to have no ‘max\_items’ limit.

Add `delete_expired_pubsub_items` command  
Support XEP-0060’s pubsub#item\_expire feature by adding a command for deleting expired PubSub items.

Fix `get_max_items_node/1` specification  
Make it explicit that the get\_max\_items\_node/1 function returns ?MAXITEMS if the ‘max\_items\_node’ option isn’t specified. The function didn’t actually fall back to ‘undefined’ (but to the ‘max\_items\_node’ default; i.e., ?MAXITEMS) anyway. This change just clarifies the behavior and adjusts the function specification accordingly.

### Improvements in the ejabberd Documentation web

Added many cross-links between modules, options, and specific sections.

Added a new [API Tags](https://docs.ejabberd.im/developer/ejabberd-api/admin-tags/?ref=process-one.net) page similar to “ejabberdctl help tags”.

Improved the [API Reference](https://docs.ejabberd.im/developer/ejabberd-api/admin-api/?ref=process-one.net) page, so commands show the tags and the definer module.

### Configuration changes

`mod_register_web` is now affected by the restrictions that you configure in `mod_register` ([#3688](https://github.com/processone/ejabberd/issues/3688?ref=process-one.net)).

`mod_register` gets a new option, `allow_modules`, to restrict what modules can register new accounts. This is useful if you want to allow only registration using `mod_register_web`, for example.

### PosgreSQL changes

Added to PgSQL’s new schema missing SQL migration for table push\_session ([#3656](https://github.com/processone/ejabberd/pull/3656?ref=process-one.net))

Fixed in PgSQL’s new schema the vcard\_search definition ([#3695](https://github.com/processone/ejabberd/issues/3695?ref=process-one.net)).  
How to update an existing database:

```sql
ALTER TABLE vcard_search DROP CONSTRAINT vcard_search_pkey;
ALTER TABLE vcard_search ADD PRIMARY KEY (server_host, lusername);

```

### Summary of changes:

#### Commands

- create\_room\_with\_opts: Fixed when using SQL storage ([#3700](https://github.com/processone/ejabberd/issues/3700?ref=process-one.net))
- change\_room\_option: Add missing fields from config inside mod\_muc\_admin:change\_options
- piefxis: Fixed arguments of all commands

#### Modules

- mod\_caps: Don’t forget caps on XEP-0198 resumption
- mod\_conversejs: New module to serve a simple page for Converse.js
- mod\_http\_upload\_quota: Avoid ‘max\_days’ race
- mod\_muc: Support MUC hats (XEP-0317, conversejs/prosody compatible)
- mod\_muc: Optimize MucSub processing
- mod\_muc: Fix exception in mucsub {un}subscription events multicast handler
- mod\_multicast: Improve and optimize multicast routing code
- mod\_offline: Allow storing non-composing x:events in offline
- mod\_ping: Send ping from server, not bare user JID ([#3658](https://github.com/processone/ejabberd/issues/3658?ref=process-one.net))
- mod\_push: Fix handling of MUC/Sub messages ([#3651](https://github.com/processone/ejabberd/issues/3651?ref=process-one.net))
- mod\_register: New allow\_modules option to restrict registration modules
- mod\_register\_web: Handle unknown host gracefully
- mod\_register\_web: Use mod\_register configured restrictions ([#3688](https://github.com/processone/ejabberd/issues/3688?ref=process-one.net))

#### PubSub

- Add delete\_expired\_pubsub\_items command
- Add delete\_old\_pubsub\_items command
- Optimize publishing on large nodes (SQL)
- Support unlimited number of items
- Support ‘max\_items=max’ node configuration ([#3666](https://github.com/processone/ejabberd/pull/3666?ref=process-one.net))
- Bump default value for ‘max\_items’ limit from 10 to 1000 ([#3652](https://github.com/processone/ejabberd/pull/3652?ref=process-one.net))
- Use configured ‘max\_items’ by default
- node\_flat: Avoid catch-all clauses for RSM
- node\_flat\_sql: Avoid catch-all clauses for RSM

#### SQL

- Use INSERT … ON CONFLICT in SQL\_UPSERT for PostgreSQL >= 9.5
- mod\_mam export: assign MUC entries to the MUC service ([#3680](https://github.com/processone/ejabberd/issues/3680?ref=process-one.net))
- MySQL: Fix typo when creating index ([#3654](https://github.com/processone/ejabberd/pull/3654?ref=process-one.net))
- PgSQL: Add SASL auth support, PostgreSQL 14 ([#3691](https://github.com/processone/ejabberd/issues/3691?ref=process-one.net))
- PgSQL: Add missing SQL migration for table push\_session ([#3656](https://github.com/processone/ejabberd/pull/3656?ref=process-one.net))
- PgSQL: Fix vcard\_search definition in pgsql new schema ([#3695](https://github.com/processone/ejabberd/issues/3695?ref=process-one.net))

#### Other

- captcha-ng.sh: “sort -R” command not POSIX, added “shuf” and “cat” as fallback ([#3660](https://github.com/processone/ejabberd/pull/3660?ref=process-one.net))
- Make s2s connection table cleanup more robust
- Update export/import of scram password to XEP-0227 1.1 ([#3676](https://github.com/processone/ejabberd/issues/3676?ref=process-one.net))
- Update Jose to 1.11.1 (the last in hex.pm correctly versioned)

## ejabberd 21.12 download & feedback

As usual, the release is tagged in the Git source code repository on [Github](https://github.com/processone/ejabberd.git?ref=process-one.net).

The source package and binary installers are available at [ejabberd XMPP & MQTT server download page](https://www.process-one.net/en/ejabberd/downloads/).

If you suspect that you’ve found a bug, please search or fill a bug report on [Github](https://github.com/processone/ejabberd/issues?ref=process-one.net).