User Upload Reporting & Quota

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:

5 Likes

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?

1 Like

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.

Like minds.

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.

1 Like

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?

2 Likes

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.

3 Likes

Nope, it’s only used when pulling external images.

2 Likes