Automatically delete the oldest attachments when approaching a set storage limit
If I have a 20GB server instance, and we're posting big files all the time, we'll hit that pretty quickly. If we hit it, the server will slow down and start rejecting uploads or having errors. Instead, I should be able to set it to limit the total attachment storage to, say, 15gb, and it should aim to stay under that by deleting the oldest stuff.
-
Vincent commented
It could maybe be done via the API, but not easy. Via https://api.mattermost.com/#operation/SearchFiles you can find all files in a team, but it is too restrictive. Easiest would be to check the database to find fileIDs, filenames and dates. Files need to be moved from the filesystem manually, and https://api.mattermost.com/#operation/PatchPost is required to remove the attachment.
Personally I use a lot of automatic uploads of generated reports. I am thinking to use emojis to label uploads that can safely be removed after a certain time. :firecracker: https://api.mattermost.com/#operation/SaveReaction
Related: https://github.com/mattermost/mattermost-redux/issues/777
-
Guillaume Antier commented
I agree with this idea. Small communities and organization may have not the cash to buy/extend storage infinitly, this must be a Team Edition feature.