Skip to content

Move static data from config to resources/config/ - #18893

Merged
LukasReschke merged 3 commits into
masterfrom
move-static-data
Sep 22, 2015
Merged

LukasReschke merged 3 commits into
masterfrom
move-static-data

Conversation

@LukasReschke

Copy link
Copy Markdown
Contributor

This moves the static data from config into resources/config/ to prevent further update problems.

@rullzer Please review with regard to the mimetype stuff
@karlitschek FYI

@LukasReschke LukasReschke added this to the 8.2-current milestone Sep 8, 2015
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

We should keep the mimetypealiases.json and mimetypemapping.json in config/, since those files are supposed to be edited by the admin. The .dist.json files can go in resources/ though

@karlitschek

Copy link
Copy Markdown
Contributor

I disagree. People will forget to add the mimetypemapping.json the same way the miss the cert. We have to move this over too.
Changing the file is a very esoteric usecase. Why should an admin do this?
Actually I suggest to go into the oposite direction. ownCloud shouldn't try to detect and handle all the mimetypes in the first place. This will lead to performance problems and has no benefit for the user. The only places where we need to know the mimetypes is to show the right icon in the UI and to filter for gallery and muic. But this is only a subset of the mimetypes that don't change at all.

@karlitschek

Copy link
Copy Markdown
Contributor

Can we move it to core/ressources? I think we shold have less crap in the root directory. Maybe sometime we can cleanup more stuff like moving the db_structure.xml and other to /core too.
Beside that 👍

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

@karlitschek Note, the file doesn't exist by default. It's for admins that wish to add custom mimetype aliases or mappings. ownCloud distributes a standard set of mimetype aliases/mappings, which currently go in config/mimetypealiases.dist.json and config/mimetypemapping.dist.json, which I agree should go in /resources. But the admin-configurable files should stay in config/

cc @rullzer

@rullzer

rullzer commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

@karlitschek basically what @Xenopathic said. I think the dist one should go into /resources but the user one should stay in /config. The user generated one is not the be shipped by default. So only if an admin has a very specific use case it adds it. And then it should go into /config. That way it will persist during upgrades etc.

Just to be clear. The file in /config basically extends the one in /resources. So if an admin does not add it ownCloud will just use the shipped one in /resources

@karlitschek

Copy link
Copy Markdown
Contributor

Got it. But why should an admin extend this list in the first place? What is the usecase?

@rullzer

rullzer commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

@karlitschek well if the default mapping is not good enough. Lets say I want all my .cpp files to have a custom icon because I'm a huge C++ fanboy.

Or if a hospital has some obscure format to store large medical images in. Then they might want to map the correct extensions to that mimetype. And at the same time map that mimetype to a generic image icon.

@karlitschek

Copy link
Copy Markdown
Contributor

So how would you actually add the mimetype icons? In a theme?
Again. This is a very esoteric usecase.

@rullzer

rullzer commented Sep 9, 2015

Copy link
Copy Markdown
Contributor

Yes if you have specific icons you would add them in a theme.
But even without new icons there might file extensions that you want mapped to certain mimetypes which are just not the case by default. (For example the .dvi extension is not mapped by default).

Most of the admins will not create those custom mappings or aliases. And that is totally fine. But there are legit use cases where we should not limit them and make them patch core. A config file is a lot cleaner.

But I think this really is besides the point. If there is user configured stuff it should go into /config. The stuff bundled with owncloud by default (our default mappings and mimetype aliases) they should go into /resources.

@LukasReschke

Copy link
Copy Markdown
Contributor Author

Fair enough… Then let's for whatever reason somebody might want to modify mimetypes keep these manual edits in config 🙈

@LukasReschke

Copy link
Copy Markdown
Contributor Author

@Xenopathic @rullzer Happier now? - If so please review 🙊

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably drop the .dist part now that it's not in config/. That was only there to differentiate between the distributed file and the one that the admin can change.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Code looks good 👍

Now it's a race between this and #19272 for the merge conflict 😆

@LukasReschke

Copy link
Copy Markdown
Contributor Author

THIS THIS THIS THIS THIS! ;-)

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

@LukasReschke But you like merge conflicts, right? I wouldn't want to take that away from you 😆 Think of it as an early Christmas present

LukasReschke added a commit that referenced this pull request Sep 22, 2015
Move static data from config to resources/config/
@LukasReschke
LukasReschke merged commit 7222e5f into master Sep 22, 2015
@LukasReschke
LukasReschke deleted the move-static-data branch September 22, 2015 15:37
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants