1
Fork 0
mirror of https://codeberg.org/nexy7574/matrix-invite-logger.git synced 2026-11-03 17:56:43 +00:00
[Pull Mirror] Matrix Invite Logger - the invite monitor with teeth
  • Go 99.3%
  • Dockerfile 0.7%
Find a file
2025-11-05 08:42:56 +00:00
.forgejo/workflows meta/ci: auto-build&push for tag pushes 2025-05-25 04:55:54 +02:00
cmd/matrix-invite-logger fix(*): Fix build errors 2025-11-05 08:42:56 +00:00
doc Split policy evaluation into its own module 2025-05-08 04:05:16 +01:00
pkg fix(*): Fix build errors 2025-11-05 08:42:56 +00:00
.dockerignore Add dockerfile for docker container 2025-04-28 19:00:28 +01:00
.gitignore Add basic CLI, fix gitignore, add MIT license 2025-05-19 18:20:58 +01:00
Dockerfile docker: move binary to /bin 2025-05-24 03:43:19 +01:00
example-config.yaml mil: integrate some simple anti-fingerprinting 2025-05-27 01:08:23 +01:00
go.mod chore: bump dependencies 2025-11-05 08:37:10 +00:00
go.sum chore: bump dependencies 2025-11-05 08:37:10 +00:00
LICENSE Add basic CLI, fix gitignore, add MIT license 2025-05-19 18:20:58 +01:00
README.md Update README links, add notice about rewrite 2025-05-23 20:15:13 +02:00

Matrix Invite Logger

Warning

Due to a sudden and rapid increase in scope, matrix-invite-logger is currently undergoing a major rewrite on the v2 branch. I am not currently accepting new issues regarding the current code (there are many problems, I know), however PRs are welcome.

A permissionless (does not require server admin) daemon that listens to a collection of accounts for invites, logs them, and optionally rejects ones that violate ban policies.

Join my Matrix room for help

Tip

You may also like: MatrixAntiDmSpam.git (similar tool written in C#)


If you're like me, you may have a few Matrix accounts spread across different homeservers. Maybe your main account, a backup account, a testing account, and a bot account. Whatever the case, they will likely eventually get spam invites, especially if you are in some public rooms.

This invite logger is a simple solution that will log all invites and their associated metadata to a room, and if available, will check the invite user, room, and user homeserver against a set of policy lists.

If you have access to a Meowlnir API, you can delegate policy checking to a Meowlnir instance. This is not required!

Installing

With the go command

go install codeberg.org/nexy7574/matrix-invite-logger/cmd/matrix-invite-logger@dev

Building from source

git clone https://codeberg.org/nexy7574/matrix-invite-logger.git
cd matrix-invite-logger
go build -o matrix-invite-logger ./cmd/matrix-invite-logger

Using the Docker image

docker pull codeberg.org/nexy7574/matrix-invite-logger:latest

docker run \
-v /path/to/config.yaml:/app/config.yaml:rw \
--name matrix-invite-logger \
codeberg.org/nexy7574/matrix-invite-logger:latest

Usage

First, you will want to generate the example config.

matrix-invite-logger -generate-config

This will create a new config file at ./config.yaml. You can then edit this file to your liking. If you don't want to edit the YAML yourself, you can use the -cli flag to engage the configuration wizard.

$ matrix-invite-logger -cli
Welcome to the Matrix Invite Logger configuration wizard.
Changes are saved as they are made.
1. Add account
2. Remove account
3. List accounts
4. Subscribe to policy list room
5. Unsubscribe from policy list room
6. Set log room
7. Exit
Enter your choice:

From there, you can add accounts, remove accounts, and set the log room. If you aren't using Meowlnir, it is also recommended to set some policy lists, such as #cme-bl:neko.dev.

See example-config.yaml for an example of all the available configuration options, or view the repo wiki for detailed information.

FAQ

I don't have Meowlnir!

Well, that's not a question, but I'll answer anyway.

You do not need Meowlnir to be able to use policy-based auto-rejecting! matrix-invite-logger has a built-in (albeit less-efficient) policy evaluator that can fill the role of Meowlnir.

The downside of this is that every account will try to join the policy rooms, however only one is required to be in the room in order to check policies. Furthermore, the built-in policy list evaluator is not as mature as Meowlnir/Draupnir/Mjolnir, and is very much designed to be used in a "no other option" situation. It works, in the same way that burnt toast is still toast.

Invites are rejecting, but there's sometimes no reason attached?

Due to a bug in conduwuit (and possibly other Conduit forks), when a leave event is federated, the reason is dropped from the membership event. This does not happen on Synapse or Dendrite.

Nothing can be done without patching the server.

If you are invited to a room already known to your homeserver, this issue is irrelevant as a federated leave is not performed.

The accounts are logging weird messages about tombstones

The tombstone handler is a bit weird at figuring out room names sometimes. Rest assured, it follows them fine, this is purely a cosmetic problem.