libreofficedocker / libreoffice-unoserver

A packaged unoserver with REST APIs using Libreoffice in Docker
Apache License 2.0
10 stars 6 forks source link

Can't access API #11

Open andyrozman opened 5 days ago

andyrozman commented 5 days ago

Hi ! So I am running on Ubuntu 24.04, I succesfully downloaded your image (3.19) and then I issued command

"docker run libreofficedocker/libreoffice-unoserver:3.19"

Docker started: `INFO:unoserver:Starting unoserver. INFO:unoserver:Command: libreoffice --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmpb40gxfpl --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext INFO:unoserver:Server PID: 110


/ / / / ____ __ __ _ / / / / \/ _ \/ / _ \/ / | / / \/ / / // / / / / /_/ ( ) / / | |/ / / / ___////\/___/\// |/\//__ / \/ __/ / / / | / \/ / / // / / \ \ / / / /| | / // // / / , / / / // / / |/ ____// / // |_/___//_/// // |// //

Starting REST API server...

And when I try to issue command:

curl -s -v \ --request POST \ --url http://127.0.0.1:2004/request \ --header 'Content-Type: multipart/form-data' \ --form "file=@${CURRENT_DIR}/${file}" \ --form 'convert-to="txt:Text (encoded):UTF8"' \ --output '${file}.txt'

I get such response:

`* Trying 127.0.0.1:2004...

I tried both 2004 and 2002 ports and same result...

Could you maybe extend your README to give exact examples on how to use... Even how to start correctly.. Not everybody is docker expert...

I tried to get this unoserver running locally, but Ubuntu is being very uncooperative... And running conversion locally takes forever if you have a lot of files...

andyrozman commented 5 days ago

Ok solved the part of issue.. After running with -p 2004:2004 it started working...

Now if I send the full command to convert (like I would locally)

    curl -s -v \
       --request POST \
       --url http://172.17.0.1:2004/request \
       --header 'Content-Type: multipart/form-data' \
       --form "file=@${CURRENT_DIR}/${file}" \
       --form 'convert-to="txt:Text (encoded):UTF8" ' \
       --output "${file}.txt"

This doesn't work. I am converting html to txt, with unicode.