Archived
1
Fork 0
This repository has been archived on 2025-11-08. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2025-03-01 02:12:16 +00:00
src/redactme Fix history iteration within a timespan being infinite 2025-03-01 02:12:16 +00:00
.gitignore Initial and working proof of concept 2024-10-05 03:06:44 +01:00
LICENSE Initial and working proof of concept 2024-10-05 03:06:44 +01:00
pyproject.toml Fix setuptools always spitting out 0.0.0 2024-11-24 12:27:39 +00:00
README.md Update the README for v2 2024-11-08 21:27:11 +00:00
tox.ini Initial and working proof of concept 2024-10-05 03:06:44 +01:00

Redact me

A little tool that will bulk redact events in Matrix given specific criteria.

Installing

You can use pip, but you should ideally use pipx:

pipx install git+https://codeberg.org/nexy7574/redact-me.git@v2

You may also need to pipx ensurepath.

Usage

See redact-me --help.

Some examples:

  • Redact all messages since the first of December 2023: redact-me --mxid=@example:example.example --since=2023-12-01 #room:example.example
  • Redact all messages from a specific room: redact-me --mxid=@example:example.example --max-lookback=0 #example:example.example
  • Redact all messages matching a specific lambda: redact-me --mxid=@example:example.example --callback="'example' in event['content'].get('body')" #room:example.example
  • Redact messages and reactions from a room: redact-me --mxid=@example:example.example --redact-type=m.room.message --redact-type=m.reaction #room:example.example
  • Redact messages between the first of June and the first of July 2023: redact-me --mxid=@example:example.example --since=2023-06-01 --until=2023-07-01 #room:example.example
  • Only redact 3 messages per second (throttle): redact-me --mxid=@example:example.example --throttle=3 #room:example.example
  • Redact all events in a room: redact-me --mxid=@example:example.example --redact-type=* #room:example.example or redact-me --mxid=@example:example.example --nuclear #room:example.example (warning: This will also redact your membership event. If you created the room, you may also brick the room.)
  • Only show what would be redacted: redact-me --mxid=@example:example.example --dry-run #room:example.example

Note that you can specify as many aliases or room IDs as you want. As long as you have access to them.

Warning with Synapse

Synapse likes to rate-limit events, and as such, you may need to manually throttle. The tool will automatically handle rate-limits, however, redacting a lot of events may end up taking possibly hours. You may want to run this in a screen or tmux session.