Commit graph

33 commits

Author SHA1 Message Date
Robin Appelman
f2bd0ab4f5 do onetime user setup before getting any mount from providers
this fixes a race condition where wrappers weren't properly applied if when a mount provider creates the storage instance one mountpoint creation instead of lazily

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-14 14:23:18 -07:00
Robin Appelman
4b4b80bc1c delay updating setup providers untill we register the mounts
otherwise the fallback to a full setup for a missing cached mount provider will lead to a race condition

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-18 14:38:30 +00:00
blizzz
d81e38d296
Merge pull request #32273 from nextcloud/backport/32152/stable24
[stable24] Allow compatibility wrapper on local external storage
2022-08-04 11:42:56 +02:00
Robin Appelman
2c6cd0daf8 always triger setup of builtin storage wrappers
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-22 20:24:35 +00:00
Jonas
786317e1cb
Fix listening for circle events in SetupManager
So far, SetupManager listened for deprecated events that are no longer
triggered. Instead, use the circle events that actually get triggered
when adding or removing a circle or circle member. Also, these events
get triggered on each instance of a globalscale setup.

Fixes: #33210

Signed-off-by: Jonas <jonas@freesources.org>
2022-07-18 21:09:37 +01:00
Vincent Petry
7ba6738031
Merge pull request #32801 from nextcloud/backport/32797/stable24
[stable24] fix mounts mounted at the users home
2022-06-10 14:47:03 +02:00
Robin Appelman
787b10ba2f perform onetime setup earlier to ensure wrappers are registered on time
this fixes an issue with wrappers like encryption not always being applied to mountpoint that create the storage object directly (such as external storage)

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-10 09:26:14 +00:00
Robin Appelman
b110026909 fix mounts mounted at the users home
this fixes external storages with '/' as mountpoint

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-09 23:23:16 +00:00
Vincent Petry
4f86a5051f Allow compatibility wrapper on local external storage
The check was likely in place to prevent adding the wrapper on the root
and home storage, which is not possible anyway since the encoding option cannot
be set on that mount.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-05-05 06:22:24 +00:00
Robin Appelman
aae1769e60 Only need to setup root for groupfolders
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-25 17:39:29 +00:00
Robin Appelman
c727beba9f only register mounts that are new from providers that are new during a full setup
this fixes cases where during the (partial) setup of a shared mount a full setup is triggered

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 15:06:30 +00:00
Robin Appelman
f7a0157589 cache fullSetupRequired locally
no need to hit redis every time

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 09:36:02 +00:00
Robin Appelman
54e52e9b5e
always do full setup for home folder with submounts
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-08 15:05:43 +02:00
Robin Appelman
bdc86e9486
add missing return
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-08 15:04:35 +02:00
Robin Appelman
791dc509d3
only setup home mount when getting home folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 13:13:32 +02:00
Robin Appelman
99ac46d8f5
allow getting mounts by providers
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 14:57:56 +02:00
Robin Appelman
881e107543
Apply suggestions from code review
Co-authored-by: Louis <6653109+artonge@users.noreply.github.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:41:37 +01:00
Robin Appelman
b7a7425fbd
make mount cache duration configurable
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:36:53 +01:00
Robin Appelman
70c37c2717
fmt
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:55 +01:00
Robin Appelman
89919b0e24
invalidate mount cache on circles change
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:52 +01:00
Robin Appelman
15c9a3114a
perform full setup if a cached mount doesn't have a provider set
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:16 +01:00
Robin Appelman
d342c764f2
don't double setup provider when calling setupForUser after setupForPath
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:13 +01:00
Robin Appelman
6b085b6fd1
add logic to perform a full filesystem setup when needed
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:10 +01:00
Robin Appelman
506d29c095
update cached mounts when only specific providers have been setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:55 +01:00
Robin Appelman
79f6742410
improve lazy UserFolder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:49 +01:00
Robin Appelman
19c64cf8b6
setup only relevant mounts when possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:46 +01:00
Robin Appelman
577b1fa856
setup for current user when finding mounts in the root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-17 14:56:49 +01:00
Robin Appelman
917c74e214
type fixes
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:16 +01:00
Robin Appelman
07a7dcb824
move user mountpoint setup to setupmanager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:12 +01:00
Robin Appelman
22875bf367
move logic to decide what to setup to setupmanager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:03 +01:00
Robin Appelman
1c468129af
adjust tests to new fs setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:59 +01:00
Robin Appelman
5c0fe93498
move teardown logic to SetupManager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:50 +01:00
Robin Appelman
15ff65c12f
start moving filesystem setup logic to it's own place
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:47 +01:00