[Pull Mirror] Read-only mirror of https://codeberg.org/nexy7574/redact-me
https://codeberg.org/nexy7574/redact-me.git
- Python 100%
| src/redactme | ||
| .gitignore | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| tox.ini | ||
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.exampleorredact-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.