You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Me and a friend want to provide storage renting service, and SFTPGo seems like a promising solution. However, there currently isn't a reliable way to know how much storage an user is using without logging into their user, or viewing the SQL database directly (used_quota_size and used_quota_files). This is blocking me from writing another daemon that tracks the disk usage in real time, so that we know how much the users should pay. That's why I hope there is an endpoint for the purpose.
Describe the solution you'd like
Add a new endpoint, GET /quotas/users/{username}/usage, that returns similarly to the following
While we are at it, it might be a good idea to also add endpoints for getting transfer quota usage and folder quota usage.
Describe alternatives you've considered
Logging into the user's account to view the quota usage
Why not: Requires either knowing the password of the user and storing them in plaintext, or adding a backdoor to the login mechanism, which is even unsafer. It's also slightly more complicated to automate
Fetching quota usage from the SQL database directly
Why not: Requires root/sftpgo permission and exposes the daemon to more information than necessary (eg. the salted passwords)
What are you using SFTPGo for?
2-person business
Additional context
I might implement this myself within this week, as it seems like a simple task to do. Hopefully my instinct is right this time!
The text was updated successfully, but these errors were encountered:
@drakkan May I know what was invalid with the Issue?
Oh, right, how ignorant I was to post the issue without reading the Support policy first. Well then, see you in the PR later
@drakkan May I know what was invalid with the Issue? Oh, right, how ignorant I was to post the issue without reading the Support policy first. Well then, see you in the PR later
this can already be done, a PR will be closed the same way, as for PRs read this comment. Thank you
Is your feature request related to a problem? Please describe.
Me and a friend want to provide storage renting service, and SFTPGo seems like a promising solution. However, there currently isn't a reliable way to know how much storage an user is using without logging into their user, or viewing the SQL database directly (used_quota_size and used_quota_files). This is blocking me from writing another daemon that tracks the disk usage in real time, so that we know how much the users should pay. That's why I hope there is an endpoint for the purpose.
Describe the solution you'd like
Add a new endpoint, GET /quotas/users/{username}/usage, that returns similarly to the following
While we are at it, it might be a good idea to also add endpoints for getting transfer quota usage and folder quota usage.
Describe alternatives you've considered
Logging into the user's account to view the quota usage
Why not: Requires either knowing the password of the user and storing them in plaintext, or adding a backdoor to the login mechanism, which is even unsafer. It's also slightly more complicated to automate
Fetching quota usage from the SQL database directly
Why not: Requires root/sftpgo permission and exposes the daemon to more information than necessary (eg. the salted passwords)
What are you using SFTPGo for?
2-person business
Additional context
I might implement this myself within this week, as it seems like a simple task to do. Hopefully my instinct is right this time!
The text was updated successfully, but these errors were encountered: