owncloud / docs-server

ownCloud Server Documentation
https://doc.owncloud.com
GNU Affero General Public License v3.0
12 stars 30 forks source link

Update previews_configuration.adoc - PreviewProvider clarification #1269

Closed jnweiger closed 7 months ago

jnweiger commented 7 months ago

Hinting at enabled imagic is not sufficient. imagic may or may not have builtin support for all of these. E.g.: Currently our docker image have an imagick that neither supports SVG nor PDF.

Compare https://github.com/owncloud/core/issues/41185

jnweiger commented 7 months ago

imagick with builtin PDF support is not sufficient. It may log errors like this:

{"reqId":"ZdTTKF4NnahSP@pWmjqPgAAAAQ","level":3,"time":"2024-02-20T16:28:24+00:00","remoteAddr":"80.139.80.57","user":"admin","app":"core","method":"GET","url":"\/remote.php\/dav\/files\/admin\/Documents\/InkscapeLaserEinstellungen.pdf?c=145a412fb93f4d19fdd63abd46f1dcdf&x=32&y=32&forceIcon=0&preview=1",
"message":"ImageMagick says: attempt to perform an operation not allowed by the security policy `PDF' @ error\/constitute.c\/IsCoderAuthorized\/408"}

Per ubuntu-20.04 default installation of ImageMagick, /etc/ImageMagick-6/policy.xml contains the line <policy domain="coder" rights="none" pattern="PDF" /> This needs to be changed to <policy domain="coder" rights="read" pattern="PDF" />

followed by an apache restart.


A 2018 comment on stackoverflow says, that the PDF policy was added due to a bug in Ghostscript, which they believe has now been fixed.

phil-davis commented 7 months ago

A 2018 comment on stackoverflow says, that the PDF policy was added due to a bug in Ghostscript, which they believe has now been fixed.

I had this problem when adding tests for the related PR. I was still on Ubuntu 20.04, and found similar StackOverflow help. . I completely removed the pattern="PDF" policy.

mmattel commented 7 months ago

Needs backport to 10.12 and 10.13