LibreOffice WASM and https on Docker #691
-
|
Hi there. While trying to figure out why my Word to PDF conversion was failing, I stumbled across this in the docs:
I am assuming this is the reason why the Word to PDF conversion fails with:
Two questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Add bentopdf.local to /etc/hosts on each device that needs access (pointing at your Ubuntu host's IP), visit https://bentopdf.local, accept the local-cert warning once, and Word to PDF will start working. If you want a real public-CA cert without opening any firewall ports, Tailscale Funnel or a Cloudflare Tunnel also works and takes about 5 minutes. The COOP/COEP headers Word→PDF needs (Cross-Origin-Opener-Policy: same-origin, Cross-Origin-Embedder-Policy: credentialless) are already set by the BentoPDF nginx by default, so you don't need to configure those. Now having said that, This has been a recurring point of friction for self hosters, so over the coming week I'll be making the self hosting story significantly easier with better docs, an HTTPS-ready Docker variant, and clearer troubleshooting for the secure context / reverse-proxy issues people keep running into. Thanks for the patience while I improve it. |
Beta Was this translation helpful? Give feedback.
Yes, that's exactly the cause. Word to PDF uses LibreOffice compiled to WebAssembly, which depends on SharedArrayBuffer for its worker threads. Without SharedArrayBuffer, the LibreOffice worker never finishes initialising and you get the "WASM initialization timeout" you're seeing. Other tools (PDF merge, split, compress, OCR) don't depend on SharedArrayBuffer, which is why they keep working over plain LAN HTTP.
Also Yes for now, the Docker image only ships plain HTTP nginx, so HTTPS termination is on the operator. The fastest path on Ubuntu is to put Caddy in front:
Add bento…