matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.13k forks source link

Delete Media on Media storage providers #16475

Open Alkl58 opened 1 year ago

Alkl58 commented 1 year ago

Description:

Currently the implementation for the media_storage_providers is only able to upload and download - with options whether or not to store locally uploaded files and / or to store remote media (media cache), however we can only delete local media files.

When looking at the code, we only delete local files:

There are probably some questions which have to be answered first:

I am personally running a server with the synapse-s3-storage-provider and noticed relatively late, that it's basically append only, meaning the s3 storage will continuously grow without being able to delete old/unused media. (Related Github Issue https://github.com/matrix-org/synapse-s3-storage-provider/issues/96)

I may or may not be able to contribute, I would need to setup a dev environment for that.