Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per volume size/upload limit. #40

Closed
Gremious opened this issue Jun 17, 2023 · 1 comment
Closed

Per volume size/upload limit. #40

Gremious opened this issue Jun 17, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Gremious
Copy link

Gremious commented Jun 17, 2023

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:

  1. It would be far more annoying to do because you'd have to keep track of how much the user has uploaded/deleted somewhere (what if an upload breaks or the server internet cuts off?)
  2. It would not work for anon users e.g. friends-of-friends, where I provide a "shared" folder that has short-lived files so they can use it to go over e.g. Discord upload limits.

Additional context
This app has so many features....
It is also the best one I've found, and I really searched...good job !!

@Gremious Gremious added the enhancement New feature or request label Jun 17, 2023
@9001 9001 closed this as completed in 8b0cf2c Jun 19, 2023
@9001
Copy link
Owner

9001 commented Jun 19, 2023

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 👍

You can grab a beta here if you'd like: https://ocv.me/copyparty-sfx.py

Thanks for the idea and for using copyparty :>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants