0
Under review

How to get "LibreOffice Viewer" plugin working in Docker installation?

Thomas P 11 months ago updated 3 months ago 23

Hi there,

I would like to activate the "LibreOffice Viewer" plugin in my Docker installation (official FileRun Docker with FileRun 2020.11.21). It "reqiures that LibreOffice is installed on the server, and path  configured under the FileRun control panel section "Thumbnails and
preview".". So I looked for the soffice binary in /bin and in /sbin in the docker container but I cannot find the binary. How could I achieve to get the "LibreOffice Viewer" plugin  working in a Docker installation?

Thanks in advance for any hints.

+1
Under review

It would require a new Docker image that has LibreOffice installed. Because such an image is about one gigabyte larger, we haven't added it to the default FileRun image, and we plan to add a separate one. 

+1

Hi Vlad,

thanks for taking this up. So it is a pity that LibreOffice enlarges the size of the Docker image that much. However, if there is no sleeker solution available, I really would be happy with an LibreOffice enhanced Docker image of FileRun. I am looking forward to it.

+1

Hello, Vlad,
First of all I would like to say that Filerun is a really great software. Congratulations. I have been waiting for this release for more than a year. Now I was happy to be able to install Filerun on my QNAP NAS TS251. I used your docker installation instructions, and it works very well - except for LibreOffice. I tried for three days to get it to work with LibeOffice, but I did not manage to get it to work. Unfortunately I am not very familiar with Linux and Docker. Neither installing LibreOffice via HD Station nor creating a separate Docker container worked. I would be very grateful if you could give me some instructions! Maybe I made only little mistakes, but I don't know.


Regards Andreas  

You are welcome to try this Docker image "afian/filerun:libreoffice".

Fresh FileRun installations generated by this image will be automatically configured for thumbnails and previews. Existing installation would need to be manually configured via the FileRun control panel to enable LibreOffice support with the following "Path to LibreOffice binary":

/opt/libreoffice6.4/program/soffice

Don't forget to change the default viewers from "Files" > "Plugins" > "Defaults". Set "Microsoft Office Documents" and "OpenOffice Documents" to "LibreOffice Viewer". From the same place, remove the associations for "odt", "ods" and "odp" files.


Thanks to Vlad, libreoffice created thumbnails.

Now it seems to bring new problems. It seems unfriendly to files that once existed, I mean, files that existed before it was opened. Tips: preview generation failed! Output file not found

After opening libreoffice, create a new file again. The preview image can be generated, and there is no problem in opening the file.
Therefore, there is a question: how to open the old files? Do you have any good ideas?

Try renaming a file and see if it makes a difference.

I found the problem. This seems to be the problem with libreoffice. When the file name (folder) is Japanese or Chinese (no other language is tested), the prompt is: preview generation failed! Output file not found

It is a bug from FileRun when it comes to filenames with special characters. We will fix this.

In addition, I am not sure whether it is the docker version problem or the conflict caused by opening libreoffice. The PSD file can no longer generate thumbnails. Please confirm.

I am confirming that GraphicsMagick seems to be unable to process PSD files. I will fix this with an updated Docker image.

Hello, Vlad,

thank you very much. Your help is very, very much appreciated!

I installed afian/filerun:libreoffice as you said, and it works, except for thumbnail generation with libreoffice. Unfortunately, it throws the same error than I got before after 3 days of frustating work. The missing file javaldx is located in "/opt/libreoffice6.4/program" but libreoffice is not able to find it.

This is the message I get :

Running: /opt/libreoffice6.4/program/soffice --headless --nologo --nofirststartwizard --norestore --convert-to jpg:writer_jpg_Export --outdir "/user-files/.filerun.thumbnails/myTest.docx" "/user-files/myTest.docx" 2>&1
Results:<br> * returned code: 77<br> * returned text: Array
(
    [0] => javaldx failed!
    [1] => Warning: failed to read path from javaldx
    [2] => LibreOffice 6.4 - Fatal Error: The application cannot be started.
    [3] => User installation could not be completed.

Regards Andreas

A new Docker image with the tag "afian/filerun:libreoffice" has been now pushed.

Here are the changes, compared to the regular FileRun Docker image:

Included LibreOffice and set all the office file types to open the preview with the LibreOffice Viewer FileRun plugin. The "Path to LibreOffice binary" needs to be set to:

export HOME=/tmp && /opt/libreoffice6.4/program/soffice

Fixes the error reported by Andreas, when running Apache under a different user than default.

Replaced GraphicsMagick with ImageMagick, for supporting more file formats, such as raw photos and PSD files.
Enabled Apache mod_rewrite to make the "Office" plugin work.
Enabled Apache xSendFile download accelerator by default, to allow for better handling of very large downloads. (This needs to be manually enabled for existing FileRun installations)

Hi, Vlad,

absolutely fantastic support. Thanks again for this brilliant software. I will try out the new version tonight.

I already suspected and feared that it was due to the different user rights, but I could not solve this problem. Maybe because it is a NAS (from QNAP). I do not know. Again, thank you very much for your help.

By the way, I would like to replace Alfresco, which is also very good, but it is slow because it has too many features (which I don't need).

Regards Andreas

My last post on this topic: The new "afian/filerun:libreoffice" work very well. Problem solved.

Thank you! Andreas


Excuse me, Vlad. I've re installed Afian/ filerun:libreoffice ", still unable to produce PSD thumbnails. Can you take a look at this?

Sorry, this is a misunderstanding. When I clear the browser cache and refresh the page, the thumbnail appears.

with the latest docker image Afian/ filerun:libreoffice,docs or pptx with a name included chinese characters still can't be previewed.

how to running afian/filerun:libreoffice?
docker pull afian/filerun:libreoffice -
it's corret?
but after running this command, i can't see libreoffice on /opt/?
we need to install libreoffice before?

The LibreOffice path when using the FileRun Docker image needs to be set to "

export HOME=/tmp && /opt/libreoffice6.4/program/soffice


With the filerun:libreoffice image:

Neither thumbnails, nor previews 

With only the path to soffice no error message, but still no thumbnail/preview:

Any ideas? 

Bob

Try putting

putenv('HOME=/tmp');

inside "customizables/config.php" ( file needs to start with <?php )

Worked like a charm! Thank you, Vlad! 

Bob