Closed Gremious closed 1 year ago
Absolutely, this will be useful in a lot of scenarios. Added!
There's two new volflags; vmaxb
specifies max total size of a volume, and vmaxn
for max total number of files. Both take an optional SI suffix, so vmaxb=1t
would be max 1024 GiB.
Unless I forgot something, it should also catch files that are mid-upload -- so if someone starts uploading a file that consumes most of the free space, it should stop additional uploads at the hashing stage (before the actual uploads begin). And looks like all this has surprisingly little performance impact too :+1:
You can grab a beta here if you'd like: https://ocv.me/copyparty-sfx.py
Thanks for the idea and for using copyparty :>
is your feature request related to a problem? Please describe.
I want to share my copyparty instance with my friends so that they can use it for cloud storage/sharing, but I want to set e.g. a 1 TB upload limit for the volume I give to them.
Describe the idea / solution you'd like
I think the easier solution is definitely just a volflag like
maxup/maxsize: 1tb
which would just check the folder/volume size on upload, and if it's over the limit, deny the upload, no matter the IP.Then you can simply set up a "user folder", and all works well.
Describe any alternatives you've considered
I suppose I can do
maxb=1tb,9999999999...
but that feels very hacky.It is also different from checking volume size, since
maxb
is per ip and you can just use your phone or a vpn or something, not as hard of a limit, that's better at deterring random short-term users from messing around.Also, maybe good idea to have a 50gb folder limit on like, a "shared"/"public" volume used by many random users. Also makes it possible to limit a volume used by two users, e.g. for a friend and their partner, where IP blocking won't work.
I've also consider per-user tracking, but:
Additional context This app has so many features.... It is also the best one I've found, and I really searched...good job !!