- Install python3 on debian 11 its preinstalled if not already installed. \
- Install pip3:
sudo apt install python3-pip
- Install required packages:
pip3 install -r requirements.txt
Python3 is necessary, but since matrix runs on it, it should already be installed.
You call the script via python and give two positional parameters. The user you want to delete and the path to the config file.
python3 mtd.py [username] [path/to/homeserver.yaml]
for example:
./mtd mustermann /etc/matrix-synapse/homeserver.yaml
- Get the word count in the sql dump:
grep -oi "<pattern>" <dump>.sql | wc -l
- List occurance with line number:
grep -in "<pattern>" <dump>.sql
- Create sql dump
sqlite3 homeserver.db .dump > del_test.sql
- Create sql dump with timestamp
sqlite3 homeserver.db .dump > dump_$(date +"%d.%m._%H:%M").sql
Every message of a user gets removed from the database entirely. This action can't be undone.
It also removes any occurrence of the username.
Right now it does not remove every trace of every message, but it also does not cause any inconsistencies.