Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

Sync portal docs from docs repo (#7866)

stirlingbot[bot]02b7b17f9fe2
diff --git a/frontend/editor/src/portal/generated/docsManifest.json b/frontend/editor/src/portal/generated/docsManifest.json
index dd212cd5e7..597b4cd61a 100644
--- a/frontend/editor/src/portal/generated/docsManifest.json
+++ b/frontend/editor/src/portal/generated/docsManifest.json
@@ -429,7 +429,7 @@
"title": "Telegram Bot Integration",
"description": "Process PDFs through a Telegram bot powered by Stirling PDF pipelines",
"section": "configuration/automation",
- "markdown": "Stirling PDF can run a Telegram bot that accepts PDF files from chats and returns processed results using your saved [Automate / Pipeline](doc:configuration/automation/pipeline) configurations. Send a PDF to the bot, get a processed PDF back.\n\nFree on all license tiers.\n\n> **⚠️ Warning: Community feature - not recommended for Enterprise use**\n>\n> The Telegram bot integration is a **community-built feature** in **beta**. It is not built, tested, or supported by Stirling Tools and is not covered by the Server / Enterprise support SLA. **We do not recommend it for Enterprise or production-critical deployments.** Raise issues on GitHub or in the community Discord. Behaviour and config keys may change in future releases.\n\n\n---\n\n## How it works\n\n1. A user, channel, or group sends a PDF file to your Telegram bot.\n2. The bot saves the file into a watched pipeline inbox folder.\n3. Stirling PDF processes the file using the pipeline JSON in that folder (see [Folder Scanning](doc:configuration/storage/folderscanning)).\n4. The bot sends the result back to the chat.\n\nThe bot talks to Telegram outbound only - no inbound port or webhook setup required, just outbound HTTPS to `api.telegram.org`.\n\n---\n\n## Setup overview\n\n1. Create the bot in Telegram and get a bot token.\n2. Set your token and username in Stirling PDF.\n3. Drop a pipeline JSON into the inbox folder.\n4. Send a PDF to the bot.\n\n---\n\n## 1. Create the bot in Telegram\n\n1. Open [@BotFather](https://t.me/BotFather) in Telegram.\n2. Send `/newbot`.\n3. Pick a display name and a username ending in `bot`.\n4. Copy the token BotFather returns.\n\n**If you plan to add the bot to groups:** also send `/setprivacy`, select your bot, choose **Disable**. With privacy mode on (the default), the bot only sees commands and direct mentions in groups.\n\n---\n\n## 2. Configure Stirling PDF\n\nThe `telegram:` block is already present in the shipped `settings.yml` - find it and update the values (set `enabled: true`, fill in `botToken` and `botUsername`), or set the equivalent environment variables. Restart Stirling PDF after saving via file edits; the Admin UI hot-applies.\n\n### Minimal config\n\n```yaml\ntelegram:\n enabled: true\n botToken: \"your-token-from-botfather\"\n botUsername: \"your_bot_username\"\n```\n\n### Recommended config\n\n```yaml\ntelegram:\n enabled: true\n botToken: \"your-token-from-botfather\"\n botUsername: \"your_bot_username\"\n customFolderSuffix: true # one inbox per chat\n enableAllowUserIDs: true # restrict to known users\n allowUserIDs: [123456789]\n processingTimeoutSeconds: 180 # max time to wait for a result\n```\n\n### Admin UI\n\nIf you have login enabled, configure the bot from **Admin Settings → Connections → Telegram Bot**. Changes saved through the UI apply without a restart.\n\n---\n\n## 3. Drop a pipeline JSON into the inbox\n\nThe bot will not process uploads until at least one `.json` pipeline file exists in the chat's inbox folder.\n\nDefault inbox path: `/pipeline/watchedFolders/telegram/`. With `customFolderSuffix: true` (recommended), each chat gets its own subfolder named after its Telegram chat ID.\n\n### How to get a chat ID\n\nThe folder is created the first time a chat messages the bot. Easiest bootstrap:\n\n1. Send any message from the chat to the bot.\n2. Look at the new subfolder name under `/pipeline/watchedFolders/telegram/`.\n3. That subfolder name is the chat ID.\n\nOr chat with [@userinfobot](https://t.me/userinfobot) which echoes your user ID.\n\n### Build the pipeline JSON\n\nOpen the **Automate** tool, build the workflow you want, then click **Export for Folder Scanning** to download the JSON. Drop the file into the chat's inbox folder. The filename does not matter - any `.json` is picked up.\n\nSee [Pipeline Automation](doc:configuration/automation/pipeline) for details.\n\n---\n\n## 4. Use the bot\n\nIn Telegram, send the bot a PDF. The bot acknowledges, processes it via the pipeline, and sends the result back. Typical end-to-end time is 1-3 minutes (depending on what the pipeline does).\n\nOnly files with MIME type `application/pdf` are accepted.\n\n`/start` in a private chat returns a welcome message.\n\n---\n\n## Configuration reference\n\nAll options live under the top-level `telegram:` block. Environment variables use the `TELEGRAM_*` form (Spring Boot relaxed binding: dots become underscores, camelCase joins stay glued).\n\n| YAML key | Default | Purpose |\n|---|---|---|\n| `enabled` | `false` | Master toggle. |\n| `botToken` | empty | BotFather token. |\n| `botUsername` | empty | Bot username, without the `@`. |\n| `pipelineInboxFolder` | `\"telegram\"` | Subfolder name under `/pipeline/watchedFolders/`. |\n| `customFolderSuffix` | `true` | Appends the chat ID as a subdirectory so each chat has its own inbox. |\n| `enableAllowUserIDs` | `true` | Turn on user ID allowlist (for private chats). |\n| `allowUserIDs` | `[]` | Allowed user IDs. |\n| `enableAllowChannelIDs` | `true` | Turn on channel ID allowlist. |\n| `allowChannelIDs` | `[]` | Allowed channel IDs (typically negative, e.g. `-1001234567890`). |\n| `processingTimeoutSeconds` | `180` | Max wait for a pipeline result. Keep ≥ 90s. |\n| `pollingIntervalMillis` | `2000` | How often to check for results. |\n| `feedback.user.*` | all `true` | Per-message-type replies in private chats (`noValidDocument`, `errorMessage`, `errorProcessing`, `processing`). |\n| `feedback.channel.*` | all `true` | Same for channels. |\n\n---\n\n## Access control\n\n- **Private chats**: controlled by `enableAllowUserIDs` + `allowUserIDs`.\n- **Channels**: controlled by `enableAllowChannelIDs` + `allowChannelIDs`.\n- **Groups and supergroups**: **always allowed** - the allowlist does not apply. To restrict group access, either don't add the bot to groups, or use BotFather's `/setjoingroups → Disable` so it can't be invited.\n\nFor production deployments, always enable the user or channel allowlist.\n\n---\n\n## Limitations\n\n- **20 MB upload limit** (a Telegram bot API constraint, not Stirling).\n- **One JSON per chat folder** when `customFolderSuffix: true`. Create the folder by messaging the bot first, then drop the JSON in.\n- **Output is sent file-by-file** - if your pipeline emits N files, the user gets N Telegram messages, no zipping.\n\n---\n\n## Recommended deployment patterns\n\n- **Personal use**: private-chat allowlist with your own user ID. Single pipeline JSON in your chat's subfolder.\n- **Team-shared inbox**: a Telegram group, with the bot's privacy mode disabled in BotFather. One pipeline JSON for the group.\n- **Per-user pipelines**: `customFolderSuffix: true` plus a tailored pipeline JSON per chat ID.\n- **Channel posting**: add the bot as a channel admin with \"Post Messages\" permission, restrict via `allowChannelIDs`.\n\n---\n\n## Related Documentation\n\n- **[Pipeline Automation](doc:configuration/automation/pipeline)** - Build the pipeline JSONs the bot uses\n- **[Folder Scanning](doc:configuration/storage/folderscanning)** - The processing engine the bot relies on\n- **[API Documentation](doc:api)** - Trigger pipelines without Telegram",
+ "markdown": "Stirling PDF can run a Telegram bot that accepts PDF files from chats and returns processed results using your saved [Automate / Pipeline](doc:configuration/automation/pipeline) configurations. Send a PDF to the bot, get a processed PDF back.\n\nFree on all license tiers.\n\n> **⚠️ Warning: Community feature - not recommended for Enterprise use**\n>\n> The Telegram bot integration is a **community-built feature** in **beta**. It is not built, tested, or supported by Stirling Tools and is not covered by the Team / Enterprise support SLA. **We do not recommend it for Enterprise or production-critical deployments.** Raise issues on GitHub or in the community Discord. Behaviour and config keys may change in future releases.\n\n\n---\n\n## How it works\n\n1. A user, channel, or group sends a PDF file to your Telegram bot.\n2. The bot saves the file into a watched pipeline inbox folder.\n3. Stirling PDF processes the file using the pipeline JSON in that folder (see [Folder Scanning](doc:configuration/storage/folderscanning)).\n4. The bot sends the result back to the chat.\n\nThe bot talks to Telegram outbound only - no inbound port or webhook setup required, just outbound HTTPS to `api.telegram.org`.\n\n---\n\n## Setup overview\n\n1. Create the bot in Telegram and get a bot token.\n2. Set your token and username in Stirling PDF.\n3. Drop a pipeline JSON into the inbox folder.\n4. Send a PDF to the bot.\n\n---\n\n## 1. Create the bot in Telegram\n\n1. Open [@BotFather](https://t.me/BotFather) in Telegram.\n2. Send `/newbot`.\n3. Pick a display name and a username ending in `bot`.\n4. Copy the token BotFather returns.\n\n**If you plan to add the bot to groups:** also send `/setprivacy`, select your bot, choose **Disable**. With privacy mode on (the default), the bot only sees commands and direct mentions in groups.\n\n---\n\n## 2. Configure Stirling PDF\n\nThe `telegram:` block is already present in the shipped `settings.yml` - find it and update the values (set `enabled: true`, fill in `botToken` and `botUsername`), or set the equivalent environment variables. Restart Stirling PDF after saving via file edits; the Admin UI hot-applies.\n\n### Minimal config\n\n```yaml\ntelegram:\n enabled: true\n botToken: \"your-token-from-botfather\"\n botUsername: \"your_bot_username\"\n```\n\n### Recommended config\n\n```yaml\ntelegram:\n enabled: true\n botToken: \"your-token-from-botfather\"\n botUsername: \"your_bot_username\"\n customFolderSuffix: true # one inbox per chat\n enableAllowUserIDs: true # restrict to known users\n allowUserIDs: [123456789]\n processingTimeoutSeconds: 180 # max time to wait for a result\n```\n\n### Admin UI\n\nIf you have login enabled, configure the bot from **Admin Settings → Connections → Telegram Bot**. Changes saved through the UI apply without a restart.\n\n---\n\n## 3. Drop a pipeline JSON into the inbox\n\nThe bot will not process uploads until at least one `.json` pipeline file exists in the chat's inbox folder.\n\nDefault inbox path: `/pipeline/watchedFolders/telegram/`. With `customFolderSuffix: true` (recommended), each chat gets its own subfolder named after its Telegram chat ID.\n\n### How to get a chat ID\n\nThe folder is created the first time a chat messages the bot. Easiest bootstrap:\n\n1. Send any message from the chat to the bot.\n2. Look at the new subfolder name under `/pipeline/watchedFolders/telegram/`.\n3. That subfolder name is the chat ID.\n\nOr chat with [@userinfobot](https://t.me/userinfobot) which echoes your user ID.\n\n### Build the pipeline JSON\n\nOpen the **Automate** tool, build the workflow you want, then click **Export for Folder Scanning** to download the JSON. Drop the file into the chat's inbox folder. The filename does not matter - any `.json` is picked up.\n\nSee [Pipeline Automation](doc:configuration/automation/pipeline) for details.\n\n---\n\n## 4. Use the bot\n\nIn Telegram, send the bot a PDF. The bot acknowledges, processes it via the pipeline, and sends the result back. Typical end-to-end time is 1-3 minutes (depending on what the pipeline does).\n\nOnly files with MIME type `application/pdf` are accepted.\n\n`/start` in a private chat returns a welcome message.\n\n---\n\n## Configuration reference\n\nAll options live under the top-level `telegram:` block. Environment variables use the `TELEGRAM_*` form (Spring Boot relaxed binding: dots become underscores, camelCase joins stay glued).\n\n| YAML key | Default | Purpose |\n|---|---|---|\n| `enabled` | `false` | Master toggle. |\n| `botToken` | empty | BotFather token. |\n| `botUsername` | empty | Bot username, without the `@`. |\n| `pipelineInboxFolder` | `\"telegram\"` | Subfolder name under `/pipeline/watchedFolders/`. |\n| `customFolderSuffix` | `true` | Appends the chat ID as a subdirectory so each chat has its own inbox. |\n| `enableAllowUserIDs` | `true` | Turn on user ID allowlist (for private chats). |\n| `allowUserIDs` | `[]` | Allowed user IDs. |\n| `enableAllowChannelIDs` | `true` | Turn on channel ID allowlist. |\n| `allowChannelIDs` | `[]` | Allowed channel IDs (typically negative, e.g. `-1001234567890`). |\n| `processingTimeoutSeconds` | `180` | Max wait for a pipeline result. Keep ≥ 90s. |\n| `pollingIntervalMillis` | `2000` | How often to check for results. |\n| `feedback.user.*` | all `true` | Per-message-type replies in private chats (`noValidDocument`, `errorMessage`, `errorProcessing`, `processing`). |\n| `feedback.channel.*` | all `true` | Same for channels. |\n\n---\n\n## Access control\n\n- **Private chats**: controlled by `enableAllowUserIDs` + `allowUserIDs`.\n- **Channels**: controlled by `enableAllowChannelIDs` + `allowChannelIDs`.\n- **Groups and supergroups**: **always allowed** - the allowlist does not apply. To restrict group access, either don't add the bot to groups, or use BotFather's `/setjoingroups → Disable` so it can't be invited.\n\nFor production deployments, always enable the user or channel allowlist.\n\n---\n\n## Limitations\n\n- **20 MB upload limit** (a Telegram bot API constraint, not Stirling).\n- **One JSON per chat folder** when `customFolderSuffix: true`. Create the folder by messaging the bot first, then drop the JSON in.\n- **Output is sent file-by-file** - if your pipeline emits N files, the user gets N Telegram messages, no zipping.\n\n---\n\n## Recommended deployment patterns\n\n- **Personal use**: private-chat allowlist with your own user ID. Single pipeline JSON in your chat's subfolder.\n- **Team-shared inbox**: a Telegram group, with the bot's privacy mode disabled in BotFather. One pipeline JSON for the group.\n- **Per-user pipelines**: `customFolderSuffix: true` plus a tailored pipeline JSON per chat ID.\n- **Channel posting**: add the bot as a channel admin with \"Post Messages\" permission, restrict via `allowChannelIDs`.\n\n---\n\n## Related Documentation\n\n- **[Pipeline Automation](doc:configuration/automation/pipeline)** - Build the pipeline JSONs the bot uses\n- **[Folder Scanning](doc:configuration/storage/folderscanning)** - The processing engine the bot relies on\n- **[API Documentation](doc:api)** - Trigger pipelines without Telegram",
"sourcePath": "docs/Configuration/Automation/Telegram Bot.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Automation/Telegram Bot.md"
},
@@ -446,7 +446,7 @@
"title": "Configuration Guide",
"description": "Configure Stirling PDF using environment variables, settings files, or in-app settings",
"section": "configuration",
- "markdown": "Stirling PDF can be configured in three ways, depending on your deployment and preferences.\n\n## Configuration Methods\n\n### 1. In-App Settings (Recommended)\n\nIf you have login enabled, admins can configure everything through the Settings menu in the application.\n\n**To use:**\n1. Set `SECURITY_ENABLELOGIN=true`\n2. Log in as admin\n3. Go to Settings → configure through UI\n4. Changes apply immediately, no restart needed\n\n**Best for:** Production deployments with admin users\n\n---\n\n### 2. Environment Variables\n\nConfigure via Docker environment variables or system environment variables.\n\n**To use:**\n```bash\ndocker run -d \\\n -e SECURITY_ENABLELOGIN=true \\\n -e SYSTEM_DEFAULTLOCALE=en-US \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n**Best for:** Docker deployments, infrastructure-as-code, initial setup\n\n---\n\n### 3. Settings File (settings.yml)\n\nEdit `/configs/settings.yml` directly for advanced configuration.\n\n**To use:**\n```yaml\nsecurity:\n enableLogin: true\nsystem:\n defaultLocale: en-US\n```\n\n**Best for:** Complex configurations, when you prefer file-based config\n\n---\n\n## Common Settings\n\n### Authentication\n\n**Note:** Authentication and additional features are included by default in:\n- **Docker**: All images except ultra-lite (authentication is enabled by default)\n- **JAR**: [Stirling-PDF-with-login.jar](https://files.stirlingpdf.com/Stirling-PDF-with-login.jar) **(Recommended)**\n\nThe plain [Stirling-PDF.jar](https://files.stirlingpdf.com/Stirling-PDF.jar) does not include authentication or additional features.\n\nConfigure user login:\n\n\n \n ```yaml\n security:\n enableLogin: true\n initialLogin:\n username: admin\n password: changeme123\n ```\n \n \n ```bash\n SECURITY_ENABLELOGIN=true\n SECURITY_INITIALLOGIN_USERNAME=admin\n SECURITY_INITIALLOGIN_PASSWORD=changeme123\n ```\n \n\n\nDefault credentials: `admin` / `stirling` (change immediately after first login)\n\nFor more details, see [System and Security Configuration](doc:configuration/security/system-and-security).\n\n### Language & Localization\n\n\n \n ```yaml\n ui:\n languages: [] # Available languages (empty = all enabled), e.g. [\"en_US\", \"de_DE\"]\n system:\n defaultLocale: en-US # Default language for new users\n ```\n \n \n ```bash\n UI_LANGUAGES=en_US,de_DE # Restrict available languages (omit to enable all)\n SYSTEM_DEFAULTLOCALE=en-US # Default language\n ```\n \n\n\nLeaving `defaultLocale` empty (the default) auto-detects the language from the browser and falls back to `en-US` if no preference is found.\n\n**How language selection works:**\n\nStirling PDF determines the interface language using this priority order:\n\n1. **User's manual selection** (highest priority)\n - When a user clicks the language globe icon and selects a language\n - Choice is stored in browser's localStorage (persists across sessions)\n - Storage key: `i18nextLng`\n\n2. **System default locale**\n - Set via `SYSTEM_DEFAULTLOCALE` or `system.defaultLocale`\n - When configured, it overrides the browser's detected language for users who have not made a manual selection\n\n3. **Browser's language preference**\n - Automatically detected from the browser's language setting\n - Example: Firefox set to Swedish (sv-SE) shows Swedish UI when no `defaultLocale` is configured\n\n4. **Fallback** (lowest priority)\n - `en-US` is used when none of the above resolve to an available language\n\n**Example:**\n- Config: `SYSTEM_DEFAULTLOCALE=en-US`\n- Browser: Swedish (sv-SE)\n- Result: UI shows English (US) (the configured default overrides the browser preference)\n\nIf `defaultLocale` is left empty (the default), the browser-detected language is used instead. Users can always override either choice by manually selecting a language via the language globe icon.\n\n> **Tip**: Set `SYSTEM_DEFAULTLOCALE` to your organization's primary language. Users can always override it using the language selector in the top-right corner.\n\n### File Upload Limits\n\n\n \n ```yaml\n system:\n fileUploadLimit: \"500MB\" # Number (0-999) followed by KB, MB, or GB. Empty = no limit\n spring:\n servlet:\n multipart:\n max-file-size: 2000MB\n max-request-size: 2000MB\n ```\n \n \n ```bash\n SYSTEM_MAXFILESIZE=500 # Size in MB (valid range 1-999)\n SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE=2000MB\n SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE=2000MB\n ```\n \n\n\n### Memory Management\n\n```bash\nJAVA_TOOL_OPTIONS=\"-Xms512m -Xmx4g\" # Min 512MB, Max 4GB RAM\n```\n\n---\n\n## Specialized Configuration Guides\n\nFor advanced features and specific use cases, see these detailed guides:\n\n### Authentication & Security\n\n**[Single Sign-On (SSO)](doc:configuration/security/single-sign-on-configuration)**\n- OAuth2 (Google, GitHub, Keycloak, OIDC) - Server tier\n- SAML2 (Okta, Azure AD) - Enterprise tier\n- Complete configuration examples\n\n**[System and Security](doc:configuration/security/system-and-security)**\n- Server certificates\n- JWT configuration\n\n**[Fail2Ban Integration](doc:configuration/security/fail2ban)**\n- Protect against brute-force attacks\n- Auto-ban after failed login attempts\n\n---\n\n### Features & Customization\n\n**[UI Customization](doc:configuration/customisation/ui-customisation)**\n- Branding and logos\n- Theme customization\n- Custom styling\n\n**[Endpoint/Feature Control](doc:configuration/customisation/endpoint-or-feature-customisation)**\n- Enable/disable specific tools\n- Control feature availability by user/role\n\n**[Pipeline (Automation)](doc:configuration/automation/pipeline)**\n- Automated workflows\n- Folder scanning\n- Batch processing\n- Multi-step operations\n\n---\n\n### Integration & Storage\n\n**[External Database](doc:configuration/storage/external-database)**\n- PostgreSQL configuration (Pro/Enterprise)\n- Database migration\n- Backup strategies\n\n**[Google Drive File Picker](doc:configuration/storage/google-drive-file-picker)**\n- Direct Google Drive integration\n- OAuth setup\n\n**[MCP Server](doc:configuration/automation/mcp-server)**\n- Expose Stirling PDF tools over the Model Context Protocol\n- OAuth2 or API-key authentication\n- Operation allow/deny lists\n\n**[S3 / Object Storage](doc:configuration/storage/file-sharing-and-storage)**\n- Store uploads and job artifacts in S3-compatible object storage\n- Shared storage for multi-node deployments\n\n**[Telegram Bot](doc:configuration/automation/telegram-bot)**\n- Run a Telegram bot that processes PDFs sent in chat\n\n**[OCR Configuration](doc:configuration/operations/ocr)**\n- Tesseract language packs\n- OCR optimization\n\n**[Usage Monitoring](doc:configuration/automation/usage-monitoring)**\n- Prometheus metrics (Pro/Enterprise)\n- Application monitoring\n- Performance tracking\n\n---\n\n### Performance & Scaling\n\n**[Performance Optimization & Sizing](doc:configuration/operations/performance-optimization)**\n- Resource sizing, JVM tuning, memory model, and scaling guidance\n\n**[Process Limits](doc:configuration/operations/process-limits)**\n- Session limits and timeouts for external tools\n\n**[LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)**\n- Configure multiple LibreOffice instances for faster document conversion\n- Local UNO server pool and remote UNO server endpoints\n\n---\n\n### Diagnostics & Support\n\n**[Diagnostics & Reporting Issues](doc:configuration/operations/diagnostics)**\n- Built-in diagnostics tool for Docker containers\n- How to report issues via GitHub, Discord, and email\n\n---\n\n### Other Configuration\n\n**[Folder Scanning](doc:configuration/storage/folderscanning)**\n- Watch folders for automatic processing\n\n**[Custom Signature Files](doc:configuration/security/sign-with-custom-files)**\n- Pre-loaded signatures for quick signing\n\n**[Extra Settings](doc:configuration/customisation/extra-settings)**\n- Logging configuration\n- Server settings (port, SSL/TLS)\n- Advanced Spring Boot settings\n\n---\n\n## Configuration Priority\n\nWhen the same setting is defined in multiple places, this is the order of precedence (highest to lowest):\n\n1. **Environment Variables**\n2. **settings.yml / In-App Settings**\n3. **Default values**\n\n---\n\n## Environment Variable Format\n\nConvert YAML paths to environment variables:\n\n```yaml\n# settings.yml\nsecurity:\n enableLogin: true\n```\n\nBecomes:\n```bash\nSECURITY_ENABLELOGIN=true\n```\n\n**Rules:**\n- Uppercase everything\n- Replace `.` with `_`\n- Nested properties become `PARENT_CHILD`\n\n---\n\n## Troubleshooting\n\n### Settings Not Applied\n\n1. Check configuration priority (env vars override settings.yml)\n2. Restart container after changing environment variables\n3. Check logs: `docker logs stirling-pdf | grep ERROR`\n4. Verify file permissions on `/configs` volume\n\n### Database Issues\n\nDefault database location: `/configs/stirling-pdf-DB-<schema-version>.mv.db` (the schema version is part of the filename, e.g. `/configs/stirling-pdf-DB-2.3.232.mv.db`).\n\nIf missing:\n- Ensure `/configs` volume is mounted\n- Check write permissions\n- Review startup logs\n\n---\n\n## Next Steps\n\n- **Production Deployment:** See [Production Deployment Guide](doc:server-admin-onboarding)\n- **API Usage:** See [API Documentation](doc:api)\n- **Tool Reference:** See [Functionality](doc:functionality/functionality)\n- **Troubleshooting:** See [Diagnostics & Reporting Issues](doc:configuration/operations/diagnostics)",
+ "markdown": "Stirling PDF can be configured in three ways, depending on your deployment and preferences.\n\n## Configuration Methods\n\n### 1. In-App Settings (Recommended)\n\nIf you have login enabled, admins can configure everything through the Settings menu in the application.\n\n**To use:**\n1. Set `SECURITY_ENABLELOGIN=true`\n2. Log in as admin\n3. Go to Settings → configure through UI\n4. Changes apply immediately, no restart needed\n\n**Best for:** Production deployments with admin users\n\n---\n\n### 2. Environment Variables\n\nConfigure via Docker environment variables or system environment variables.\n\n**To use:**\n```bash\ndocker run -d \\\n -e SECURITY_ENABLELOGIN=true \\\n -e SYSTEM_DEFAULTLOCALE=en-US \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n**Best for:** Docker deployments, infrastructure-as-code, initial setup\n\n---\n\n### 3. Settings File (settings.yml)\n\nEdit `/configs/settings.yml` directly for advanced configuration.\n\n**To use:**\n```yaml\nsecurity:\n enableLogin: true\nsystem:\n defaultLocale: en-US\n```\n\n**Best for:** Complex configurations, when you prefer file-based config\n\n---\n\n## Common Settings\n\n### Authentication\n\n**Note:** Authentication and additional features are included by default in:\n- **Docker**: All images except ultra-lite (authentication is enabled by default)\n- **JAR**: [Stirling-PDF-with-login.jar](https://files.stirlingpdf.com/Stirling-PDF-with-login.jar) **(Recommended)**\n\nThe plain [Stirling-PDF.jar](https://files.stirlingpdf.com/Stirling-PDF.jar) does not include authentication or additional features.\n\nConfigure user login:\n\n\n \n ```yaml\n security:\n enableLogin: true\n initialLogin:\n username: admin\n password: changeme123\n ```\n \n \n ```bash\n SECURITY_ENABLELOGIN=true\n SECURITY_INITIALLOGIN_USERNAME=admin\n SECURITY_INITIALLOGIN_PASSWORD=changeme123\n ```\n \n\n\nDefault credentials: `admin` / `stirling` (change immediately after first login)\n\nFor more details, see [System and Security Configuration](doc:configuration/security/system-and-security).\n\n### Language & Localization\n\n\n \n ```yaml\n ui:\n languages: [] # Available languages (empty = all enabled), e.g. [\"en_US\", \"de_DE\"]\n system:\n defaultLocale: en-US # Default language for new users\n ```\n \n \n ```bash\n UI_LANGUAGES=en_US,de_DE # Restrict available languages (omit to enable all)\n SYSTEM_DEFAULTLOCALE=en-US # Default language\n ```\n \n\n\nLeaving `defaultLocale` empty (the default) auto-detects the language from the browser and falls back to `en-US` if no preference is found.\n\n**How language selection works:**\n\nStirling PDF determines the interface language using this priority order:\n\n1. **User's manual selection** (highest priority)\n - When a user clicks the language globe icon and selects a language\n - Choice is stored in browser's localStorage (persists across sessions)\n - Storage key: `i18nextLng`\n\n2. **System default locale**\n - Set via `SYSTEM_DEFAULTLOCALE` or `system.defaultLocale`\n - When configured, it overrides the browser's detected language for users who have not made a manual selection\n\n3. **Browser's language preference**\n - Automatically detected from the browser's language setting\n - Example: Firefox set to Swedish (sv-SE) shows Swedish UI when no `defaultLocale` is configured\n\n4. **Fallback** (lowest priority)\n - `en-US` is used when none of the above resolve to an available language\n\n**Example:**\n- Config: `SYSTEM_DEFAULTLOCALE=en-US`\n- Browser: Swedish (sv-SE)\n- Result: UI shows English (US) (the configured default overrides the browser preference)\n\nIf `defaultLocale` is left empty (the default), the browser-detected language is used instead. Users can always override either choice by manually selecting a language via the language globe icon.\n\n> **Tip**: Set `SYSTEM_DEFAULTLOCALE` to your organization's primary language. Users can always override it using the language selector in the top-right corner.\n\n### File Upload Limits\n\n\n \n ```yaml\n system:\n fileUploadLimit: \"500MB\" # Number (0-999) followed by KB, MB, or GB. Empty = no limit\n spring:\n servlet:\n multipart:\n max-file-size: 2000MB\n max-request-size: 2000MB\n ```\n \n \n ```bash\n SYSTEM_MAXFILESIZE=500 # Size in MB (valid range 1-999)\n SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE=2000MB\n SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE=2000MB\n ```\n \n\n\n### Memory Management\n\n```bash\nJAVA_TOOL_OPTIONS=\"-Xms512m -Xmx4g\" # Min 512MB, Max 4GB RAM\n```\n\n---\n\n## Specialized Configuration Guides\n\nFor advanced features and specific use cases, see these detailed guides:\n\n### Authentication & Security\n\n**[Single Sign-On (SSO)](doc:configuration/security/single-sign-on-configuration)**\n- OAuth2 (Google, GitHub, Keycloak, OIDC) - Team tier\n- SAML2 (Okta, Azure AD) - Enterprise tier\n- Complete configuration examples\n\n**[System and Security](doc:configuration/security/system-and-security)**\n- Server certificates\n- JWT configuration\n\n**[Fail2Ban Integration](doc:configuration/security/fail2ban)**\n- Protect against brute-force attacks\n- Auto-ban after failed login attempts\n\n---\n\n### Features & Customization\n\n**[UI Customization](doc:configuration/customisation/ui-customisation)**\n- Branding and logos\n- Theme customization\n- Custom styling\n\n**[Endpoint/Feature Control](doc:configuration/customisation/endpoint-or-feature-customisation)**\n- Enable/disable specific tools\n- Control feature availability by user/role\n\n**[Pipeline (Automation)](doc:configuration/automation/pipeline)**\n- Automated workflows\n- Folder scanning\n- Batch processing\n- Multi-step operations\n\n---\n\n### Integration & Storage\n\n**[External Database](doc:configuration/storage/external-database)**\n- PostgreSQL configuration (Pro/Enterprise)\n- Database migration\n- Backup strategies\n\n**[Google Drive File Picker](doc:configuration/storage/google-drive-file-picker)**\n- Direct Google Drive integration\n- OAuth setup\n\n**[MCP Server](doc:configuration/automation/mcp-server)**\n- Expose Stirling PDF tools over the Model Context Protocol\n- OAuth2 or API-key authentication\n- Operation allow/deny lists\n\n**[S3 / Object Storage](doc:configuration/storage/file-sharing-and-storage)**\n- Store uploads and job artifacts in S3-compatible object storage\n- Shared storage for multi-node deployments\n\n**[Telegram Bot](doc:configuration/automation/telegram-bot)**\n- Run a Telegram bot that processes PDFs sent in chat\n\n**[OCR Configuration](doc:configuration/operations/ocr)**\n- Tesseract language packs\n- OCR optimization\n\n**[Usage Monitoring](doc:configuration/automation/usage-monitoring)**\n- Prometheus metrics (Pro/Enterprise)\n- Application monitoring\n- Performance tracking\n\n---\n\n### Performance & Scaling\n\n**[Performance Optimization & Sizing](doc:configuration/operations/performance-optimization)**\n- Resource sizing, JVM tuning, memory model, and scaling guidance\n\n**[Process Limits](doc:configuration/operations/process-limits)**\n- Session limits and timeouts for external tools\n\n**[LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)**\n- Configure multiple LibreOffice instances for faster document conversion\n- Local UNO server pool and remote UNO server endpoints\n\n---\n\n### Diagnostics & Support\n\n**[Diagnostics & Reporting Issues](doc:configuration/operations/diagnostics)**\n- Built-in diagnostics tool for Docker containers\n- How to report issues via GitHub, Discord, and email\n\n---\n\n### Other Configuration\n\n**[Folder Scanning](doc:configuration/storage/folderscanning)**\n- Watch folders for automatic processing\n\n**[Custom Signature Files](doc:configuration/security/sign-with-custom-files)**\n- Pre-loaded signatures for quick signing\n\n**[Extra Settings](doc:configuration/customisation/extra-settings)**\n- Logging configuration\n- Server settings (port, SSL/TLS)\n- Advanced Spring Boot settings\n\n---\n\n## Configuration Priority\n\nWhen the same setting is defined in multiple places, this is the order of precedence (highest to lowest):\n\n1. **Environment Variables**\n2. **settings.yml / In-App Settings**\n3. **Default values**\n\n---\n\n## Environment Variable Format\n\nConvert YAML paths to environment variables:\n\n```yaml\n# settings.yml\nsecurity:\n enableLogin: true\n```\n\nBecomes:\n```bash\nSECURITY_ENABLELOGIN=true\n```\n\n**Rules:**\n- Uppercase everything\n- Replace `.` with `_`\n- Nested properties become `PARENT_CHILD`\n\n---\n\n## Troubleshooting\n\n### Settings Not Applied\n\n1. Check configuration priority (env vars override settings.yml)\n2. Restart container after changing environment variables\n3. Check logs: `docker logs stirling-pdf | grep ERROR`\n4. Verify file permissions on `/configs` volume\n\n### Database Issues\n\nDefault database location: `/configs/stirling-pdf-DB-<schema-version>.mv.db` (the schema version is part of the filename, e.g. `/configs/stirling-pdf-DB-2.3.232.mv.db`).\n\nIf missing:\n- Ensure `/configs` volume is mounted\n- Check write permissions\n- Review startup logs\n\n---\n\n## Next Steps\n\n- **Production Deployment:** See [Production Deployment Guide](doc:server-admin-onboarding)\n- **API Usage:** See [API Documentation](doc:api)\n- **Tool Reference:** See [Functionality](doc:functionality/functionality)\n- **Troubleshooting:** See [Diagnostics & Reporting Issues](doc:configuration/operations/diagnostics)",
"sourcePath": "docs/Configuration/Configuration.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Configuration.md"
},
@@ -538,7 +538,7 @@
"title": "Performance Optimization & Sizing",
"description": "Resource sizing and scaling guidance for Stirling PDF deployments",
"section": "configuration/operations",
- "markdown": "PDF processing is memory-intensive - a single large PDF can expand to many times its file size in memory during processing. This guide helps you size your deployment correctly.\n\n---\n\n## How Stirling PDF Uses Memory\n\nStirling PDF loads PDFs into memory using a tiered strategy based on file size:\n\n| File Size | Strategy | Memory Impact |\n|---|---|---|\n| Up to 10 MB | Loaded entirely into memory | Fast, but consumes memory proportional to file size |\n| 10 MB to 50 MB | Partially in memory, remainder stored on disk | Moderate memory usage with disk spillover |\n| Over 50 MB | Fully stored on disk during processing | Minimal memory usage, but requires adequate disk space |\n\nThe application also monitors memory pressure. If available memory drops too low, all operations are forced into disk-backed mode regardless of file size.\n\n> **⚠️ Caution: Memory-Intensive Operations**\n>\n> A 50 MB PDF with complex vector graphics, embedded fonts, and many pages can expand to 200-500 MB in memory during processing. Operations that render pages (such as PDF-to-image conversion) and OCR are particularly memory-intensive. Plan for several times the maximum expected file size per concurrent operation.\n\n\n---\n\n## Resource Recommendations\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 2 cores (4+ recommended)\n- **RAM:** 4 GB\n- **Disk:** 10 GB free space\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n deploy:\n resources:\n limits:\n memory: 4G\n cpus: '2.0'\n```\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 4-8 cores\n- **RAM:** 8-16 GB\n- **Disk:** 50 GB (SSD recommended)\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n environment:\n PROCESS_EXECUTOR_SESSION_LIMIT_LIBRE_OFFICE_SESSION_LIMIT: 2\n deploy:\n resources:\n limits:\n memory: 8G\n cpus: '4.0'\n```\n\n**Consider:**\n- Increase LibreOffice session limit for faster document conversions - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n- External PostgreSQL database for reliability\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 8+ cores\n- **RAM:** 16-32 GB\n- **Disk:** 100+ GB, SSD strongly recommended\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n environment:\n PROCESS_EXECUTOR_SESSION_LIMIT_LIBRE_OFFICE_SESSION_LIMIT: 4\n PROCESS_EXECUTOR_SESSION_LIMIT_TESSERACT_SESSION_LIMIT: 2\n deploy:\n resources:\n limits:\n memory: 16G\n cpus: '8.0'\n```\n\n**Architecture considerations:**\n- Multiple instances behind a load balancer with session affinity\n- Remote UNO servers for LibreOffice scaling - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n- External PostgreSQL database (enterprise feature)\n- Shared `/configs` volume across instances for consistent settings\n\n> **💡 Tip: Server/Enterprise Recommended**\n>\n> For large organizations, **Server or Enterprise plans** provide SSO, external database support, advanced monitoring, and dedicated support.\n>\n> [Learn more](doc:server-admin-onboarding)\n\n\n\n\n\n---\n\n## Fine Tuning\n\nFor most deployments, Stirling PDF's defaults work well and no manual tuning is needed. If you are experiencing performance issues with large files or high concurrency, you can adjust the memory allocated to the application using the `JAVA_TOOL_OPTIONS` environment variable:\n\n```yaml\nservices:\n stirling-pdf:\n environment:\n JAVA_TOOL_OPTIONS: \"-Xms512m -Xmx4g\"\n```\n\n`-Xms` sets the initial memory allocation and `-Xmx` sets the maximum. If running in Docker or Kubernetes with memory limits, set the container limit to **at least 1.5x the `-Xmx` value** to leave room for background processes like LibreOffice and Tesseract.\n\n---\n\n## Resource-Intensive Operations\n\nSome operations require significantly more resources than others. If your organization primarily uses specific tools, you should size your deployment based on the most resource-heavy operations your users will perform.\n\n| Operation | CPU Impact | Memory Impact | Notes |\n|---|---|---|---|\n| Merge / Split | Low | Proportional to total file sizes | Lightweight file operations |\n| OCR (Tesseract) | Very High | High | CPU-bound image analysis |\n| File Conversion (LibreOffice) | High | High | Single-threaded per instance - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) to scale. |\n| PDF-to-Image | Moderate | Very High | Page rendering expands memory significantly |\n| PDF/A Conversion | Moderate | High | Font embedding and color profiles |\n| Compression | Moderate | High | Rewriting internal PDF structures |\n\nFor example, if your team primarily uses OCR and document conversion, you will need significantly more resources than a team that mainly merges and splits PDFs. Adjust your [Process Limits](doc:configuration/operations/process-limits) and resource allocation accordingly.\n\n---\n\n## Related\n\n- [Process Limits](doc:configuration/operations/process-limits) - Configure session limits and timeouts for all external tools\n- [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) - Scale document conversions with multiple instances\n- [Production Deployment Guide](doc:server-admin-onboarding) - Full production setup walkthrough\n- [Diagnostics](doc:configuration/operations/diagnostics) - Collect system and application diagnostics for troubleshooting",
+ "markdown": "PDF processing is memory-intensive - a single large PDF can expand to many times its file size in memory during processing. This guide helps you size your deployment correctly.\n\n---\n\n## How Stirling PDF Uses Memory\n\nStirling PDF loads PDFs into memory using a tiered strategy based on file size:\n\n| File Size | Strategy | Memory Impact |\n|---|---|---|\n| Up to 10 MB | Loaded entirely into memory | Fast, but consumes memory proportional to file size |\n| 10 MB to 50 MB | Partially in memory, remainder stored on disk | Moderate memory usage with disk spillover |\n| Over 50 MB | Fully stored on disk during processing | Minimal memory usage, but requires adequate disk space |\n\nThe application also monitors memory pressure. If available memory drops too low, all operations are forced into disk-backed mode regardless of file size.\n\n> **⚠️ Caution: Memory-Intensive Operations**\n>\n> A 50 MB PDF with complex vector graphics, embedded fonts, and many pages can expand to 200-500 MB in memory during processing. Operations that render pages (such as PDF-to-image conversion) and OCR are particularly memory-intensive. Plan for several times the maximum expected file size per concurrent operation.\n\n\n---\n\n## Resource Recommendations\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 2 cores (4+ recommended)\n- **RAM:** 4 GB\n- **Disk:** 10 GB free space\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n deploy:\n resources:\n limits:\n memory: 4G\n cpus: '2.0'\n```\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 4-8 cores\n- **RAM:** 8-16 GB\n- **Disk:** 50 GB (SSD recommended)\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n environment:\n PROCESS_EXECUTOR_SESSION_LIMIT_LIBRE_OFFICE_SESSION_LIMIT: 2\n deploy:\n resources:\n limits:\n memory: 8G\n cpus: '4.0'\n```\n\n**Consider:**\n- Increase LibreOffice session limit for faster document conversions - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n- External PostgreSQL database for reliability\n\n\n\n\n**Recommended specifications:**\n- **CPU:** 8+ cores\n- **RAM:** 16-32 GB\n- **Disk:** 100+ GB, SSD strongly recommended\n\n**Docker Compose:**\n```yaml\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n environment:\n PROCESS_EXECUTOR_SESSION_LIMIT_LIBRE_OFFICE_SESSION_LIMIT: 4\n PROCESS_EXECUTOR_SESSION_LIMIT_TESSERACT_SESSION_LIMIT: 2\n deploy:\n resources:\n limits:\n memory: 16G\n cpus: '8.0'\n```\n\n**Architecture considerations:**\n- Multiple instances behind a load balancer with session affinity\n- Remote UNO servers for LibreOffice scaling - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n- External PostgreSQL database (enterprise feature)\n- Shared `/configs` volume across instances for consistent settings\n\n> **💡 Tip: Team/Enterprise Recommended**\n>\n> For large organizations, **Team or Enterprise plans** provide SSO, external database support, advanced monitoring, and dedicated support.\n>\n> [Learn more](doc:server-admin-onboarding)\n\n\n\n\n\n---\n\n## Fine Tuning\n\nFor most deployments, Stirling PDF's defaults work well and no manual tuning is needed. If you are experiencing performance issues with large files or high concurrency, you can adjust the memory allocated to the application using the `JAVA_TOOL_OPTIONS` environment variable:\n\n```yaml\nservices:\n stirling-pdf:\n environment:\n JAVA_TOOL_OPTIONS: \"-Xms512m -Xmx4g\"\n```\n\n`-Xms` sets the initial memory allocation and `-Xmx` sets the maximum. If running in Docker or Kubernetes with memory limits, set the container limit to **at least 1.5x the `-Xmx` value** to leave room for background processes like LibreOffice and Tesseract.\n\n---\n\n## Resource-Intensive Operations\n\nSome operations require significantly more resources than others. If your organization primarily uses specific tools, you should size your deployment based on the most resource-heavy operations your users will perform.\n\n| Operation | CPU Impact | Memory Impact | Notes |\n|---|---|---|---|\n| Merge / Split | Low | Proportional to total file sizes | Lightweight file operations |\n| OCR (Tesseract) | Very High | High | CPU-bound image analysis |\n| File Conversion (LibreOffice) | High | High | Single-threaded per instance - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) to scale. |\n| PDF-to-Image | Moderate | Very High | Page rendering expands memory significantly |\n| PDF/A Conversion | Moderate | High | Font embedding and color profiles |\n| Compression | Moderate | High | Rewriting internal PDF structures |\n\nFor example, if your team primarily uses OCR and document conversion, you will need significantly more resources than a team that mainly merges and splits PDFs. Adjust your [Process Limits](doc:configuration/operations/process-limits) and resource allocation accordingly.\n\n---\n\n## Related\n\n- [Process Limits](doc:configuration/operations/process-limits) - Configure session limits and timeouts for all external tools\n- [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) - Scale document conversions with multiple instances\n- [Production Deployment Guide](doc:server-admin-onboarding) - Full production setup walkthrough\n- [Diagnostics](doc:configuration/operations/diagnostics) - Collect system and application diagnostics for troubleshooting",
"sourcePath": "docs/Configuration/Operations/Performance-Optimization.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Operations/Performance-Optimization.md"
},
@@ -570,7 +570,7 @@
"id": "configuration/security/oauth-sso-configuration",
"title": "OAuth 2.0 Single Sign-On Configuration",
"section": "configuration/security",
- "markdown": "> **Tier**: Server\n\nStirling PDF supports Single Sign-On (SSO) using OAuth 2.0 OpenID Connect (OIDC). This allows users to log in using accounts from external providers such as Google, GitHub, Keycloak, Authentik, and others.\n\n> **Looking for SAML 2.0 SSO?** See [SAML SSO Configuration](doc:configuration/security/saml-sso-configuration) (Enterprise tier).\n\n## Prerequisites\n\nBefore configuring OAuth 2.0 SSO, ensure you have:\n\n- [ ] Stirling PDF with login enabled (`security.enableLogin: true`)\n- [ ] Valid license for the Server tier or higher\n- [ ] An OAuth 2.0 provider account (Google, GitHub, Keycloak, etc.)\n- [ ] Registered OAuth application with your provider\n- [ ] OAuth Client ID and Client Secret from your provider\n- [ ] Public HTTPS URL configured with `system.backendUrl` set to your public backend API URL (often same as frontend, verify `https://your-domain.com/api/v1/info/status` is accessible)\n- [ ] Callback URL added to provider: `https://your-domain.com/login/oauth2/code/<provider>`\n\n> **Tip**: Start with `loginMethod: all` during initial setup to allow both username/password and OAuth login. This ensures you can always access the admin account if SSO configuration needs adjustment.\n\n## Setup Guide\n\n### Step 1: Configure Login Settings\n\nEnable login and set the login method to allow both standard and OAuth authentication during initial setup.\n\n\n \n ```yaml\n security:\n enableLogin: true\n loginMethod: all # Allows both username/password and OAuth login\n ```\n \n \n ```bash\n SECURITY_ENABLELOGIN=true\n SECURITY_LOGINMETHOD=all\n ```\n \n\n\n**Login Method Options:**\n- `all`: Enables all login methods (username/password + OAuth 2)\n- `normal`: Username/password only\n- `oauth2`: OAuth 2 SSO only (disables username/password login)\n- `saml2`: SAML 2 SSO only (Enterprise tier)\n\n### Step 2: Create Initial Admin Account\n\nBefore enabling OAuth, create an initial admin account using one of these methods:\n\n**Option A: Use initialLogin credentials** (recommended for first setup)\n\n\n \n ```yaml\n security:\n initialLogin:\n username: 'admin'\n password: 'yourSecurePassword123'\n ```\n \n \n ```bash\n SECURITY_INITIALLOGIN_USERNAME=admin\n SECURITY_INITIALLOGIN_PASSWORD=yourSecurePassword123\n ```\n \n\n\n**Option B: Create admin manually**\n1. Access Stirling PDF with OAuth disabled\n2. Create an admin user through the UI\n3. Then enable OAuth\n\n### Step 3: Configure OAuth Provider\n\nSet `security.oauth2.enabled` to `true` and configure your chosen provider.\n\n\n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n client:\n google:\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: email, profile\n useAsUsername: email\n provider: google\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_CLIENT_GOOGLE_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENT_GOOGLE_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_CLIENT_GOOGLE_SCOPES=email, profile\n SECURITY_OAUTH2_CLIENT_GOOGLE_USEASUSERNAME=email\n SECURITY_OAUTH2_PROVIDER=google\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n 2. Create a new project or select existing\n 3. Enable Google+ API\n 4. Create OAuth 2.0 credentials (Web application)\n 5. Add authorized redirect URI: `https://your-domain.com/login/oauth2/code/google`\n 6. Copy Client ID and Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n client:\n github:\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: read:user\n useAsUsername: login\n provider: github\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_CLIENT_GITHUB_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENT_GITHUB_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_CLIENT_GITHUB_SCOPES=read:user\n SECURITY_OAUTH2_CLIENT_GITHUB_USEASUSERNAME=login\n SECURITY_OAUTH2_PROVIDER=github\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Go to [GitHub Developer Settings](https://github.com/settings/developers)\n 2. Create new OAuth App\n 3. Set Authorization callback URL: `https://your-domain.com/login/oauth2/code/github`\n 4. Copy Client ID and generate Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: https://your-keycloak.com/realms/your-realm\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: preferred_username\n provider: keycloak\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=https://your-keycloak.com/realms/your-realm\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=preferred_username\n SECURITY_OAUTH2_PROVIDER=keycloak\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Access your Keycloak admin console\n 2. Select your realm\n 3. Create new client (OpenID Connect)\n 4. Set Valid Redirect URIs: `https://your-domain.com/login/oauth2/code/keycloak`\n 5. Enable \"Client authentication\" for confidential access\n 6. Copy Client ID and Client Secret from Credentials tab\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: https://your-authentik.com/application/o/stirling-pdf/\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: preferred_username\n provider: authentik\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=https://your-authentik.com/application/o/stirling-pdf/\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=preferred_username\n SECURITY_OAUTH2_PROVIDER=authentik\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Create new Provider (OAuth2/OpenID)\n 2. Create new Application\n 3. Set Redirect URIs: `https://your-domain.com/login/oauth2/code/authentik`\n 4. Copy Client ID and Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: <YOUR_ISSUER_URI>\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: email\n provider: <PROVIDER_NAME>\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=<YOUR_ISSUER_URI>\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=email\n SECURITY_OAUTH2_PROVIDER=<PROVIDER_NAME>\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Requirements:**\n - Provider must support OpenID Connect Discovery\n - Must expose `/.well-known/openid-configuration` endpoint\n \n\n\n### Step 4: Configure Callback URL\n\nWhen registering your application with the OAuth provider, use this callback URL format:\n\n```\nhttps://<your-domain>/login/oauth2/code/<provider>\n```\n\n**Understanding the Provider Slug:**\n\nThe `<provider>` portion of the callback URL must exactly match your `security.oauth2.provider` configuration value:\n\n```yaml\nsecurity:\n oauth2:\n provider: authentik # This becomes part of the callback URL\n```\n\nWith the above configuration, your callback URL becomes:\n```\nhttps://your-domain.com/login/oauth2/code/authentik\n```\n\n**Examples:**\n- Google: `https://stirling.example.com/login/oauth2/code/google`\n- GitHub: `https://stirling.example.com/login/oauth2/code/github`\n- Keycloak: `https://stirling.example.com/login/oauth2/code/keycloak`\n- Custom provider: `https://stirling.example.com/login/oauth2/code/mycompany`\n\n> **Important**: If the provider slug in the callback URL doesn't match your `security.oauth2.provider` value, OAuth login will fail with redirect errors.\n\n> **Tip**: For generic OIDC providers (not Google/GitHub/Keycloak), you can set `provider` to any lowercase alphanumeric value that makes sense for your organization.\n\n### Step 5: Test OAuth Login and Promote User\n\n1. Restart Stirling PDF\n2. Test OAuth login in an incognito/private browser window\n3. Verify you can log in with your OAuth provider\n4. Log in with your initial admin account (username/password)\n5. Go to **Settings** → **User Management**\n6. Find the OAuth user account (created during test login)\n7. Change role to **Admin**\n\n### Step 6: (Optional) Switch to SSO-Only Mode\n\nOnce you've verified OAuth works and promoted an OAuth user to admin, you can disable username/password login:\n\n\n \n ```yaml\n security:\n loginMethod: oauth2 # Disables username/password login\n ```\n \n \n ```bash\n SECURITY_LOGINMETHOD=oauth2\n ```\n \n\n\n> **Important**: If you set `loginMethod: oauth2` before creating an OAuth admin user, you will only be able to log in via OAuth, and all new OAuth users will have regular user permissions. Keep `loginMethod: all` until you have at least one OAuth user with admin privileges.\n\n## Configuration Reference\n\n### Required Properties\n\n| Property | Description | Example |\n|----------|-------------|---------|\n| `security.oauth2.enabled` | Enable OAuth 2 login | `true` |\n| `security.oauth2.clientId` | Client ID from your OAuth provider | `stirling-pdf-client` |\n| `security.oauth2.clientSecret` | Client Secret from your OAuth provider | `your-secret-key` |\n| `security.oauth2.provider` | Provider name | `google`, `github`, `keycloak`, `authentik` |\n\n### Optional Properties\n\n| Property | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `security.oauth2.issuer` | OIDC issuer URL (required for generic providers, must support `/.well-known/openid-configuration`) | - | `https://keycloak.example.com/realms/myrealm` |\n| `security.oauth2.autoCreateUser` | Auto-create users on first login | `true` | `false` |\n| `security.oauth2.blockRegistration` | Block new user registration, only allow pre-registered users | `false` | `true` |\n| `security.oauth2.scopes` | Space or comma-separated list of OAuth scopes | Provider-specific | `openid, profile, email` |\n| `security.oauth2.useAsUsername` | Claim to use as username (options depend on provider) | Provider-specific | `email`, `preferred_username`, `login` |\n\n### Provider-Specific Configuration\n\n**Named providers** (Google, GitHub, Keycloak):\n```yaml\noauth2:\n client:\n google: # or github, keycloak\n clientId: ...\n clientSecret: ...\n```\n\n**Generic providers** (Authentik, custom OIDC):\n```yaml\noauth2:\n issuer: <ISSUER_URI> # Must support OIDC discovery\n clientId: ...\n clientSecret: ...\n```\n\n### Username Claim Options\n\n**Google:**\n- `email`, `name`, `given_name`, `family_name`\n- See [Google OAuth Scopes](https://developers.google.com/identity/protocols/oauth2/scopes)\n\n**GitHub:**\n- `login`, `email`, `name`\n- See [GitHub OAuth Scopes](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)\n\n**Keycloak/Generic OIDC:**\n- `email`, `preferred_username`, `nickname`, `name`\n\n## Advanced Configuration\n\n### Backend URL Configuration\n\nIf your Stirling PDF backend is accessible at a different URL than the frontend, configure the backend URL:\n\n\n \n ```yaml\n system:\n backendUrl: https://stirling-api.example.com\n ```\n \n \n ```bash\n SYSTEM_BACKENDURL=https://stirling-api.example.com\n ```\n \n\n\nVerify the backend URL is correct by checking that `https://your-domain.com/api/v1/info/status` is accessible.\n\n### Auto-Login Feature\n> **Tier**: Server\n\nAutomatically redirect users to OAuth login page, bypassing the Stirling PDF login screen.\n\n\n \n ```yaml\n premium:\n proFeatures:\n ssoAutoLogin: true\n ```\n \n \n ```bash\n PREMIUM_PROFEATURES_SSOAUTOLOGIN=true\n ```\n \n\n\n**Auto-login Activation Requirements:**\n\nAuto-login only triggers when **ALL** of the following conditions are met:\n\n1. `ssoAutoLogin` is enabled (as configured above)\n2. `loginMethod` is NOT `'all'` and NOT `'normal'` (i.e., SSO-only mode required)\n3. Exactly one OAuth provider is configured\n\n**Behavior:**\n- When all conditions are met: Users are automatically redirected to OAuth provider login\n- When conditions are not met: Standard login page is displayed\n- If the SSO redirect fails, the browser stops auto-redirecting for the current session so the login page stays reachable\n- After logging out, auto-redirect is suppressed for that session so you can sign in as a different user\n\n### User Interface\n\nOnce OAuth is configured, users will see the SSO login button:\n\n| ![login-page.png](https://raw.githubusercontent.com/Stirling-Tools/Stirling-Tools.github.io/main/static/img/login-page.png) | ![sso-login-option.png](https://raw.githubusercontent.com/Stirling-Tools/Stirling-Tools.github.io/main/static/img/sso-login-option.png) |\n|----------------------------------------|---------------------------------------------------|\n\n## Troubleshooting\n\n### Common Issues\n\n**\"OAuth2 authentication error\"**\n- Verify callback URL matches exactly (including provider slug)\n- Check client ID and secret are correct\n- Ensure provider allows the configured redirect URI\n- Confirm `security.oauth2.provider` matches the provider slug in callback URL\n\n**\"Invalid issuer\"**\n- Confirm issuer URL is correct\n- Test `https://your-issuer/.well-known/openid-configuration` returns valid JSON\n- Check network connectivity from Stirling PDF container to provider\n\n**\"User not created\"**\n- Set `autoCreateUser: true`\n- Check `blockRegistration` is `false` or user is pre-registered\n- Verify license allows user count\n\n**Users redirected to wrong URL**\n- Verify `system.backendUrl` is configured correctly\n- Test that `https://your-domain.com/api/v1/info/status` is accessible\n- Check provider's registered redirect URIs match your domain\n\n### Debug Logging\n\nEnable OAuth debug logging to troubleshoot authentication issues.\n\n\n \n ```yaml\n logging:\n level:\n org.springframework.security.oauth2: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY_OAUTH2=DEBUG\n ```\n \n\n\n### Logging the Provider's Claims (\"Attribute value for email cannot be null\")\n\nIf login fails with **\"Attribute value for email cannot be null\"** (common with ADFS and Azure AD), the provider is not returning the claim named by `useAsUsername`. Enable `security.oauth2.debugLogging` to log the full ID-token / UserInfo claim set and the resolved username, so you can see exactly which claims the provider sends and pick the right `useAsUsername` value.\n\n\n \n ```yaml\n security:\n oauth2:\n debugLogging: true\n ```\n \n \n ```bash\n SECURITY_OAUTH2_DEBUGLOGGING=true\n ```\n \n\n\nThe claims are logged at `INFO` level on each login (and again at `ERROR` level when the username attribute cannot be resolved).\n\n**⚠️ Disable `debugLogging` again as soon as you are done.** It writes personally identifiable information (such as `sub`, `email`, and `name`) to the application logs.\n\n## Known Limitations\n\n- OAuth users must be manually promoted to admin role after first login\n- Provider discovery requires `/.well-known/openid-configuration` endpoint support\n- Auto-login feature requires the Server tier (or higher)\n\n## See Also\n\n- [SAML SSO Configuration](doc:configuration/security/saml-sso-configuration) - Enterprise SAML 2.0 setup\n- [System and Security](doc:configuration/security/system-and-security) - Additional security settings\n- [External Database](doc:configuration/storage/external-database) - User storage configuration",
+ "markdown": "> **Tier**: Team\n\nStirling PDF supports Single Sign-On (SSO) using OAuth 2.0 OpenID Connect (OIDC). This allows users to log in using accounts from external providers such as Google, GitHub, Keycloak, Authentik, and others.\n\n> **Looking for SAML 2.0 SSO?** See [SAML SSO Configuration](doc:configuration/security/saml-sso-configuration) (Enterprise tier).\n\n## Prerequisites\n\nBefore configuring OAuth 2.0 SSO, ensure you have:\n\n- [ ] Stirling PDF with login enabled (`security.enableLogin: true`)\n- [ ] Valid license for the Team tier or higher\n- [ ] An OAuth 2.0 provider account (Google, GitHub, Keycloak, etc.)\n- [ ] Registered OAuth application with your provider\n- [ ] OAuth Client ID and Client Secret from your provider\n- [ ] Public HTTPS URL configured with `system.backendUrl` set to your public backend API URL (often same as frontend, verify `https://your-domain.com/api/v1/info/status` is accessible)\n- [ ] Callback URL added to provider: `https://your-domain.com/login/oauth2/code/<provider>`\n\n> **Tip**: Start with `loginMethod: all` during initial setup to allow both username/password and OAuth login. This ensures you can always access the admin account if SSO configuration needs adjustment.\n\n## Setup Guide\n\n### Step 1: Configure Login Settings\n\nEnable login and set the login method to allow both standard and OAuth authentication during initial setup.\n\n\n \n ```yaml\n security:\n enableLogin: true\n loginMethod: all # Allows both username/password and OAuth login\n ```\n \n \n ```bash\n SECURITY_ENABLELOGIN=true\n SECURITY_LOGINMETHOD=all\n ```\n \n\n\n**Login Method Options:**\n- `all`: Enables all login methods (username/password + OAuth 2)\n- `normal`: Username/password only\n- `oauth2`: OAuth 2 SSO only (disables username/password login)\n- `saml2`: SAML 2 SSO only (Enterprise tier)\n\n### Step 2: Create Initial Admin Account\n\nBefore enabling OAuth, create an initial admin account using one of these methods:\n\n**Option A: Use initialLogin credentials** (recommended for first setup)\n\n\n \n ```yaml\n security:\n initialLogin:\n username: 'admin'\n password: 'yourSecurePassword123'\n ```\n \n \n ```bash\n SECURITY_INITIALLOGIN_USERNAME=admin\n SECURITY_INITIALLOGIN_PASSWORD=yourSecurePassword123\n ```\n \n\n\n**Option B: Create admin manually**\n1. Access Stirling PDF with OAuth disabled\n2. Create an admin user through the UI\n3. Then enable OAuth\n\n### Step 3: Configure OAuth Provider\n\nSet `security.oauth2.enabled` to `true` and configure your chosen provider.\n\n\n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n client:\n google:\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: email, profile\n useAsUsername: email\n provider: google\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_CLIENT_GOOGLE_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENT_GOOGLE_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_CLIENT_GOOGLE_SCOPES=email, profile\n SECURITY_OAUTH2_CLIENT_GOOGLE_USEASUSERNAME=email\n SECURITY_OAUTH2_PROVIDER=google\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n 2. Create a new project or select existing\n 3. Enable Google+ API\n 4. Create OAuth 2.0 credentials (Web application)\n 5. Add authorized redirect URI: `https://your-domain.com/login/oauth2/code/google`\n 6. Copy Client ID and Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n client:\n github:\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: read:user\n useAsUsername: login\n provider: github\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_CLIENT_GITHUB_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENT_GITHUB_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_CLIENT_GITHUB_SCOPES=read:user\n SECURITY_OAUTH2_CLIENT_GITHUB_USEASUSERNAME=login\n SECURITY_OAUTH2_PROVIDER=github\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Go to [GitHub Developer Settings](https://github.com/settings/developers)\n 2. Create new OAuth App\n 3. Set Authorization callback URL: `https://your-domain.com/login/oauth2/code/github`\n 4. Copy Client ID and generate Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: https://your-keycloak.com/realms/your-realm\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: preferred_username\n provider: keycloak\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=https://your-keycloak.com/realms/your-realm\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=preferred_username\n SECURITY_OAUTH2_PROVIDER=keycloak\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Access your Keycloak admin console\n 2. Select your realm\n 3. Create new client (OpenID Connect)\n 4. Set Valid Redirect URIs: `https://your-domain.com/login/oauth2/code/keycloak`\n 5. Enable \"Client authentication\" for confidential access\n 6. Copy Client ID and Client Secret from Credentials tab\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: https://your-authentik.com/application/o/stirling-pdf/\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: preferred_username\n provider: authentik\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=https://your-authentik.com/application/o/stirling-pdf/\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=preferred_username\n SECURITY_OAUTH2_PROVIDER=authentik\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Provider Setup:**\n 1. Create new Provider (OAuth2/OpenID)\n 2. Create new Application\n 3. Set Redirect URIs: `https://your-domain.com/login/oauth2/code/authentik`\n 4. Copy Client ID and Client Secret\n \n \n \n \n ```yaml\n security:\n oauth2:\n enabled: true\n issuer: <YOUR_ISSUER_URI>\n clientId: <YOUR_CLIENT_ID>\n clientSecret: <YOUR_CLIENT_SECRET>\n scopes: openid, profile, email\n useAsUsername: email\n provider: <PROVIDER_NAME>\n autoCreateUser: true\n blockRegistration: false\n ```\n \n \n ```bash\n SECURITY_OAUTH2_ENABLED=true\n SECURITY_OAUTH2_ISSUER=<YOUR_ISSUER_URI>\n SECURITY_OAUTH2_CLIENTID=<YOUR_CLIENT_ID>\n SECURITY_OAUTH2_CLIENTSECRET=<YOUR_CLIENT_SECRET>\n SECURITY_OAUTH2_SCOPES=openid, profile, email\n SECURITY_OAUTH2_USEASUSERNAME=email\n SECURITY_OAUTH2_PROVIDER=<PROVIDER_NAME>\n SECURITY_OAUTH2_AUTOCREATEUSER=true\n SECURITY_OAUTH2_BLOCKREGISTRATION=false\n ```\n \n \n\n **Requirements:**\n - Provider must support OpenID Connect Discovery\n - Must expose `/.well-known/openid-configuration` endpoint\n \n\n\n### Step 4: Configure Callback URL\n\nWhen registering your application with the OAuth provider, use this callback URL format:\n\n```\nhttps://<your-domain>/login/oauth2/code/<provider>\n```\n\n**Understanding the Provider Slug:**\n\nThe `<provider>` portion of the callback URL must exactly match your `security.oauth2.provider` configuration value:\n\n```yaml\nsecurity:\n oauth2:\n provider: authentik # This becomes part of the callback URL\n```\n\nWith the above configuration, your callback URL becomes:\n```\nhttps://your-domain.com/login/oauth2/code/authentik\n```\n\n**Examples:**\n- Google: `https://stirling.example.com/login/oauth2/code/google`\n- GitHub: `https://stirling.example.com/login/oauth2/code/github`\n- Keycloak: `https://stirling.example.com/login/oauth2/code/keycloak`\n- Custom provider: `https://stirling.example.com/login/oauth2/code/mycompany`\n\n> **Important**: If the provider slug in the callback URL doesn't match your `security.oauth2.provider` value, OAuth login will fail with redirect errors.\n\n> **Tip**: For generic OIDC providers (not Google/GitHub/Keycloak), you can set `provider` to any lowercase alphanumeric value that makes sense for your organization.\n\n### Step 5: Test OAuth Login and Promote User\n\n1. Restart Stirling PDF\n2. Test OAuth login in an incognito/private browser window\n3. Verify you can log in with your OAuth provider\n4. Log in with your initial admin account (username/password)\n5. Go to **Settings** → **User Management**\n6. Find the OAuth user account (created during test login)\n7. Change role to **Admin**\n\n### Step 6: (Optional) Switch to SSO-Only Mode\n\nOnce you've verified OAuth works and promoted an OAuth user to admin, you can disable username/password login:\n\n\n \n ```yaml\n security:\n loginMethod: oauth2 # Disables username/password login\n ```\n \n \n ```bash\n SECURITY_LOGINMETHOD=oauth2\n ```\n \n\n\n> **Important**: If you set `loginMethod: oauth2` before creating an OAuth admin user, you will only be able to log in via OAuth, and all new OAuth users will have regular user permissions. Keep `loginMethod: all` until you have at least one OAuth user with admin privileges.\n\n## Configuration Reference\n\n### Required Properties\n\n| Property | Description | Example |\n|----------|-------------|---------|\n| `security.oauth2.enabled` | Enable OAuth 2 login | `true` |\n| `security.oauth2.clientId` | Client ID from your OAuth provider | `stirling-pdf-client` |\n| `security.oauth2.clientSecret` | Client Secret from your OAuth provider | `your-secret-key` |\n| `security.oauth2.provider` | Provider name | `google`, `github`, `keycloak`, `authentik` |\n\n### Optional Properties\n\n| Property | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `security.oauth2.issuer` | OIDC issuer URL (required for generic providers, must support `/.well-known/openid-configuration`) | - | `https://keycloak.example.com/realms/myrealm` |\n| `security.oauth2.autoCreateUser` | Auto-create users on first login | `true` | `false` |\n| `security.oauth2.blockRegistration` | Block new user registration, only allow pre-registered users | `false` | `true` |\n| `security.oauth2.scopes` | Space or comma-separated list of OAuth scopes | Provider-specific | `openid, profile, email` |\n| `security.oauth2.useAsUsername` | Claim to use as username (options depend on provider) | Provider-specific | `email`, `preferred_username`, `login` |\n\n### Provider-Specific Configuration\n\n**Named providers** (Google, GitHub, Keycloak):\n```yaml\noauth2:\n client:\n google: # or github, keycloak\n clientId: ...\n clientSecret: ...\n```\n\n**Generic providers** (Authentik, custom OIDC):\n```yaml\noauth2:\n issuer: <ISSUER_URI> # Must support OIDC discovery\n clientId: ...\n clientSecret: ...\n```\n\n### Username Claim Options\n\n**Google:**\n- `email`, `name`, `given_name`, `family_name`\n- See [Google OAuth Scopes](https://developers.google.com/identity/protocols/oauth2/scopes)\n\n**GitHub:**\n- `login`, `email`, `name`\n- See [GitHub OAuth Scopes](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)\n\n**Keycloak/Generic OIDC:**\n- `email`, `preferred_username`, `nickname`, `name`\n\n## Advanced Configuration\n\n### Backend URL Configuration\n\nIf your Stirling PDF backend is accessible at a different URL than the frontend, configure the backend URL:\n\n\n \n ```yaml\n system:\n backendUrl: https://stirling-api.example.com\n ```\n \n \n ```bash\n SYSTEM_BACKENDURL=https://stirling-api.example.com\n ```\n \n\n\nVerify the backend URL is correct by checking that `https://your-domain.com/api/v1/info/status` is accessible.\n\n### Auto-Login Feature\n> **Tier**: Team\n\nAutomatically redirect users to OAuth login page, bypassing the Stirling PDF login screen.\n\n\n \n ```yaml\n premium:\n proFeatures:\n ssoAutoLogin: true\n ```\n \n \n ```bash\n PREMIUM_PROFEATURES_SSOAUTOLOGIN=true\n ```\n \n\n\n**Auto-login Activation Requirements:**\n\nAuto-login only triggers when **ALL** of the following conditions are met:\n\n1. `ssoAutoLogin` is enabled (as configured above)\n2. `loginMethod` is NOT `'all'` and NOT `'normal'` (i.e., SSO-only mode required)\n3. Exactly one OAuth provider is configured\n\n**Behavior:**\n- When all conditions are met: Users are automatically redirected to OAuth provider login\n- When conditions are not met: Standard login page is displayed\n- If the SSO redirect fails, the browser stops auto-redirecting for the current session so the login page stays reachable\n- After logging out, auto-redirect is suppressed for that session so you can sign in as a different user\n\n### User Interface\n\nOnce OAuth is configured, users will see the SSO login button:\n\n| ![login-page.png](https://raw.githubusercontent.com/Stirling-Tools/Stirling-Tools.github.io/main/static/img/login-page.png) | ![sso-login-option.png](https://raw.githubusercontent.com/Stirling-Tools/Stirling-Tools.github.io/main/static/img/sso-login-option.png) |\n|----------------------------------------|---------------------------------------------------|\n\n## Troubleshooting\n\n### Common Issues\n\n**\"OAuth2 authentication error\"**\n- Verify callback URL matches exactly (including provider slug)\n- Check client ID and secret are correct\n- Ensure provider allows the configured redirect URI\n- Confirm `security.oauth2.provider` matches the provider slug in callback URL\n\n**\"Invalid issuer\"**\n- Confirm issuer URL is correct\n- Test `https://your-issuer/.well-known/openid-configuration` returns valid JSON\n- Check network connectivity from Stirling PDF container to provider\n\n**\"User not created\"**\n- Set `autoCreateUser: true`\n- Check `blockRegistration` is `false` or user is pre-registered\n- Verify license allows user count\n\n**Users redirected to wrong URL**\n- Verify `system.backendUrl` is configured correctly\n- Test that `https://your-domain.com/api/v1/info/status` is accessible\n- Check provider's registered redirect URIs match your domain\n\n### Debug Logging\n\nEnable OAuth debug logging to troubleshoot authentication issues.\n\n\n \n ```yaml\n logging:\n level:\n org.springframework.security.oauth2: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY_OAUTH2=DEBUG\n ```\n \n\n\n### Logging the Provider's Claims (\"Attribute value for email cannot be null\")\n\nIf login fails with **\"Attribute value for email cannot be null\"** (common with ADFS and Azure AD), the provider is not returning the claim named by `useAsUsername`. Enable `security.oauth2.debugLogging` to log the full ID-token / UserInfo claim set and the resolved username, so you can see exactly which claims the provider sends and pick the right `useAsUsername` value.\n\n\n \n ```yaml\n security:\n oauth2:\n debugLogging: true\n ```\n \n \n ```bash\n SECURITY_OAUTH2_DEBUGLOGGING=true\n ```\n \n\n\nThe claims are logged at `INFO` level on each login (and again at `ERROR` level when the username attribute cannot be resolved).\n\n**⚠️ Disable `debugLogging` again as soon as you are done.** It writes personally identifiable information (such as `sub`, `email`, and `name`) to the application logs.\n\n## Known Limitations\n\n- OAuth users must be manually promoted to admin role after first login\n- Provider discovery requires `/.well-known/openid-configuration` endpoint support\n- Auto-login feature requires the Team tier (or higher)\n\n## See Also\n\n- [SAML SSO Configuration](doc:configuration/security/saml-sso-configuration) - Enterprise SAML 2.0 setup\n- [System and Security](doc:configuration/security/system-and-security) - Additional security settings\n- [External Database](doc:configuration/storage/external-database) - User storage configuration",
"sourcePath": "docs/Configuration/Security/OAuth SSO Configuration.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Security/OAuth SSO Configuration.md"
},
@@ -578,7 +578,7 @@
"id": "configuration/security/saml-sso-configuration",
"title": "SAML 2.0 Single Sign-On Configuration",
"section": "configuration/security",
- "markdown": "> **Tier**: Enterprise\n\nStirling PDF supports SAML 2.0 Single Sign-On for enterprise deployments. This allows integration with Identity Providers (IdP) like Okta, Azure AD, Google Workspace, OneLogin, Authentik, and others.\n\n> **Looking for OAuth 2.0 SSO?** See [OAuth SSO Configuration](doc:configuration/security/oauth-sso-configuration) (Server tier).\n\n## Prerequisites\n\nBefore starting, ensure you have:\n\n- [ ] **Enterprise license active** - SAML requires Enterprise tier\n- [ ] **Configs directory mounted** - Docker volume mounted (e.g., `./configs:/configs:ro`)\n- [ ] **Public backend URL configured** - Set `system.backendUrl` to your public backend API URL (often same as frontend, verify `https://your-domain.com/api/v1/info/status` is accessible)\n- [ ] **Reverse proxy configured** - Nginx/Traefik/Caddy with X-Forwarded-* headers forwarding\n- [ ] **Login enabled** - `security.enableLogin: true` in settings\n- [ ] **Admin account ready** - Either existing admin or plan to use `security.initialLogin` credentials\n- [ ] **IdP admin access** - Access to your SAML Identity Provider (Okta, Azure AD, etc.)\n\n> ⚠️ **License Requirement**: SAML 2.0 authentication requires an **ENTERPRISE** license. Existing users created before SAML was license-gated are grandfathered and can continue using SAML with any license tier.\n\n> 💡 **Tip**: Start with `loginMethod: all` during initial setup to allow both username/password and SAML login. This ensures you can always access the admin account if SAML configuration needs adjustment.\n\n## Setup Guide\n\nFollow these steps in order to configure SAML SSO:\n\n### Step 1: Setup Certificates\n\nSAML requires 3 certificate files for mutual trust:\n\n| Certificate | Purpose | Action |\n|-------------|---------|--------|\n| **SP Private Key** | Sign SAML requests to IdP | Generate with OpenSSL |\n| **SP Certificate** | Prove identity to IdP | Generate with OpenSSL, upload to IdP |\n| **IdP Certificate** | Verify SAML responses from IdP | Download from your IdP |\n\n#### 1a. Generate Service Provider (SP) Keypair\n\nStirling PDF needs a keypair to sign SAML requests and verify responses.\n\n> ℹ️ **If you don't have a keypair**, generate one using OpenSSL:\n>\n> ```bash\n> openssl req -newkey rsa:2048 -nodes \\\n> -keyout private_key.key \\\n> -x509 -days 365 \\\n> -out certificate.crt \\\n> -subj \"/C=US/ST=State/L=City/O=Stirling-PDF/CN=your-domain.com\"\n> ```\n>\n> **Command explanation:**\n> - `rsa:2048`: Generates 2048-bit RSA key (secure standard)\n> - `-nodes`: No passphrase (required for automated systems)\n> - `-days 365`: Certificate valid for 1 year\n> - Creates two files: `private_key.key` (private) and `certificate.crt` (public)\n\nIf you already have a keypair, ensure you have both the private key and certificate files ready.\n\n#### 1b. Download IdP Certificate\n\n1. Go to your IdP admin panel\n2. Find SAML app/provider settings\n3. Download signing certificate (PEM format)\n4. Save as `idp-certificate.pem`\n\n#### 1c. Place Certificates in Mounted Directory\n\nPlace all 3 certificates inside your mounted configs directory:\n\n```\n./configs/\n ├── private_key.key ← SP private key (keep secure!)\n ├── certificate.crt ← SP certificate (will upload to IdP)\n └── idp-certificate.pem ← IdP certificate (downloaded)\n```\n\n> ⚠️ **Critical**: Use absolute paths in configuration: `/configs/filename.pem` (no `file:` or `classpath:` prefix for Docker)\n\n### Step 2: Configure Stirling PDF\n\nConfigure SAML authentication by providing:\n- **IdP URLs and certificate** - Get these from your Identity Provider (obtained from IdP admin panel)\n- **SP certificates** - Point to the certificate files created in Step 1\n- **Backend URL** - Your public backend API URL for SAML callbacks (often same as frontend, e.g., `https://stirling.example.com`)\n- **Login settings** - Enable login and set method to `all` (allows both username/password and SAML during setup)\n\n**Key configuration options:**\n- `autoCreateUser: true` - Automatically create user accounts on first SAML login\n- `blockRegistration: false` - Allow new SAML users (set to `true` to require admin pre-approval)\n- `registrationId: stirling` - Identifier used in SAML URLs (must match across all URLs)\n\n\n \n Edit `/configs/settings.yml`:\n\n ```yaml\n security:\n enableLogin: true\n loginMethod: all # Keep 'all' during initial setup\n\n saml2:\n enabled: true\n autoCreateUser: true\n blockRegistration: false\n registrationId: stirling\n\n # Identity Provider (IdP) URLs (get from your IdP)\n idpSingleLoginUrl: https://idp.example.com/saml/login\n idpSingleLogoutUrl: https://idp.example.com/saml/logout\n idpIssuer: https://idp.example.com/entityid\n idpCert: /configs/idp-certificate.pem\n\n # Service Provider (SP) Certificates\n privateKey: /configs/private_key.key\n spCert: /configs/certificate.crt\n\n # Required for SAML callback URLs\n system:\n backendUrl: https://stirling.example.com\n ```\n \n \n Add to your `docker-compose.yml` or Docker run command:\n\n ```yaml\n environment:\n SYSTEM_BACKENDURL: https://stirling.example.com\n SECURITY_ENABLELOGIN: true\n SECURITY_LOGINMETHOD: all\n SECURITY_SAML2_ENABLED: true\n SECURITY_SAML2_AUTOCREATEUSER: true\n SECURITY_SAML2_BLOCKREGISTRATION: false\n SECURITY_SAML2_REGISTRATIONID: stirling\n SECURITY_SAML2_IDPSINGLELOGINURL: https://idp.example.com/saml/login\n SECURITY_SAML2_IDPSINGLELOGOUTURL: https://idp.example.com/saml/logout\n SECURITY_SAML2_IDPISSUER: https://idp.example.com/entityid\n SECURITY_SAML2_IDPCERT: /configs/idp-certificate.pem\n SECURITY_SAML2_PRIVATEKEY: /configs/private_key.key\n SECURITY_SAML2_SPCERT: /configs/certificate.crt\n ```\n \n\n\n> 💡 **Tip**: Replace the example URLs (`idp.example.com`) with actual values from your Identity Provider.\n\n#### Public URL for SAML SLO\n\nFor Single Logout (SLO) to work correctly in production, Stirling PDF uses your `system.backendUrl` setting to tell the Identity Provider where to send the logout response. Make sure that value is set to your public-facing URL (the same setting used for the SAML callbacks above):\n\n\n \n Set in `/configs/settings.yml`:\n\n ```yaml\n system:\n backendUrl: https://your-domain.com\n ```\n \n \n Set in your Docker Compose environment variables:\n\n ```yaml\n environment:\n SYSTEM_BACKENDURL: https://your-domain.com\n ```\n \n\n\n> ⚠️ **Important**: `system.backendUrl` must be set to your public-facing URL for SAML (including Single Logout) to work correctly in production.\n\n### Step 3: Configure Your Identity Provider\n\nProvide your IdP with these Service Provider details:\n\n**Entity ID / SP Metadata URL:**\n```\nhttps://your-domain.com/saml2/service-provider-metadata/stirling\n```\n\n**Assertion Consumer Service (ACS) URL:**\n```\nhttps://your-domain.com/login/saml2/sso/stirling\n```\n\n**Single Logout (SLO) URL:**\n```\nhttps://your-domain.com/logout\n```\n\n> 📌 **Important**: Replace `stirling` with your `registrationId` value if you changed it. The registration ID must match in all URLs.\n\n**Upload SP Certificate to IdP** (Critical Step):\n1. Open `certificate.crt` (your SP public certificate)\n2. In your IdP's SAML app configuration, find \"Verification Certificate\" or \"SP Certificate\" field\n3. Upload or paste `certificate.crt` contents\n4. Save IdP configuration\n\n> Without uploading the SP certificate, your IdP cannot verify requests from Stirling PDF.\n\n**Configure NameID and Attributes:**\n- NameID format: `email` or `unspecified`\n- Ensure at least one username attribute is sent: `username`, `emailaddress`, `name`, `upn`, or `uid`\n\n### Step 4: Test SAML Login\n\n1. Open an incognito/private browser window\n2. Navigate to `https://your-domain.com`\n3. Click \"Login via Single Sign-On\" button\n4. You'll be redirected to your IdP login page\n5. Enter your IdP credentials\n6. You'll be redirected back to Stirling PDF\n7. A new user account is automatically created (if `autoCreateUser: true`)\n\n> ⚠️ **If login fails**, check application logs for SAML errors. See [Troubleshooting](#troubleshooting) section.\n\n### Step 5: Promote SAML User to Admin\n\n1. Log in with your initial admin account (username/password)\n2. Go to **Settings** → **User Management**\n3. Find the SAML user account (created during test login)\n4. Change **Role** to **Admin**\n5. **Save**\n\n> ⚠️ **Important**: Keep at least one SAML user with admin privileges before switching to SSO-only mode.\n\n### Step 6 (Optional): Switch to SSO-Only Mode\n\nOnce you've verified SAML works and have a SAML admin user:\n\n```yaml\nsecurity:\n loginMethod: saml2 # Disables username/password login\n```\n\nRestart Stirling PDF.\n\n## Configuration Reference\n\n### Required Properties\n\n| Property | Description | Example |\n|----------|-------------|---------|\n| `security.saml2.enabled` | Enable SAML 2 authentication | `true` |\n| `security.saml2.idpSingleLoginUrl` | IdP's Single Sign-On URL | `https://idp.example.com/sso` |\n| `security.saml2.idpSingleLogoutUrl` | IdP's Single Logout URL | `https://idp.example.com/slo` |\n| `security.saml2.idpIssuer` | IdP's Entity ID / Issuer | `https://idp.example.com` |\n| `security.saml2.idpCert` | IdP's signing certificate (PEM format) | `/configs/idp-cert.pem` |\n| `security.saml2.privateKey` | Your SP private key | `/configs/private_key.key` |\n| `security.saml2.spCert` | Your SP certificate | `/configs/certificate.crt` |\n| `system.backendUrl` | Public HTTPS URL for callbacks | `https://stirling.example.com` |\n\n### Optional Properties\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `security.saml2.autoCreateUser` | `true` | Auto-create users on first SAML login |\n| `security.saml2.blockRegistration` | `false` | Block new users (only allow pre-registered) |\n| `security.saml2.registrationId` | `stirling` | Registration ID (must match ACS URL path) |\n| `security.saml2.provider` | `null` | Optional provider name for logging |\n| `security.loginMethod` | `all` | Login method: `all`, `normal`, `oauth2`, `saml2` |\n\n## Advanced Configuration\n\n### SAML Attribute Mapping\n\nStirling PDF attempts to determine the username in the following priority order:\n\n1. **`username`** attribute\n2. **`emailaddress`** attribute (or full URI: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`)\n3. **`name`** attribute (or full URI: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`)\n4. **`upn`** attribute (User Principal Name - often used in Active Directory)\n5. **`uid`** attribute (Unix user ID)\n6. **NameID** from SAML Subject (fallback if no attributes provided)\n\n**Minimum requirement:** NameID in the SAML Subject (used as fallback identifier)\n\n**Recommended:** At least one username attribute from the priority list above\n\n#### Attribute Debugging\n\nEnable debug logging to see what attributes your IdP is sending:\n\n\n \n Add to `/configs/custom_settings.yml`:\n\n ```yaml\n logging:\n level:\n stirling.software.proprietary.security.saml2: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_STIRLING_SOFTWARE_PROPRIETARY_SECURITY_SAML2=DEBUG\n ```\n \n\n\nCheck logs for:\n```\nExtracted SAML Attributes: {username=[john.doe], emailaddress=[[email protected]], ...}\n```\n\n> 💡 **Note**: Currently, Stirling PDF only uses attributes for username identification. Other attributes (first name, last name, groups, roles) are extracted but not used.\n\n### Understanding Registration ID\n\nThe `registrationId` is a critical configuration value that becomes part of your SAML URLs:\n\n```yaml\nsecurity:\n saml2:\n registrationId: stirling # Default value\n```\n\nWith `registrationId: stirling`, your URLs are:\n- Metadata: `https://your-domain.com/saml2/service-provider-metadata/stirling`\n- ACS: `https://your-domain.com/login/saml2/sso/stirling`\n\n**If you change the registration ID:**\n```yaml\nsecurity:\n saml2:\n registrationId: mycompany # Custom value\n```\n\nYour URLs become:\n- Metadata: `https://your-domain.com/saml2/service-provider-metadata/mycompany`\n- ACS: `https://your-domain.com/login/saml2/sso/mycompany`\n\n> ⚠️ **Critical**: If you change `registrationId` after configuring your IdP, you must update ALL URLs in your IdP configuration. The registration ID must match exactly in all places, or SAML login will fail.\n\n> 💡 **Recommendation**: Keep the default `stirling` value unless you have a specific reason to change it (e.g., running multiple Stirling PDF instances with the same IdP).\n\n### Auto-Login Feature\n> **Tier**: Enterprise\n\nAutomatically redirect users to SAML login, bypassing the Stirling PDF login screen:\n\n```yaml\npremium:\n proFeatures:\n ssoAutoLogin: true\n```\n\n**Auto-login Activation Requirements:**\n\nAuto-login only triggers when **ALL** of the following conditions are met:\n\n1. `ssoAutoLogin` is enabled (as configured above)\n2. `loginMethod` is NOT `'all'` and NOT `'normal'` (i.e., SSO-only mode required)\n3. Exactly one SAML provider is configured\n\n**Behavior:**\n- When all conditions are met: Users are automatically redirected to IdP\n- When conditions are not met: Standard login page is displayed\n- If a single sign-on attempt fails, the automatic redirect is suppressed for the rest of that browser session so the login page stays visible (this is separate from the `security.loginAttemptCount` account-lockout setting, which locks the user account after repeated failures)\n- Users can still manually access `/login` for form login if `loginMethod: all`\n\n## Troubleshooting\n\n### \"SAML requires Enterprise license\"\n**Cause**: SAML authentication requires Enterprise tier license.\n\n**Solution**:\n- Verify valid Enterprise license is configured\n- Check `premium.enabled=true` in settings\n- Existing users created before license enforcement are grandfathered\n\n### \"Invalid SAML response signature\"\n**Cause**: IdP certificate mismatch or incorrect format.\n\n**Solution**:\n- Verify `idpCert` file matches certificate from IdP\n- Ensure certificate is in PEM format (starts with `-----BEGIN CERTIFICATE-----`)\n- Re-download certificate from IdP\n- Check certificate hasn't expired\n\n### \"ACS URL mismatch\"\n**Cause**: Redirect URL doesn't match IdP configuration.\n\n**Solution**:\n- Verify `SYSTEM_BACKENDURL` is set to public HTTPS URL\n- Check reverse proxy sends X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Port headers\n- Ensure `registrationId` matches in both URL and configuration\n- Update ACS URL in IdP to match: `https://your-domain.com/login/saml2/sso/stirling`\n\n### \"File not found: idp-certificate.pem\"\n**Cause**: Certificate file path is incorrect.\n\n**Solution**:\n- Verify file exists at specified path\n- For Docker: ensure volume is mounted correctly\n- Use absolute paths like `/configs/filename.pem` (no `file:` prefix)\n- Check file permissions (must be readable by application)\n\n### \"Cannot auto-create user\"\n**Cause**: User doesn't exist and auto-creation is disabled.\n\n**Solution**:\n- Set `autoCreateUser: true` to allow new users\n- Or pre-create user accounts as admin\n- Check license allows additional users\n\n### \"Redirect loop after SAML login\"\n**Cause**: Session or cookie issues.\n\n**Solution**:\n- Clear browser cookies\n- Check `SYSTEM_BACKENDURL` matches actual access URL\n- Verify cookies are allowed for domain\n- Ensure SameSite cookie settings are compatible\n\n### \"Invalid username\" error\n**Cause**: No valid username found in assertion.\n\n**Solution**:\n1. Enable debug logging to see what attributes are received\n2. Ensure IdP sends at least one of: `username`, `emailaddress`, `name`, `upn`, `uid`\n3. Verify NameID is present in SAML Subject as fallback\n4. Check attribute name format (short name vs full URI)\n\n### Debug Logging\n\nEnable SAML debug logging to see detailed authentication flow:\n\n\n \n Add to `/configs/custom_settings.yml`:\n\n ```yaml\n logging:\n level:\n org.springframework.security.saml2: DEBUG\n org.opensaml: DEBUG\n stirling.software.proprietary.security: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY_SAML2=DEBUG\n LOGGING_LEVEL_ORG_OPENSAML=DEBUG\n LOGGING_LEVEL_STIRLING_SOFTWARE_PROPRIETARY_SECURITY=DEBUG\n ```\n \n\n\nCheck logs for SAML attribute information:\n```\nExtracted SAML Attributes: {username=[john.doe], emailaddress=[[email protected]], ...}\n```\n\n### Inspect SAML Assertions\n\nUse browser developer tools:\n1. Open Network tab\n2. Clear network log\n3. Attempt SAML login\n4. Look for POST to `/login/saml2/sso/stirling`\n5. Decode SAMLResponse parameter (Base64 + inflate)\n\n**Tools:**\n- [SAML-tracer](https://addons.mozilla.org/en-US/firefox/addon/saml-tracer/) (Firefox/Chrome extension)\n- [SAML Decoder](https://www.samltool.com/decode.php) (online tool)\n\n## Known Limitations\n\n### idpMetadataUri Not Auto-Populating\n\nThe `idpMetadataUri` configuration field exists but is **not currently used** to auto-populate IdP settings. You must manually configure:\n- `idpSingleLoginUrl`\n- `idpSingleLogoutUrl`\n- `idpIssuer`\n- `idpCert`\n\n**Workaround**: Manually extract values from IdP metadata XML.\n\n> 💡 **Note**: Auto-populating IdP settings from metadata URI is a planned enhancement coming soon.\n\n## See Also\n\n- [OAuth SSO Configuration](doc:configuration/security/oauth-sso-configuration) - OAuth 2.0 / OIDC setup\n- [System and Security](doc:configuration/security/system-and-security) - Additional security settings\n- [External Database](doc:configuration/storage/external-database) - User storage configuration\n- [Paid Offerings](doc:paid-offerings) - Enterprise tier and licensing information",
+ "markdown": "> **Tier**: Enterprise\n\nStirling PDF supports SAML 2.0 Single Sign-On for enterprise deployments. This allows integration with Identity Providers (IdP) like Okta, Azure AD, Google Workspace, OneLogin, Authentik, and others.\n\n> **Looking for OAuth 2.0 SSO?** See [OAuth SSO Configuration](doc:configuration/security/oauth-sso-configuration) (Team tier).\n\n## Prerequisites\n\nBefore starting, ensure you have:\n\n- [ ] **Enterprise license active** - SAML requires Enterprise tier\n- [ ] **Configs directory mounted** - Docker volume mounted (e.g., `./configs:/configs:ro`)\n- [ ] **Public backend URL configured** - Set `system.backendUrl` to your public backend API URL (often same as frontend, verify `https://your-domain.com/api/v1/info/status` is accessible)\n- [ ] **Reverse proxy configured** - Nginx/Traefik/Caddy with X-Forwarded-* headers forwarding\n- [ ] **Login enabled** - `security.enableLogin: true` in settings\n- [ ] **Admin account ready** - Either existing admin or plan to use `security.initialLogin` credentials\n- [ ] **IdP admin access** - Access to your SAML Identity Provider (Okta, Azure AD, etc.)\n\n> ⚠️ **License Requirement**: SAML 2.0 authentication requires an **ENTERPRISE** license. Existing users created before SAML was license-gated are grandfathered and can continue using SAML with any license tier.\n\n> 💡 **Tip**: Start with `loginMethod: all` during initial setup to allow both username/password and SAML login. This ensures you can always access the admin account if SAML configuration needs adjustment.\n\n## Setup Guide\n\nFollow these steps in order to configure SAML SSO:\n\n### Step 1: Setup Certificates\n\nSAML requires 3 certificate files for mutual trust:\n\n| Certificate | Purpose | Action |\n|-------------|---------|--------|\n| **SP Private Key** | Sign SAML requests to IdP | Generate with OpenSSL |\n| **SP Certificate** | Prove identity to IdP | Generate with OpenSSL, upload to IdP |\n| **IdP Certificate** | Verify SAML responses from IdP | Download from your IdP |\n\n#### 1a. Generate Service Provider (SP) Keypair\n\nStirling PDF needs a keypair to sign SAML requests and verify responses.\n\n> ℹ️ **If you don't have a keypair**, generate one using OpenSSL:\n>\n> ```bash\n> openssl req -newkey rsa:2048 -nodes \\\n> -keyout private_key.key \\\n> -x509 -days 365 \\\n> -out certificate.crt \\\n> -subj \"/C=US/ST=State/L=City/O=Stirling-PDF/CN=your-domain.com\"\n> ```\n>\n> **Command explanation:**\n> - `rsa:2048`: Generates 2048-bit RSA key (secure standard)\n> - `-nodes`: No passphrase (required for automated systems)\n> - `-days 365`: Certificate valid for 1 year\n> - Creates two files: `private_key.key` (private) and `certificate.crt` (public)\n\nIf you already have a keypair, ensure you have both the private key and certificate files ready.\n\n#### 1b. Download IdP Certificate\n\n1. Go to your IdP admin panel\n2. Find SAML app/provider settings\n3. Download signing certificate (PEM format)\n4. Save as `idp-certificate.pem`\n\n#### 1c. Place Certificates in Mounted Directory\n\nPlace all 3 certificates inside your mounted configs directory:\n\n```\n./configs/\n ├── private_key.key ← SP private key (keep secure!)\n ├── certificate.crt ← SP certificate (will upload to IdP)\n └── idp-certificate.pem ← IdP certificate (downloaded)\n```\n\n> ⚠️ **Critical**: Use absolute paths in configuration: `/configs/filename.pem` (no `file:` or `classpath:` prefix for Docker)\n\n### Step 2: Configure Stirling PDF\n\nConfigure SAML authentication by providing:\n- **IdP URLs and certificate** - Get these from your Identity Provider (obtained from IdP admin panel)\n- **SP certificates** - Point to the certificate files created in Step 1\n- **Backend URL** - Your public backend API URL for SAML callbacks (often same as frontend, e.g., `https://stirling.example.com`)\n- **Login settings** - Enable login and set method to `all` (allows both username/password and SAML during setup)\n\n**Key configuration options:**\n- `autoCreateUser: true` - Automatically create user accounts on first SAML login\n- `blockRegistration: false` - Allow new SAML users (set to `true` to require admin pre-approval)\n- `registrationId: stirling` - Identifier used in SAML URLs (must match across all URLs)\n\n\n \n Edit `/configs/settings.yml`:\n\n ```yaml\n security:\n enableLogin: true\n loginMethod: all # Keep 'all' during initial setup\n\n saml2:\n enabled: true\n autoCreateUser: true\n blockRegistration: false\n registrationId: stirling\n\n # Identity Provider (IdP) URLs (get from your IdP)\n idpSingleLoginUrl: https://idp.example.com/saml/login\n idpSingleLogoutUrl: https://idp.example.com/saml/logout\n idpIssuer: https://idp.example.com/entityid\n idpCert: /configs/idp-certificate.pem\n\n # Service Provider (SP) Certificates\n privateKey: /configs/private_key.key\n spCert: /configs/certificate.crt\n\n # Required for SAML callback URLs\n system:\n backendUrl: https://stirling.example.com\n ```\n \n \n Add to your `docker-compose.yml` or Docker run command:\n\n ```yaml\n environment:\n SYSTEM_BACKENDURL: https://stirling.example.com\n SECURITY_ENABLELOGIN: true\n SECURITY_LOGINMETHOD: all\n SECURITY_SAML2_ENABLED: true\n SECURITY_SAML2_AUTOCREATEUSER: true\n SECURITY_SAML2_BLOCKREGISTRATION: false\n SECURITY_SAML2_REGISTRATIONID: stirling\n SECURITY_SAML2_IDPSINGLELOGINURL: https://idp.example.com/saml/login\n SECURITY_SAML2_IDPSINGLELOGOUTURL: https://idp.example.com/saml/logout\n SECURITY_SAML2_IDPISSUER: https://idp.example.com/entityid\n SECURITY_SAML2_IDPCERT: /configs/idp-certificate.pem\n SECURITY_SAML2_PRIVATEKEY: /configs/private_key.key\n SECURITY_SAML2_SPCERT: /configs/certificate.crt\n ```\n \n\n\n> 💡 **Tip**: Replace the example URLs (`idp.example.com`) with actual values from your Identity Provider.\n\n#### Public URL for SAML SLO\n\nFor Single Logout (SLO) to work correctly in production, Stirling PDF uses your `system.backendUrl` setting to tell the Identity Provider where to send the logout response. Make sure that value is set to your public-facing URL (the same setting used for the SAML callbacks above):\n\n\n \n Set in `/configs/settings.yml`:\n\n ```yaml\n system:\n backendUrl: https://your-domain.com\n ```\n \n \n Set in your Docker Compose environment variables:\n\n ```yaml\n environment:\n SYSTEM_BACKENDURL: https://your-domain.com\n ```\n \n\n\n> ⚠️ **Important**: `system.backendUrl` must be set to your public-facing URL for SAML (including Single Logout) to work correctly in production.\n\n### Step 3: Configure Your Identity Provider\n\nProvide your IdP with these Service Provider details:\n\n**Entity ID / SP Metadata URL:**\n```\nhttps://your-domain.com/saml2/service-provider-metadata/stirling\n```\n\n**Assertion Consumer Service (ACS) URL:**\n```\nhttps://your-domain.com/login/saml2/sso/stirling\n```\n\n**Single Logout (SLO) URL:**\n```\nhttps://your-domain.com/logout\n```\n\n> 📌 **Important**: Replace `stirling` with your `registrationId` value if you changed it. The registration ID must match in all URLs.\n\n**Upload SP Certificate to IdP** (Critical Step):\n1. Open `certificate.crt` (your SP public certificate)\n2. In your IdP's SAML app configuration, find \"Verification Certificate\" or \"SP Certificate\" field\n3. Upload or paste `certificate.crt` contents\n4. Save IdP configuration\n\n> Without uploading the SP certificate, your IdP cannot verify requests from Stirling PDF.\n\n**Configure NameID and Attributes:**\n- NameID format: `email` or `unspecified`\n- Ensure at least one username attribute is sent: `username`, `emailaddress`, `name`, `upn`, or `uid`\n\n### Step 4: Test SAML Login\n\n1. Open an incognito/private browser window\n2. Navigate to `https://your-domain.com`\n3. Click \"Login via Single Sign-On\" button\n4. You'll be redirected to your IdP login page\n5. Enter your IdP credentials\n6. You'll be redirected back to Stirling PDF\n7. A new user account is automatically created (if `autoCreateUser: true`)\n\n> ⚠️ **If login fails**, check application logs for SAML errors. See [Troubleshooting](#troubleshooting) section.\n\n### Step 5: Promote SAML User to Admin\n\n1. Log in with your initial admin account (username/password)\n2. Go to **Settings** → **User Management**\n3. Find the SAML user account (created during test login)\n4. Change **Role** to **Admin**\n5. **Save**\n\n> ⚠️ **Important**: Keep at least one SAML user with admin privileges before switching to SSO-only mode.\n\n### Step 6 (Optional): Switch to SSO-Only Mode\n\nOnce you've verified SAML works and have a SAML admin user:\n\n```yaml\nsecurity:\n loginMethod: saml2 # Disables username/password login\n```\n\nRestart Stirling PDF.\n\n## Configuration Reference\n\n### Required Properties\n\n| Property | Description | Example |\n|----------|-------------|---------|\n| `security.saml2.enabled` | Enable SAML 2 authentication | `true` |\n| `security.saml2.idpSingleLoginUrl` | IdP's Single Sign-On URL | `https://idp.example.com/sso` |\n| `security.saml2.idpSingleLogoutUrl` | IdP's Single Logout URL | `https://idp.example.com/slo` |\n| `security.saml2.idpIssuer` | IdP's Entity ID / Issuer | `https://idp.example.com` |\n| `security.saml2.idpCert` | IdP's signing certificate (PEM format) | `/configs/idp-cert.pem` |\n| `security.saml2.privateKey` | Your SP private key | `/configs/private_key.key` |\n| `security.saml2.spCert` | Your SP certificate | `/configs/certificate.crt` |\n| `system.backendUrl` | Public HTTPS URL for callbacks | `https://stirling.example.com` |\n\n### Optional Properties\n\n| Property | Default | Description |\n|----------|---------|-------------|\n| `security.saml2.autoCreateUser` | `true` | Auto-create users on first SAML login |\n| `security.saml2.blockRegistration` | `false` | Block new users (only allow pre-registered) |\n| `security.saml2.registrationId` | `stirling` | Registration ID (must match ACS URL path) |\n| `security.saml2.provider` | `null` | Optional provider name for logging |\n| `security.loginMethod` | `all` | Login method: `all`, `normal`, `oauth2`, `saml2` |\n\n## Advanced Configuration\n\n### SAML Attribute Mapping\n\nStirling PDF attempts to determine the username in the following priority order:\n\n1. **`username`** attribute\n2. **`emailaddress`** attribute (or full URI: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`)\n3. **`name`** attribute (or full URI: `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`)\n4. **`upn`** attribute (User Principal Name - often used in Active Directory)\n5. **`uid`** attribute (Unix user ID)\n6. **NameID** from SAML Subject (fallback if no attributes provided)\n\n**Minimum requirement:** NameID in the SAML Subject (used as fallback identifier)\n\n**Recommended:** At least one username attribute from the priority list above\n\n#### Attribute Debugging\n\nEnable debug logging to see what attributes your IdP is sending:\n\n\n \n Add to `/configs/custom_settings.yml`:\n\n ```yaml\n logging:\n level:\n stirling.software.proprietary.security.saml2: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_STIRLING_SOFTWARE_PROPRIETARY_SECURITY_SAML2=DEBUG\n ```\n \n\n\nCheck logs for:\n```\nExtracted SAML Attributes: {username=[john.doe], emailaddress=[[email protected]], ...}\n```\n\n> 💡 **Note**: Currently, Stirling PDF only uses attributes for username identification. Other attributes (first name, last name, groups, roles) are extracted but not used.\n\n### Understanding Registration ID\n\nThe `registrationId` is a critical configuration value that becomes part of your SAML URLs:\n\n```yaml\nsecurity:\n saml2:\n registrationId: stirling # Default value\n```\n\nWith `registrationId: stirling`, your URLs are:\n- Metadata: `https://your-domain.com/saml2/service-provider-metadata/stirling`\n- ACS: `https://your-domain.com/login/saml2/sso/stirling`\n\n**If you change the registration ID:**\n```yaml\nsecurity:\n saml2:\n registrationId: mycompany # Custom value\n```\n\nYour URLs become:\n- Metadata: `https://your-domain.com/saml2/service-provider-metadata/mycompany`\n- ACS: `https://your-domain.com/login/saml2/sso/mycompany`\n\n> ⚠️ **Critical**: If you change `registrationId` after configuring your IdP, you must update ALL URLs in your IdP configuration. The registration ID must match exactly in all places, or SAML login will fail.\n\n> 💡 **Recommendation**: Keep the default `stirling` value unless you have a specific reason to change it (e.g., running multiple Stirling PDF instances with the same IdP).\n\n### Auto-Login Feature\n> **Tier**: Enterprise\n\nAutomatically redirect users to SAML login, bypassing the Stirling PDF login screen:\n\n```yaml\npremium:\n proFeatures:\n ssoAutoLogin: true\n```\n\n**Auto-login Activation Requirements:**\n\nAuto-login only triggers when **ALL** of the following conditions are met:\n\n1. `ssoAutoLogin` is enabled (as configured above)\n2. `loginMethod` is NOT `'all'` and NOT `'normal'` (i.e., SSO-only mode required)\n3. Exactly one SAML provider is configured\n\n**Behavior:**\n- When all conditions are met: Users are automatically redirected to IdP\n- When conditions are not met: Standard login page is displayed\n- If a single sign-on attempt fails, the automatic redirect is suppressed for the rest of that browser session so the login page stays visible (this is separate from the `security.loginAttemptCount` account-lockout setting, which locks the user account after repeated failures)\n- Users can still manually access `/login` for form login if `loginMethod: all`\n\n## Troubleshooting\n\n### \"SAML requires Enterprise license\"\n**Cause**: SAML authentication requires Enterprise tier license.\n\n**Solution**:\n- Verify valid Enterprise license is configured\n- Check `premium.enabled=true` in settings\n- Existing users created before license enforcement are grandfathered\n\n### \"Invalid SAML response signature\"\n**Cause**: IdP certificate mismatch or incorrect format.\n\n**Solution**:\n- Verify `idpCert` file matches certificate from IdP\n- Ensure certificate is in PEM format (starts with `-----BEGIN CERTIFICATE-----`)\n- Re-download certificate from IdP\n- Check certificate hasn't expired\n\n### \"ACS URL mismatch\"\n**Cause**: Redirect URL doesn't match IdP configuration.\n\n**Solution**:\n- Verify `SYSTEM_BACKENDURL` is set to public HTTPS URL\n- Check reverse proxy sends X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Port headers\n- Ensure `registrationId` matches in both URL and configuration\n- Update ACS URL in IdP to match: `https://your-domain.com/login/saml2/sso/stirling`\n\n### \"File not found: idp-certificate.pem\"\n**Cause**: Certificate file path is incorrect.\n\n**Solution**:\n- Verify file exists at specified path\n- For Docker: ensure volume is mounted correctly\n- Use absolute paths like `/configs/filename.pem` (no `file:` prefix)\n- Check file permissions (must be readable by application)\n\n### \"Cannot auto-create user\"\n**Cause**: User doesn't exist and auto-creation is disabled.\n\n**Solution**:\n- Set `autoCreateUser: true` to allow new users\n- Or pre-create user accounts as admin\n- Check license allows additional users\n\n### \"Redirect loop after SAML login\"\n**Cause**: Session or cookie issues.\n\n**Solution**:\n- Clear browser cookies\n- Check `SYSTEM_BACKENDURL` matches actual access URL\n- Verify cookies are allowed for domain\n- Ensure SameSite cookie settings are compatible\n\n### \"Invalid username\" error\n**Cause**: No valid username found in assertion.\n\n**Solution**:\n1. Enable debug logging to see what attributes are received\n2. Ensure IdP sends at least one of: `username`, `emailaddress`, `name`, `upn`, `uid`\n3. Verify NameID is present in SAML Subject as fallback\n4. Check attribute name format (short name vs full URI)\n\n### Debug Logging\n\nEnable SAML debug logging to see detailed authentication flow:\n\n\n \n Add to `/configs/custom_settings.yml`:\n\n ```yaml\n logging:\n level:\n org.springframework.security.saml2: DEBUG\n org.opensaml: DEBUG\n stirling.software.proprietary.security: DEBUG\n ```\n \n \n ```bash\n LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY_SAML2=DEBUG\n LOGGING_LEVEL_ORG_OPENSAML=DEBUG\n LOGGING_LEVEL_STIRLING_SOFTWARE_PROPRIETARY_SECURITY=DEBUG\n ```\n \n\n\nCheck logs for SAML attribute information:\n```\nExtracted SAML Attributes: {username=[john.doe], emailaddress=[[email protected]], ...}\n```\n\n### Inspect SAML Assertions\n\nUse browser developer tools:\n1. Open Network tab\n2. Clear network log\n3. Attempt SAML login\n4. Look for POST to `/login/saml2/sso/stirling`\n5. Decode SAMLResponse parameter (Base64 + inflate)\n\n**Tools:**\n- [SAML-tracer](https://addons.mozilla.org/en-US/firefox/addon/saml-tracer/) (Firefox/Chrome extension)\n- [SAML Decoder](https://www.samltool.com/decode.php) (online tool)\n\n## Known Limitations\n\n### idpMetadataUri Not Auto-Populating\n\nThe `idpMetadataUri` configuration field exists but is **not currently used** to auto-populate IdP settings. You must manually configure:\n- `idpSingleLoginUrl`\n- `idpSingleLogoutUrl`\n- `idpIssuer`\n- `idpCert`\n\n**Workaround**: Manually extract values from IdP metadata XML.\n\n> 💡 **Note**: Auto-populating IdP settings from metadata URI is a planned enhancement coming soon.\n\n## See Also\n\n- [OAuth SSO Configuration](doc:configuration/security/oauth-sso-configuration) - OAuth 2.0 / OIDC setup\n- [System and Security](doc:configuration/security/system-and-security) - Additional security settings\n- [External Database](doc:configuration/storage/external-database) - User storage configuration\n- [Paid Offerings](doc:paid-offerings) - Enterprise tier and licensing information",
"sourcePath": "docs/Configuration/Security/SAML SSO Configuration.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Security/SAML SSO Configuration.md"
},
@@ -602,7 +602,7 @@
"id": "configuration/security/single-sign-on-configuration",
"title": "Single Sign-On (SSO) Overview",
"section": "configuration/security",
- "markdown": "Stirling PDF supports Single Sign-On (SSO) authentication through two protocols:\n\n## OAuth 2.0 / OpenID Connect (OIDC)\n> **Tier**: Server\n\nOAuth 2.0 SSO allows login via popular identity providers like:\n- Google\n- GitHub\n- Keycloak\n- Authentik\n- Any OIDC-compliant provider\n\n**[→ Configure OAuth 2.0 SSO](doc:configuration/security/oauth-sso-configuration)**\n\n**Key Features:**\n- Easy setup with major providers\n- Auto-discovery via `.well-known/openid-configuration`\n- Social login support\n- Suitable for small to medium organizations\n\n---\n\n## SAML 2.0\n> **Tier**: Enterprise\n\nSAML 2.0 SSO provides enterprise-grade authentication with:\n- Okta\n- Azure AD (Entra ID)\n- Google Workspace\n- OneLogin\n- Any SAML 2.0-compliant IdP\n\n**[→ Configure SAML 2.0 SSO](doc:configuration/security/saml-sso-configuration)**\n\n**Key Features:**\n- Enterprise identity provider integration\n- Advanced security controls\n- Single Logout (SLO) support\n- Suitable for large organizations",
+ "markdown": "Stirling PDF supports Single Sign-On (SSO) authentication through two protocols:\n\n## OAuth 2.0 / OpenID Connect (OIDC)\n> **Tier**: Team\n\nOAuth 2.0 SSO allows login via popular identity providers like:\n- Google\n- GitHub\n- Keycloak\n- Authentik\n- Any OIDC-compliant provider\n\n**[→ Configure OAuth 2.0 SSO](doc:configuration/security/oauth-sso-configuration)**\n\n**Key Features:**\n- Easy setup with major providers\n- Auto-discovery via `.well-known/openid-configuration`\n- Social login support\n- Suitable for small to medium organizations\n\n---\n\n## SAML 2.0\n> **Tier**: Enterprise\n\nSAML 2.0 SSO provides enterprise-grade authentication with:\n- Okta\n- Azure AD (Entra ID)\n- Google Workspace\n- OneLogin\n- Any SAML 2.0-compliant IdP\n\n**[→ Configure SAML 2.0 SSO](doc:configuration/security/saml-sso-configuration)**\n\n**Key Features:**\n- Enterprise identity provider integration\n- Advanced security controls\n- Single Logout (SLO) support\n- Suitable for large organizations",
"sourcePath": "docs/Configuration/Security/Single Sign-On Configuration.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Security/Single Sign-On Configuration.md"
},
@@ -618,7 +618,7 @@
"id": "configuration/storage/database",
"title": "Database Backups",
"section": "configuration/storage",
- "markdown": "> **Tier**: Server\n\n## Functionality Overview\n\nThe newly introduced feature enhances the application with robust database backup and import capabilities. This feature is designed to ensure data integrity and provide a straightforward way to manage database backups. Here's how it works:\n\n1. Automatic Backup Creation\n - The system automatically creates a database backup every day at midnight. This ensures that there is always a recent backup available, minimizing the risk of data loss.\n2. Manual Backup Export\n - Admin actions that modify the user database trigger a manual export of the database. This keeps the backup up-to-date with the latest changes and provides an extra layer of data security.\n3. Importing Database Backups\n - Admin users can import a database backup either via the web interface or API endpoints. This allows for easy restoration of the database to a previous state in case of data corruption or other issues.\n - The import process ensures that the database structure and data are correctly restored, maintaining the integrity of the application.\n4. Managing Backup Files\n - Admins can view a list of all existing backup files, along with their creation dates and sizes. This helps in managing storage and identifying the most recent or relevant backups.\n - Backup files can be downloaded for offline storage or transferred to other environments, providing flexibility in database management.\n - Unnecessary backup files can be deleted through the interface to free up storage space and maintain an organized backup directory.\n\n## User Interface\n\n### Web Interface\n\n1. Upload SQL files to import database backups.\n2. View details of existing backups, such as file names, creation dates, and sizes.\n3. Download backup files for offline storage.\n4. Delete outdated or unnecessary backup files.\n\n### API Endpoints\n\n1. Import database backups by uploading SQL files.\n2. Download backup files.\n3. Delete backup files.\n\nThis new functionality streamlines database management, ensuring that backups are always available and easy to manage, thus improving the reliability and resilience of the application.",
+ "markdown": "> **Tier**: Team\n\n## Functionality Overview\n\nThe newly introduced feature enhances the application with robust database backup and import capabilities. This feature is designed to ensure data integrity and provide a straightforward way to manage database backups. Here's how it works:\n\n1. Automatic Backup Creation\n - The system automatically creates a database backup every day at midnight. This ensures that there is always a recent backup available, minimizing the risk of data loss.\n2. Manual Backup Export\n - Admin actions that modify the user database trigger a manual export of the database. This keeps the backup up-to-date with the latest changes and provides an extra layer of data security.\n3. Importing Database Backups\n - Admin users can import a database backup either via the web interface or API endpoints. This allows for easy restoration of the database to a previous state in case of data corruption or other issues.\n - The import process ensures that the database structure and data are correctly restored, maintaining the integrity of the application.\n4. Managing Backup Files\n - Admins can view a list of all existing backup files, along with their creation dates and sizes. This helps in managing storage and identifying the most recent or relevant backups.\n - Backup files can be downloaded for offline storage or transferred to other environments, providing flexibility in database management.\n - Unnecessary backup files can be deleted through the interface to free up storage space and maintain an organized backup directory.\n\n## User Interface\n\n### Web Interface\n\n1. Upload SQL files to import database backups.\n2. View details of existing backups, such as file names, creation dates, and sizes.\n3. Download backup files for offline storage.\n4. Delete outdated or unnecessary backup files.\n\n### API Endpoints\n\n1. Import database backups by uploading SQL files.\n2. Download backup files.\n3. Delete backup files.\n\nThis new functionality streamlines database management, ensuring that backups are always available and easy to manage, thus improving the reliability and resilience of the application.",
"sourcePath": "docs/Configuration/Storage/DATABASE.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Storage/DATABASE.md"
},
@@ -626,7 +626,7 @@
"id": "configuration/storage/external-database",
"title": "External Database",
"section": "configuration/storage",
- "markdown": "## Using an External Database\n> **Tier**: Server\n\nIt is possible to use your own external database with Stirling PDF rather than the default H2 database if you wish.\nPostgreSQL is currently the only supported variant, others will be added on request.\n\n### Setting Up External Database Configuration\nYou can configure the new `Datasource` property in your `settings.yml` to connect to your external database:\n\n> **⚠️ Warning: Note**\n>\n> To use the external database feature, you will need to have a valid enterprise license and set the environment variable `DISABLE_ADDITIONAL_FEATURES` to `false`.\n\n\n\n \n\n```yaml\n datasource:\n enableCustomDatabase: false\n customDatabaseUrl: jdbc:postgresql://localhost:5432/postgres\n username: postgres\n password: postgres\n type: postgresql\n hostName: localhost\n port: 5432\n name: postgres\n```\n\n- `enableCustomDatabase`: Set this property to `true` to enable use of the custom database **Note: An enterprise license to use this feature**\n- `customDatabaseUrl`: Enter the database connection url for the database here. **Note: If you set the `customDatabaseUrl` you do not need to set the type, hostName, port and name, they will all be automatically derived from the url.**\n- `username`: The username for the database\n- `password`: The password for the database\n\nIf you would like more fine-grained control of the database connection, you can also use the following properties:\n\n#### Fine-grained Database Configuration\n- `type`: The database type. Available options are `h2` and `postgresql`\n- `hostName`: The host name of the database connection url (e.g. 'localhost')\n- `port`: The port number of the database connection url (e.g. 8080)\n- `name`: The name of the custom database. This should match the name you have set for your database\n\n\n \n\n```yaml\nservices:\n db:\n image: 'postgres:17.2-alpine'\n container_name: db\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_DB: \"stirling_pdf\"\n POSTGRES_USER: \"admin\"\n POSTGRES_PASSWORD: \"stirling\"\n```\n\n- `container_name`: This is the name of your database container. This should match the name of the container under `services` as this is what Docker will use to refer to your database\n- `ports`: Specify the port number for your database. The number on the left is the port number the container will access the database internally. The number on the right is the port number the Stirling PDF app will use to connect to the database externally. Ensure this matches the port number in the connection url for your database otherwise the app will not be able to access it.\n- `POSTGRES_DB`: An environment variable for the database container. Specify the name of the custom database here\n- `POSTGRES_USER`: An environment variable for the database container. Specify the username for the database\n- `POSTGRES_PASSWORD`: An environment variable for the database container. Specify the password for the database\n\nYou will also need to update the Docker configuration in your app in order to connect to the database:\n\n```yaml\nservices:\n stirling-pdf:\n depends_on:\n - db\n environment:\n DISABLE_ADDITIONAL_FEATURES: \"false\" \"true\"\n SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: \"true\"\n SYSTEM_DATASOURCE_CUSTOMDATABASEURL: \"jdbc:postgresql://db:5432/stirling_pdf\"\n SYSTEM_DATASOURCE_USERNAME: \"admin\"\n SYSTEM_DATASOURCE_PASSWORD: \"stirling\"\n # further configuration\n```\n\n- `depends_on`: This specifies any services that your app will need in order to run. Ensure the name matches the container name for your database\n- `DISABLE_ADDITIONAL_FEATURES`: Set this to `false` to enable security features\n- `SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE`: An environment variable to connect to the database container. Set this to `true` to enable use of the external database\n- `SYSTEM_DATASOURCE_CUSTOMDATABASEURL`: An environment variable to connect to the database container. Set the connection url for the database here. **Note: If you set this url you do not need to set the type, hostName, port and name (namely `SYSTEM_DATASOURCE_TYPE`, `SYSTEM_DATASOURCE_HOSTNAME`, `SYSTEM_DATASOURCE_PORT`, `SYSTEM_DATASOURCE_NAME`), they will all be automatically derived from the url.**\n- `SYSTEM_DATASOURCE_USERNAME`: An environment variable to connect to the database container. Set the username for the database. Ensure this matches the corresponding property in your database container\n- `SYSTEM_DATASOURCE_PASSWORD`: An environment variable to connect to the database container. Set the password for the database. Ensure this matches the corresponding property in your database container\n\nBelow is an example of what your configuration should look like after configuring the custom database:\n\n```yaml\nservices:\n stirling-pdf:\n depends_on:\n - db\n environment:\n DISABLE_ADDITIONAL_FEATURES: \"false\" \"true\"\n SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: \"true\"\n SYSTEM_DATASOURCE_CUSTOMDATABASEURL: \"jdbc:postgresql://db:5432/stirling_pdf\"\n SYSTEM_DATASOURCE_USERNAME: \"admin\"\n SYSTEM_DATASOURCE_PASSWORD: \"stirling\"\n # further configuration\n\n db:\n image: 'postgres:17.2-alpine'\n container_name: db\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_DB: \"stirling_pdf\"\n POSTGRES_USER: \"admin\"\n POSTGRES_PASSWORD: \"stirling\"\n```\n\n \n\n\n*Example configuration can be found in [exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml](https://github.com/Stirling-Tools/Stirling-PDF/blob/428b4238e3a7280d71697d994a66174a250387a7/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml)*",
+ "markdown": "## Using an External Database\n> **Tier**: Team\n\nIt is possible to use your own external database with Stirling PDF rather than the default H2 database if you wish.\nPostgreSQL is currently the only supported variant, others will be added on request.\n\n### Setting Up External Database Configuration\nYou can configure the new `Datasource` property in your `settings.yml` to connect to your external database:\n\n> **⚠️ Warning: Note**\n>\n> To use the external database feature, you will need to have a valid enterprise license and set the environment variable `DISABLE_ADDITIONAL_FEATURES` to `false`.\n\n\n\n \n\n```yaml\n datasource:\n enableCustomDatabase: false\n customDatabaseUrl: jdbc:postgresql://localhost:5432/postgres\n username: postgres\n password: postgres\n type: postgresql\n hostName: localhost\n port: 5432\n name: postgres\n```\n\n- `enableCustomDatabase`: Set this property to `true` to enable use of the custom database **Note: An enterprise license to use this feature**\n- `customDatabaseUrl`: Enter the database connection url for the database here. **Note: If you set the `customDatabaseUrl` you do not need to set the type, hostName, port and name, they will all be automatically derived from the url.**\n- `username`: The username for the database\n- `password`: The password for the database\n\nIf you would like more fine-grained control of the database connection, you can also use the following properties:\n\n#### Fine-grained Database Configuration\n- `type`: The database type. Available options are `h2` and `postgresql`\n- `hostName`: The host name of the database connection url (e.g. 'localhost')\n- `port`: The port number of the database connection url (e.g. 8080)\n- `name`: The name of the custom database. This should match the name you have set for your database\n\n\n \n\n```yaml\nservices:\n db:\n image: 'postgres:17.2-alpine'\n container_name: db\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_DB: \"stirling_pdf\"\n POSTGRES_USER: \"admin\"\n POSTGRES_PASSWORD: \"stirling\"\n```\n\n- `container_name`: This is the name of your database container. This should match the name of the container under `services` as this is what Docker will use to refer to your database\n- `ports`: Specify the port number for your database. The number on the left is the port number the container will access the database internally. The number on the right is the port number the Stirling PDF app will use to connect to the database externally. Ensure this matches the port number in the connection url for your database otherwise the app will not be able to access it.\n- `POSTGRES_DB`: An environment variable for the database container. Specify the name of the custom database here\n- `POSTGRES_USER`: An environment variable for the database container. Specify the username for the database\n- `POSTGRES_PASSWORD`: An environment variable for the database container. Specify the password for the database\n\nYou will also need to update the Docker configuration in your app in order to connect to the database:\n\n```yaml\nservices:\n stirling-pdf:\n depends_on:\n - db\n environment:\n DISABLE_ADDITIONAL_FEATURES: \"false\" \"true\"\n SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: \"true\"\n SYSTEM_DATASOURCE_CUSTOMDATABASEURL: \"jdbc:postgresql://db:5432/stirling_pdf\"\n SYSTEM_DATASOURCE_USERNAME: \"admin\"\n SYSTEM_DATASOURCE_PASSWORD: \"stirling\"\n # further configuration\n```\n\n- `depends_on`: This specifies any services that your app will need in order to run. Ensure the name matches the container name for your database\n- `DISABLE_ADDITIONAL_FEATURES`: Set this to `false` to enable security features\n- `SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE`: An environment variable to connect to the database container. Set this to `true` to enable use of the external database\n- `SYSTEM_DATASOURCE_CUSTOMDATABASEURL`: An environment variable to connect to the database container. Set the connection url for the database here. **Note: If you set this url you do not need to set the type, hostName, port and name (namely `SYSTEM_DATASOURCE_TYPE`, `SYSTEM_DATASOURCE_HOSTNAME`, `SYSTEM_DATASOURCE_PORT`, `SYSTEM_DATASOURCE_NAME`), they will all be automatically derived from the url.**\n- `SYSTEM_DATASOURCE_USERNAME`: An environment variable to connect to the database container. Set the username for the database. Ensure this matches the corresponding property in your database container\n- `SYSTEM_DATASOURCE_PASSWORD`: An environment variable to connect to the database container. Set the password for the database. Ensure this matches the corresponding property in your database container\n\nBelow is an example of what your configuration should look like after configuring the custom database:\n\n```yaml\nservices:\n stirling-pdf:\n depends_on:\n - db\n environment:\n DISABLE_ADDITIONAL_FEATURES: \"false\" \"true\"\n SYSTEM_DATASOURCE_ENABLECUSTOMDATABASE: \"true\"\n SYSTEM_DATASOURCE_CUSTOMDATABASEURL: \"jdbc:postgresql://db:5432/stirling_pdf\"\n SYSTEM_DATASOURCE_USERNAME: \"admin\"\n SYSTEM_DATASOURCE_PASSWORD: \"stirling\"\n # further configuration\n\n db:\n image: 'postgres:17.2-alpine'\n container_name: db\n ports:\n - \"5432:5432\"\n environment:\n POSTGRES_DB: \"stirling_pdf\"\n POSTGRES_USER: \"admin\"\n POSTGRES_PASSWORD: \"stirling\"\n```\n\n \n\n\n*Example configuration can be found in [exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml](https://github.com/Stirling-Tools/Stirling-PDF/blob/428b4238e3a7280d71697d994a66174a250387a7/exampleYmlFiles/docker-compose-latest-fat-security-postgres.yml)*",
"sourcePath": "docs/Configuration/Storage/External Database.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Storage/External Database.md"
},
@@ -651,7 +651,7 @@
"id": "configuration/storage/google-drive-file-picker",
"title": "Google Drive File Picker",
"section": "configuration/storage",
- "markdown": "> **Tier**: Server\n\nStirling PDF allows users to select Files for processing through tools via google drive.\n\n## Google Api Access\nTo enable this features for your users, you must first set up your Google environment. This includes creating a Google Cloud project. Follow the **Setting up your environment** section of [this guide](https://developers.google.com/workspace/drive/picker/guides/overview#setup) to do so.\n\n## Stirling PDF configuration\n\n```yaml\npremium:\n ...\n enabled: true # Enable license key checks for pro/enterprise features\n proFeatures:\n ...\n googleDrive:\n enabled: true\n clientId: <YOUR_CLIENT_ID>\n apiKey: <YOUR_API_KEY>\n appId: <YOUR_APP_ID>\n```\n- `premium.enabled`: Set to `true` to enable premium features. \n- `googleDrive.enabled`: Set to `true` to enable google drive file picker features. \n- `googleDrive.clientId`: Your Google web app's client ID. [Go to Credentials](https://console.cloud.google.com/apis/credentials) and Click **Create credentials > OAuth client ID**.\n- `googleDrive.apiKey`: API key for google api access. [Go to Credentials](https://console.cloud.google.com/apis/credentials) and Click **Create credentials > API key**.\n- `googleDrive.appId`: Google drive app ID also known as your Project Number Found in your [IAM&Admin Project Settings](https://console.cloud.google.com/iam-admin/settings)\n\n\n > #### ⚠️ Note\n> _You must set the Authorized Javascript origins for your OAuth client ID to include your Stirling PDF host domain or IP address._\n\n## Configurations Examples\nBelow are examples of the full configuration for enabling the google Drive Picker:\n\n\n \n ```yaml\n premium:\n enabled: true # Enable license key checks for pro/enterprise features\n proFeatures:\n googleDrive:\n enabled: true\n clientId: <YOUR_CLIENT_ID>\n apiKey: <YOUR_API_KEY>\n appId: <YOUR_APP_ID>\n ```\n \n \n ```bash\n export PREMIUM_ENABLED=true\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED=true\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID=\"<YOUR_CLIENT_ID>\"\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY=\"<YOUR_API_KEY>\"\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID=\"<YOUR_APP_ID>\"\n ```\n \n \n ```bash\n -e PREMIUM_ENABLED=true \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED=true \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID=\"<YOUR_CLIENT_ID>\" \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY=\"<YOUR_API_KEY>\" \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID=\"<YOUR_APP_ID>\" \\\n ```\n \n \n ```yaml\n environment:\n PREMIUM_ENABLED: true\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED: true\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID: <YOUR_CLIENT_ID>\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY: <YOUR_API_KEY>\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID: <YOUR_APP_ID>\n ```",
+ "markdown": "> **Tier**: Team\n\nStirling PDF allows users to select Files for processing through tools via google drive.\n\n## Google Api Access\nTo enable this features for your users, you must first set up your Google environment. This includes creating a Google Cloud project. Follow the **Setting up your environment** section of [this guide](https://developers.google.com/workspace/drive/picker/guides/overview#setup) to do so.\n\n## Stirling PDF configuration\n\n```yaml\npremium:\n ...\n enabled: true # Enable license key checks for pro/enterprise features\n proFeatures:\n ...\n googleDrive:\n enabled: true\n clientId: <YOUR_CLIENT_ID>\n apiKey: <YOUR_API_KEY>\n appId: <YOUR_APP_ID>\n```\n- `premium.enabled`: Set to `true` to enable premium features. \n- `googleDrive.enabled`: Set to `true` to enable google drive file picker features. \n- `googleDrive.clientId`: Your Google web app's client ID. [Go to Credentials](https://console.cloud.google.com/apis/credentials) and Click **Create credentials > OAuth client ID**.\n- `googleDrive.apiKey`: API key for google api access. [Go to Credentials](https://console.cloud.google.com/apis/credentials) and Click **Create credentials > API key**.\n- `googleDrive.appId`: Google drive app ID also known as your Project Number Found in your [IAM&Admin Project Settings](https://console.cloud.google.com/iam-admin/settings)\n\n\n > #### ⚠️ Note\n> _You must set the Authorized Javascript origins for your OAuth client ID to include your Stirling PDF host domain or IP address._\n\n## Configurations Examples\nBelow are examples of the full configuration for enabling the google Drive Picker:\n\n\n \n ```yaml\n premium:\n enabled: true # Enable license key checks for pro/enterprise features\n proFeatures:\n googleDrive:\n enabled: true\n clientId: <YOUR_CLIENT_ID>\n apiKey: <YOUR_API_KEY>\n appId: <YOUR_APP_ID>\n ```\n \n \n ```bash\n export PREMIUM_ENABLED=true\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED=true\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID=\"<YOUR_CLIENT_ID>\"\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY=\"<YOUR_API_KEY>\"\n export PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID=\"<YOUR_APP_ID>\"\n ```\n \n \n ```bash\n -e PREMIUM_ENABLED=true \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED=true \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID=\"<YOUR_CLIENT_ID>\" \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY=\"<YOUR_API_KEY>\" \\\n -e PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID=\"<YOUR_APP_ID>\" \\\n ```\n \n \n ```yaml\n environment:\n PREMIUM_ENABLED: true\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_ENABLED: true\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_CLIENT_ID: <YOUR_CLIENT_ID>\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_API_KEY: <YOUR_API_KEY>\n PREMIUM_PRO_FEATURES_GOOGLE_DRIVE_APP_ID: <YOUR_APP_ID>\n ```",
"sourcePath": "docs/Configuration/Storage/Google Drive File Picker.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Configuration/Storage/Google Drive File Picker.md"
},
@@ -854,7 +854,7 @@
"id": "getting-started",
"title": "Getting Started",
"section": "overview",
- "markdown": "## Welcome to Stirling PDF\n\nStirling PDF is a locally hosted web application that allows you to perform various operations on PDF files. With 55+ tools, flexible deployment options, and enterprise features, it's the comprehensive PDF solution for individuals and organizations.\n\n## Benefits of Stirling PDF\n- **Extensive PDF Functionality:** 55+ tools covering signing, converting, merging, editing, OCR, and redaction.\n- **Stateful Workspace:** Upload once and chain tools together, with full undo and redo history.\n- **Runs Anywhere:** Docker, bare metal, Kubernetes, or native desktop apps for Windows, macOS, and Linux.\n- **Data Security:** Files are processed by your own instance, never a third-party service.\n- **Configure In-App:** Change settings from the UI, or drive everything with environment variables and `settings.yml`.\n- **Automation & Integration:** REST API, pipelines, folder scanning, and an MCP server for AI assistants.\n- **Enterprise Features:** SSO (OAuth2 and SAML), user management, permission controls, and audit logging.\n- **Self-Hosted:** Community-driven with frequent updates and GitHub support.\n- **Multi-Language Support:** Available in 40+ languages with active translations.\n\n---\n\n## Installation\n\nChoose how you want to run Stirling PDF based on your needs:\n\n### Desktop Applications\n\nNative apps with system integration:\n\n| Platform | Download | Guide |\n|----------|----------|-------|\n| **Windows** | [Installer](https://files.stirlingpdf.com/win-installer.exe) | [Windows Guide](doc:installation/windows) |\n| **Mac** (Universal) | [DMG](https://files.stirlingpdf.com/mac-installer.dmg) | [Mac Guide](doc:installation/mac) |\n| **Linux** | [DEB](https://files.stirlingpdf.com/linux-installer.deb) | [Unix Guide](doc:installation/unix) |\n\n**Features:** Fast startup, \"Open with\" integration, no login required, optional server connection for advanced tools\n\n---\n\n### Docker Deployment\n\nRecommended for server deployments and organizations:\n\n**Quick Start:**\n```bash\ndocker run -d \\\n -p 8080:8080 \\\n -v ./stirling-data:/configs \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n**Available versions:**\n- `latest` - Standard version (recommended)\n- `latest-fat` - Extra fonts and tools for highest quality conversions and full format support\n- `latest-ultra-lite` - Minimal size for resource-constrained environments\n\n**Full guide:** [Docker Installation Guide](doc:installation/docker-install)\n\n---\n\n### Manual Server Setup\n\nFor bare metal installations or environments without Docker:\n\n1. Download `Stirling-PDF.jar`\n2. Install Java 25+\n3. Install dependencies (LibreOffice, Tesseract for OCR)\n4. Run the JAR file\n\n**Full guide:** [Unix Installation Guide](doc:installation/unix)\n\n---\n\n## Documentation Guide\n\n### For Individual Users\n\n**[Tool Reference](doc:functionality/functionality)**\nBrowse all 55+ PDF tools with descriptions\n\n**[Migration Guide](doc:migration/overview)**\nUpgrading from V1? What's new in V2 and how to upgrade smoothly\n\n---\n\n### For Organizations & IT Teams\n\n**[Production Deployment Guide](doc:server-admin-onboarding)**\nComplete walkthrough: installation - configuration - security - monitoring\n\n**[Paid Offerings (Server & Enterprise)](doc:paid-offerings)**\nExternal databases, Google Drive integration, SSO, advanced monitoring, and priority support\n\n**[Configuration Options](doc:configuration/customisation/extra-settings)**\nAll configuration options for Docker and server deployments\n\n---\n\n### For Developers & Integration\n\n**[API Documentation](doc:api)**\nIntegrate Stirling PDF into your applications and workflows\n\n**[Configuration](doc:configuration/security/system-and-security)**\nSSO, certificates, security settings, and more\n\n**[Contribute Guide](doc:contribute)**\nHelp improve Stirling PDF - development setup and guidelines\n\n---\n\n## Quick Links\n\n- **Questions?** Check our **[FAQ](doc:faq)**\n- **Issues?** Report on **[GitHub](https://github.com/Stirling-Tools/Stirling-PDF/issues)**\n- **Community?** Join our **[Discord](https://discord.gg/Cn8pWhQRxZ)**",
+ "markdown": "## Welcome to Stirling PDF\n\nStirling PDF is a locally hosted web application that allows you to perform various operations on PDF files. With 55+ tools, flexible deployment options, and enterprise features, it's the comprehensive PDF solution for individuals and organizations.\n\n## Benefits of Stirling PDF\n- **Extensive PDF Functionality:** 55+ tools covering signing, converting, merging, editing, OCR, and redaction.\n- **Stateful Workspace:** Upload once and chain tools together, with full undo and redo history.\n- **Runs Anywhere:** Docker, bare metal, Kubernetes, or native desktop apps for Windows, macOS, and Linux.\n- **Data Security:** Files are processed by your own instance, never a third-party service.\n- **Configure In-App:** Change settings from the UI, or drive everything with environment variables and `settings.yml`.\n- **Automation & Integration:** REST API, pipelines, folder scanning, and an MCP server for AI assistants.\n- **Enterprise Features:** SSO (OAuth2 and SAML), user management, permission controls, and audit logging.\n- **Self-Hosted:** Community-driven with frequent updates and GitHub support.\n- **Multi-Language Support:** Available in 40+ languages with active translations.\n\n---\n\n## Installation\n\nChoose how you want to run Stirling PDF based on your needs:\n\n### Desktop Applications\n\nNative apps with system integration:\n\n| Platform | Download | Guide |\n|----------|----------|-------|\n| **Windows** | [Installer](https://files.stirlingpdf.com/win-installer.exe) | [Windows Guide](doc:installation/windows) |\n| **Mac** (Universal) | [DMG](https://files.stirlingpdf.com/mac-installer.dmg) | [Mac Guide](doc:installation/mac) |\n| **Linux** | [DEB](https://files.stirlingpdf.com/linux-installer.deb) | [Unix Guide](doc:installation/unix) |\n\n**Features:** Fast startup, \"Open with\" integration, no login required, optional server connection for advanced tools\n\n---\n\n### Docker Deployment\n\nRecommended for server deployments and organizations:\n\n**Quick Start:**\n```bash\ndocker run -d \\\n -p 8080:8080 \\\n -v ./stirling-data:/configs \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n**Available versions:**\n- `latest` - Standard version (recommended)\n- `latest-fat` - Extra fonts and tools for highest quality conversions and full format support\n- `latest-ultra-lite` - Minimal size for resource-constrained environments\n\n**Full guide:** [Docker Installation Guide](doc:installation/docker-install)\n\n---\n\n### Manual Server Setup\n\nFor bare metal installations or environments without Docker:\n\n1. Download `Stirling-PDF.jar`\n2. Install Java 25+\n3. Install dependencies (LibreOffice, Tesseract for OCR)\n4. Run the JAR file\n\n**Full guide:** [Unix Installation Guide](doc:installation/unix)\n\n---\n\n## Documentation Guide\n\n### For Individual Users\n\n**[Tool Reference](doc:functionality/functionality)**\nBrowse all 55+ PDF tools with descriptions\n\n**[Migration Guide](doc:migration/overview)**\nUpgrading from V1? What's new in V2 and how to upgrade smoothly\n\n---\n\n### For Organizations & IT Teams\n\n**[Production Deployment Guide](doc:server-admin-onboarding)**\nComplete walkthrough: installation - configuration - security - monitoring\n\n**[Paid Offerings (Team & Enterprise)](doc:paid-offerings)**\nExternal databases, Google Drive integration, SSO, advanced monitoring, and priority support\n\n**[Configuration Options](doc:configuration/customisation/extra-settings)**\nAll configuration options for Docker and server deployments\n\n---\n\n### For Developers & Integration\n\n**[API Documentation](doc:api)**\nIntegrate Stirling PDF into your applications and workflows\n\n**[Configuration](doc:configuration/security/system-and-security)**\nSSO, certificates, security settings, and more\n\n**[Contribute Guide](doc:contribute)**\nHelp improve Stirling PDF - development setup and guidelines\n\n---\n\n## Quick Links\n\n- **Questions?** Check our **[FAQ](doc:faq)**\n- **Issues?** Report on **[GitHub](https://github.com/Stirling-Tools/Stirling-PDF/issues)**\n- **Community?** Join our **[Discord](https://discord.gg/Cn8pWhQRxZ)**",
"sourcePath": "docs/Getting Started.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Getting Started.md"
},
@@ -972,16 +972,16 @@
"title": "Modes",
"description": "The different ways to run Stirling PDF and where credits apply",
"section": "overview",
- "markdown": "Stirling PDF runs in several modes depending on how you deploy it. This page is just an overview of what each mode is - for pricing, feature matrix, and full license terms see [Paid Offerings](doc:paid-offerings).\n\n---\n\n## At a glance\n\n| Mode | What it is | Where files are processed | Credits? |\n|---|---|---|---|\n| **Desktop - Local** | Native Windows/Mac/Linux app, no sign-in | Your device | No |\n| **Desktop + Stirling.com Cloud** | Same desktop app, signed in to Stirling.com Cloud | Mix: local for basic tools, cloud for advanced | Yes, on cloud-routed ops |\n| **Desktop + Self-hosted server** | Desktop app pointed at your own Stirling server | Your server | No |\n| **Web - Self-hosted** | Docker / Kubernetes / JAR, accessed via browser | Your server | No |\n| **Stirling.com Cloud** | `stirling.com/app` web app | Stirling.com Cloud | Yes |\n\n---\n\n## Desktop\n\n### Local\n\nThe default for the Windows, Mac, and Linux desktop apps. No sign-in, no server, no credits. Basic PDF tools (merge, split, rotate, sign, watermark, page operations, etc.) run entirely on your device.\n\nTools that need server-side processing (OCR, document-format conversions, compression, repair) are not available in this mode - sign in to Stirling.com Cloud or connect to a self-hosted server to use them.\n\n### With Stirling.com Cloud\n\nThe desktop app signed in to your Stirling.com Cloud account. Basic tools still run locally for free; advanced tools route to Stirling.com Cloud and consume credits.\n\n### With a self-hosted server\n\nThe desktop app pointed at a Stirling PDF instance you run yourself. All tools route to your server and **no credits apply**. Whichever license tier your server runs (Free, Server, Enterprise) is what the desktop client gets.\n\n---\n\n## Web - Self-hosted\n\nStirling PDF running in Docker, Kubernetes, or as a bare-metal JAR, accessed via a browser. **No credits ever.** License tier determines your user capacity and which advanced features (SSO, SAML, audit logs, etc.) are unlocked - see [Paid Offerings](doc:paid-offerings).\n\n---\n\n## Stirling.com Cloud\n\nThe hosted version at [stirling.com/app](https://stirling.com/app). All processing happens in Stirling's cloud, and every operation costs credits. Free accounts include a monthly allowance; paid plans include more credits. See [Paid Offerings](doc:paid-offerings) for current pricing.\n\n---\n\n## More than 5 users\n\nThe free tier covers up to 5 users. Once you have more than 5, you need a paid Server or Enterprise plan. Server includes 100 users and adds capacity in blocks of 100; Enterprise is sized to your organization under a custom agreement. A paid plan also adds:\n\n- Official support (tickets, SLAs, priority responses)\n- SSO, SAML, audit logging, and other paid-tier features\n\nSee [Paid Offerings](doc:paid-offerings) for the full feature comparison, [book a demo](https://www.stirling.com/book-a-demo) to see the paid features first-hand, or [contact us](https://www.stirling.com/contact-us) if you're not sure which plan fits.",
+ "markdown": "Stirling PDF runs in several modes depending on how you deploy it. This page is just an overview of what each mode is - for pricing, feature matrix, and full license terms see [Paid Offerings](doc:paid-offerings).\n\n---\n\n## At a glance\n\n| Mode | What it is | Where files are processed | Credits? |\n|---|---|---|---|\n| **Desktop - Local** | Native Windows/Mac/Linux app, no sign-in | Your device | No |\n| **Desktop + Stirling.com Cloud** | Same desktop app, signed in to Stirling.com Cloud | Mix: local for basic tools, cloud for advanced | Yes, on cloud-routed ops |\n| **Desktop + Self-hosted server** | Desktop app pointed at your own Stirling server | Your server | No |\n| **Web - Self-hosted** | Docker / Kubernetes / JAR, accessed via browser | Your server | No |\n| **Stirling.com Cloud** | `stirling.com/app` web app | Stirling.com Cloud | Yes |\n\n---\n\n## Desktop\n\n### Local\n\nThe default for the Windows, Mac, and Linux desktop apps. No sign-in, no server, no credits. Basic PDF tools (merge, split, rotate, sign, watermark, page operations, etc.) run entirely on your device.\n\nTools that need server-side processing (OCR, document-format conversions, compression, repair) are not available in this mode - sign in to Stirling.com Cloud or connect to a self-hosted server to use them.\n\n### With Stirling.com Cloud\n\nThe desktop app signed in to your Stirling.com Cloud account. Basic tools still run locally for free; advanced tools route to Stirling.com Cloud and consume credits.\n\n### With a self-hosted server\n\nThe desktop app pointed at a Stirling PDF instance you run yourself. All tools route to your server and **no credits apply**. Whichever license tier your server runs (Free, Team, Enterprise) is what the desktop client gets.\n\n---\n\n## Web - Self-hosted\n\nStirling PDF running in Docker, Kubernetes, or as a bare-metal JAR, accessed via a browser. **No credits ever.** License tier determines your user capacity and which advanced features (SSO, SAML, audit logs, etc.) are unlocked - see [Paid Offerings](doc:paid-offerings).\n\n---\n\n## Stirling.com Cloud\n\nThe hosted version at [stirling.com/app](https://stirling.com/app). All processing happens in Stirling's cloud, and every operation costs credits. Free accounts include a monthly allowance; paid plans include more credits. See [Paid Offerings](doc:paid-offerings) for current pricing.\n\n---\n\n## More than 5 users\n\nThe free tier covers up to 5 users. Once you have more than 5, you need a paid Team or Enterprise plan. Team includes 100 users and adds capacity in blocks of 100; Enterprise is sized to your organization under a custom agreement. A paid plan also adds:\n\n- Official support (tickets, SLAs, priority responses)\n- SSO, SAML, audit logging, and other paid-tier features\n\nSee [Paid Offerings](doc:paid-offerings) for the full feature comparison, [book a demo](https://www.stirling.com/book-a-demo) to see the paid features first-hand, or [contact us](https://www.stirling.com/contact-us) if you're not sure which plan fits.",
"sourcePath": "docs/Modes-and-Licensing.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Modes-and-Licensing.md"
},
"paid-offerings": {
"id": "paid-offerings",
"title": "Paid Offerings",
- "description": "Server and Enterprise paid plans for Stirling PDF",
+ "description": "Team and Enterprise paid plans for Stirling PDF",
"section": "overview",
- "markdown": "## Stirling PDF Paid Offerings\n\nStirling PDF offers Server and Enterprise paid plans. These provide the same great software with added features, streamlined license management, and support options.\n\n> This page covers **self-hosted** Server and Enterprise licensing (a license key, no credits). Stirling Cloud and the credit-based Processor plan are separate offerings - see [Modes](doc:modes-and-licensing) for how the deployment modes compare, and [stirling.com/pricing](https://www.stirling.com/pricing) for the full plan lineup.\n\n## Available Plans\n\n### Free Plan\n- **Cost**: Free forever\n- **Users**: Up to 5 users\n- **Features**:\n - Self-hosted deployment\n - All PDF operations\n - Community support\n - Regular updates\n- **Perfect for**: Personal use, small teams, or evaluation\n\n### Server Plan\n- **Cost**: $99/month or $999/year (save $189 with annual billing)\n- **Available billing**: Monthly or Yearly\n- **Users**: 100 users included. Add capacity in blocks of 100 users as your team grows\n- **Value**: One bill for the whole team instead of per-seat licenses (100 users works out under $1 per user per month)\n- **Features**:\n - Self-hosted deployment\n - All PDF operations\n - 100 users included, with capacity added in blocks of 100\n - One bill instead of per-seat licenses\n - Community support\n - Regular updates\n - Support tickets via [email protected]\n - [External Database](doc:configuration/storage/external-database) support for optimized deployments and load-balancing\n - Google Drive integration\n - [OAuth2 SSO](doc:configuration/security/oauth-sso-configuration) (Google, GitHub, Keycloak, any OIDC provider)\n- **Perfect for**: Teams and organizations that want predictable, block-based pricing without tracking individual seats\n\n### Enterprise Plan\n- **Cost**: Custom pricing - [contact sales](https://www.stirling.com/contact-us) for a quote\n- **Available billing**: Agreed as part of your contract\n- **Users**: Sized to your organization, with volume discounts as you scale\n- **Features**:\n - All Server Plan features, plus:\n - Air-gapped / offline deployment, activated with a [certificate file](#option-2-certificate-file-air-gapped-offline) instead of an online key check\n - Uptime SLAs\n - Custom procurement, security review, and contract terms\n - Volume discounts\n - [SAML2 SSO](doc:configuration/security/saml-sso-configuration) (Okta, Azure AD, etc.) with automated login handling\n - Custom automated metadata handling\n - Priority support tickets via [email protected]\n - 1:1 meetings with the Stirling PDF team (from registered email domain)\n - Priority feature enhancements\n - Prometheus endpoint for advanced usage monitoring\n - Usage Monitoring UI\n - Audit logs\n - Custom integrations support\n - Dedicated account manager\n- **Perfect for**: Regulated environments and large organizations that need air-gapped deployment, uptime SLAs, and an agreement to match\n- **Evaluating?** [Book a demo](https://www.stirling.com/book-a-demo) to see the Enterprise features in action\n\n## Purchasing a License\n\n### In-App Purchase (Recommended)\n\nStirling PDF offers streamlined in-app purchasing and license activation. This covers the Server plan; Enterprise is quoted and issued by sales rather than bought in-app.\n\n1. **Navigate to Settings**: Log in as an admin and go to Settings → Plan\n2. **Select Your Plan**: Choose the Server plan (100 users included, capacity added in blocks of 100)\n3. **Choose Billing Period**: Select monthly or yearly billing (yearly saves money)\n4. **Complete Checkout**: You'll be redirected to Stripe's secure checkout\n5. **Automatic Activation**: After payment, your license key is automatically retrieved and activated\n6. **Confirmation**: You'll see your active plan status immediately in the Settings\n\n**Benefits of In-App Purchase:**\n- No manual license key entry required\n- Instant activation after payment\n- Manage billing directly from the app\n- Automatic license key synchronization\n- Easy plan upgrades\n\n### Alternative - Contact Us\n\nIf you prefer to purchase outside the app or have questions:\n\n1. Visit [stirling.com/contact-us](https://www.stirling.com/contact-us) or email [email protected]\n2. Our team will assist you with your purchase\n3. You'll receive your license key via email\n4. Follow manual activation steps below\n\n## Activating Your License\n\n### Automatic Activation\n\nIf you purchased in-app, your license is automatically activated. No further action needed!\n\n### Manual Activation\n\nStirling PDF accepts two manual activation inputs from the admin UI: a license **key** (string), or a license **certificate file** (`.lic` / `.cert`, used for offline / air-gapped Enterprise activation).\n\n#### Option 1 - License Key\n\nIf you purchased via the website and received a license key by email:\n\n1. **Admin Settings**: Log in as an admin and navigate to Settings → Plan\n2. **Open License Input**: Expand the \"Got a license key or certificate file?\" section\n3. **Select Input Type**: Make sure \"License Key\" is selected\n4. **Enter License Key**: Paste your license key in the provided field\n5. **Activate**: Save to apply the license\n6. **Confirmation**: Your plan features will be enabled immediately\n\n#### Option 2 - Certificate File (Air-Gapped / Offline)\n\nIf you received a `.lic` or `.cert` certificate file (typically issued for Enterprise customers who need to activate without outbound internet access):\n\n1. **Admin Settings**: Log in as an admin and navigate to Settings → Plan\n2. **Open License Input**: Expand the \"Got a license key or certificate file?\" section\n3. **Select Input Type**: Switch to \"Certificate File\"\n4. **Choose File**: Click \"Choose License File\" and select your `.lic` or `.cert` file (must start with `-----BEGIN LICENSE FILE-----`)\n5. **Upload**: The file is uploaded, validated, saved to your `configs/` folder, and activated automatically. Any previous certificate is backed up to `configs/backup/`\n6. **Confirmation**: Your plan features will be enabled immediately\n\nBoth flows activate dynamically and do not strictly require a restart.\n\n> **Recommended**: Restart the Stirling PDF installation after activation. While the license is applied immediately, restarting ensures all components (security profile, premium feature gates, user/seat counters, scheduled validation jobs) pick up the new license state from a clean startup. This avoids edge cases where cached state from before activation lingers in a long-running process.\n\n### Legacy - settings.yml Activation\n\nFor scripted deployments or fully automated provisioning, you can still activate via `settings.yml` directly:\n\n1. Navigate to the Stirling PDF config folder\n2. Open `settings.yml`\n3. Find the premium section:\n\n```yaml\npremium:\n key: 00000000-0000-0000-0000-000000000000\n enabled: false # Enable license key checks for pro/enterprise features\n```\n\n4. Replace the key with your license key\n5. Change `enabled` from `false` to `true`\n6. Restart Stirling PDF\n\nTo reference a certificate file from `settings.yml` instead of uploading via the UI:\n\n 1. Place your `.lic` or `.cert` certificate in the config folder (e.g., `configs/cert.lic`)\n 2. Use the `file:` prefix to point at the certificate path:\n\n ```yaml\n premium:\n key: file:configs/cert.lic\n enabled: true\n ```\n\n\n## Managing Your Subscription\n\n### Billing Portal\n\nStirling PDF includes a convenient billing management interface:\n\n1. Navigate to Settings → Plan\n2. On your current plan, click \"Manage\"\n3. You'll be redirected to Stripe's customer portal where you can:\n - Update payment methods\n - View invoices\n - Cancel or modify subscriptions\n - Update billing information\n\n## Feature Configuration\n\nOnce activated, you can customize premium features in your `settings.yml`:\n\n```yaml\npremium:\n proFeatures:\n ssoAutoLogin: false\n customMetadata:\n autoUpdateMetadata: false\n author: username\n creator: Stirling-PDF\n producer: Stirling-PDF\n googleDrive:\n enabled: false\n clientId: ''\n apiKey: ''\n appId: ''\n```\n\n## License Model\n\nStirling PDF uses an **installation-based licensing model**:\n\n- Each license is tied to a specific installation (identified by machine fingerprint)\n- **Server Plan**: $99/month covers one installation with 100 users included\n - Capacity is added in blocks of 100 users, so you get one bill instead of per-seat licenses\n - Example: 100 users = under $1 per user per month\n- **Enterprise Plan**: Capacity and terms are set in your contract, with volume discounts as you scale\n - [Contact sales](https://www.stirling.com/contact-us) for a quote covering your user count, deployment model, and SLA\n\n## Upgrading Your Plan\n\nYou can upgrade from Free → Server at any time:\n\n1. Navigate to Settings → Plan\n2. On the plan tier you want, click \"Upgrade\"\n3. Complete checkout\n4. Your existing license will be automatically upgraded\n\nMoving Server → Enterprise goes through sales - use the \"Contact Us\" button on the Enterprise tier in Settings → Plan, or [contact sales](https://www.stirling.com/contact-us).\n\nAdding more user capacity to an existing Server plan is coming soon as an in-app feature. Until it lands, email [email protected] and we'll add the block for you.\n\n**Note**: When upgrading, your new plan starts immediately and you'll be credited for any unused time on your previous plan.\n\n## Support\n\n### Community Support (All Plans)\n- GitHub Issues: [github.com/Stirling-Tools/Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF)\n- Discord: Join our community server\n\n### Email Support (Server & Enterprise)\n- Email: [email protected]\n- Response time: 1-2 business days (Server), Priority response (Enterprise)\n\n### Enterprise Support\n- Priority email support\n- 1:1 meetings with Stirling PDF team\n- Dedicated account manager\n- Uptime SLAs agreed in your contract\n\n## Frequently Asked Questions\n\n**Q: Can I try before I buy?**\nA: Yes! The Free plan includes all features for up to 5 users. Test thoroughly before upgrading. If you'd rather be walked through the paid features first, [book a demo](https://www.stirling.com/book-a-demo).\n\n**Q: What happens if I cancel?**\nA: Your license remains active until the end of your billing period, then reverts to Free plan limits.\n\n**Q: What happens when we pass 100 users?**\nA: The Server plan includes 100 users. When you need more, capacity is added in blocks of 100 - you stay on one bill rather than buying individual seats. Adding a block from inside the app is coming soon; in the meantime, email [email protected].\n\n**Q: How is Enterprise priced?**\nA: Custom, based on your user count, deployment model, and the terms you need. It is not sold in-app - [contact sales](https://www.stirling.com/contact-us) for a quote. Volume discounts apply as you scale. If you want to see it working first, [book a demo](https://www.stirling.com/book-a-demo).\n\n**Q: Can I move my license to a different server?**\nA: Contact [email protected] for license transfers. Enterprise customers have more flexibility.\n\n**Q: Do I need an internet connection?**\nA: License activation requires internet for initial verification. Enterprise customers running air-gapped can request offline certificate files instead.\n\n**Q: What's the difference between monthly and yearly billing?**\nA: Yearly billing offers significant savings. For Server plan: $999/year vs $1,188/year monthly (save $189 = almost 2 months free).\n\n**Q: How do I get an invoice?**\nA: Invoices are automatically sent via email and accessible through the Billing Portal.\n\n## Migration from V1\n\nIf you're upgrading from Stirling PDF V1 with an existing license:\n\n1. Your existing license key will continue to work\n2. You can enter it manually via Settings → Plan\n3. Or, re-activate through the in-app purchase flow\n4. Contact [email protected] if you encounter any issues\n\n---\n\nFor pricing details, visit [stirling.com/pricing](https://stirling.com/pricing)\n\nFor technical support, email [email protected]",
+ "markdown": "## Stirling PDF Paid Offerings\n\nStirling PDF offers Team and Enterprise paid plans. These provide the same great software with added features, streamlined license management, and support options.\n\n> This page covers **self-hosted** Team and Enterprise licensing (a license key, no credits). Stirling Cloud and the credit-based Processor plan are separate offerings - see [Modes](doc:modes-and-licensing) for how the deployment modes compare, and [stirling.com/pricing](https://www.stirling.com/pricing) for the full plan lineup.\n\n## Available Plans\n\n### Free Plan\n- **Cost**: Free forever\n- **Users**: Up to 5 users\n- **Features**:\n - Self-hosted deployment\n - All PDF operations\n - Community support\n - Regular updates\n- **Perfect for**: Personal use, small teams, or evaluation\n\n### Team Plan\n- **Cost**: $99/month or $999/year (save $189 with annual billing)\n- **Available billing**: Monthly or Yearly\n- **Users**: 100 users included. Add capacity in blocks of 100 users as your team grows\n- **Value**: One bill for the whole team instead of per-seat licenses (100 users works out under $1 per user per month)\n- **Features**:\n - Self-hosted deployment\n - All PDF operations\n - 100 users included, with capacity added in blocks of 100\n - One bill instead of per-seat licenses\n - Community support\n - Regular updates\n - Support tickets via [email protected]\n - [External Database](doc:configuration/storage/external-database) support for optimized deployments and load-balancing\n - Google Drive integration\n - [OAuth2 SSO](doc:configuration/security/oauth-sso-configuration) (Google, GitHub, Keycloak, any OIDC provider)\n- **Perfect for**: Teams and organizations that want predictable, block-based pricing without tracking individual seats\n\n### Enterprise Plan\n- **Cost**: Custom pricing - [contact sales](https://www.stirling.com/contact-us) for a quote\n- **Available billing**: Agreed as part of your contract\n- **Users**: Sized to your organization, with volume discounts as you scale\n- **Features**:\n - All Team Plan features, plus:\n - Air-gapped / offline deployment, activated with a [certificate file](#option-2-certificate-file-air-gapped-offline) instead of an online key check\n - Uptime SLAs\n - Custom procurement, security review, and contract terms\n - Volume discounts\n - [SAML2 SSO](doc:configuration/security/saml-sso-configuration) (Okta, Azure AD, etc.) with automated login handling\n - Custom automated metadata handling\n - Priority support tickets via [email protected]\n - 1:1 meetings with the Stirling PDF team (from registered email domain)\n - Priority feature enhancements\n - Prometheus endpoint for advanced usage monitoring\n - Usage Monitoring UI\n - Audit logs\n - Custom integrations support\n - Dedicated account manager\n- **Perfect for**: Regulated environments and large organizations that need air-gapped deployment, uptime SLAs, and an agreement to match\n- **Evaluating?** [Book a demo](https://www.stirling.com/book-a-demo) to see the Enterprise features in action\n\n## Purchasing a License\n\n### In-App Purchase (Recommended)\n\nStirling PDF offers streamlined in-app purchasing and license activation. This covers the Team plan; Enterprise is quoted and issued by sales rather than bought in-app.\n\n1. **Navigate to Settings**: Log in as an admin and go to Settings → Plan\n2. **Select Your Plan**: Choose the Team plan (100 users included, capacity added in blocks of 100)\n3. **Choose Billing Period**: Select monthly or yearly billing (yearly saves money)\n4. **Complete Checkout**: You'll be redirected to Stripe's secure checkout\n5. **Automatic Activation**: After payment, your license key is automatically retrieved and activated\n6. **Confirmation**: You'll see your active plan status immediately in the Settings\n\n**Benefits of In-App Purchase:**\n- No manual license key entry required\n- Instant activation after payment\n- Manage billing directly from the app\n- Automatic license key synchronization\n- Easy plan upgrades\n\n### Alternative - Contact Us\n\nIf you prefer to purchase outside the app or have questions:\n\n1. Visit [stirling.com/contact-us](https://www.stirling.com/contact-us) or email [email protected]\n2. Our team will assist you with your purchase\n3. You'll receive your license key via email\n4. Follow manual activation steps below\n\n## Activating Your License\n\n### Automatic Activation\n\nIf you purchased in-app, your license is automatically activated. No further action needed!\n\n### Manual Activation\n\nStirling PDF accepts two manual activation inputs from the admin UI: a license **key** (string), or a license **certificate file** (`.lic` / `.cert`, used for offline / air-gapped Enterprise activation).\n\n#### Option 1 - License Key\n\nIf you purchased via the website and received a license key by email:\n\n1. **Admin Settings**: Log in as an admin and navigate to Settings → Plan\n2. **Open License Input**: Expand the \"Got a license key or certificate file?\" section\n3. **Select Input Type**: Make sure \"License Key\" is selected\n4. **Enter License Key**: Paste your license key in the provided field\n5. **Activate**: Save to apply the license\n6. **Confirmation**: Your plan features will be enabled immediately\n\n#### Option 2 - Certificate File (Air-Gapped / Offline)\n\nIf you received a `.lic` or `.cert` certificate file (typically issued for Enterprise customers who need to activate without outbound internet access):\n\n1. **Admin Settings**: Log in as an admin and navigate to Settings → Plan\n2. **Open License Input**: Expand the \"Got a license key or certificate file?\" section\n3. **Select Input Type**: Switch to \"Certificate File\"\n4. **Choose File**: Click \"Choose License File\" and select your `.lic` or `.cert` file (must start with `-----BEGIN LICENSE FILE-----`)\n5. **Upload**: The file is uploaded, validated, saved to your `configs/` folder, and activated automatically. Any previous certificate is backed up to `configs/backup/`\n6. **Confirmation**: Your plan features will be enabled immediately\n\nBoth flows activate dynamically and do not strictly require a restart.\n\n> **Recommended**: Restart the Stirling PDF installation after activation. While the license is applied immediately, restarting ensures all components (security profile, premium feature gates, user/seat counters, scheduled validation jobs) pick up the new license state from a clean startup. This avoids edge cases where cached state from before activation lingers in a long-running process.\n\n### Legacy - settings.yml Activation\n\nFor scripted deployments or fully automated provisioning, you can still activate via `settings.yml` directly:\n\n1. Navigate to the Stirling PDF config folder\n2. Open `settings.yml`\n3. Find the premium section:\n\n```yaml\npremium:\n key: 00000000-0000-0000-0000-000000000000\n enabled: false # Enable license key checks for pro/enterprise features\n```\n\n4. Replace the key with your license key\n5. Change `enabled` from `false` to `true`\n6. Restart Stirling PDF\n\nTo reference a certificate file from `settings.yml` instead of uploading via the UI:\n\n 1. Place your `.lic` or `.cert` certificate in the config folder (e.g., `configs/cert.lic`)\n 2. Use the `file:` prefix to point at the certificate path:\n\n ```yaml\n premium:\n key: file:configs/cert.lic\n enabled: true\n ```\n\n\n## Managing Your Subscription\n\n### Billing Portal\n\nStirling PDF includes a convenient billing management interface:\n\n1. Navigate to Settings → Plan\n2. On your current plan, click \"Manage\"\n3. You'll be redirected to Stripe's customer portal where you can:\n - Update payment methods\n - View invoices\n - Cancel or modify subscriptions\n - Update billing information\n\n## Feature Configuration\n\nOnce activated, you can customize premium features in your `settings.yml`:\n\n```yaml\npremium:\n proFeatures:\n ssoAutoLogin: false\n customMetadata:\n autoUpdateMetadata: false\n author: username\n creator: Stirling-PDF\n producer: Stirling-PDF\n googleDrive:\n enabled: false\n clientId: ''\n apiKey: ''\n appId: ''\n```\n\n## License Model\n\nStirling PDF uses an **installation-based licensing model**:\n\n- Each license is tied to a specific installation (identified by machine fingerprint)\n- **Team Plan**: $99/month covers one installation with 100 users included\n - Capacity is added in blocks of 100 users, so you get one bill instead of per-seat licenses\n - Example: 100 users = under $1 per user per month\n- **Enterprise Plan**: Capacity and terms are set in your contract, with volume discounts as you scale\n - [Contact sales](https://www.stirling.com/contact-us) for a quote covering your user count, deployment model, and SLA\n\n## Upgrading Your Plan\n\nYou can upgrade from Free → Team at any time:\n\n1. Navigate to Settings → Plan\n2. On the plan tier you want, click \"Upgrade\"\n3. Complete checkout\n4. Your existing license will be automatically upgraded\n\nMoving Team → Enterprise goes through sales - use the \"Contact Us\" button on the Enterprise tier in Settings → Plan, or [contact sales](https://www.stirling.com/contact-us).\n\nAdding more user capacity to an existing Team plan is coming soon as an in-app feature. Until it lands, email [email protected] and we'll add the block for you.\n\n**Note**: When upgrading, your new plan starts immediately and you'll be credited for any unused time on your previous plan.\n\n## Support\n\n### Community Support (All Plans)\n- GitHub Issues: [github.com/Stirling-Tools/Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF)\n- Discord: Join our community server\n\n### Email Support (Team & Enterprise)\n- Email: [email protected]\n- Response time: 1-2 business days (Team), Priority response (Enterprise)\n\n### Enterprise Support\n- Priority email support\n- 1:1 meetings with Stirling PDF team\n- Dedicated account manager\n- Uptime SLAs agreed in your contract\n\n## Frequently Asked Questions\n\n**Q: Can I try before I buy?**\nA: Yes! The Free plan includes all features for up to 5 users. Test thoroughly before upgrading. If you'd rather be walked through the paid features first, [book a demo](https://www.stirling.com/book-a-demo).\n\n**Q: What happens if I cancel?**\nA: Your license remains active until the end of your billing period, then reverts to Free plan limits.\n\n**Q: What happens when we pass 100 users?**\nA: The Team plan includes 100 users. When you need more, capacity is added in blocks of 100 - you stay on one bill rather than buying individual seats. Adding a block from inside the app is coming soon; in the meantime, email [email protected].\n\n**Q: How is Enterprise priced?**\nA: Custom, based on your user count, deployment model, and the terms you need. It is not sold in-app - [contact sales](https://www.stirling.com/contact-us) for a quote. Volume discounts apply as you scale. If you want to see it working first, [book a demo](https://www.stirling.com/book-a-demo).\n\n**Q: Can I move my license to a different server?**\nA: Contact [email protected] for license transfers. Enterprise customers have more flexibility.\n\n**Q: Do I need an internet connection?**\nA: License activation requires internet for initial verification. Enterprise customers running air-gapped can request offline certificate files instead.\n\n**Q: What's the difference between monthly and yearly billing?**\nA: Yearly billing offers significant savings. For Team plan: $999/year vs $1,188/year monthly (save $189 = almost 2 months free).\n\n**Q: How do I get an invoice?**\nA: Invoices are automatically sent via email and accessible through the Billing Portal.\n\n## Migration from V1\n\nIf you're upgrading from Stirling PDF V1 with an existing license:\n\n1. Your existing license key will continue to work\n2. You can enter it manually via Settings → Plan\n3. Or, re-activate through the in-app purchase flow\n4. Contact [email protected] if you encounter any issues\n\n---\n\nFor pricing details, visit [stirling.com/pricing](https://stirling.com/pricing)\n\nFor technical support, email [email protected]",
"sourcePath": "docs/Paid-Offerings.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Paid-Offerings.md"
},
@@ -990,7 +990,7 @@
"title": "Production Deployment Guide",
"description": "Complete production deployment guide for server administrators deploying Stirling-PDF",
"section": "overview",
- "markdown": "Welcome! This guide will walk you through deploying Stirling-PDF for your organization, from initial installation to advanced configuration and scaling.\n\n> **💡 Tip: For Organizations & Teams**\n>\n> This guide is designed for server administrators deploying Stirling-PDF for teams, departments, or entire organizations. If you're interested in **paid plan features** (external database, Google Drive, SSO, advanced user management, priority support), we'll highlight upgrade paths throughout this guide.\n\n\n---\n\n## Overview: What You'll Accomplish\n\nBy the end of this guide, you'll have:\n\n1. ✅ **Stirling-PDF running** on your infrastructure\n2. ✅ **User authentication configured** with admin access\n3. ✅ **Settings customized** for your organization\n4. ✅ **Security hardened** with HTTPS and proper access controls\n5. ✅ **Monitoring setup** to track usage and performance\n6. ✅ **Understanding of paid plan** upgrade paths (Server/Enterprise)\n\n**Time estimate:** 30-60 minutes for basic setup, 2-3 hours for full enterprise configuration\n\n---\n\n## Step 1: Choose Your Deployment Path\n\n\n\n\n**Best for:** Most organizations, production deployments, easy management\n\n**Why Docker Compose?**\n- ✅ Simple one-command deployment\n- ✅ Easy updates and rollbacks\n- ✅ Persistent data management\n- ✅ Production-ready configuration\n- ✅ Easy to scale and customize\n\n**Requirements:**\n- Docker Engine 20.10+\n- Docker Compose 1.29+\n- 2GB RAM minimum (4GB+ recommended)\n- 10GB disk space\n\n**Jump to:** [Docker Compose Setup](#docker-compose-setup)\n\n\n\n\n**Best for:** Quick testing, single-container deployments, learning\n\n**Why Docker Run?**\n- ✅ Fastest way to get started\n- ✅ Single command deployment\n- ✅ Good for testing before production\n- ⚠️ More manual management needed\n\n**Requirements:**\n- Docker Engine 20.10+\n- 2GB RAM minimum\n- 5GB disk space\n\n**Jump to:** [Docker Run Setup](#docker-run-setup)\n\n\n\n\n**Best for:** Enterprise scale, high availability, cloud-native deployments\n\n**Why Kubernetes?**\n- ✅ Auto-scaling capabilities\n- ✅ High availability and fault tolerance\n- ✅ Load balancing built-in\n- ✅ Cloud provider integration\n- ⚠️ More complex to set up\n\n**Requirements:**\n- Kubernetes cluster 1.19+\n- kubectl configured\n- Persistent volume support\n- Load balancer support\n\n**Jump to:** [Kubernetes Guide](doc:installation/kubernetes)\n\n\n\n\n**Best for:** Environments without Docker, specific OS requirements\n\n**Why Bare Metal?**\n- ✅ Maximum control\n- ✅ No container overhead\n- ✅ Custom Java configurations\n- ⚠️ More maintenance required\n\n**Requirements:**\n- Java 25+\n- Linux/Unix system\n- 2GB RAM minimum\n- LibreOffice, Tesseract (for features)\n\n**Jump to:** [Unix Installation Guide](doc:installation/unix)\n\n\n\n\n---\n\n## Step 2: Installation\n\nFollow the installation instructions for your chosen deployment method from Step 1.\n\n\n\n\n### Docker Compose Setup\n\nThis is the recommended approach for production deployments.\n\n#### 2.1: Create docker-compose.yml\n\nCreate a directory for your Stirling-PDF deployment:\n\n```bash\nmkdir -p ~/stirling-pdf\ncd ~/stirling-pdf\n```\n\nCreate `docker-compose.yml` with this production-ready configuration:\n\n```yaml\n\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n container_name: stirling-pdf\n ports:\n - '8080:8080'\n volumes:\n # Persistent data storage\n - ./stirling-data/tessdata:/usr/share/tessdata # OCR language files\n - ./stirling-data/configs:/configs # Settings & database\n - ./stirling-data/logs:/logs # Application logs\n - ./stirling-data/customFiles:/customFiles:rw # Custom branding files\n - ./stirling-data/pipeline:/pipeline # Automation configs\n environment:\n # Core Settings\n - SECURITY_ENABLELOGIN=true # Enable user authentication\n\n # Language & Localization\n - SYSTEM_DEFAULTLOCALE=en-US # Default UI locale for new users\n\n # System Configuration\n - SYSTEM_GOOGLEVISIBILITY=false # Hide from search engines\n - SYSTEM_ROOTURIPATH=/ # Base URL path\n - SYSTEMFILEUPLOADLIMIT=2000MB # Max upload size (legacy: SYSTEM_MAXFILESIZE in MB)\n\n restart: unless-stopped\n\n # Optional: Resource limits\n deploy:\n resources:\n limits:\n memory: 4G\n cpus: '2.0'\n reservations:\n memory: 2G\n cpus: '1.0'\n```\n\n#### 2.2: Start Stirling-PDF\n\n```bash\n# Start the container\ndocker-compose up -d\n\n# Check if it's running\ndocker-compose ps\n\n# View logs\ndocker-compose logs -f\n```\n\n#### 2.3: Verify Installation\n\nOpen your browser and navigate to:\n```\nhttp://your-server-ip:8080\n```\n\nYou should see the Stirling-PDF homepage!\n\n> **💡 Tip: Success!**\n>\n> If you see the Stirling-PDF interface, your installation is successful. Continue to Step 3 to set up authentication.\n\n\n**Troubleshooting:**\n- **Can't connect?** Check firewall rules: `sudo ufw allow 8080`\n- **Container won't start?** Check logs: `docker-compose logs`\n- **Permission errors?** Fix permissions: `sudo chmod -R 755 ./stirling-data`\n\n\n\n\n### Docker Run Setup\n\nFor quick testing or simpler deployments.\n\n#### 2.1: Create Data Directory and Run Container\n\n```bash\n# Create data directory\nmkdir -p ~/stirling-data\n\n# Run Stirling-PDF\ndocker run -d \\\n --name stirling-pdf \\\n -p 8080:8080 \\\n -v ~/stirling-data/tessdata:/usr/share/tessdata \\\n -v ~/stirling-data/configs:/configs \\\n -v ~/stirling-data/logs:/logs \\\n -v ~/stirling-data/customFiles:/customFiles:rw \\\n -e SECURITY_ENABLELOGIN=true \\\n -e SYSTEM_DEFAULTLOCALE=en-US \\\n -e SYSTEM_GOOGLEVISIBILITY=false \\\n -e SYSTEMFILEUPLOADLIMIT=2000MB \\\n --restart unless-stopped \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n#### 2.2: Verify Installation\n\n```bash\n# Check if running\ndocker ps | grep stirling-pdf\n\n# View logs\ndocker logs -f stirling-pdf\n```\n\nOpen your browser and navigate to:\n```\nhttp://your-server-ip:8080\n```\n\nYou should see the Stirling-PDF homepage!\n\n> **💡 Tip: Success!**\n>\n> If you see the Stirling-PDF interface, your installation is successful. Continue to Step 3 to set up authentication.\n\n\n**Troubleshooting:**\n- **Can't connect?** Check firewall rules: `sudo ufw allow 8080`\n- **Container won't start?** Check logs: `docker logs stirling-pdf`\n- **Permission errors?** Fix permissions: `sudo chmod -R 755 ~/stirling-data`\n\n\n\n\n### Kubernetes Setup\n\nFor enterprise-scale deployments with high availability.\n\nKubernetes deployment requires:\n- Persistent Volume Claims (PVCs)\n- Deployments and Services\n- Ingress/LoadBalancer configuration\n- Resource limits and autoscaling\n\n**See full guide:** [Kubernetes Installation Guide](doc:installation/kubernetes)\n\nThis includes complete YAML configurations, namespace setup, SSL/TLS, and horizontal pod autoscaling.\n\n\n\n\n### Bare Metal Setup\n\nFor environments without Docker or specific OS requirements.\n\nBare metal installation requires:\n- Java 25+\n- LibreOffice (for conversions)\n- Tesseract OCR (for OCR features)\n- Systemd service setup\n\n**See full guide:** [Unix Installation Guide](doc:installation/unix)\n\nThis includes complete dependency installation, JAR setup, systemd configuration, and troubleshooting.\n\n\n\n\n---\n\n## Step 3: Initial Login & Admin Setup\n\nNow that Stirling-PDF is running with authentication enabled, you need to create your admin account.\n\n### 3.1: First-Time Login\n\n1. **Navigate to your Stirling-PDF instance:**\n ```\n http://your-server-ip:8080\n ```\n\n2. **Log in with default credentials:**\n ```\n Username: admin\n Password: stirling\n ```\n\n3. **Change the default password immediately:**\n - After first login, go to Settings → Account\n - Change to a strong password (12+ characters, mixed case, numbers, symbols)\n\n> **💡 Tip: Customizing Default Credentials**\n>\n> You can set custom default credentials **before first startup** using environment variables:\n>\n> ```yaml\n> environment:\n> - SECURITY_INITIALLOGIN_USERNAME=youradmin\n> - SECURITY_INITIALLOGIN_PASSWORD=YourSecurePassword123!\n> ```\n>\n> **Important:** These only work on first startup. If you change them after the database is created, the old credentials remain active. Always change the password through the UI after first login.\n\n\n> **💡 Tip: User Registration**\n>\n> After first login, you can control how additional users are created through Settings → Security (covered in Step 4).\n\n\n### 3.2: Verify Admin Access\n\n1. **Log in with your admin account**\n\n2. **Click the Settings gear icon** ⚙️ in the top navigation bar\n\n3. **Verify you have admin access** by checking for admin-only sections:\n - **General Settings** - System configuration\n - **Security Settings** - User management, login settings\n - **UI Customization** - Branding and appearance\n - **User Management** - Create/manage users\n - **Endpoint Configuration** - Enable/disable tools\n\n **Note:** Regular users can also access Settings but only see their personal preferences (language, theme). Only admins see the sections listed above.\n\n4. **If you don't see admin sections:**\n - Check logs: `docker logs stirling-pdf`\n - Verify you're the first user created\n - Confirm `SECURITY_ENABLELOGIN=true` is set\n\n> **⚠️ Warning: Secure Your Admin Account**\n>\n> - **Change the default password immediately** after first login\n> - Use a strong password (12+ characters, mixed case, numbers, symbols)\n> - Consider using SSO (OAuth2/SAML2) to avoid password management entirely\n\n\n---\n\n## Step 4: Configure Essential Settings\n\nNow that you're logged in as admin, let's configure Stirling-PDF for your organization.\n\n### 4.1: General Settings\n\nNavigate to **Settings → General**\n\n\n\n\n**These settings should be configured immediately:**\n\n#### System Locale & Language\n```yaml\nsystem:\n defaultLocale: en-US # or en-GB, de-DE, fr-FR, etc.\n\nui:\n languages: [] # Empty = all languages enabled. Or specify: [\"en_GB\", \"de_DE\", \"fr_FR\"]\n```\n\n**Why:** Ensures UI appears in the correct language for your users\n\n#### Search Engine Visibility\n```yaml\nsystem:\n googlevisibility: false # Prevents search engines from indexing your site\n```\n\n**Why:** Keeps your internal PDF tool private\n\n#### File Upload Limits\n```yaml\nsystem:\n fileUploadLimit: 2000MB # or \"2GB\" - adjust based on your needs\n```\n\n**Why:** Prevents users from uploading files that crash the system\n\n\n\n\n**Configure these for better user experience:**\n\n#### Legal & Compliance\n```yaml\nlegal:\n termsAndConditions: https://yourcompany.com/tos # or empty string to disable\n privacyPolicy: https://yourcompany.com/privacy # or empty string to disable\n accessibilityStatement: '' # optional\n cookiePolicy: '' # optional\n impressum: '' # optional (required in some countries like Germany)\n```\n\n**Why:** Legal compliance, especially in GDPR/regulated industries\n\n#### Update Notifications (Optional)\n```yaml\nsystem:\n showUpdate: false # Set true to show update notifications\n showUpdateOnlyAdmin: false # Only admins see updates (requires showUpdate: true)\n```\n\n**Why:** Control update notifications in production environments\n\n#### Process Limits\n```yaml\nprocessExecutor:\n sessionLimit:\n libreOfficeSessionLimit: 1\n tesseractSessionLimit: 1\n pythonOpenCvSessionLimit: 8\n timeoutMinutes:\n libreOfficetimeoutMinutes: 30\n tesseractTimeoutMinutes: 30\n```\n\n**Why:** Prevents resource exhaustion based on your server capacity\n\n\n\n\n### 4.2: Security Settings\n\nNavigate to **Settings → Security**\n\n> **⚠️ Warning: Critical for Production**\n>\n> These settings directly impact your organization's security. Review carefully!\n\n\n#### User Registration Control\n\n\n\n\n**Best for:** Controlled environments, enterprises, security-conscious orgs\n\n**How it works:**\n1. Admin creates user accounts manually in Settings → User Management\n2. Admin shares credentials with users securely\n3. Users log in with provided credentials\n\n**Email Invitations (Optional):**\nIf you configure email, admins can send invitation links instead.\n\n\n\n\n```yaml\nmail:\n enabled: true\n enableInvites: true\n host: smtp.gmail.com\n port: 587\n username: [email protected]\n password: ${MAIL_PASSWORD} # Use environment variable\n from: [email protected]\n startTlsEnable: true # STARTTLS upgrade after connecting (port 587)\n```\n\n\n\n\n```bash\nMAIL_ENABLED=true\nMAIL_ENABLEINVITES=true\nMAIL_HOST=smtp.gmail.com\nMAIL_PORT=587\[email protected]\nMAIL_PASSWORD=your-app-password\[email protected]\nMAIL_STARTTLSENABLE=true\n```\n\n\n\n\n\n\n\n**Best for:** Large enterprises, existing SSO infrastructure\n\n**Single Sign-On (SSO) options:**\n- **OAuth2:** Server tier - Supports Google, GitHub, Keycloak, any OpenID Connect provider\n- **SAML2:** Enterprise tier - Supports Okta, Azure AD, etc.\n\n**Key settings:**\n```yaml\nsecurity:\n enableLogin: true\n loginMethod: oauth2 # or 'saml2' or 'all'\n oauth2:\n enabled: true\n autoCreateUser: true # Auto-create users on first login\n blockRegistration: false # Set true to require admin pre-registration\n```\n\n**Benefits:**\n- ✅ No password management\n- ✅ Centralized access control\n- ✅ Automatic user provisioning\n- ✅ Corporate policy compliance\n\n**See full guide:** [SSO Configuration Guide](doc:configuration/security/single-sign-on-configuration)\n\nComplete configuration examples for Google, GitHub, Keycloak, Okta, Azure AD, and generic OIDC/SAML2 providers.\n\n\n\n\n#### Login Security Settings\n\n```yaml\nsecurity:\n loginAttemptCount: 5 # Lock account after 5 failed attempts\n loginResetTimeMinutes: 120 # Unlock after 2 hours\n```\n\n**Notes:**\n- Session timeout is not configurable via settings\n- Password policies (length, complexity) are not currently configurable\n- Use SSO/OAuth2 for enterprise password policies\n\n### 4.3: Feature Control\n\nNavigate to **Settings → Endpoints**\n\nControl which PDF tools are available to users.\n\n\n\n\n**All tools are enabled by default.** You can disable specific tools if needed:\n\n```yaml\nendpoints:\n toRemove: [] # Add tool IDs to disable, e.g. ['sign', 'add-password']\n groupsToRemove: [] # Disable entire groups, e.g. ['LibreOffice']\n```\n\n**Most organizations don't need to disable anything** - all tools are useful and safe\n\n\n\n\n**Example: Disable security-sensitive tools:**\n\n```yaml\nendpoints:\n toRemove:\n - 'add-password' # Disable password protection tool\n - 'remove-password' # Disable password removal tool\n - 'change-permissions' # Disable permissions modification\n```\n\n**Example: Disable entire groups:**\n\n```yaml\nendpoints:\n groupsToRemove:\n - 'LibreOffice' # Disables all LibreOffice-based conversions\n```\n\n**How to disable in UI:**\n1. Log in as admin\n2. Go to Settings → Endpoints\n3. In \"Disabled Endpoints\", select the tools you want to disable (or use \"Disabled Endpoint Groups\" for whole groups)\n4. Save changes\n\n**See all tool IDs:** [Endpoint Customisation](doc:configuration/customisation/endpoint-or-feature-customisation)\n\n\n\n\n### 4.4: Save and Apply Settings\n\nAfter configuring all settings:\n\n1. **Click \"Save\" button** at the bottom of each settings page\n2. **Verify settings saved** - You should see a success message\n3. **Some settings require restart** - Check if restart notification appears\n4. **Test changes** - Log out and log in as a regular user to verify\n\n**If restart is needed:**\n```bash\n# Docker Compose\ndocker-compose restart\n\n# Docker Run\ndocker restart stirling-pdf\n```\n\n---\n\n## Step 5: HTTPS & Domain Setup\n\n> **🚫 Danger: Production Requirement**\n>\n> **Never run in production without HTTPS.** User credentials and PDF files will be transmitted in plain text over the network.\n\n\n### 5.1: Choose Your HTTPS Method\n\n\n\n\n**Best for:** Simple deployments, no reverse proxy needed\n\nStirling-PDF can handle HTTPS directly using built-in SSL configuration.\n\n#### Configure SSL in Stirling-PDF\n\n1. **Generate or obtain SSL certificate:**\n\n **Option A: Self-signed (for testing/internal use):**\n ```bash\n # Generate self-signed certificate\n keytool -genkeypair \\\n -alias stirling \\\n -keyalg RSA \\\n -keysize 2048 \\\n -storetype PKCS12 \\\n -keystore keystore.p12 \\\n -validity 365\n\n # Move to configs directory\n mv keystore.p12 ./stirling-data/configs/\n ```\n\n **Option B: Let's Encrypt (for production):**\n ```bash\n # Get certificate with certbot\n sudo certbot certonly --standalone -d pdf.yourcompany.com\n\n # Convert to PKCS12 format\n sudo openssl pkcs12 -export \\\n -in /etc/letsencrypt/live/pdf.yourcompany.com/fullchain.pem \\\n -inkey /etc/letsencrypt/live/pdf.yourcompany.com/privkey.pem \\\n -out keystore.p12 \\\n -name stirling\n\n # Move to configs\n sudo mv keystore.p12 ./stirling-data/configs/\n sudo chown $USER:$USER ./stirling-data/configs/keystore.p12\n ```\n\n2. **Create custom_settings.yml:**\n\n Create `./stirling-data/configs/custom_settings.yml`:\n ```yaml\n server:\n port: 8443 # HTTPS port\n ssl:\n enabled: true\n key-store: file:/configs/keystore.p12\n key-store-password: your-keystore-password\n key-store-type: PKCS12\n key-alias: stirling\n ```\n\n3. **Update docker-compose.yml to expose port 8443:**\n ```yaml\n services:\n stirling-pdf:\n ports:\n - '8443:8443' # Change from 8080:8080\n ```\n\n4. **Restart Stirling-PDF:**\n ```bash\n docker-compose down\n docker-compose up -d\n ```\n\n5. **Access via HTTPS:**\n ```\n https://pdf.yourcompany.com:8443\n ```\n\n**Benefits:**\n- ✅ Simple setup, no reverse proxy needed\n- ✅ Direct SSL termination in application\n- ✅ Good for small deployments\n\n**Limitations:**\n- ⚠️ Manual certificate renewal\n- ⚠️ No load balancing\n- ⚠️ Port 8443 instead of standard 443\n\n**Learn more:** [Custom Settings - SSL Configuration](doc:configuration/customisation/extra-settings)\n\n\n\n\n**Best for:** Production deployments, standard ports (443), load balancing\n\nUse a reverse proxy like **Nginx, Apache, or Traefik** to handle HTTPS.\n\n#### Option A: Nginx with Let's Encrypt\n\n**Install Nginx and Certbot:**\n```bash\nsudo apt update\nsudo apt install nginx certbot python3-certbot-nginx\n```\n\n**Configure Nginx:**\n\nCreate `/etc/nginx/sites-available/stirling-pdf`:\n```nginx\nserver {\n listen 80;\n server_name pdf.yourcompany.com;\n\n # Redirect HTTP to HTTPS\n return 301 https://$server_name$request_uri;\n}\n\nserver {\n listen 443 ssl http2;\n server_name pdf.yourcompany.com;\n\n # SSL certificates (will be added by certbot)\n ssl_certificate /etc/letsencrypt/live/pdf.yourcompany.com/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/pdf.yourcompany.com/privkey.pem;\n\n # Strong SSL settings\n ssl_protocols TLSv1.2 TLSv1.3;\n ssl_ciphers HIGH:!aNULL:!MD5;\n ssl_prefer_server_ciphers on;\n\n # Security headers\n add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains\" always;\n add_header X-Frame-Options \"SAMEORIGIN\" always;\n add_header X-Content-Type-Options \"nosniff\" always;\n add_header X-XSS-Protection \"1; mode=block\" always;\n\n # Large file uploads\n client_max_body_size 2000M;\n client_body_timeout 300s;\n\n # Proxy to Stirling-PDF\n location / {\n proxy_pass http://localhost:8080;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n\n # WebSocket support (if needed)\n proxy_http_version 1.1;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection \"upgrade\";\n\n # Timeouts for large files\n proxy_connect_timeout 300s;\n proxy_send_timeout 300s;\n proxy_read_timeout 300s;\n }\n}\n```\n\n**Enable site and get certificate:**\n```bash\n# Enable site\nsudo ln -s /etc/nginx/sites-available/stirling-pdf /etc/nginx/sites-enabled/\nsudo nginx -t\nsudo systemctl reload nginx\n\n# Get Let's Encrypt certificate\nsudo certbot --nginx -d pdf.yourcompany.com\n\n# Auto-renewal (certbot sets this up automatically)\nsudo certbot renew --dry-run\n```\n\n**Update DNS:**\n```\nA record: pdf.yourcompany.com → your-server-ip\n```\n\n**Access your site:**\n```\nhttps://pdf.yourcompany.com\n```\n\n\n\n\n**Best for:** Docker environments, automatic certificate management\n\nTraefik is a Docker-native reverse proxy that automatically:\n- Obtains SSL certificates from Let's Encrypt\n- Renews certificates automatically\n- Routes traffic based on Docker labels\n\n**Key benefits:**\n- ✅ Zero-config certificate management\n- ✅ Docker label-based routing\n- ✅ Automatic service discovery\n\nAdd Traefik container to your `docker-compose.yml` and configure Stirling-PDF with Docker labels for routing.\n\n**See Traefik documentation:** https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/\n\n\n\n\n**Best for:** No public IP, behind firewall, home servers\n\nCloudflare Tunnel provides:\n- ✅ No port forwarding needed\n- ✅ DDoS protection included\n- ✅ Automatic HTTPS\n- ✅ Free for most use cases\n\n**Quick setup:**\n1. Install `cloudflared`\n2. Authenticate with Cloudflare\n3. Create tunnel pointing to `http://localhost:8080`\n4. Add DNS record\n5. Run as system service\n\n**See Cloudflare documentation:** https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/\n\n\n\n\n### 5.2: Update Stirling-PDF Configuration\n\nAfter setting up HTTPS, update Stirling-PDF to use the correct URL:\n\n**In Settings → General:**\n```yaml\nSystem Settings:\n Root URI Path: / (or /pdf if using subdirectory)\n Frontend URL: https://pdf.yourcompany.com\n CORS Allowed Origins: https://pdf.yourcompany.com\n```\n\n---\n\n## Step 6: User Management\n\nNow that your system is secure and accessible, let's set up users.\n\n### 6.1: Understanding User Roles\n\n\n\n\n**Out-of-the-box roles:**\n\n| Role | Permissions | Use Case |\n|------|-------------|----------|\n| **Admin** | Full access to all features, settings, user management | System administrators, IT staff |\n| **User** | Access to enabled PDF tools, no settings access | Regular employees, end users |\n\n**Admin capabilities:**\n- ✅ Access all PDF tools\n- ✅ Manage users (create, delete, reset passwords)\n- ✅ Configure all settings\n- ✅ View usage statistics\n- ✅ Enable/disable features\n- ✅ View logs (if configured)\n\n**User capabilities:**\n- ✅ Access enabled PDF tools only\n- ✅ Upload and process files\n- ✅ Download results\n- ❌ No settings access\n- ❌ No user management\n- ❌ No system configuration\n\n\n\n\n### 6.2: Adding Users\n\n\n\n\n**As admin, manually create user accounts:**\n\n1. **Navigate to Settings → User Management**\n\n2. **Click \"Add User\" button**\n\n3. **Fill in user details:**\n ```\n Username: john.doe\n Email: [email protected] (optional but recommended)\n Password: Auto-generate or set manually\n Role: User (or Admin for additional admins)\n Enabled: Yes\n ```\n\n4. **Click \"Create User\"**\n\n5. **Share credentials with user** (via secure channel)\n\n**Bulk user creation:**\nYou can paste a list of email addresses (one per line) to create multiple users at once.\n\n**Best practices:**\n- Use email as username for easier identification\n- Auto-generate strong passwords\n- Keep records of who has access\n\n\n\n\n**Send email invitations** (requires email configuration):\n\n1. **Navigate to Settings → User Management**\n\n2. **Click \"Invite User\" button**\n\n3. **Fill in details:**\n ```\n Email: [email protected]\n Role: User\n Message: Optional welcome message\n ```\n\n4. **Click \"Send Invitation\"**\n\n5. **User receives email** with magic link to register\n\n6. **User clicks link, creates password, and is automatically logged in**\n\n**Bulk invitations:**\nYou can paste a list of email addresses (one per line) to send multiple invitations at once.\n\n**Benefits:**\n- ✅ More secure (user sets own password)\n- ✅ Professional onboarding experience\n- ✅ Magic link authentication\n- ✅ No need to share passwords\n\n**Email configuration required:**\n```yaml\nEmail Settings:\n SMTP Host: smtp.gmail.com\n SMTP Port: 587\n SMTP Username: [email protected]\n SMTP Password: your-app-password\n From Address: [email protected]\n```\n\n\n\n\n### 6.3: User Management Tasks\n\n**Common admin tasks:**\n\n#### View All Users\n- Navigate to **Settings → User Management**\n- See list of all users with status, role, last login\n\n#### Reset User Password\n1. Find user in user list\n2. Click \"Reset Password\" button\n3. New password generated or set manually\n4. Share new password securely\n\n#### Disable/Enable User\n1. Find user in user list\n2. Toggle \"Enabled\" switch\n3. Disabled users cannot log in\n\n#### Delete User\n1. Find user in user list\n2. Click \"Delete\" button\n3. Confirm deletion\n4. ⚠️ **Warning:** This is permanent\n\n#### Change User Role\n1. Find user in user list\n2. Change role dropdown (User/Admin)\n3. Save changes\n\n---\n\n## Step 7: Monitoring & Usage Tracking\n\nUnderstanding how your users are using Stirling-PDF helps with capacity planning and identifying issues.\n\n### 7.1: Basic Monitoring\n\n\n\n\n**View application logs:**\n\n```bash\n# Docker Compose\ndocker-compose logs -f stirling-pdf\n\n# Docker Run\ndocker logs -f stirling-pdf\n\n# Last 100 lines\ndocker logs --tail 100 stirling-pdf\n\n# Filter for errors\ndocker logs stirling-pdf 2>&1 | grep ERROR\n```\n\n**What to look for:**\n- ✅ Successful operations\n- ⚠️ Warnings (disk space, memory)\n- ❌ Errors (failed operations, crashes)\n- 🔒 Security events (failed logins, unauthorized access)\n\n**Common log entries:**\n```\nINFO: User john.doe uploaded file document.pdf\nINFO: Operation MERGE completed successfully\nWARN: Disk space low: 85% used\nERROR: OCR operation failed: Tesseract not found\n```\n\n\n\n\n#### Basic API Monitoring\n\n**Usage Statistics API** (available to all users):\n```bash\n# Application status\ncurl http://localhost:8080/api/v1/info/status\n\n# Request counts\ncurl http://localhost:8080/api/v1/info/requests/all\n\n# Unique users\ncurl http://localhost:8080/api/v1/info/requests/all/unique\n```\n\n**Health Check Endpoint:**\n```bash\ncurl http://localhost:8080/api/v1/info/status\n\n# Response:\n{\"status\":\"UP\",\"version\":\"<version>\"}\n```\n\nUse `/api/v1/info/status` for health and uptime checks - it is always reachable without authentication.\n\n**Use for:**\n- Load balancer health checks\n- Uptime monitoring (Uptime Robot, Pingdom)\n- Custom monitoring scripts\n\n#### Prometheus Integration (Enterprise)\n\nStirling-PDF Enterprise plan supports Prometheus metrics for advanced monitoring.\n\n**Learn more:** [Usage Monitoring - Prometheus Setup](doc:configuration/automation/usage-monitoring)\n\n**Features:**\n- JVM metrics (memory, GC, threads)\n- System metrics (CPU, disk)\n- Application metrics (request rates, processing times)\n- PDF processing metrics\n\n#### Log Aggregation\n\nForward logs to centralized logging:\n\n**Option 1: Docker log driver**\n```yaml\nservices:\n stirling-pdf:\n logging:\n driver: \"json-file\"\n options:\n max-size: \"10m\"\n max-file: \"3\"\n```\n\n**Option 2: Syslog**\n```yaml\nservices:\n stirling-pdf:\n logging:\n driver: syslog\n options:\n syslog-address: \"tcp://your-syslog-server:514\"\n```\n\n**Popular log aggregation tools:**\n- ELK Stack (Elasticsearch, Logstash, Kibana)\n- Splunk\n- Graylog\n- Datadog\n\n\n\n\n### 7.2: Set Up Monitoring\n\n**Basic monitoring approach:**\n\n1. **Monitor Docker logs regularly:**\n ```bash\n docker logs stirling-pdf --tail 100 -f\n ```\n\n2. **Check Docker container health:**\n ```bash\n docker ps\n docker stats stirling-pdf\n ```\n\n3. **Monitor disk space:**\n ```bash\n df -h\n du -sh ./stirling-data/*\n ```\n\n4. **Use external uptime monitoring:**\n - Uptime Robot (free)\n - Pingdom\n - StatusCake\n - Monitor the status endpoint: `http://localhost:8080/api/v1/info/status`\n\n---\n\n## Step 8: Backup & Disaster Recovery\n\nProtect your users' data and configuration with proper backups.\n\n### 8.1: What to Backup\n\n**Critical data to backup:**\n\n| Data | Location | Frequency | Importance |\n|------|----------|-----------|------------|\n| **User Database (if local)** | `./stirling-data/configs/stirling-pdf-DB-<schema-version>.mv.db` | Daily | Critical* |\n| **Settings File** | `./stirling-data/configs/settings.yml` | After changes | Critical |\n| **Custom Files** | `./stirling-data/customFiles/` | After changes | High |\n| **OCR Languages** | `./stirling-data/tessdata/` | Weekly | Medium |\n| **Logs** | `./stirling-data/logs/` | Optional | Low |\n\n**\\*Note on User Database:**\n- **Free edition:** Uses a local H2 database file named `stirling-pdf-DB-<schema-version>.mv.db` (the schema version is embedded in the filename, e.g. `stirling-pdf-DB-2.3.232.mv.db`) - must be backed up. The simplest approach is to back up the whole `configs/` directory.\n- **Server/Enterprise:** Should use external PostgreSQL database (backed up separately)\n\n> **💡 Tip: Server/Enterprise Recommendation**\n>\n> Server and Enterprise plan users should configure an external PostgreSQL database instead of using the local H2 database. This provides better reliability, scalability, and backup capabilities.\n>\n> **Learn more:** [External Database Configuration](doc:configuration/storage/external-database)\n\n\n### 8.2: Backup Strategies\n\n\n\n\n**Create automated backup script:**\n\nCreate `backup-stirling.sh`:\n```bash\n#!/bin/bash\n\n# Configuration\nBACKUP_DIR=\"/backups/stirling-pdf\"\nSTIRLING_DATA=\"/path/to/stirling-data\"\nRETENTION_DAYS=30\n\n# Create backup directory\nmkdir -p \"$BACKUP_DIR\"\n\n# Generate timestamp\nTIMESTAMP=$(date +%Y%m%d-%H%M%S)\nBACKUP_FILE=\"$BACKUP_DIR/stirling-backup-$TIMESTAMP.tar.gz\"\n\n# Stop container (optional, for consistency)\n# docker-compose -f /path/to/docker-compose.yml stop stirling-pdf\n\n# Create backup\ntar -czf \"$BACKUP_FILE\" \\\n -C \"$STIRLING_DATA\" \\\n configs/ \\\n customFiles/ \\\n tessdata/\n\n# Start container (if stopped)\n# docker-compose -f /path/to/docker-compose.yml start stirling-pdf\n\n# Delete old backups\nfind \"$BACKUP_DIR\" -name \"stirling-backup-*.tar.gz\" -mtime +$RETENTION_DAYS -delete\n\n# Log result\necho \"[$TIMESTAMP] Backup completed: $BACKUP_FILE\"\n```\n\n**Make executable and schedule:**\n```bash\nchmod +x backup-stirling.sh\n\n# Add to crontab (daily at 2 AM)\ncrontab -e\n# Add: 0 2 * * * /path/to/backup-stirling.sh >> /var/log/stirling-backup.log 2>&1\n```\n\n\n\n\n**Backup Docker volumes:**\n\n```bash\n# Stop container\ndocker-compose stop stirling-pdf\n\n# Backup volumes\ndocker run --rm \\\n -v $(pwd)/stirling-data:/data \\\n -v $(pwd)/backups:/backup \\\n alpine tar -czf /backup/stirling-data-$(date +%Y%m%d).tar.gz /data\n\n# Start container\ndocker-compose start stirling-pdf\n```\n\n**Automated with Cron:**\nCreate `docker-volume-backup.sh`:\n```bash\n#!/bin/bash\ncd /path/to/stirling-pdf\ndocker-compose stop stirling-pdf\ndocker run --rm \\\n -v \"$(pwd)/stirling-data:/data\" \\\n -v \"$(pwd)/backups:/backup\" \\\n alpine tar -czf /backup/stirling-data-$(date +%Y%m%d).tar.gz /data\ndocker-compose start stirling-pdf\n\n# Cleanup old backups (keep 30 days)\nfind backups/ -name \"stirling-data-*.tar.gz\" -mtime +30 -delete\n```\n\n\n\n\n### 8.3: Restore from Backup\n\n**Restore procedure:**\n\n1. **Stop Stirling-PDF:**\n ```bash\n docker-compose stop stirling-pdf\n ```\n\n2. **Extract backup:**\n ```bash\n tar -xzf stirling-backup-YYYYMMDD-HHMMSS.tar.gz -C ./stirling-data/\n ```\n\n3. **Verify files restored:**\n ```bash\n ls -la ./stirling-data/configs/\n # Should see: stirling-pdf-DB-<schema-version>.mv.db, settings.yml\n ```\n\n4. **Start Stirling-PDF:**\n ```bash\n docker-compose start stirling-pdf\n ```\n\n5. **Verify functionality:**\n - Access web interface\n - Log in as admin\n - Check users exist\n - Verify settings\n\n---\n\n## Step 9: Performance Optimization\n\nFor resource sizing recommendations, scaling guidance, and fine tuning, see the dedicated [Performance Optimization & Sizing](doc:configuration/operations/performance-optimization) guide.\n\n---\n\n## Step 10: Paid Plans (Server/Enterprise)\n\nStirling-PDF offers **Server and Enterprise paid plans** with additional features for organizations.\n\n### Key Paid Plan Features\n\n**Authentication & Security:**\n- **OAuth2 SSO:** Server tier (Google, GitHub, Keycloak, OIDC)\n- **SAML2 SSO:** Enterprise tier (Okta, Azure AD, etc.)\n- Enhanced security features\n\n**Database & Infrastructure:**\n- **External PostgreSQL Database:** Available for Server/Enterprise deployments\n- Better reliability and scalability than local H2 database\n- Professional backup and replication strategies\n\n**Monitoring & Analytics:**\n- **Prometheus Integration:** Advanced metrics and monitoring\n- **Usage Monitoring UI:** Graphical usage statistics in the admin interface\n- Enhanced monitoring APIs\n\n**For pricing and enterprise inquiries:**\n- **Email:** [email protected]\n- **Website:** https://stirling.com/pricing\n- **Documentation:** [Paid Offerings](doc:paid-offerings)\n- **External Database Setup:** [External Database Guide](doc:configuration/storage/external-database)\n- **Monitoring Setup:** [Usage Monitoring](doc:configuration/automation/usage-monitoring)\n\n---\n\n## Next Steps & Resources\n\nCongratulations! You've successfully deployed and configured Stirling-PDF for your organization.\n\n### Recommended Next Steps\n\n1. **📚 Train your users**\n - Share the [Getting Started Guide](doc:getting-started)\n - Point them to [Tool Reference](doc:functionality/functionality)\n - Create internal documentation for your specific workflows\n\n2. **🔧 Advanced configuration**\n - [OCR Configuration](doc:configuration/operations/ocr) - Add more languages\n - [Pipeline Automation](doc:configuration/automation/pipeline) - Automate workflows\n - [API Integration](doc:api) - Integrate with other systems\n - [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) - Scale document conversions\n\n3. **🔒 Harden security**\n - [Fail2Ban Setup](doc:configuration/security/fail2ban) - Prevent brute force\n - [External Database](doc:configuration/storage/external-database) - Use PostgreSQL\n - Review [System and Security](doc:configuration/security/system-and-security) settings\n\n4. **📊 Monitor and optimize**\n - Set up regular backup verification\n - Review logs weekly\n - Monitor disk space and performance\n - Plan for growth\n\n### Support & Community\n\n- **Documentation:** https://docs.stirlingpdf.com\n- **GitHub:** https://github.com/Stirling-Tools/Stirling-PDF\n- **Discord:** https://discord.gg/HYmhKj45pU\n- **Issue Tracker:** https://github.com/Stirling-Tools/Stirling-PDF/issues\n\n### Stay Updated\n\n- **Release Notes:** https://github.com/Stirling-Tools/Stirling-PDF/releases\n- **Blog:** https://stirlingtools.com/blog\n- **Newsletter:** Subscribe at https://stirlingtools.com\n\n---\n\n## Troubleshooting Common Issues\n\n### Authentication Issues\n\n**Problem:** Can't log in as admin\n\n**Solutions:**\n1. Check logs: `docker logs stirling-pdf | grep ERROR`\n2. Verify `SECURITY_ENABLELOGIN=true` is set\n3. Reset admin password via command line:\n ```bash\n docker exec -it stirling-pdf sh\n # Use built-in password reset tool\n ```\n\n### Performance Issues\n\n**Problem:** Slow processing, timeouts\n\n**Solutions:**\n1. Check resource limits: `docker stats stirling-pdf`\n2. Increase JVM heap - see [Performance Optimization](doc:configuration/operations/performance-optimization)\n3. Increase LibreOffice instances if document conversions are slow - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n4. Check disk I/O: Use SSD for temp file storage\n5. Run the built-in [diagnostics tool](doc:configuration/operations/diagnostics) and check application logs\n\n### HTTPS/Certificate Issues\n\n**Problem:** Certificate errors, HTTPS not working\n\n**Solutions:**\n1. Check Nginx/Traefik logs\n2. Verify DNS points to correct IP\n3. Ensure ports 80 and 443 are open\n4. Test Let's Encrypt manually: `sudo certbot certificates`\n\n### File Upload Issues\n\n**Problem:** Can't upload large files\n\n**Solutions:**\n1. Increase Nginx limit: `client_max_body_size 2000M;`\n2. Increase Stirling-PDF limit: `system.fileUploadLimit: 2000MB` (env `SYSTEMFILEUPLOADLIMIT=2000MB`)\n3. Check disk space: `df -h`\n4. Increase timeouts: `client_body_timeout 300s;`\n\n### Need More Help?\n\nRun the built-in [diagnostics tool](doc:configuration/operations/diagnostics) inside your Docker container to collect logs, configuration, and system information into a shareable archive.\n\n**For Community Support:**\n- Join Discord: https://discord.gg/HYmhKj45pU\n- Search GitHub Issues: https://github.com/Stirling-Tools/Stirling-PDF/issues\n\n**For Priority Support:**\n- Upgrade to Server or Enterprise plan\n- Email: [email protected]\n- Get dedicated support team\n\n---\n\n**You're all set!** 🎉\n\nYour Stirling-PDF deployment is ready for production use. If you have any questions or need assistance, don't hesitate to reach out to our community or consider upgrading to a paid plan (Server or Enterprise) for dedicated support.\n\nHappy PDF processing! 📄✨",
+ "markdown": "Welcome! This guide will walk you through deploying Stirling-PDF for your organization, from initial installation to advanced configuration and scaling.\n\n> **💡 Tip: For Organizations & Teams**\n>\n> This guide is designed for server administrators deploying Stirling-PDF for teams, departments, or entire organizations. If you're interested in **paid plan features** (external database, Google Drive, SSO, advanced user management, priority support), we'll highlight upgrade paths throughout this guide.\n\n\n---\n\n## Overview: What You'll Accomplish\n\nBy the end of this guide, you'll have:\n\n1. ✅ **Stirling-PDF running** on your infrastructure\n2. ✅ **User authentication configured** with admin access\n3. ✅ **Settings customized** for your organization\n4. ✅ **Security hardened** with HTTPS and proper access controls\n5. ✅ **Monitoring setup** to track usage and performance\n6. ✅ **Understanding of paid plan** upgrade paths (Team/Enterprise)\n\n**Time estimate:** 30-60 minutes for basic setup, 2-3 hours for full enterprise configuration\n\n---\n\n## Step 1: Choose Your Deployment Path\n\n\n\n\n**Best for:** Most organizations, production deployments, easy management\n\n**Why Docker Compose?**\n- ✅ Simple one-command deployment\n- ✅ Easy updates and rollbacks\n- ✅ Persistent data management\n- ✅ Production-ready configuration\n- ✅ Easy to scale and customize\n\n**Requirements:**\n- Docker Engine 20.10+\n- Docker Compose 1.29+\n- 2GB RAM minimum (4GB+ recommended)\n- 10GB disk space\n\n**Jump to:** [Docker Compose Setup](#docker-compose-setup)\n\n\n\n\n**Best for:** Quick testing, single-container deployments, learning\n\n**Why Docker Run?**\n- ✅ Fastest way to get started\n- ✅ Single command deployment\n- ✅ Good for testing before production\n- ⚠️ More manual management needed\n\n**Requirements:**\n- Docker Engine 20.10+\n- 2GB RAM minimum\n- 5GB disk space\n\n**Jump to:** [Docker Run Setup](#docker-run-setup)\n\n\n\n\n**Best for:** Enterprise scale, high availability, cloud-native deployments\n\n**Why Kubernetes?**\n- ✅ Auto-scaling capabilities\n- ✅ High availability and fault tolerance\n- ✅ Load balancing built-in\n- ✅ Cloud provider integration\n- ⚠️ More complex to set up\n\n**Requirements:**\n- Kubernetes cluster 1.19+\n- kubectl configured\n- Persistent volume support\n- Load balancer support\n\n**Jump to:** [Kubernetes Guide](doc:installation/kubernetes)\n\n\n\n\n**Best for:** Environments without Docker, specific OS requirements\n\n**Why Bare Metal?**\n- ✅ Maximum control\n- ✅ No container overhead\n- ✅ Custom Java configurations\n- ⚠️ More maintenance required\n\n**Requirements:**\n- Java 25+\n- Linux/Unix system\n- 2GB RAM minimum\n- LibreOffice, Tesseract (for features)\n\n**Jump to:** [Unix Installation Guide](doc:installation/unix)\n\n\n\n\n---\n\n## Step 2: Installation\n\nFollow the installation instructions for your chosen deployment method from Step 1.\n\n\n\n\n### Docker Compose Setup\n\nThis is the recommended approach for production deployments.\n\n#### 2.1: Create docker-compose.yml\n\nCreate a directory for your Stirling-PDF deployment:\n\n```bash\nmkdir -p ~/stirling-pdf\ncd ~/stirling-pdf\n```\n\nCreate `docker-compose.yml` with this production-ready configuration:\n\n```yaml\n\nservices:\n stirling-pdf:\n image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n container_name: stirling-pdf\n ports:\n - '8080:8080'\n volumes:\n # Persistent data storage\n - ./stirling-data/tessdata:/usr/share/tessdata # OCR language files\n - ./stirling-data/configs:/configs # Settings & database\n - ./stirling-data/logs:/logs # Application logs\n - ./stirling-data/customFiles:/customFiles:rw # Custom branding files\n - ./stirling-data/pipeline:/pipeline # Automation configs\n environment:\n # Core Settings\n - SECURITY_ENABLELOGIN=true # Enable user authentication\n\n # Language & Localization\n - SYSTEM_DEFAULTLOCALE=en-US # Default UI locale for new users\n\n # System Configuration\n - SYSTEM_GOOGLEVISIBILITY=false # Hide from search engines\n - SYSTEM_ROOTURIPATH=/ # Base URL path\n - SYSTEMFILEUPLOADLIMIT=2000MB # Max upload size (legacy: SYSTEM_MAXFILESIZE in MB)\n\n restart: unless-stopped\n\n # Optional: Resource limits\n deploy:\n resources:\n limits:\n memory: 4G\n cpus: '2.0'\n reservations:\n memory: 2G\n cpus: '1.0'\n```\n\n#### 2.2: Start Stirling-PDF\n\n```bash\n# Start the container\ndocker-compose up -d\n\n# Check if it's running\ndocker-compose ps\n\n# View logs\ndocker-compose logs -f\n```\n\n#### 2.3: Verify Installation\n\nOpen your browser and navigate to:\n```\nhttp://your-server-ip:8080\n```\n\nYou should see the Stirling-PDF homepage!\n\n> **💡 Tip: Success!**\n>\n> If you see the Stirling-PDF interface, your installation is successful. Continue to Step 3 to set up authentication.\n\n\n**Troubleshooting:**\n- **Can't connect?** Check firewall rules: `sudo ufw allow 8080`\n- **Container won't start?** Check logs: `docker-compose logs`\n- **Permission errors?** Fix permissions: `sudo chmod -R 755 ./stirling-data`\n\n\n\n\n### Docker Run Setup\n\nFor quick testing or simpler deployments.\n\n#### 2.1: Create Data Directory and Run Container\n\n```bash\n# Create data directory\nmkdir -p ~/stirling-data\n\n# Run Stirling-PDF\ndocker run -d \\\n --name stirling-pdf \\\n -p 8080:8080 \\\n -v ~/stirling-data/tessdata:/usr/share/tessdata \\\n -v ~/stirling-data/configs:/configs \\\n -v ~/stirling-data/logs:/logs \\\n -v ~/stirling-data/customFiles:/customFiles:rw \\\n -e SECURITY_ENABLELOGIN=true \\\n -e SYSTEM_DEFAULTLOCALE=en-US \\\n -e SYSTEM_GOOGLEVISIBILITY=false \\\n -e SYSTEMFILEUPLOADLIMIT=2000MB \\\n --restart unless-stopped \\\n docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest\n```\n\n#### 2.2: Verify Installation\n\n```bash\n# Check if running\ndocker ps | grep stirling-pdf\n\n# View logs\ndocker logs -f stirling-pdf\n```\n\nOpen your browser and navigate to:\n```\nhttp://your-server-ip:8080\n```\n\nYou should see the Stirling-PDF homepage!\n\n> **💡 Tip: Success!**\n>\n> If you see the Stirling-PDF interface, your installation is successful. Continue to Step 3 to set up authentication.\n\n\n**Troubleshooting:**\n- **Can't connect?** Check firewall rules: `sudo ufw allow 8080`\n- **Container won't start?** Check logs: `docker logs stirling-pdf`\n- **Permission errors?** Fix permissions: `sudo chmod -R 755 ~/stirling-data`\n\n\n\n\n### Kubernetes Setup\n\nFor enterprise-scale deployments with high availability.\n\nKubernetes deployment requires:\n- Persistent Volume Claims (PVCs)\n- Deployments and Services\n- Ingress/LoadBalancer configuration\n- Resource limits and autoscaling\n\n**See full guide:** [Kubernetes Installation Guide](doc:installation/kubernetes)\n\nThis includes complete YAML configurations, namespace setup, SSL/TLS, and horizontal pod autoscaling.\n\n\n\n\n### Bare Metal Setup\n\nFor environments without Docker or specific OS requirements.\n\nBare metal installation requires:\n- Java 25+\n- LibreOffice (for conversions)\n- Tesseract OCR (for OCR features)\n- Systemd service setup\n\n**See full guide:** [Unix Installation Guide](doc:installation/unix)\n\nThis includes complete dependency installation, JAR setup, systemd configuration, and troubleshooting.\n\n\n\n\n---\n\n## Step 3: Initial Login & Admin Setup\n\nNow that Stirling-PDF is running with authentication enabled, you need to create your admin account.\n\n### 3.1: First-Time Login\n\n1. **Navigate to your Stirling-PDF instance:**\n ```\n http://your-server-ip:8080\n ```\n\n2. **Log in with default credentials:**\n ```\n Username: admin\n Password: stirling\n ```\n\n3. **Change the default password immediately:**\n - After first login, go to Settings → Account\n - Change to a strong password (12+ characters, mixed case, numbers, symbols)\n\n> **💡 Tip: Customizing Default Credentials**\n>\n> You can set custom default credentials **before first startup** using environment variables:\n>\n> ```yaml\n> environment:\n> - SECURITY_INITIALLOGIN_USERNAME=youradmin\n> - SECURITY_INITIALLOGIN_PASSWORD=YourSecurePassword123!\n> ```\n>\n> **Important:** These only work on first startup. If you change them after the database is created, the old credentials remain active. Always change the password through the UI after first login.\n\n\n> **💡 Tip: User Registration**\n>\n> After first login, you can control how additional users are created through Settings → Security (covered in Step 4).\n\n\n### 3.2: Verify Admin Access\n\n1. **Log in with your admin account**\n\n2. **Click the Settings gear icon** ⚙️ in the top navigation bar\n\n3. **Verify you have admin access** by checking for admin-only sections:\n - **General Settings** - System configuration\n - **Security Settings** - User management, login settings\n - **UI Customization** - Branding and appearance\n - **User Management** - Create/manage users\n - **Endpoint Configuration** - Enable/disable tools\n\n **Note:** Regular users can also access Settings but only see their personal preferences (language, theme). Only admins see the sections listed above.\n\n4. **If you don't see admin sections:**\n - Check logs: `docker logs stirling-pdf`\n - Verify you're the first user created\n - Confirm `SECURITY_ENABLELOGIN=true` is set\n\n> **⚠️ Warning: Secure Your Admin Account**\n>\n> - **Change the default password immediately** after first login\n> - Use a strong password (12+ characters, mixed case, numbers, symbols)\n> - Consider using SSO (OAuth2/SAML2) to avoid password management entirely\n\n\n---\n\n## Step 4: Configure Essential Settings\n\nNow that you're logged in as admin, let's configure Stirling-PDF for your organization.\n\n### 4.1: General Settings\n\nNavigate to **Settings → General**\n\n\n\n\n**These settings should be configured immediately:**\n\n#### System Locale & Language\n```yaml\nsystem:\n defaultLocale: en-US # or en-GB, de-DE, fr-FR, etc.\n\nui:\n languages: [] # Empty = all languages enabled. Or specify: [\"en_GB\", \"de_DE\", \"fr_FR\"]\n```\n\n**Why:** Ensures UI appears in the correct language for your users\n\n#### Search Engine Visibility\n```yaml\nsystem:\n googlevisibility: false # Prevents search engines from indexing your site\n```\n\n**Why:** Keeps your internal PDF tool private\n\n#### File Upload Limits\n```yaml\nsystem:\n fileUploadLimit: 2000MB # or \"2GB\" - adjust based on your needs\n```\n\n**Why:** Prevents users from uploading files that crash the system\n\n\n\n\n**Configure these for better user experience:**\n\n#### Legal & Compliance\n```yaml\nlegal:\n termsAndConditions: https://yourcompany.com/tos # or empty string to disable\n privacyPolicy: https://yourcompany.com/privacy # or empty string to disable\n accessibilityStatement: '' # optional\n cookiePolicy: '' # optional\n impressum: '' # optional (required in some countries like Germany)\n```\n\n**Why:** Legal compliance, especially in GDPR/regulated industries\n\n#### Update Notifications (Optional)\n```yaml\nsystem:\n showUpdate: false # Set true to show update notifications\n showUpdateOnlyAdmin: false # Only admins see updates (requires showUpdate: true)\n```\n\n**Why:** Control update notifications in production environments\n\n#### Process Limits\n```yaml\nprocessExecutor:\n sessionLimit:\n libreOfficeSessionLimit: 1\n tesseractSessionLimit: 1\n pythonOpenCvSessionLimit: 8\n timeoutMinutes:\n libreOfficetimeoutMinutes: 30\n tesseractTimeoutMinutes: 30\n```\n\n**Why:** Prevents resource exhaustion based on your server capacity\n\n\n\n\n### 4.2: Security Settings\n\nNavigate to **Settings → Security**\n\n> **⚠️ Warning: Critical for Production**\n>\n> These settings directly impact your organization's security. Review carefully!\n\n\n#### User Registration Control\n\n\n\n\n**Best for:** Controlled environments, enterprises, security-conscious orgs\n\n**How it works:**\n1. Admin creates user accounts manually in Settings → User Management\n2. Admin shares credentials with users securely\n3. Users log in with provided credentials\n\n**Email Invitations (Optional):**\nIf you configure email, admins can send invitation links instead.\n\n\n\n\n```yaml\nmail:\n enabled: true\n enableInvites: true\n host: smtp.gmail.com\n port: 587\n username: [email protected]\n password: ${MAIL_PASSWORD} # Use environment variable\n from: [email protected]\n startTlsEnable: true # STARTTLS upgrade after connecting (port 587)\n```\n\n\n\n\n```bash\nMAIL_ENABLED=true\nMAIL_ENABLEINVITES=true\nMAIL_HOST=smtp.gmail.com\nMAIL_PORT=587\[email protected]\nMAIL_PASSWORD=your-app-password\[email protected]\nMAIL_STARTTLSENABLE=true\n```\n\n\n\n\n\n\n\n**Best for:** Large enterprises, existing SSO infrastructure\n\n**Single Sign-On (SSO) options:**\n- **OAuth2:** Team tier - Supports Google, GitHub, Keycloak, any OpenID Connect provider\n- **SAML2:** Enterprise tier - Supports Okta, Azure AD, etc.\n\n**Key settings:**\n```yaml\nsecurity:\n enableLogin: true\n loginMethod: oauth2 # or 'saml2' or 'all'\n oauth2:\n enabled: true\n autoCreateUser: true # Auto-create users on first login\n blockRegistration: false # Set true to require admin pre-registration\n```\n\n**Benefits:**\n- ✅ No password management\n- ✅ Centralized access control\n- ✅ Automatic user provisioning\n- ✅ Corporate policy compliance\n\n**See full guide:** [SSO Configuration Guide](doc:configuration/security/single-sign-on-configuration)\n\nComplete configuration examples for Google, GitHub, Keycloak, Okta, Azure AD, and generic OIDC/SAML2 providers.\n\n\n\n\n#### Login Security Settings\n\n```yaml\nsecurity:\n loginAttemptCount: 5 # Lock account after 5 failed attempts\n loginResetTimeMinutes: 120 # Unlock after 2 hours\n```\n\n**Notes:**\n- Session timeout is not configurable via settings\n- Password policies (length, complexity) are not currently configurable\n- Use SSO/OAuth2 for enterprise password policies\n\n### 4.3: Feature Control\n\nNavigate to **Settings → Endpoints**\n\nControl which PDF tools are available to users.\n\n\n\n\n**All tools are enabled by default.** You can disable specific tools if needed:\n\n```yaml\nendpoints:\n toRemove: [] # Add tool IDs to disable, e.g. ['sign', 'add-password']\n groupsToRemove: [] # Disable entire groups, e.g. ['LibreOffice']\n```\n\n**Most organizations don't need to disable anything** - all tools are useful and safe\n\n\n\n\n**Example: Disable security-sensitive tools:**\n\n```yaml\nendpoints:\n toRemove:\n - 'add-password' # Disable password protection tool\n - 'remove-password' # Disable password removal tool\n - 'change-permissions' # Disable permissions modification\n```\n\n**Example: Disable entire groups:**\n\n```yaml\nendpoints:\n groupsToRemove:\n - 'LibreOffice' # Disables all LibreOffice-based conversions\n```\n\n**How to disable in UI:**\n1. Log in as admin\n2. Go to Settings → Endpoints\n3. In \"Disabled Endpoints\", select the tools you want to disable (or use \"Disabled Endpoint Groups\" for whole groups)\n4. Save changes\n\n**See all tool IDs:** [Endpoint Customisation](doc:configuration/customisation/endpoint-or-feature-customisation)\n\n\n\n\n### 4.4: Save and Apply Settings\n\nAfter configuring all settings:\n\n1. **Click \"Save\" button** at the bottom of each settings page\n2. **Verify settings saved** - You should see a success message\n3. **Some settings require restart** - Check if restart notification appears\n4. **Test changes** - Log out and log in as a regular user to verify\n\n**If restart is needed:**\n```bash\n# Docker Compose\ndocker-compose restart\n\n# Docker Run\ndocker restart stirling-pdf\n```\n\n---\n\n## Step 5: HTTPS & Domain Setup\n\n> **🚫 Danger: Production Requirement**\n>\n> **Never run in production without HTTPS.** User credentials and PDF files will be transmitted in plain text over the network.\n\n\n### 5.1: Choose Your HTTPS Method\n\n\n\n\n**Best for:** Simple deployments, no reverse proxy needed\n\nStirling-PDF can handle HTTPS directly using built-in SSL configuration.\n\n#### Configure SSL in Stirling-PDF\n\n1. **Generate or obtain SSL certificate:**\n\n **Option A: Self-signed (for testing/internal use):**\n ```bash\n # Generate self-signed certificate\n keytool -genkeypair \\\n -alias stirling \\\n -keyalg RSA \\\n -keysize 2048 \\\n -storetype PKCS12 \\\n -keystore keystore.p12 \\\n -validity 365\n\n # Move to configs directory\n mv keystore.p12 ./stirling-data/configs/\n ```\n\n **Option B: Let's Encrypt (for production):**\n ```bash\n # Get certificate with certbot\n sudo certbot certonly --standalone -d pdf.yourcompany.com\n\n # Convert to PKCS12 format\n sudo openssl pkcs12 -export \\\n -in /etc/letsencrypt/live/pdf.yourcompany.com/fullchain.pem \\\n -inkey /etc/letsencrypt/live/pdf.yourcompany.com/privkey.pem \\\n -out keystore.p12 \\\n -name stirling\n\n # Move to configs\n sudo mv keystore.p12 ./stirling-data/configs/\n sudo chown $USER:$USER ./stirling-data/configs/keystore.p12\n ```\n\n2. **Create custom_settings.yml:**\n\n Create `./stirling-data/configs/custom_settings.yml`:\n ```yaml\n server:\n port: 8443 # HTTPS port\n ssl:\n enabled: true\n key-store: file:/configs/keystore.p12\n key-store-password: your-keystore-password\n key-store-type: PKCS12\n key-alias: stirling\n ```\n\n3. **Update docker-compose.yml to expose port 8443:**\n ```yaml\n services:\n stirling-pdf:\n ports:\n - '8443:8443' # Change from 8080:8080\n ```\n\n4. **Restart Stirling-PDF:**\n ```bash\n docker-compose down\n docker-compose up -d\n ```\n\n5. **Access via HTTPS:**\n ```\n https://pdf.yourcompany.com:8443\n ```\n\n**Benefits:**\n- ✅ Simple setup, no reverse proxy needed\n- ✅ Direct SSL termination in application\n- ✅ Good for small deployments\n\n**Limitations:**\n- ⚠️ Manual certificate renewal\n- ⚠️ No load balancing\n- ⚠️ Port 8443 instead of standard 443\n\n**Learn more:** [Custom Settings - SSL Configuration](doc:configuration/customisation/extra-settings)\n\n\n\n\n**Best for:** Production deployments, standard ports (443), load balancing\n\nUse a reverse proxy like **Nginx, Apache, or Traefik** to handle HTTPS.\n\n#### Option A: Nginx with Let's Encrypt\n\n**Install Nginx and Certbot:**\n```bash\nsudo apt update\nsudo apt install nginx certbot python3-certbot-nginx\n```\n\n**Configure Nginx:**\n\nCreate `/etc/nginx/sites-available/stirling-pdf`:\n```nginx\nserver {\n listen 80;\n server_name pdf.yourcompany.com;\n\n # Redirect HTTP to HTTPS\n return 301 https://$server_name$request_uri;\n}\n\nserver {\n listen 443 ssl http2;\n server_name pdf.yourcompany.com;\n\n # SSL certificates (will be added by certbot)\n ssl_certificate /etc/letsencrypt/live/pdf.yourcompany.com/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/pdf.yourcompany.com/privkey.pem;\n\n # Strong SSL settings\n ssl_protocols TLSv1.2 TLSv1.3;\n ssl_ciphers HIGH:!aNULL:!MD5;\n ssl_prefer_server_ciphers on;\n\n # Security headers\n add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains\" always;\n add_header X-Frame-Options \"SAMEORIGIN\" always;\n add_header X-Content-Type-Options \"nosniff\" always;\n add_header X-XSS-Protection \"1; mode=block\" always;\n\n # Large file uploads\n client_max_body_size 2000M;\n client_body_timeout 300s;\n\n # Proxy to Stirling-PDF\n location / {\n proxy_pass http://localhost:8080;\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n\n # WebSocket support (if needed)\n proxy_http_version 1.1;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection \"upgrade\";\n\n # Timeouts for large files\n proxy_connect_timeout 300s;\n proxy_send_timeout 300s;\n proxy_read_timeout 300s;\n }\n}\n```\n\n**Enable site and get certificate:**\n```bash\n# Enable site\nsudo ln -s /etc/nginx/sites-available/stirling-pdf /etc/nginx/sites-enabled/\nsudo nginx -t\nsudo systemctl reload nginx\n\n# Get Let's Encrypt certificate\nsudo certbot --nginx -d pdf.yourcompany.com\n\n# Auto-renewal (certbot sets this up automatically)\nsudo certbot renew --dry-run\n```\n\n**Update DNS:**\n```\nA record: pdf.yourcompany.com → your-server-ip\n```\n\n**Access your site:**\n```\nhttps://pdf.yourcompany.com\n```\n\n\n\n\n**Best for:** Docker environments, automatic certificate management\n\nTraefik is a Docker-native reverse proxy that automatically:\n- Obtains SSL certificates from Let's Encrypt\n- Renews certificates automatically\n- Routes traffic based on Docker labels\n\n**Key benefits:**\n- ✅ Zero-config certificate management\n- ✅ Docker label-based routing\n- ✅ Automatic service discovery\n\nAdd Traefik container to your `docker-compose.yml` and configure Stirling-PDF with Docker labels for routing.\n\n**See Traefik documentation:** https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/\n\n\n\n\n**Best for:** No public IP, behind firewall, home servers\n\nCloudflare Tunnel provides:\n- ✅ No port forwarding needed\n- ✅ DDoS protection included\n- ✅ Automatic HTTPS\n- ✅ Free for most use cases\n\n**Quick setup:**\n1. Install `cloudflared`\n2. Authenticate with Cloudflare\n3. Create tunnel pointing to `http://localhost:8080`\n4. Add DNS record\n5. Run as system service\n\n**See Cloudflare documentation:** https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/\n\n\n\n\n### 5.2: Update Stirling-PDF Configuration\n\nAfter setting up HTTPS, update Stirling-PDF to use the correct URL:\n\n**In Settings → General:**\n```yaml\nSystem Settings:\n Root URI Path: / (or /pdf if using subdirectory)\n Frontend URL: https://pdf.yourcompany.com\n CORS Allowed Origins: https://pdf.yourcompany.com\n```\n\n---\n\n## Step 6: User Management\n\nNow that your system is secure and accessible, let's set up users.\n\n### 6.1: Understanding User Roles\n\n\n\n\n**Out-of-the-box roles:**\n\n| Role | Permissions | Use Case |\n|------|-------------|----------|\n| **Admin** | Full access to all features, settings, user management | System administrators, IT staff |\n| **User** | Access to enabled PDF tools, no settings access | Regular employees, end users |\n\n**Admin capabilities:**\n- ✅ Access all PDF tools\n- ✅ Manage users (create, delete, reset passwords)\n- ✅ Configure all settings\n- ✅ View usage statistics\n- ✅ Enable/disable features\n- ✅ View logs (if configured)\n\n**User capabilities:**\n- ✅ Access enabled PDF tools only\n- ✅ Upload and process files\n- ✅ Download results\n- ❌ No settings access\n- ❌ No user management\n- ❌ No system configuration\n\n\n\n\n### 6.2: Adding Users\n\n\n\n\n**As admin, manually create user accounts:**\n\n1. **Navigate to Settings → User Management**\n\n2. **Click \"Add User\" button**\n\n3. **Fill in user details:**\n ```\n Username: john.doe\n Email: [email protected] (optional but recommended)\n Password: Auto-generate or set manually\n Role: User (or Admin for additional admins)\n Enabled: Yes\n ```\n\n4. **Click \"Create User\"**\n\n5. **Share credentials with user** (via secure channel)\n\n**Bulk user creation:**\nYou can paste a list of email addresses (one per line) to create multiple users at once.\n\n**Best practices:**\n- Use email as username for easier identification\n- Auto-generate strong passwords\n- Keep records of who has access\n\n\n\n\n**Send email invitations** (requires email configuration):\n\n1. **Navigate to Settings → User Management**\n\n2. **Click \"Invite User\" button**\n\n3. **Fill in details:**\n ```\n Email: [email protected]\n Role: User\n Message: Optional welcome message\n ```\n\n4. **Click \"Send Invitation\"**\n\n5. **User receives email** with magic link to register\n\n6. **User clicks link, creates password, and is automatically logged in**\n\n**Bulk invitations:**\nYou can paste a list of email addresses (one per line) to send multiple invitations at once.\n\n**Benefits:**\n- ✅ More secure (user sets own password)\n- ✅ Professional onboarding experience\n- ✅ Magic link authentication\n- ✅ No need to share passwords\n\n**Email configuration required:**\n```yaml\nEmail Settings:\n SMTP Host: smtp.gmail.com\n SMTP Port: 587\n SMTP Username: [email protected]\n SMTP Password: your-app-password\n From Address: [email protected]\n```\n\n\n\n\n### 6.3: User Management Tasks\n\n**Common admin tasks:**\n\n#### View All Users\n- Navigate to **Settings → User Management**\n- See list of all users with status, role, last login\n\n#### Reset User Password\n1. Find user in user list\n2. Click \"Reset Password\" button\n3. New password generated or set manually\n4. Share new password securely\n\n#### Disable/Enable User\n1. Find user in user list\n2. Toggle \"Enabled\" switch\n3. Disabled users cannot log in\n\n#### Delete User\n1. Find user in user list\n2. Click \"Delete\" button\n3. Confirm deletion\n4. ⚠️ **Warning:** This is permanent\n\n#### Change User Role\n1. Find user in user list\n2. Change role dropdown (User/Admin)\n3. Save changes\n\n---\n\n## Step 7: Monitoring & Usage Tracking\n\nUnderstanding how your users are using Stirling-PDF helps with capacity planning and identifying issues.\n\n### 7.1: Basic Monitoring\n\n\n\n\n**View application logs:**\n\n```bash\n# Docker Compose\ndocker-compose logs -f stirling-pdf\n\n# Docker Run\ndocker logs -f stirling-pdf\n\n# Last 100 lines\ndocker logs --tail 100 stirling-pdf\n\n# Filter for errors\ndocker logs stirling-pdf 2>&1 | grep ERROR\n```\n\n**What to look for:**\n- ✅ Successful operations\n- ⚠️ Warnings (disk space, memory)\n- ❌ Errors (failed operations, crashes)\n- 🔒 Security events (failed logins, unauthorized access)\n\n**Common log entries:**\n```\nINFO: User john.doe uploaded file document.pdf\nINFO: Operation MERGE completed successfully\nWARN: Disk space low: 85% used\nERROR: OCR operation failed: Tesseract not found\n```\n\n\n\n\n#### Basic API Monitoring\n\n**Usage Statistics API** (available to all users):\n```bash\n# Application status\ncurl http://localhost:8080/api/v1/info/status\n\n# Request counts\ncurl http://localhost:8080/api/v1/info/requests/all\n\n# Unique users\ncurl http://localhost:8080/api/v1/info/requests/all/unique\n```\n\n**Health Check Endpoint:**\n```bash\ncurl http://localhost:8080/api/v1/info/status\n\n# Response:\n{\"status\":\"UP\",\"version\":\"<version>\"}\n```\n\nUse `/api/v1/info/status` for health and uptime checks - it is always reachable without authentication.\n\n**Use for:**\n- Load balancer health checks\n- Uptime monitoring (Uptime Robot, Pingdom)\n- Custom monitoring scripts\n\n#### Prometheus Integration (Enterprise)\n\nStirling-PDF Enterprise plan supports Prometheus metrics for advanced monitoring.\n\n**Learn more:** [Usage Monitoring - Prometheus Setup](doc:configuration/automation/usage-monitoring)\n\n**Features:**\n- JVM metrics (memory, GC, threads)\n- System metrics (CPU, disk)\n- Application metrics (request rates, processing times)\n- PDF processing metrics\n\n#### Log Aggregation\n\nForward logs to centralized logging:\n\n**Option 1: Docker log driver**\n```yaml\nservices:\n stirling-pdf:\n logging:\n driver: \"json-file\"\n options:\n max-size: \"10m\"\n max-file: \"3\"\n```\n\n**Option 2: Syslog**\n```yaml\nservices:\n stirling-pdf:\n logging:\n driver: syslog\n options:\n syslog-address: \"tcp://your-syslog-server:514\"\n```\n\n**Popular log aggregation tools:**\n- ELK Stack (Elasticsearch, Logstash, Kibana)\n- Splunk\n- Graylog\n- Datadog\n\n\n\n\n### 7.2: Set Up Monitoring\n\n**Basic monitoring approach:**\n\n1. **Monitor Docker logs regularly:**\n ```bash\n docker logs stirling-pdf --tail 100 -f\n ```\n\n2. **Check Docker container health:**\n ```bash\n docker ps\n docker stats stirling-pdf\n ```\n\n3. **Monitor disk space:**\n ```bash\n df -h\n du -sh ./stirling-data/*\n ```\n\n4. **Use external uptime monitoring:**\n - Uptime Robot (free)\n - Pingdom\n - StatusCake\n - Monitor the status endpoint: `http://localhost:8080/api/v1/info/status`\n\n---\n\n## Step 8: Backup & Disaster Recovery\n\nProtect your users' data and configuration with proper backups.\n\n### 8.1: What to Backup\n\n**Critical data to backup:**\n\n| Data | Location | Frequency | Importance |\n|------|----------|-----------|------------|\n| **User Database (if local)** | `./stirling-data/configs/stirling-pdf-DB-<schema-version>.mv.db` | Daily | Critical* |\n| **Settings File** | `./stirling-data/configs/settings.yml` | After changes | Critical |\n| **Custom Files** | `./stirling-data/customFiles/` | After changes | High |\n| **OCR Languages** | `./stirling-data/tessdata/` | Weekly | Medium |\n| **Logs** | `./stirling-data/logs/` | Optional | Low |\n\n**\\*Note on User Database:**\n- **Free edition:** Uses a local H2 database file named `stirling-pdf-DB-<schema-version>.mv.db` (the schema version is embedded in the filename, e.g. `stirling-pdf-DB-2.3.232.mv.db`) - must be backed up. The simplest approach is to back up the whole `configs/` directory.\n- **Team/Enterprise:** Should use external PostgreSQL database (backed up separately)\n\n> **💡 Tip: Team/Enterprise Recommendation**\n>\n> Team and Enterprise plan users should configure an external PostgreSQL database instead of using the local H2 database. This provides better reliability, scalability, and backup capabilities.\n>\n> **Learn more:** [External Database Configuration](doc:configuration/storage/external-database)\n\n\n### 8.2: Backup Strategies\n\n\n\n\n**Create automated backup script:**\n\nCreate `backup-stirling.sh`:\n```bash\n#!/bin/bash\n\n# Configuration\nBACKUP_DIR=\"/backups/stirling-pdf\"\nSTIRLING_DATA=\"/path/to/stirling-data\"\nRETENTION_DAYS=30\n\n# Create backup directory\nmkdir -p \"$BACKUP_DIR\"\n\n# Generate timestamp\nTIMESTAMP=$(date +%Y%m%d-%H%M%S)\nBACKUP_FILE=\"$BACKUP_DIR/stirling-backup-$TIMESTAMP.tar.gz\"\n\n# Stop container (optional, for consistency)\n# docker-compose -f /path/to/docker-compose.yml stop stirling-pdf\n\n# Create backup\ntar -czf \"$BACKUP_FILE\" \\\n -C \"$STIRLING_DATA\" \\\n configs/ \\\n customFiles/ \\\n tessdata/\n\n# Start container (if stopped)\n# docker-compose -f /path/to/docker-compose.yml start stirling-pdf\n\n# Delete old backups\nfind \"$BACKUP_DIR\" -name \"stirling-backup-*.tar.gz\" -mtime +$RETENTION_DAYS -delete\n\n# Log result\necho \"[$TIMESTAMP] Backup completed: $BACKUP_FILE\"\n```\n\n**Make executable and schedule:**\n```bash\nchmod +x backup-stirling.sh\n\n# Add to crontab (daily at 2 AM)\ncrontab -e\n# Add: 0 2 * * * /path/to/backup-stirling.sh >> /var/log/stirling-backup.log 2>&1\n```\n\n\n\n\n**Backup Docker volumes:**\n\n```bash\n# Stop container\ndocker-compose stop stirling-pdf\n\n# Backup volumes\ndocker run --rm \\\n -v $(pwd)/stirling-data:/data \\\n -v $(pwd)/backups:/backup \\\n alpine tar -czf /backup/stirling-data-$(date +%Y%m%d).tar.gz /data\n\n# Start container\ndocker-compose start stirling-pdf\n```\n\n**Automated with Cron:**\nCreate `docker-volume-backup.sh`:\n```bash\n#!/bin/bash\ncd /path/to/stirling-pdf\ndocker-compose stop stirling-pdf\ndocker run --rm \\\n -v \"$(pwd)/stirling-data:/data\" \\\n -v \"$(pwd)/backups:/backup\" \\\n alpine tar -czf /backup/stirling-data-$(date +%Y%m%d).tar.gz /data\ndocker-compose start stirling-pdf\n\n# Cleanup old backups (keep 30 days)\nfind backups/ -name \"stirling-data-*.tar.gz\" -mtime +30 -delete\n```\n\n\n\n\n### 8.3: Restore from Backup\n\n**Restore procedure:**\n\n1. **Stop Stirling-PDF:**\n ```bash\n docker-compose stop stirling-pdf\n ```\n\n2. **Extract backup:**\n ```bash\n tar -xzf stirling-backup-YYYYMMDD-HHMMSS.tar.gz -C ./stirling-data/\n ```\n\n3. **Verify files restored:**\n ```bash\n ls -la ./stirling-data/configs/\n # Should see: stirling-pdf-DB-<schema-version>.mv.db, settings.yml\n ```\n\n4. **Start Stirling-PDF:**\n ```bash\n docker-compose start stirling-pdf\n ```\n\n5. **Verify functionality:**\n - Access web interface\n - Log in as admin\n - Check users exist\n - Verify settings\n\n---\n\n## Step 9: Performance Optimization\n\nFor resource sizing recommendations, scaling guidance, and fine tuning, see the dedicated [Performance Optimization & Sizing](doc:configuration/operations/performance-optimization) guide.\n\n---\n\n## Step 10: Paid Plans (Team/Enterprise)\n\nStirling-PDF offers **Team and Enterprise paid plans** with additional features for organizations.\n\n### Key Paid Plan Features\n\n**Authentication & Security:**\n- **OAuth2 SSO:** Team tier (Google, GitHub, Keycloak, OIDC)\n- **SAML2 SSO:** Enterprise tier (Okta, Azure AD, etc.)\n- Enhanced security features\n\n**Database & Infrastructure:**\n- **External PostgreSQL Database:** Available for Team/Enterprise deployments\n- Better reliability and scalability than local H2 database\n- Professional backup and replication strategies\n\n**Monitoring & Analytics:**\n- **Prometheus Integration:** Advanced metrics and monitoring\n- **Usage Monitoring UI:** Graphical usage statistics in the admin interface\n- Enhanced monitoring APIs\n\n**For pricing and enterprise inquiries:**\n- **Email:** [email protected]\n- **Website:** https://stirling.com/pricing\n- **Documentation:** [Paid Offerings](doc:paid-offerings)\n- **External Database Setup:** [External Database Guide](doc:configuration/storage/external-database)\n- **Monitoring Setup:** [Usage Monitoring](doc:configuration/automation/usage-monitoring)\n\n---\n\n## Next Steps & Resources\n\nCongratulations! You've successfully deployed and configured Stirling-PDF for your organization.\n\n### Recommended Next Steps\n\n1. **📚 Train your users**\n - Share the [Getting Started Guide](doc:getting-started)\n - Point them to [Tool Reference](doc:functionality/functionality)\n - Create internal documentation for your specific workflows\n\n2. **🔧 Advanced configuration**\n - [OCR Configuration](doc:configuration/operations/ocr) - Add more languages\n - [Pipeline Automation](doc:configuration/automation/pipeline) - Automate workflows\n - [API Integration](doc:api) - Integrate with other systems\n - [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing) - Scale document conversions\n\n3. **🔒 Harden security**\n - [Fail2Ban Setup](doc:configuration/security/fail2ban) - Prevent brute force\n - [External Database](doc:configuration/storage/external-database) - Use PostgreSQL\n - Review [System and Security](doc:configuration/security/system-and-security) settings\n\n4. **📊 Monitor and optimize**\n - Set up regular backup verification\n - Review logs weekly\n - Monitor disk space and performance\n - Plan for growth\n\n### Support & Community\n\n- **Documentation:** https://docs.stirlingpdf.com\n- **GitHub:** https://github.com/Stirling-Tools/Stirling-PDF\n- **Discord:** https://discord.gg/HYmhKj45pU\n- **Issue Tracker:** https://github.com/Stirling-Tools/Stirling-PDF/issues\n\n### Stay Updated\n\n- **Release Notes:** https://github.com/Stirling-Tools/Stirling-PDF/releases\n- **Blog:** https://stirlingtools.com/blog\n- **Newsletter:** Subscribe at https://stirlingtools.com\n\n---\n\n## Troubleshooting Common Issues\n\n### Authentication Issues\n\n**Problem:** Can't log in as admin\n\n**Solutions:**\n1. Check logs: `docker logs stirling-pdf | grep ERROR`\n2. Verify `SECURITY_ENABLELOGIN=true` is set\n3. Reset admin password via command line:\n ```bash\n docker exec -it stirling-pdf sh\n # Use built-in password reset tool\n ```\n\n### Performance Issues\n\n**Problem:** Slow processing, timeouts\n\n**Solutions:**\n1. Check resource limits: `docker stats stirling-pdf`\n2. Increase JVM heap - see [Performance Optimization](doc:configuration/operations/performance-optimization)\n3. Increase LibreOffice instances if document conversions are slow - see [LibreOffice Parallel Processing](doc:configuration/operations/libreoffice-parallel-processing)\n4. Check disk I/O: Use SSD for temp file storage\n5. Run the built-in [diagnostics tool](doc:configuration/operations/diagnostics) and check application logs\n\n### HTTPS/Certificate Issues\n\n**Problem:** Certificate errors, HTTPS not working\n\n**Solutions:**\n1. Check Nginx/Traefik logs\n2. Verify DNS points to correct IP\n3. Ensure ports 80 and 443 are open\n4. Test Let's Encrypt manually: `sudo certbot certificates`\n\n### File Upload Issues\n\n**Problem:** Can't upload large files\n\n**Solutions:**\n1. Increase Nginx limit: `client_max_body_size 2000M;`\n2. Increase Stirling-PDF limit: `system.fileUploadLimit: 2000MB` (env `SYSTEMFILEUPLOADLIMIT=2000MB`)\n3. Check disk space: `df -h`\n4. Increase timeouts: `client_body_timeout 300s;`\n\n### Need More Help?\n\nRun the built-in [diagnostics tool](doc:configuration/operations/diagnostics) inside your Docker container to collect logs, configuration, and system information into a shareable archive.\n\n**For Community Support:**\n- Join Discord: https://discord.gg/HYmhKj45pU\n- Search GitHub Issues: https://github.com/Stirling-Tools/Stirling-PDF/issues\n\n**For Priority Support:**\n- Upgrade to Team or Enterprise plan\n- Email: [email protected]\n- Get dedicated support team\n\n---\n\n**You're all set!** 🎉\n\nYour Stirling-PDF deployment is ready for production use. If you have any questions or need assistance, don't hesitate to reach out to our community or consider upgrading to a paid plan (Team or Enterprise) for dedicated support.\n\nHappy PDF processing! 📄✨",
"sourcePath": "docs/Server-Admin-Onboarding.md",
"editUrl": "https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/Server-Admin-Onboarding.md"
}