raftario / filite

A simple, light and standalone pastebin, URL shortener and file-sharing service
MIT License
190 stars 16 forks source link

Opt-in feature to set quota limits for file upload storage #16

Open caycaycarly opened 4 years ago

caycaycarly commented 4 years ago

In some scenarios, it would be useful to set the limit for the size of the directory storing the file uploads. Even better if it could be done via the config file. Example, when a user wants to not store more than 20GB of files on his server, he can simply set the config file as follows :

# Max allowed size for file uploads, in bytes
max_filesize = 10000000
# Max allowed size for file uploads directory, in gigabytes (set value to -1 for no limit)
max_filedir = 20

Filite would disable the file upload feature when the size of the directory reaches 20GB, and the admin would be notified in some way.

raftario commented 4 years ago

That's not a feature I plan to prioritize, but if anyone wants to open a PR for it feel free!