Gnuxie 879e822332 Monoreponir (#1046)
* Move src to apps/draupnir/src

https://github.com/the-draupnir-project/planning/issues/100

* Move package.json

https://github.com/the-draupnir-project/planning/issues/100

* Add matrix-basic-types to monorepo.

Get everything working including linting and prettier :3

https://github.com/the-draupnir-project/planning/issues/100

* Add interface-manager to monorepo.

This was a bitch because apparently we forgot to delete node_modules
before creating the workspace package.json. So it had linked a bunch
of local stuff like was in node_modules for Draupnir...

Anyways i think we're still on track.

https://github.com/the-draupnir-project/planning/issues/100

* idk why there are prettier changes in apps but there are.

* Add matrix-protection-suite to monorepo.

https://github.com/the-draupnir-project/planning/issues/100

* Add matrix-protection-suite-for-matrix-bot-sdk

https://github.com/the-draupnir-project/planning/issues/100

We will need to add the real upstreams and versions and remove the
file links as we publish the packages.

* Move mps-interface-adaptor into monorepo

https://github.com/the-draupnir-project/planning/issues/100

Wohoo, i think only draupnir is left now?

* Move Draupnir test files to draupnir directory smh smh smh.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript config for tests and eslint.

Now we get proper linting and type checking of tests.

https://github.com/the-draupnir-project/planning/issues/100

* WIP Integrating draupnir into monorepo tooling...

https://github.com/the-draupnir-project/planning/issues/100

We need to stop aliasing bot-sdk but we should first check that
upstream is using a consistent name too.

* Remove matrix-bot-sdk alias for vector fork.

https://github.com/the-draupnir-project/planning/issues/100

* Add top command description type and weave through API.

A more recent version of typescript meant that the exectutor's
contravariance got checked which destroyed the API so we had to make a
top type for command descriptions and parametrise some of the API.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript errors related to class property initialisation changes.

https://www.typescriptlang.org/tsconfig/#useDefineForClassFields

Seems like they were using defineProperty before which meant
properites were initialised after the constructor ran.

Honestly i like that more but we're going to stick with what they
intend to be the default.

https://github.com/the-draupnir-project/planning/issues/100

* Fix tests lacking fixtures context.

https://github.com/the-draupnir-project/planning/issues/100

* Fix typescript errors related to error destructuring in tests.

https://github.com/the-draupnir-project/planning/issues/100

* Pin postgres package to workaround upstream issue

https://github.com/porsager/postgres/issues/1150
Documented in DEPENDENCIES.md

https://github.com/the-draupnir-project/planning/issues/100

* Fix contravariance issue in hash store helper.

Part of the TS 5.9 upgrade fallout.
https://github.com/the-draupnir-project/planning/issues/100

* Fix minor typescript 5.9 migration issuess

All typescript errors finished, yay.

* Fix REUSE missing headers.

* Fix assets script in draupnir app.

* Add Draupnir to eslint scope

* Remove the appservice web API.

There are too many eslint errors here to do with unsafe parsing of
properties from the body etc. And there's actually no consumers to
this API. It's also a widget API, and all it does is provision the bot
and nothing more.

* Fix eslint config for DeadDocumentJSX.

It wasn't working well with the jsx templates.
We should probably delete the tsconfig.eslint.json shite now.

* Update src/utils.ts for eslint.

This shit is legacy i hate it.

* Fix eslint errors in config.

Really this is paint over rot since the config doesn't have a schema,
and we can't really make one either.

* Fix eslint issues in ReportManager.

This code is diabolical. It hasn't really been fixed that will take
refactoring and making sure people don't write this sorts of bad code
ever again. Which thankfully we have process in place for.

* Fix clientHelper eslint issues.

* Fix eslint for ImportCommand.

* Grinding eslint fml.

* Fix miscellaneous eslint issues.

* allow no-deprecate for logMessage.

shit's being annoying.

* Fix remaining eslint issues...

We also deleted one of the scripts used to evaluate the performance of
various endpoints, which we were not using.

* Give bot toggle asyncDispose for code consistency.

* Fix package.json access issues.

* Adjust Docker and CI for new app location in monorepo.

* Fix broken integration tests.

* Remove prepare script from matrix-protection-suite package.

Isn't needed anymore


* Fix build:all script missing base files.

* Remove test script from matrix-protection-suite-for-matrix-bot-sdk

It doesn't have any tests :/

* Order of setup is wrong in integration test workflows.

* Fix mps interface adaptor doesn't have any tests.

* Fix appservice registration for test harness.

* Fix matrix-basic-types jest configuration

* Fix no build step in mjolnir.yaml

* Transfer common dev dependencies to the workspace root.


They were just wrong.
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2025-10-09 16:49:53 +01:00
2024-10-08 16:43:52 +03:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2024-07-25 10:58:40 +01:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2024-07-25 10:58:40 +01:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00
2026-03-19 16:13:14 +00:00

Draupnir

Draupnir is a unified platform to grow, manage, and sustain communities on Matrix.

Why communities choose Draupnir

  • Draupnir provides Unified control to manage your Matrix community from one place.
  • Draupnir has Open governance and transparent project leadership grounded in grassroots community focus.
  • Draupnir is Extensible, dynamically reconfigure protections and plugins for your circumstances or needs.
  • Draupnir utilizes Distributed moderation: Subscribe to trusted, community-curated policy lists that keep spaces safe around the clock.

Status

We have recently passed a huge milestone: Draupnir's 2.0.0 release 🎉

See governance reports for the current project focus.

Draupnir is supported by NLnet through the NGI Zero Core programme. The goals of this work are described here.

Quick start

See Setting up Draupnir.

Visit #draupnir:matrix.org in your client and come say hi.

Core Features

  • Draupnir's UX is centred around intuitive interactive prompts, with no need to type out commands for most activities. Just use your client to invite the bot to rooms, or manage community members, and Draupnir will prompt you to complete your changes.

  • Draupnir can protect your community by applying policies from community curated policy lists. For example lists such as the the community moderation effort can be watched to protect your rooms around the clock. This means that adjacent Matrix communities can warn and protect each other of known threats. Draupnir and the list provided by the community moderation effort are the bread and butter essentials of moderating public spaces on Matrix.

  • Draupnir includes advanced homeserver administrative features, such as automatically suspending user accounts, blocking invitations, and taking down rooms. As well as reviewing abuse reports. This also includes protecting your homeserver with Draupnir's watched policy rooms.

  • Draupnir can be used standalone to protect a community without a homeserver.

  • Draupnir includes a series of protections that can be enabled that can help you in given scenarios when your community is being targeted.

  • Draupnir is a forwards and backwards compatible drop in replacement for Mjolnir.

Prompt UX

It is no longer necessary to use commands for most core functions. Banning a user in a protected room from your Matrix client will cause Draupnir to show a prompt in the management room, which will offer to add the ban to a policy list1 .

A demo showing a propagation prompt

You can also unban users the same way, and Draupnir will prompt you to unban them without any confusing hiccups. If you do still wish to use the ban command, please note that users and other entities that are being banned are now the first argument to the ban command. It is now also possible to provide only the entity to Draupnir and have Draupnir prompt you for the policy list and the ban reason.

A demo showing the ban command

In general, all commands have been migrated to a new interface which feature better error messages for common problems and allow admins to trace the cause of unexpected errors much more easily.

Technical differences from Mjolnir and other moderation bots

I offer you the ring, which was burned, laid upon the pyre of Baldr by Odin.

Draupnir began as a fork of Mjolnir, in order to break a feature freeze and improve the architecture.

Draupnir remains a forwards and backwards compatible drop in replacement for Mjolnir that provides significant technical improvements:

  • Draupnir is much less dependant on commands and will automatically send prompts to the management room. Prompts are sent for inviting Draupnir to protect rooms, watch policy lists, ban users, and unban users.

  • Draupnir is much more responsive. Unlike Mjolnir and other bots, Draupnir does not need to request any data from the homeserver before applying new bans or to ban new users.

  • Draupnir uses an advanced persistent revision system for room state, members, policies, and policy matches. By using revisions, Draupnir only has to process room state once in terms of simple deltas as room state is updated.

  • Draupnir offers a room state backing store, allowing Draupnir to startup quickly, even when deployed at distance from the homeserver.

  • Draupnir's core functionality is implemented as protections, which can be configured and dynamically turned on and off. If you can write even a little JS/TS, Draupnir's behaviour can be radically changed or customized. And because the core functionality is implemented with the extension system, there are less limits.

  • A huge effort has been spent refactoring the code base, paving the way for future feature development of Draupnir and adjacent projects. This includes the rewrite of the core of Draupnir into the matrix-protection-suite, providing all the Matrix client code required to operate a protection platform. The matrix-protection-suite also covers severall shortfalls in the available SDK's, providing event parsing and types that keep code secure and sound. The interface-manager providing an advanced command-oriented interface (note, this does not mean command-line interface). The matrix-basic-types library for dealing with Matrix's various string types. And finally the introduction of prettier, eslint and typescript-eslint into Draupnir's development tooling, modernising TypeScript development.

Migration

Migrating from Mjolnir is straightforward and requires no manual steps, migration for your setup is likely as simple as changing your server config to pull the latest Draupnir docker image gnuxie/draupnir:latest instead of a mjolnir one. Draupnir remains backwards compatible so that it is possible to try Draupnir and still have the option to switch back to Mjolnir.

Any problems with migration should be reported to our support room.

Setting up

See the setup documentation for first-time setup documentation.

See the configuration sample with documentation for detailed information about Draupnir's configuration.

See homeserver administration for how to use Draupnir's features to protect your homeserver and users.

After your bot is up and running, you'll want to run a couple commands to get everything set up:

  1. !draupnir list create my-coc code-of-conduct-ban-list - This will create a new ban list with the shortcode my-coc and an alias of #code-of-conduct-ban-list:example.org. You will be invited to the room it creates automatically where you can change settings such as the visibility of the room.
  2. Review the Moderator's Guide.
  3. Review !draupnir help to see what else the bot can do.

Legacy documentation (v1.87.0 and below)

For information about the legacy version of Draupnir, see v1.87.0, the documentation for which can be found here.

Contributing & Opening Issues

Please see or contributing document, but do not worry too much about following the guidance to the letter. And keep that in mind throughout.

Supported by

NLnet

This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

You can find details of the work that is being supported from NLnet here and the goals here.


  1. Yes, i know they don't align horizontally, you are welcome to suggest how this should be fixed. ↩︎

S
Description
No description provided
Readme 25 MiB
Languages
TypeScript 99.3%
JavaScript 0.6%