Skip to content
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

Add a configuration switch for enabled preview mimetypes #11211

Merged
merged 2 commits into from Sep 22, 2014

Conversation

LukasReschke
Copy link
Member

Do not merge - requires discussion and some fine-tuning.

@MTRichards @karlitschek @craigpg See mail. THX.

@LukasReschke
Copy link
Member Author

Closes #11170

@karlitschek
Copy link
Contributor

the right approach imho

@karlitschek
Copy link
Contributor

👍

@MTRichards
Copy link
Contributor

For what it is worth, I agree. Good approach.

* - OC\Preview\PDF
* - OC\Preview\Tiff
*/
$enabledProviders = \OC::$server->getConfig()->getSystemValue('enabledPreviewProviders', array(
Copy link
Contributor

Choose a reason for hiding this comment

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

One DB query for each registerProvider call? Why not put it into a static variable? Don't mind, that static stuff is evil, it is even a static method - and once this is refactored to a class instance it could easily be made non-static.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes. static configuration should be totally fine in this case because the code implementation is also static ;-)

@LukasReschke
Copy link
Member Author

@MorrisJobke @karlitschek Static now and good to review. Thanks.

Requires a backport down to stable6 and also needs to be documented.

@carlaschroder All preview providers except "Image", "MP3", "TXT" and "MarkDown" are now disabled by default due to performance and privacy concerns. They can be enabled by a switch in config.php (enabledPreviewProviders) but this is strongly discouraged by the ownCloud project and should not be done if the instance is accessible by untrusted users. Could you do that? - Thanks :-)

@ghost
Copy link

ghost commented Sep 22, 2014

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser/7500/

@LukasReschke
Copy link
Member Author

Let me check why the hell we have VCF tests in the preview ...

@LukasReschke
Copy link
Member Author

@georgehrke I have no idea what the VCF and ICS test in there are for. Please take a look. Thanks.

(Please review regardless of this test fail…)

@georgehrke
Copy link
Contributor

@georgehrke I have no idea what the VCF and ICS test in there are for. Please take a look. Thanks.

It seems like those files where supposed to test the transparent background of the TXT backend, but afaik looking at it the vcf and ics didn't test the transparent background of the txt backend (as supposed), but rather the transparent backend of the unknown backend (which is gone now, that's why the test fail).

I'd say just remove the ics/vcf file from the data-provider (and delete the files if they are not used in any other tests)

(Please review regardless of this test fail…)

Code looks good, testing right now

@LukasReschke
Copy link
Member Author

I'd say just remove the ics/vcf file from the data-provider (and delete the files if they are not used in any other tests)

Done - thanks.

Code looks good, testing right now

Awesome :-)

@georgehrke
Copy link
Contributor

Works 👍

Images, mp3 and txt work out of the box. Other preview backends don't, but work just fine after the enabling them in the config.php

@karlitschek
Copy link
Contributor

👍 Please backport

@ghost
Copy link

ghost commented Sep 22, 2014

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser/7515/

@ghost
Copy link

ghost commented Sep 22, 2014

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser/7519/

MorrisJobke added a commit that referenced this pull request Sep 22, 2014
Add a configuration switch for enabled preview mimetypes
@MorrisJobke MorrisJobke merged commit 051ed93 into master Sep 22, 2014
@MorrisJobke MorrisJobke deleted the previewProviderSwitch branch September 22, 2014 22:46
@MorrisJobke
Copy link
Contributor

@LukasReschke Can I ask you to backport this? Thanks

@LukasReschke
Copy link
Member Author

Stable7 PR: #11245

@LukasReschke
Copy link
Member Author

Stable6: #11246

@scrutinizer-notifier
Copy link

The inspection completed: No issues found

@carlaschroder
Copy link

What are the other preview providers, and what are the exact options to use in config.php? Are "Image", "MP3", "TXT" and "MarkDown" the actual config switches? @LukasReschke

@carlaschroder
Copy link

Also, does 'preview_office_cl_parameters' go away?

@georgehrke
Copy link
Contributor

What are the other preview providers, and what are the exact options to use in config.php? Are "Image", "MP3", "TXT" and "MarkDown" the actual config switches?

See config.sample.php: https://github.com/owncloud/core/blob/master/config/config.sample.php#L297

Also, does 'preview_office_cl_parameters' go away?

No

@carlaschroder
Copy link

Excellent, thanks @georgehrke

@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 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.

None yet

8 participants