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
Currently all home folders are directly under "data" and mix up with other folders.
This means that if you create a user called "owncloud.log" or "owncloud.db", it would try and overwrite these files but fail hopefully.
Also having the directories here makes it difficult to find out whether a directory contains metadata (like "data/files_encryption" or other global app-related metadata or whether they are real user folders.
I suggest to move the home folders into a subdirectory, maybe "data/home/$user" instead of "data/$user".
Obviously such a move will require a careful migration.
positive: easy to manage for existing users since their webserver configs stay the same
negative: breaks all apps that access the file system
Add an appdata directory
positive: apps would have time to migrate, no breakage
negative: additional checks on upgrades and installations if the directory is writable and if the directory can directly be accessed by the browser (which it shouldn't)
I like this proposal #18029 (comment) by @DeepDiver1975 but I also agree with @Raydiation, better write out the name, way easier to understand and I don't see a reason why the directory name should be only one letter.
Though, the hard part here is the migration. There are thousands of places where we create paths manually. Maybe we can map them internally for some time to make migration easier.
If we implement this directory structure we should also provide some helper method to get the user, group, app directory so that users don't have to construct the paths manually.
Though, the hard part here is the migration. There are thousands of places where we create paths manually. Maybe we can map them internally for some time to make migration easier.
And also the migration of existing installations - this will no be easy.
Since we have no understanding of the individual system setup we need to leave this completely to the admin. e.g. there are setups where the user homes are mounted to NFS servers - we cannot start to move around folders.
i agree. moving all files and folders automatically around during migration is too dangerous and not an option. we need a different solution whatever it is.
On installations with tens of thousands of users it would make sense to prefix users and sort them into subfolders, eg /path/to/data/a/d/admin. That would leave us with ~40 single char folders for users in the data folder.
Any metadata folders should be prefixed with _ so they sort nicely. _avatars comes to mind. Probably _lucene_index but we have app folders for that. If we want to stay with that logic the avatars should be in /path/to/data/core/avatars.
I'd not use .hidden folders because I don't want admins asking 'Where can I find xyz' just because they didn't do an ls -h.
We could move the users to /path/to/data/users but actually /path/to/data/files makes more sense because that is the app that handles all files.
a global /path/to/data/cache makes sense, /path/to/data/thumbnails and /path/to/data/encryption as well because you can place all of these on different storage types if you want. For an easy setup with muliple webservers we could even put tmp in the data folder.
While moving files out of the users home might seem flimsy because deleting a user would require looking in multiple places I think it actually makes sense, because we get rid of thumbnails and cache entries in the filecache.
Thinking this further, files_versions and files_trashbin should live in their own folders as well. I'd propose using /path/to/data/<appid>/users/a/d/admin style locations for anything file related. Which, come to think of it, just turns around what we currently have: /path/to/data/<userid>/<appid>.
Why is /path/to/data/<appid>/users/a/d/admin better? It allows for a better separation of storages. We already introduced config flags for the cache and tmp locations, this just makes apps the first level item. I don't see a reason why we need to have eg. thumbnails in our virtual fs, or anything that isn't synced, such as trashbin, versions and encryption keys (we are doing stunts during fs setup for the latter anyway).
Regarding migration: By default we should look inside the new style path and fall back to the old style path. Only files, trashbin and versions need to be moved, thumbnails will just fade out (but we could move them as well). Any migration should be triggered by an OCC command (and an action in the users web ui).
Which brings us to the naming rule for home folders. As @DeepDiver1975 mentioned we will store the home folder as a preference for a user, so that even when the admin changes the naming rule, eg from admin to ././admin nothing changes for users that already have a home initialized. The admin can then move the data and change the user specific home folder naming rule as he sees fit.
So, where do we put avatars? An avatar makes no sense without a user and users are managed by core as a setting for a user: /path/to/data/core/users/a/d/admin/avatar.jpg You could argue that user management is like an app, so /path/to/data/users/a/d/admin/avatar.jpg is fine by me.
So this is a little different than #18029 (comment). Migration may not be easy, but we need to take care of the storage anyway.
the advantage of having the metadata in a main folder "_metadata/" is that some admins will want to mount it on different storages than the files.
But if we embed it inside as before this won't be possible. Unless again we have additional user preference keys to specify the path for the metadata of each app...
Lets try to keep this simple and agree to a default scheme that is logical and allows admins to easily mount a differen type of storage for a certain aspect, eg. tmp, cache or thumbnails.
I propose /path/to/data/<aspect>/a/d/admin/ with aspect being eg files, files_trashbin, files_versions, encryption or any other app. But it can also be tmp, users, groups, cache, thumbnails ...
Then why not have avatars as an aspect? I think avatars are tightly coupled with user management ... and bascally _ already indicates metadata. Admins might want to put _metadata/avatars on a different storage than _metadata/cache (if we decide to put it there).
We could prefix non app dirs with _ to distinguish them.
I dislike the _metadata folder because I would like to keep the hierarchy in the data folder the same.
I can agree to /path/to/data/_avatars/a/d/admin.jpg ...
or if we consider "files" to be a data type, then just have it be getUserDataFolder($userId, $type == 'files'). And we need to stop using the root folder and stop assuming the folder structure and always go through these methods.
The oc_accounts table now contain the full path to the home folder, so it would be possible to introduce the change above without affecting the existing homes.
Then a command needs to be provided to optionally migrate those old homes to the new paths.
Any ETA of when the home folder would be moved to their own subdir?
We have encountered this issue today while updating our LDAP configuration. One of our users is named meta and after the configuration change in LDAP we ended up with the same issue described in #32547.
Is it safe to change the home folder path manually in the database, or does ownCloud will fix it by itself on the next LDAP sync?
@Mayeu this ticket was mostly for non-LDAP scenarios.
with LDAP you should already be able to specify custom home folders using the matching attribute (see advanced tab to configure it). then for every user you can have that attribute provide an absolute path to their homes.
@PVince81: Thank you for your response. Assuming I have access in the LDAP directory to other fields that don't clash with ownCloud and that are 100% sure to be unique yes :)
In our case that means that I plan to go back to uuid as home folders, even it if make dealing with the filesystem harder in debugging situation.
I anyway really hope this improvement to happen, it does not feels really safe to store everything in one folder 😅
Activity
MorrisJobke commentedon Aug 3, 2015
@Raydiation You had similiar issue regarding this with the news app some time back, right?
BernhardPosselt commentedon Aug 3, 2015
@MorrisJobke yes :)
There are two possibilities:
DeepDiver1975 commentedon Aug 3, 2015
Proposal:
user data goes into data/u/{uid}
group data goes into data/g/{gid}
app data goes into data/a/{aid}
Any changes in this area would require explicit storing of the users home in the user configuration.
DeepDiver1975 commentedon Aug 3, 2015
this is necessary as soon as someone wants to implement something like a group workspace or something like that
MorrisJobke commentedon Aug 3, 2015
@DeepDiver1975 Do we then also disallow special home folder naming rules as known by user_ldap?
BernhardPosselt commentedon Aug 3, 2015
Side note: I'd write out the names e.g. data/users, data/groups and data/apps. It's not a lot longer but way easier to understand for an admin
DeepDiver1975 commentedon Aug 3, 2015
Can you please elaborate the context of this question? THX
LukasReschke commentedon Aug 4, 2015
Will also fix #10767
schiessle commentedon Aug 4, 2015
I like this proposal #18029 (comment) by @DeepDiver1975 but I also agree with @Raydiation, better write out the name, way easier to understand and I don't see a reason why the directory name should be only one letter.
Though, the hard part here is the migration. There are thousands of places where we create paths manually. Maybe we can map them internally for some time to make migration easier.
If we implement this directory structure we should also provide some helper method to get the user, group, app directory so that users don't have to construct the paths manually.
DeepDiver1975 commentedon Aug 4, 2015
fine by me 🙈
DeepDiver1975 commentedon Aug 4, 2015
And also the migration of existing installations - this will no be easy.
Since we have no understanding of the individual system setup we need to leave this completely to the admin. e.g. there are setups where the user homes are mounted to NFS servers - we cannot start to move around folders.
karlitschek commentedon Aug 4, 2015
i agree. moving all files and folders automatically around during migration is too dangerous and not an option. we need a different solution whatever it is.
4 remaining items
butonic commentedon Sep 22, 2016
On installations with tens of thousands of users it would make sense to prefix users and sort them into subfolders, eg
/path/to/data/a/d/admin. That would leave us with ~40 single char folders for users in the data folder.Any metadata folders should be prefixed with
_so they sort nicely._avatarscomes to mind. Probably_lucene_indexbut we have app folders for that. If we want to stay with that logic the avatars should be in/path/to/data/core/avatars.I'd not use
.hiddenfolders because I don't want admins asking 'Where can I find xyz' just because they didn't do anls -h.We could move the users to
/path/to/data/usersbut actually/path/to/data/filesmakes more sense because that is the app that handles all files.a global
/path/to/data/cachemakes sense,/path/to/data/thumbnailsand/path/to/data/encryptionas well because you can place all of these on different storage types if you want. For an easy setup with muliple webservers we could even put tmp in the data folder.While moving files out of the users home might seem flimsy because deleting a user would require looking in multiple places I think it actually makes sense, because we get rid of thumbnails and cache entries in the filecache.
Thinking this further, files_versions and files_trashbin should live in their own folders as well. I'd propose using
/path/to/data/<appid>/users/a/d/adminstyle locations for anything file related. Which, come to think of it, just turns around what we currently have:/path/to/data/<userid>/<appid>.Why is
/path/to/data/<appid>/users/a/d/adminbetter? It allows for a better separation of storages. We already introduced config flags for the cache and tmp locations, this just makes apps the first level item. I don't see a reason why we need to have eg. thumbnails in our virtual fs, or anything that isn't synced, such as trashbin, versions and encryption keys (we are doing stunts during fs setup for the latter anyway).Regarding migration: By default we should look inside the new style path and fall back to the old style path. Only files, trashbin and versions need to be moved, thumbnails will just fade out (but we could move them as well). Any migration should be triggered by an OCC command (and an action in the users web ui).
Which brings us to the naming rule for home folders. As @DeepDiver1975 mentioned we will store the home folder as a preference for a user, so that even when the admin changes the naming rule, eg from
adminto././adminnothing changes for users that already have a home initialized. The admin can then move the data and change the user specific home folder naming rule as he sees fit.So, where do we put avatars? An avatar makes no sense without a user and users are managed by core as a setting for a user:
/path/to/data/core/users/a/d/admin/avatar.jpgYou could argue that user management is like an app, so/path/to/data/users/a/d/admin/avatar.jpgis fine by me.So this is a little different than #18029 (comment). Migration may not be easy, but we need to take care of the storage anyway.
At least that is my opinion.
PVince81 commentedon Sep 22, 2016
yes, or in the future user list table.
PVince81 commentedon Sep 22, 2016
the advantage of having the metadata in a main folder "_metadata/" is that some admins will want to mount it on different storages than the files.
But if we embed it inside as before this won't be possible. Unless again we have additional user preference keys to specify the path for the metadata of each app...
butonic commentedon Sep 22, 2016
Lets try to keep this simple and agree to a default scheme that is logical and allows admins to easily mount a differen type of storage for a certain aspect, eg. tmp, cache or thumbnails.
I propose
/path/to/data/<aspect>/a/d/admin/with aspect being egfiles,files_trashbin,files_versions,encryptionor any other app. But it can also betmp,users,groups,cache,thumbnails...Then why not have
avatarsas an aspect? I think avatars are tightly coupled with user management ... and bascally_already indicates metadata. Admins might want to put_metadata/avatarson a different storage than_metadata/cache(if we decide to put it there).We could prefix non app dirs with
_to distinguish them.I dislike the
_metadatafolder because I would like to keep the hierarchy in the data folder the same.I can agree to
/path/to/data/_avatars/a/d/admin.jpg...butonic commentedon Sep 22, 2016
@DeepDiver1975 what is your opinion?
PVince81 commentedon Sep 27, 2016
We could extend
IRootFolderto provide another methodgetMetadataFolderForUser($userId, $metadataType)PVince81 commentedon Sep 27, 2016
or if we consider "files" to be a data type, then just have it be
getUserDataFolder($userId, $type == 'files'). And we need to stop using the root folder and stop assuming the folder structure and always go through these methods.PVince81 commentedon Oct 10, 2016
related #17005
PVince81 commentedon Sep 11, 2017
The oc_accounts table now contain the full path to the home folder, so it would be possible to introduce the change above without affecting the existing homes.
Then a command needs to be provided to optionally migrate those old homes to the new paths.
Mayeu commentedon May 15, 2019
Any ETA of when the home folder would be moved to their own subdir?
We have encountered this issue today while updating our LDAP configuration. One of our users is named
metaand after the configuration change in LDAP we ended up with the same issue described in #32547.Is it safe to change the home folder path manually in the database, or does ownCloud will fix it by itself on the next LDAP sync?
PVince81 commentedon May 15, 2019
@Mayeu this ticket was mostly for non-LDAP scenarios.
with LDAP you should already be able to specify custom home folders using the matching attribute (see advanced tab to configure it). then for every user you can have that attribute provide an absolute path to their homes.
Mayeu commentedon May 20, 2019
@PVince81: Thank you for your response. Assuming I have access in the LDAP directory to other fields that don't clash with ownCloud and that are 100% sure to be unique yes :)
In our case that means that I plan to go back to uuid as home folders, even it if make dealing with the filesystem harder in debugging situation.
I anyway really hope this improvement to happen, it does not feels really safe to store everything in one folder 😅
stale commentedon Sep 21, 2021
This issue has been automatically closed.