feat: add custom branding, air-gapped deployment script, and updated self-hosting docs

This commit is contained in:
alam00000
2026-02-14 21:38:58 +05:30
parent 75b1d67fbd
commit 3cf435d59d
38 changed files with 1487 additions and 123 deletions

View File

@@ -10,27 +10,49 @@
## Build Configuration
| Setting | Value |
|---------|-------|
| Framework preset | None |
| Build command | `npm run build` |
| Build output directory | `dist` |
| Root directory | `/` |
| Setting | Value |
| ---------------------- | --------------- |
| Framework preset | None |
| Build command | `npm run build` |
| Build output directory | `dist` |
| Root directory | `/` |
## Environment Variables
Add these in Settings → Environment variables:
| Variable | Value |
|----------|-------|
| `NODE_VERSION` | `18` |
| `SIMPLE_MODE` | `false` (optional) |
| Variable | Value |
| ----------------------- | ------------------------------------------ |
| `NODE_VERSION` | `18` |
| `SIMPLE_MODE` | `false` (optional) |
| `VITE_BRAND_NAME` | Custom brand name (optional) |
| `VITE_BRAND_LOGO` | Logo path relative to `public/` (optional) |
| `VITE_FOOTER_TEXT` | Custom footer/copyright text (optional) |
| `VITE_DEFAULT_LANGUAGE` | Default UI language, e.g. `fr` (optional) |
## Configuration File
Create `_headers` in your `public` folder:
```
# Required security headers for SharedArrayBuffer (used by LibreOffice WASM)
/*
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: cross-origin
# Pre-compressed LibreOffice WASM binary
/libreoffice-wasm/soffice.wasm.gz
Content-Type: application/wasm
Content-Encoding: gzip
Cache-Control: public, max-age=31536000, immutable
# Pre-compressed LibreOffice WASM data
/libreoffice-wasm/soffice.data.gz
Content-Type: application/octet-stream
Content-Encoding: gzip
Cache-Control: public, max-age=31536000, immutable
# Cache WASM files aggressively
/*.wasm
Cache-Control: public, max-age=31536000, immutable
@@ -41,6 +63,10 @@ Create `_headers` in your `public` folder:
Cache-Control: no-cache
```
::: warning Important
The `Cross-Origin-Embedder-Policy` and `Cross-Origin-Opener-Policy` headers are required for Word/ODT/Excel/PowerPoint to PDF conversions. Without them, `SharedArrayBuffer` is unavailable and the LibreOffice WASM engine will fail to initialize.
:::
Create `_redirects` for SPA routing:
```
@@ -89,11 +115,11 @@ npx wrangler deploy
### Security Features
| Feature | Description |
|---------|-------------|
| **URL Restrictions** | Only certificate URLs allowed |
| **File Size Limit** | Max 10MB per request |
| **Rate Limiting** | 60 req/IP/min (requires KV) |
| Feature | Description |
| ----------------------- | ------------------------------ |
| **URL Restrictions** | Only certificate URLs allowed |
| **File Size Limit** | Max 10MB per request |
| **Rate Limiting** | 60 req/IP/min (requires KV) |
| **Private IP Blocking** | Blocks localhost, internal IPs |
### Enable Rate Limiting