-
Notifications
You must be signed in to change notification settings - Fork 184
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
implement quota fetching #3745
implement quota fetching #3745
Conversation
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
💥 Acceptance test Core-API-Tests-ocis-storage-8 failed. Further test are cancelled... |
https://drone.owncloud.com/owncloud/ocis/11623/51/10 may need a fix in web, or should we mark this as an expected failure for now? @kulmann this PR currently prevents login ... |
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
aa7d70e
to
b986f02
Compare
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Kudos, SonarCloud Quality Gate passed! |
// TODO support negative values or flags for the quota to carry special meaning: -1 = uncalculated, -2 = unknown, -3 = unlimited | ||
// for now we can only report total and used | ||
Total: int64(total), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the oc10 code has this: https://github.com/owncloud/core/blob/817f54f53d64249166feaa0eb9231c50ca1ed7e0/lib/public/Files/FileInfo.php#L44-L58
it is returned for quota-available-bytes
in propfind requests:
$ curl https://demo.owncloud.com/remote.php/webdav/ -udemo:demo -X PROPFIND -d '<?xml version="1.0" ?><d:propfind xmlns:d="DAV:"><d:prop><d:quota-available-bytes/><d:quota-used-bytes/></d:prop></d:propfind>' -v --trace-time | xmllint -format -
...
<d:response>
<d:href>/remote.php/webdav/Photos/</d:href>
<d:propstat>
<d:prop>
<d:quota-available-bytes>-3</d:quota-available-bytes>
<d:quota-used-bytes>1011464</d:quota-used-bytes>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
...
the ocs api only returns quota on the /ocs/v[1|2].php/cloud/users/{username}
endpoint:
$ curl https://demo.owncloud.com/ocs/v1.php/cloud/users/demo?format=json -u demo:demo -v | jq
...
"quota": {
"free": 27273637888,
"used": 7716359,
"total": 27281354247,
"relative": 0.03,
"definition": "none"
},
...
but it always returns the actually available bytes, not -3 ...
urgh ... so can we please kill all but signing from the ocis ocs implementation and move everything into reva, requiring cs3org/reva#2870? Or do we remove everything ocs related from reva, make it the cs3 api only repo and move ocs to ocis? One way to move forward is to leave ocs and ocdav in reva but flesh out libregraph in ocis... the signing key could be replaced with webdav urls in the libregraph api: https://docs.microsoft.com/de-de/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http#request a
so we could return a signed url here |
closing in favor of cs3org/reva#2870 |
We implemented fetching the personal space quota on the ocs endpoint. But since quota is unset by default we currently cannot calculate meaningful values for total or relative. The web UI should omit that information instead of trying to eg. divide by 0: owncloud/web#6913
I also tried reporting -3 (unlimited) but that is something the web ui would have to learn as well ...
So for now I think the best way forwrd is to leave out info that is not there and deal with that case properly.
quota setting tracked in #3748