-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Introducing AppData #1306
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
Introducing AppData #1306
Conversation
|
|
||
| /** @var string $instanceId */ | ||
| try { | ||
| $appDataFolder = $this->rootFolder->get($instanceId); |
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.
imo it would be nices to have something like appdata_$instanceid as the folder name, makes it clear to the admin what that weirdly named folder is
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.
Also can we add some magic to ensure that a user with that name doesn't get that folder? :)
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.
Yes was actually also thinking about that.
Of course we can do that
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.
Well it would be kind of hard to do it for ldap etc for example. But I'm sure we can do it somehwere when we create the users folder
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.
@icewind1991 should we just test for this in the initMountPoints function? that if the userId is equal to appdata_<instanceid> throw exception?
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.
copySkeleton seems like the best place
Why not putting all the previews into the database? |
|
@mmattel no that is way to much data. We also don't store all the files just in the db. |
3defcd2 to
015a8f4
Compare
|
Review time! |
| try { | ||
| $appDataFolder = $this->rootFolder->newFolder($name); | ||
| } catch (NotPermittedException $e) { | ||
| // Log |
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.
/me sees no logging here and below ;)
6ff6af3 to
85e6797
Compare
|
| \OC::$server->getUserManager(), | ||
| \OC::$server->getGroupManager() | ||
| ), | ||
| new MoveAvatars( |
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.
Dont register, when the config is disabled?
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.
I'd rather not introduce logic in that function. To not complicate things.
* Introduce simpleFS * Introduce IAppData * Introduce AppData Factory to get your AppData folder * Update FileDisplayResponse * AppData implements a ISimpleRoot but lazy. So only if an apps starts to access data will stuff get initialized Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix AvatarTest Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Skip move avatar if avatars disabled Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Current coverage is 30.64% (diff: 52.43%)@@ master #1306 diff @@
==========================================
Files 1064 1087 +23
Lines 60691 60456 -235
Methods 6812 6879 +67
Messages 0 0
Branches 0 0
==========================================
- Hits 33937 18525 -15412
- Misses 26754 41931 +15177
Partials 0 0
|
|
Fixed. Review time! |
| * @return ISimpleFolder | ||
| * @since 9.2.0 | ||
| */ | ||
| public function newFolder($name); |
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.
Missing annotations that this also can return an exception?
https://github.com/nextcloud/server/pull/1306/files#diff-c4d23a2caf57c34cf6a6f376daa5ac98R95
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.
Done
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
|
👍 |
|
LGTM |
Follow up of #1039
Implementing #136
This PR introduces an AppData folder. Basically the file variant of app tables. Sometimes you need to store data but where to put it. Or we want a more efficient way to store the data.
For example:
data/userid/avatar.jpgetc. It might make sense to have 1 place for all the avatars.data/<appdata>/avatars/<userid>/avatar.jpg. It could be that your user mounts are on slow (but huge) storage and you want the avatars to be serverd blazing fast.data/a better place would of course bedata/<appdata>/theming/icons/<icon>.svgetc.Right now this uses the very limited simpleFS (see #1039). And we use the instanceid as appdatafolder. Which means:
data/<instanceid>/<appid>this means it can't escapeThis is limiting. I know. But giving more freedom is always easier than reducing it. Plus I think this should be fine for most apps to start with.
Right now this is just mapped on our normal fs. But those abstraction allow this to be improved in the future.
Todo:
appdata_instanceidAvatar releated todo: