Remove image files posted in Matrix

To save space I’d like to mass remove old image files posted to Matrix, but am not sure what the best way to do so is. Two questions:

  • Where are the image files stored?
  • Will deleting image files cause any problems for the Matrix server?

I am running GNU/Linux 12 (bookworm) and FreedomBox version 23.6.2 on an Olimex Pioneer Edition SBC.

Thank you for your help!

P.s. Once again, I love the FreedomBox project. It is now fully integrated into my as well as my family’s online life in so many ways!

There is some discussion here.

The images are stored in /var/lib/matrix-synapse/media. Unfortunately I don’t know if deleting them will cause any issues. You can pull some information about the files from the database, using sqlite3:

sqlite3 /var/lib/matrix-synapse/homeserver.db
select * from local_media_repository;

The first column is media_id. If it is, for example, nbPjqEXqAnFCVeEggNwfIQXC, then the file path will be /var/lib/matrix-synapse/media/local_content/nb/Pj/qEXqAnFCVeEggNwfIQXf.

1 Like