From 93e26ea1787bee21900506d509af73f8bd52fcba Mon Sep 17 00:00:00 2001 From: alam00000 Date: Mon, 2 Feb 2026 19:38:04 +0530 Subject: [PATCH] fix: WASM CDN defaults bypass Docker empty env vars, nginx redirect port issue - Fix envOrDefault() to treat empty strings as unset, so Docker builds without WASM build args correctly fall through to hardcoded CDN defaults - Show CDN defaults as placeholder text in WASM settings page instead of filling input values, with "Pre-configured" status badge - Fix nginx redirecting locale URLs without trailing slash (e.g. /de) to internal port 8080 by adding absolute_redirect off - Handle encrypted PDF error in compress tool with descriptive message - Replace Docker Hub pulls badge with GHCR downloads badge --- README.md | 2 +- nginx.conf | 3 ++- src/js/logic/compress-pdf-page.ts | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 743019c0..af47b992 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **BentoPDF** is a powerful, privacy-first, client-side PDF toolkit that is self hostable and allows you to manipulate, edit, merge, and process PDF files directly in your browser. No server-side processing is required, ensuring your files remain secure and private. -![Docker Pulls](https://img.shields.io/docker/pulls/bentopdfteam/bentopdf) [![Ko-fi](https://img.shields.io/badge/Buy%20me%20a%20Coffee-yellow?logo=kofi&style=flat-square)](https://ko-fi.com/alio01) ![GitHub Stars](https://img.shields.io/github/stars/alam00000/bentopdf?style=social) +[![Docker Downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fghcr-badge.elias.eu.org%2Fapi%2Falam00000%2Fbentopdf%2Fbentopdf&query=%24.downloadCount&logo=docker&label=Docker%20Downloads&color=blue)](https://github.com/alam00000/bentopdf/pkgs/container/bentopdf) [![Ko-fi](https://img.shields.io/badge/Buy%20me%20a%20Coffee-yellow?logo=kofi&style=flat-square)](https://ko-fi.com/alio01) ![GitHub Stars](https://img.shields.io/github/stars/alam00000/bentopdf?style=social) [![Sponsor me on GitHub](https://img.shields.io/badge/Sponsor-%E2%9D%A4-ff69b4)](https://github.com/sponsors/alam00000) ![BentoPDF Tools](public/images/bentopdf-tools.png) diff --git a/nginx.conf b/nginx.conf index ecf93a6b..e30d20d3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -25,7 +25,8 @@ http { server_name localhost; root /usr/share/nginx/html; index index.html; - + absolute_redirect off; + location ~* \.html$ { expires 1h; diff --git a/src/js/logic/compress-pdf-page.ts b/src/js/logic/compress-pdf-page.ts index c5ec5e73..0500f2a5 100644 --- a/src/js/logic/compress-pdf-page.ts +++ b/src/js/logic/compress-pdf-page.ts @@ -121,6 +121,15 @@ async function performCondenseCompression( return { ...result, usedFallback: true }; } + if ( + errorMessage.includes('closed or encrypted') || + errorMessage.includes('encrypted') + ) { + throw new Error( + 'This PDF is encrypted or password-protected. Please remove the password first using the Unlock PDF tool, then try compressing again.' + ); + } + throw new Error(`PDF compression failed: ${errorMessage}`); } }