We had a recent need to find where our uploads size was increasing quickly, so this feature request breaks down into two ideas:
(1) A way to see per user the file upload capacity used, i.e. a per user total uploads in mb.
(2) A trust-based or per-user upload quota limit that would either warn staff/admin that a quota was exceeded or prevent further uploading until the quota was increased.
Our support experience I am basing this request for feature discussion is here:
Thereâs already a related warning that is sent when the entire host disk has less than 10% free space remaining:
download remote images threshold
Minimum disk space necessary to download remote images locally (in percent)
When that gets triggered, remote images in posts are no longer downloaded locally and converted to local images. However I donât know that it also blocks local direct uploads @zogstrip?
Yep, that feature was very useful, and provided our first heads-up. The setting can also be tweaked from the default 10% too. After we got that warning and it ticked itself off (stopping local copy downloads) I donât think direct uploads were stopped (actually fairly sure it didnât).
The question was then what to do afterwards, i.e. check it wasnât just Ubuntu gorging on security updates or something that Discourse users were busy with. I was ok because I could write a bit of SQL or navigate within Rails, but the feature is more for those not able/wanting/blessed/cursed to be doing that.
I was thinking the same thing. Something like a FIFO âyou are almost out of upload space do you wish to continue?â - âwarnimg if you continue some of your earlier uploads will be removed to make room for this oneâ
Are these Settings checked and 1 ?
clean up uploads
Remove orphan unreferenced uploads to prevent illegal hosting. WARNING: you may want to back up of your /uploads directory before enabling this setting.
clean orphan uploads grace period hours
Grace period (in hours) before an orphan upload is removed.
Yep, all left as default. We are tempted to lower the 30 day default of âpurge deleted uploads grace period daysâ, as that might help, but not quite sure what it does. Is there an easy query to find out whatâs waiting there?
This isnât a good idea. In corporate environments, it could inconvenience other company members if earlier files are removed. In these instances, the solution likely will come from the IT department migrating to a larger server or something. I would recommend that you warn users that they are about out of space and then prevent them from uploading more if they run out, triggering a warning to the admins. Also, give the admins the ability to set blanket and per-user quotas for uploads and to individually increase an upload quota for a user, when needed.