1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-09 17:46:29 +09:00
nixpkgs/nixos/modules/services/matrix/draupnir.md
Rory& 4b153aad5d
nixos/draupnir: init
Co-authored-by: emilylange <git@emilylange.de>
Co-authored-by: Martin Weinelt <hexa@darmstadt.ccc.de>
Co-authored-by: teutat3s <10206665+teutat3s@users.noreply.github.com>
2025-06-06 15:35:31 +02:00

2.6 KiB

Draupnir (Matrix Moderation Bot)

This chapter will show you how to set up your own, self-hosted Draupnir instance.

As an all-in-one moderation tool, it can protect your server from malicious invites, spam messages, and whatever else you don't want. In addition to server-level protection, Draupnir is great for communities wanting to protect their rooms without having to use their personal accounts for moderation.

The bot by default includes support for bans, redactions, anti-spam, server ACLs, room directory changes, room alias transfers, account deactivation, room shutdown, and more. (This depends on homeserver configuration and implementation.)

See the README page and the Moderator's guide for additional instructions on how to setup and use Draupnir.

For additional settings see the default configuration.

Draupnir Setup

First create a new unencrypted, private room which will be used as the management room for Draupnir. This is the room in which moderators will interact with Draupnir and where it will log possible errors and debugging information. You'll need to set this room ID or alias in services.draupnir.settings.managementRoom.

Next, create a new user for Draupnir on your homeserver, if one does not already exist.

The Draupnir Matrix user expects to be free of any rate limiting. See Synapse #6286 for an example on how to achieve this.

If you want Draupnir to be able to deactivate users, move room aliases, shut down rooms, etc. you'll need to make the Draupnir user a Matrix server admin.

Now invite the Draupnir user to the management room. Draupnir will automatically try to join this room on startup.

{
  services.draupnir = {
    enable = true;

    settings = {
      homeserverUrl = "https://matrix.org";
      managementRoom = "!yyy:example.org";
    };

    secrets = {
      accessToken = "/path/to/secret/containing/access-token";
    };
  };
}

Element Matrix Services (EMS)

If you are using a managed "Element Matrix Services (EMS)" server, you will need to consent to the terms and conditions. Upon startup, an error log entry with a URL to the consent page will be generated.