richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Make preview generation configurable

Open drikqlis opened this issue 5 years ago • 4 comments

Describe the bug After installing Collabora app Nextcloud generates previews for Office and PDF files despite that it is not turned on in 'enabledPreviewProvieders' in nextcloud config.

To Reproduce Steps to reproduce the behavior:

  1. Do not turn on or disable in config.php Office and PDF preview generation.
  2. Install Collabora app
  3. Create new Office or PDF document - preview is generated.
  4. Do the same with Collabora app turned off - preview is not generated as expected.

Expected behavior It should not generate previews when not configured. According to Nextcloud documentation:

The following providers are disabled by default due to performance or privacy concerns:

        OC\Preview\Illustrator
        OC\Preview\Movie
        OC\Preview\MSOffice2003
        OC\Preview\MSOffice2007
        OC\Preview\MSOfficeDoc
        OC\Preview\OpenDocument
        OC\Preview\PDF
        OC\Preview\Photoshop
        OC\Preview\Postscript
        OC\Preview\StarOffice
        OC\Preview\SVG
        OC\Preview\TIFF
        OC\Preview\Font

Screenshots If applicable, add screenshots to help explain your problem.

Client details:

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]
  • Device: [e.g. iPhone6, desktop]

Server details

Operating system: Ubuntu 18.04 LTS

Web server: Apache

Database: MariaDB

PHP version: 7.3

Nextcloud version: 20.0.6

Version of the richdocuments app 3.7.13

Version of Collabora Online 6.4

Logs

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

drikqlis avatar Jan 28 '21 13:01 drikqlis

Yeah the app registered preview providers are added in addition to the ones provided in the config, I assume we could have a setting to turn preview generation off. In case you are running a real Collabora server you could just block the Nextcloud server from using the <net><post_allow> settings

juliusknorr avatar Jan 29 '21 09:01 juliusknorr

Hi,

I’ve found many .tmp files on the server under /tmp/systemd-private--apache2.service/tmp/ that were never cleaned up by the system. Looking into those files I saw, that these are actually big .pdf files with the extension .tmp. As these were never deleted I’ve looked into the logs and there shows up an error “message”:“Failed to convert file to preview” when executing /index.php/core/preview?fileId=12345&x=32&y=32. This seems to be connected to a timeout when getting the file to generate the preview.

I haven’t been successful in finding the source of the timeout and I didn't wanted to have a preview of PDFs. But I can confirm that the same problem happens on my server: richdocuments generates previews (or tries it) of PDF files. To reduce the risk of running out of space on the server I modified the file Office.php so that it never creates previews.

I think the best option would be to look into the configuration in config.php as users do not expect that there is a second configuration option for previews. This somehow would also solve https://github.com/nextcloud/richdocuments/issues/461 .

cm-schl avatar Mar 22 '22 10:03 cm-schl

Agreed, the preview generation is a lot of overhead and times out for big documents. Making it configurable or even better respecting the existig server config would be great. Thanks!

rainerjung avatar Apr 08 '22 16:04 rainerjung