From fe32de047eb8b25b4484da8db213d2c322ade839 Mon Sep 17 00:00:00 2001 From: abdullahalam123 Date: Sat, 27 Dec 2025 21:53:21 +0530 Subject: [PATCH] fix: docker deployment issues and update readme" -m "Fixed nginx brotli_static error, duplicates, and added COOP/COEP headers for SharedArrayBuffer. Updated README with acknowledgments --- .gitignore | 5 +---- README.md | 3 +++ nginx.conf | 30 +++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a12a689..341cb20 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,4 @@ dist-ssr # Coverage reports coverage/ *.lcov -# will be deleted later -new-changes-to-port -pymupdf-wasm -serve_test + diff --git a/README.md b/README.md index d7695c4..e0019f0 100644 --- a/README.md +++ b/README.md @@ -577,5 +577,8 @@ BentoPDF wouldn't be possible without the amazing open-source tools and librarie - **[Tailwind CSS](https://tailwindcss.com/)** – For rapid, flexible, and beautiful UI styling. - **[qpdf](https://github.com/qpdf/qpdf)** and **[qpdf-wasm](https://github.com/neslinesli93/qpdf-wasm)**– A powerful command-line tool and library for inspecting, repairing, and transforming PDF file ported to wasm - **[cpdf](https://www.coherentpdf.com/)** – For content preserving pdf operations. +- **[LibreOffice](https://www.libreoffice.org/)** – For powerful document conversion capabilities. +- **[PyMuPDF](https://github.com/pymupdf/PyMuPDF)** – For high-performance PDF manipulation and data extraction. +- **[Ghostscript(GhostPDL)](https://github.com/ArtifexSoftware/ghostpdl)** – Needs no Introduction. Your work inspires and empowers developers everywhere. Thank you for making open-source amazing! diff --git a/nginx.conf b/nginx.conf index ed189de..56fab7a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,11 +8,9 @@ http { include /etc/nginx/mime.types; types { application/javascript mjs; - application/wasm wasm; } default_type application/octet-stream; - brotli_static on; gzip_static on; gzip on; @@ -33,18 +31,42 @@ http { location ~* \.html$ { expires 1h; add_header Cache-Control "public, must-revalidate"; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Opener-Policy "same-origin" always; + } + + location ~* /libreoffice-wasm/soffice\.wasm\.gz$ { + gzip off; + types {} default_type application/wasm; + add_header Content-Encoding gzip; + add_header Vary "Accept-Encoding"; + add_header Cache-Control "public, immutable"; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Opener-Policy "same-origin" always; + } + + location ~* /libreoffice-wasm/soffice\.data\.gz$ { + gzip off; + types {} default_type application/octet-stream; + add_header Content-Encoding gzip; + add_header Vary "Accept-Encoding"; + add_header Cache-Control "public, immutable"; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Opener-Policy "same-origin" always; } location ~* \.(wasm|wasm\.gz|data|data\.gz)$ { expires 1y; add_header Cache-Control "public, immutable"; - add_header Cross-Origin-Embedder-Policy "credentialless" always; + add_header Cross-Origin-Embedder-Policy "require-corp" always; add_header Cross-Origin-Opener-Policy "same-origin" always; } location ~* \.(js|mjs|css|woff|woff2|ttf|eot|otf)$ { expires 1y; add_header Cache-Control "public, immutable"; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Opener-Policy "same-origin" always; } location ~* \.(png|jpg|jpeg|gif|ico|svg|webp|avif|mp4|webm)$ { @@ -66,6 +88,8 @@ http { try_files $uri $uri/ $uri.html /index.html; expires 5m; add_header Cache-Control "public, must-revalidate"; + add_header Cross-Origin-Embedder-Policy "require-corp" always; + add_header Cross-Origin-Opener-Policy "same-origin" always; } add_header X-Frame-Options "SAMEORIGIN" always;