Repository navigation
Quota storage wrapper is now used for all users in sharing mode - #5715
Conversation
|
👍 Looks Good but Not tested |
|
Going to test whether local:// storages are auto-migrated to home:// (from #5591). I have a feeling that it won't. |
|
Test passed. |
|
I tried migrating from v5.0.12 to v5.0.13, then v6 beta 2. Either we need to automatically migrate these to the new "home::" format or I'll need to modify the wrapping detection from this PR. @icewind1991 I'll start looking into the latter. |
|
I think the latter is a safer approach |
|
Thanks for the info. Is there a way to find out whether to find out the user name and whether it's a home dir from the $storage object with "local::/srv/www/htdocs/owncloud/data/user2/" ? |
|
Not reliably from the storage path, using the mount point, as it was done before this PR, is reliable since homes are always mounted to |
|
Hmm, the problem is that I need to do it for other users as well. |
|
I've rebased everything. Please have a look. I'm now extracting the user name from the mount point. Note that you won't see any effects from this PR until #5701 is merged. This is because even though the quota wrapper is used, the "folder size" isn't propagated yet so it doesn't update the folder owner's quota. I've fixed that in that other PR. |
|
Test passed. |
|
Rebased. |
|
Test passed. |
|
Please review @schiesbn @icewind1991 @DeepDiver1975 |
|
code looks good to me 👍 |
|
@icewind1991 would be good to know what you think |
There was a problem hiding this comment.
using something like
if($storage instanceof \OC\Files\Storage\Home)
$user = $storage->getUser()->getUID(); //getUser() would need to be addedwould simplify this whole bit
There was a problem hiding this comment.
Right. I didn't use it back then because we didn't have the new "always wrap in Home storage" logic.
I'll change it.
When accessing a shared folder, the folder's owner appears as mountpoint but wasn't wrapped by a quota storage wrapper. This fix makes sure that all home storages are wrapped by a quota storage wrapper, if applicable, to make sure quotas are respected when uploading into shared folders.
To find out whether to apply a quota, we now try and detect whether the storage to wrap is a "Home" storage.
|
@icewind1991 I've rebased and the second commit is the change you suggested. Please have a look. |
|
Test passed. |
|
👍 |
Quota storage wrapper is now used for all users in sharing mode
When accessing a shared folder, the folder's owner appears as mountpoint
but wasn't wrapped by a quota storage wrapper.
This fix makes sure that all home storages are wrapped by a quota
storage wrapper, if applicable, to make sure quotas are respected when
uploading into shared folders.
@icewind1991 are "local://" based home dirs migrated to "home://" storages or should I add extra handling for those ?
Please review @icewind1991 @DeepDiver1975 @karlitschek
I'll add unit tests soon.