-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[ext storage] Rely on numeric_id, store config in DB, improve config format #11261
Comments
This is especially important if external storage is going to play a more important role in the future. |
This is just half of the pain.
The config is stored multiple times for every user/group. |
yes. agreed |
The multi-stacked arrays are very difficult to handle, I agree. I do have a suggestion for the JSON output though - instead of storing it as 'applicable type -> applicable -> storage -> class/options...', store it as 'storage -> class/options/applicable...'. For example:
The only drawback is that finding applicable mount points becomes harder - the code needs to iterate through every storage and check if it is applicable. Alternatively, what about storing this in the database?
Or something to that effect |
Storing in the database might make more sense, yes. It was already mentioned several times in discussions. I also like that you added the |
Related: #11830 about the unstable storage string id. |
I think We'd simply use the |
Updated proposal: oc_storages
oc_files_external_params
oc_files_external_applicable
|
Looks good, cant think of any use case missed by that. This could also be used to handle shares and cleanup that mess |
Thanks for the feedback, glad you like it 😉 I'm still having some doubts about the "scope" column, but I guess that's something that we can tweak on the way while working on it. Also I hope that admins won't mind the removal of mount.json, in case some admins were using it for other things or relying on it for automatically setting up instances. If needed we could add a |
The scope column could be replaced by adding something like a "personal" value to the type column in applicable but I'm not sure if that's any better. |
This change will also require to spend time fixing the JS part. The introduction of the storage id will make this much easier and cleaner to handle. |
There are cases where admins do use mount.json for automated provisioning, so it would be great to either preserve it, or allow people to make a mount.json and then make a call to occ to import it - so that it can all be automated. |
Good point. I'll start with a list:
|
Besides having a console command to import mount.json files, having some commands to manage external storages directly would be usefull |
True. The import command is mandatory only to make sure there is no loss of feature. |
Yes! Just as an example, I know of a case where a script is run to scan for new users, and then a mount.json is automatically added for each user automatically. So the import should think about admin centrally mounted mount.json files, as well as user mounted files. And then, in another case, custom mount.json files too (talk to @ogoffart and @guruz about that one). |
@MTRichards raised this separate feature as #11886 |
Thanks. |
@icewind1991 do you intend to continue working on this ? I'm teared between fixing the DB first (which isn't trivial) or implementing the options first (which will be duplicated X times in the crappy mount.json format) |
Anyway, there is also UI works that need to be done: fixing the UI side to work with the new storage_id instead of passing everything. I made this ticket for that: #12216 The ticket here would rather be for the backend side / storage format. |
This is the ticket for moving mount.json to the DB. As discussed with @DeepDiver1975, moving to 8.2. From what I heard @Xenopathic will work on it soon, so assigning him. |
I hope we can totally get rid of the storage id string in the process as it will solve many issues. |
@icewind1991 do you think it's possible in any way to make mounting the storages depend on the numeric id instead of storage string id ? How complex would the change be ? |
I think the main usage of the string id atm is the storage<-> cache mapping, currently a storage calculates it's string id, looks up the numeric id and uses that for cache operations. We would need to adjust every point a where a mount is created and inject the numeric storage id (non trivial for non-files_external since we dont keep track of numeric storage id's for things like home storages) |
We should try and get rid of |
Moving the the database as a first step (independent from old storage ids, for now): #20354 |
Also the new oc_mounts table will make it possible to do reverse lookups: #15166 |
9.0 code has the storages in the database and a mounts table, yay! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Code like this is just unreadable and difficult to extend: https://github.com/owncloud/core/blob/master/apps/files_external/lib/config.php#L503
The external storage mount points are stored with multi-dimensional arrays:
This needs a lot of code gymnastics to get to the right information and it also increases the risk of misunderstanding and introducing bugs this way.
I suggest to provide a new class to contain that data, like:
Hopefully in OC8...
@icewind1991 @Xenopathic
The text was updated successfully, but these errors were encountered: