Draupnir for PubHubs

Project task: Adapting the best existing moderation tool from the regular Matrix ecosystem (Draupnir), evaluating and extending it.

Summary

At the beginning of the project, it seemed clear that a good way to start would be to integrate the best available Matrix moderation tool, Draupnir, into PubHubs.

It turns out that at this time Draupnir is not a very good fit for PubHubs's needs. Draupnir's capabilities are largely oriented around banning user identities from public rooms. In PubHubs, by contrast, because of the way user identities are linked to real-world identities, and hubs and rooms are not usually open to the general public, we expect that there should be little need for outright banning. There is likely to be a greater need for "soft" moderation features, ways to gently guide users towards the preferred behaviours. Draupnir is also concerned with messages coming in over matrix federation, from user identities not registered on the local server, which is not a scenario PubHubs supports.

Some of Draupnir's current capabilities might be found useful in PubHubs. It can automatically apply bans across multiple rooms. It can redact all the messages sent by someone who has been spamming. It can manage and share lists of banned user identities, perhaps lists created by PubHubs Central or shared among a group of co-operating hubs. (It currently employs matrix federation for the latter, but an alternative distribution method could be substituted.)

At the moment, the use of Draupnir in PubHubs is considered only an exploration, and is not incorporated in the main branch.

The second phase of this project -- Disclosure of Identity Attributes -- was therefore developed as a stand-alone feature in PubHubs, independent of Draupnir.

The Future

The development of Draupnir is currently limited by having no funding for developers. Nevertheless, by the consistent voluntary effort of its lead developer, Draupnir is undergoing significant improvements in 2023-2024, making it more modular and more flexible and easier to extend. This work is centred around abstraction of features into a library, matrix-protection-suite. It is possible that it may become better suited to addressing the kinds of moderation that PubHubs most needs.

The Matrix Foundation is planning to set up a "Trust & Safety" working group as one of its priorities, and put more resources into this topic. It is possible that this may lead to developments in the Matrix world that may be applicable to PubHubs, whether in Draupnir or in some other tooling.


The following sections briefly describe the work done.

Integrating Draupnir in PubHubs

Demonstrating the possibility to integrate Draupnir into PubHubs hub server.

Initially I used the matrix-docker-ansible-deploy Draupnir role to deploy Draupnir on the target machine where my PubHubs hub server was running. The whole procedure is documented in this blog post. It required several preparatory steps:

  1. Register the bot account
  2. Get an access token
  3. Make sure the account is free from rate limiting
  4. Create a management room

For giving a manual demonstration of Draupnir's basic capabilities I wrote these Draupnir Demo Notes and Draupnir Demo Script.

Next I integrated the deployment of Draupnir into the PubHubs hub source tree. This code remains on my development branch: https://lab.trax.im/PubHubs/PubHubs/-/tree/jf-dev/pubhubs_hub/draupnir .

Beginning of a Draupnir GUI

I built a primitive Draupnir GUI, to begin exploring what a moderation GUI could look like.

See the page A Primitive Draupnir GUI .

Pantalaimon E2EE Proxy

Pantalaimon E2EE proxy is required initially for Draupnir to access encrypted rooms.

In standard Matrix, most people use Draupnir to monitor public rooms, and those are usually unencrypted. In PubHubs, however, all rooms are encrypted.

To this end, I constructed a Pantalaimon deployment role and contributed it to matrix-docker-ansible-deploy so other Matrix-based deployments can use it.

The need to use an E2EE proxy should be phased out from around the end of 2023 through 2024, as E2EE is becoming directly supported through the SDK which Draupnir uses.

  • see blog post about deploying Pantalaimon with Draupnir

Resources