Find a file
Shay 25b69fb7f1
Revert update to Node 24 (#630)
* Revert "bump tensorflow and nsfwjs (#628)"

This reverts commit 2988179cb7.

* Revert "Update minimum NodeJS version to 24 (#626)"

This reverts commit 3d515a4c56.
2025-11-21 11:04:09 -08:00
.github Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
.well-known Create funding-manifest-urls (#596) 2025-03-27 21:10:12 -07:00
config Support synapse-http-antispam (#610) 2025-07-23 12:28:25 -07:00
docs Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
src Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
synapse_antispam v1.11.0 2025-08-12 16:19:53 -07:00
test Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
.dockerignore Absolute bare minimum for a bot 2019-09-25 20:13:20 -06:00
.gitignore Revert "Fix traceback on Abuse Report. (#230)" (#293) 2022-05-13 15:29:49 +02:00
.prettierignore Use Prettier to format code (#542) 2024-10-09 12:32:23 -07:00
.prettierrc.js Use Prettier to format code (#542) 2024-10-09 12:32:23 -07:00
CONTRIBUTING.md remove real name requirement from DCO 2024-07-25 14:52:58 -07:00
Dockerfile Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
LICENSE Initial commit 2019-09-25 19:36:12 -06:00
mjolnir-entrypoint.sh manymjolnir appservice (#364) 2022-11-15 18:03:06 +00:00
mx-tester.yml Add commands to suspend/unsuspend user (#506) 2024-07-24 12:16:12 -07:00
package.json Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
README.md Refer to CONTRIBUTING from README (#572) 2025-02-14 10:43:07 -08:00
releasing.md update releasing instructions (#502) 2024-01-23 21:29:43 -08:00
test_tree.jpg Add a NSFW protection (#520) 2024-09-11 15:26:20 -07:00
tsconfig.json Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00
tslint.json Fix tlsint 2019-09-27 13:54:34 -06:00
yarn.lock Revert update to Node 24 (#630) 2025-11-21 11:04:09 -08:00

mjolnir

A moderation tool for Matrix. Visit #mjolnir:matrix.org for more information.

Features

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, Mjolnir 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.

A Synapse module is also available to apply the same rulesets the bot uses across an entire homeserver.

Setting up

See the setup documentation for first-time setup documentation.

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

See the synapse module documentation for information on how to setup Mjolnir's accompanying Synapse Module.

Quickstart guide

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

  1. !mjolnir list create COC code-of-conduct-ban-list - This will create a new ban list with the shortcode 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. !mjolnir default COC - This sets the default ban list to the list we just created to help with the ban commands later on.
  3. Review the Moderator's Guide.
  4. Review !mjolnir help to see what else the bot can do.

Enabling readable abuse reports

Since version 1.2, Mjölnir offers the ability to replace the Matrix endpoint used to report abuse and display it into a room, instead of requiring you to request this data from an admin API.

This requires two configuration steps:

  1. In your Mjölnir configuration file, typically /etc/mjolnir/config/production.yaml, copy and paste the web section from default.yaml, if you don't have it yet (it appears with version 1.20) and set enabled: true for both web and abuseReporting.
  2. Setup a reverse proxy that will redirect requests from ^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$ to http://host:port/api/1/report/$2/$3, where host is the host where you run Mjölnir, and port is the port you configured in production.yaml. For an example nginx configuration, see test/nginx.conf. It's the confirmation we use during runtime testing.

Security note

This mechanism can extract some information from unencrypted rooms. We have taken precautions to ensure that this cannot be abused: the only case in which this feature will publish information from room foo is:

  1. If it is used by a member of room foo; AND
  2. If said member did witness the event; AND
  3. If the event was unencrypted; AND
  4. If the event was not redacted/removed/...

Essentially, this is a more restricted variant of the Admin APIs available on homeservers.

However, if you are uncomfortable with this, please do not activate this feature. Also, you should probably setup your production.yaml to ensure that the web server can only receive requests from your reverse proxy (e.g. localhost).

Development

See CONTRIBUTING.md.