feat: separate AGPL libraries and add dynamic WASM loading

- Add WASM settings page for configuring external AGPL modules
- Implement dynamic loading for PyMuPDF, Ghostscript, and CoherentPDF
- Add Cloudflare Worker proxy for serving WASM files with CORS
- Update all affected tool pages to check WASM availability
- Add showWasmRequiredDialog for missing module configuration

Documentation:
- Update README, licensing.html, and docs to clarify AGPL components
  are not bundled and must be configured separately
- Add WASM-PROXY.md deployment guide with recommended source URLs
- Rename "CPDF" to "CoherentPDF" for consistency
This commit is contained in:
alam00000
2026-01-27 15:26:11 +05:30
parent f6d432eaa7
commit 2c85ca74e9
75 changed files with 9696 additions and 6587 deletions

View File

@@ -989,72 +989,6 @@
</p>
</div>
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<h3
class="text-xl font-semibold text-white mb-4 flex items-center gap-3"
>
<i
data-lucide="alert-triangle"
class="w-6 h-6 text-yellow-400"
></i>
Important Notice on Third-Party Components
</h3>
<p class="text-gray-300 mb-4">
This software includes components licensed under the
<strong class="text-white">GNU AGPL v3</strong>, including:
</p>
<ul class="flex flex-wrap gap-2 mb-4">
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
CPDF
</li>
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
PyMuPDF
</li>
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
Ghostscript
</li>
</ul>
<ul class="space-y-3 text-gray-400">
<li class="flex items-start gap-3">
<i
data-lucide="alert-circle"
class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5"
></i>
<span
>This commercial license
<strong class="text-white">does not</strong> grant rights to
use AGPL components in a closed-source manner.</span
>
</li>
<li class="flex items-start gap-3">
<i
data-lucide="alert-circle"
class="w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5"
></i>
<span
>Users must comply with the AGPL v3 terms for these
components.</span
>
</li>
<li class="flex items-start gap-3">
<i
data-lucide="check-circle"
class="w-5 h-5 text-green-400 flex-shrink-0 mt-0.5"
></i>
<span
>Source code for all AGPL components is included in the
distribution.</span
>
</li>
</ul>
</div>
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<h3
class="text-xl font-semibold text-white mb-4 flex items-center gap-3"
@@ -1104,6 +1038,83 @@
</li>
</ul>
</div>
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<h3
class="text-xl font-semibold text-white mb-4 flex items-center gap-3"
>
<i
data-lucide="alert-triangle"
class="w-6 h-6 text-indigo-400"
></i>
AGPL Components - Not Bundled
</h3>
<p class="text-gray-300 mb-4">
BentoPDF
<strong class="text-white">does not bundle</strong> AGPL-licensed
processing libraries. The following components must be configured
separately via
<strong class="text-white">Advanced Settings</strong> if you wish
to use their features:
</p>
<ul class="flex flex-wrap gap-2 mb-4">
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
PyMuPDF (AGPL-3.0)
</li>
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
Ghostscript (AGPL-3.0)
</li>
<li
class="px-3 py-1 bg-gray-700 rounded-full text-sm text-gray-300"
>
CoherentPDF / CPDF (AGPL-3.0)
</li>
</ul>
<p class="text-gray-300 mb-4">
<strong class="text-white"
>To enable features powered by these libraries:</strong
>
</p>
<ul class="space-y-2 text-gray-400 mb-4">
<li class="flex items-start gap-3">
<span class="text-indigo-400 font-bold">1.</span>
<span
>Navigate to
<strong class="text-white">Advanced Settings</strong> in
BentoPDF</span
>
</li>
<li class="flex items-start gap-3">
<span class="text-indigo-400 font-bold">2.</span>
<span>Configure the URL for each WASM module you need</span>
</li>
<li class="flex items-start gap-3">
<span class="text-indigo-400 font-bold">3.</span>
<span
>You can host your own files, use a
<a
href="https://github.com/alam00000/bentopdf/blob/main/cloudflare/WASM-PROXY.md"
class="text-indigo-400 hover:underline"
>WASM proxy</a
>, or use any compatible CDN</span
>
</li>
</ul>
<p class="text-gray-400 text-sm mt-4">
<i
data-lucide="alert-circle"
class="w-4 h-4 inline-block mr-1 text-indigo-400"
></i>
The commercial license covers
<strong class="text-white">BentoPDF's own code only</strong>. It
does not bypass the AGPL licensing of these components. Users must
comply with the AGPL v3 terms for these components.
</p>
</div>
</div>
</section>