139 lines
7.2 KiB
Markdown
139 lines
7.2 KiB
Markdown
# Configuration Guide
|
|
|
|
DocuNova is designed to be highly configurable through environment variables. This guide explains all available configuration options and how to use them effectively.
|
|
|
|
## Environment Variables
|
|
|
|
Configuration is primarily done through environment variables specified in a `.env` file.
|
|
|
|
### Core Settings
|
|
|
|
| **Variable** | **Description** | **Example** |
|
|
|------------------------|----------------------------------------------------------|--------------------------------|
|
|
| `DATABASE_URL` | Path/URL to the SQLite database (or other SQL backend). | `sqlite:///./app/database.db` |
|
|
| `REDIS_URL` | URL for Redis, used by Celery for broker & result store. | `redis://redis:6379/0` |
|
|
| `WORKDIR` | Working directory for the application. | `/workdir` |
|
|
| `GOTENBERG_URL` | Gotenberg PDF processing URL. | `http://gotenberg:3000` |
|
|
| `EXTERNAL_HOSTNAME` | The external hostname for the application. | `docunova.example.com` |
|
|
|
|
### IMAP Configuration
|
|
|
|
DocuNova can monitor multiple IMAP mailboxes for document attachments. Each mailbox uses a numbered prefix (e.g., `IMAP1_`, `IMAP2_`).
|
|
|
|
| **Variable** | **Description** | **Example** |
|
|
|-------------------------------|--------------------------------------------------------------|-------------------|
|
|
| `IMAP1_HOST` | Hostname for first IMAP server. | `mail.example.com`|
|
|
| `IMAP1_PORT` | Port number (usually `993`). | `993` |
|
|
| `IMAP1_USERNAME` | IMAP login (first mailbox). | `user@example.com`|
|
|
| `IMAP1_PASSWORD` | IMAP password (first mailbox). | `*******` |
|
|
| `IMAP1_SSL` | Use SSL (`true`/`false`). | `true` |
|
|
| `IMAP1_POLL_INTERVAL_MINUTES` | Frequency in minutes to poll for new mail. | `5` |
|
|
|
|
### Authentication
|
|
|
|
| **Variable** | **Description** |
|
|
|-------------------------|---------------------------------------------------------------|
|
|
| `AUTH_ENABLED` | Enable or disable authentication (`true`/`false`). |
|
|
| `AUTHENTIK_CLIENT_ID` | Client ID for Authentik OAuth2. |
|
|
| `AUTHENTIK_CLIENT_SECRET` | Client secret for Authentik OAuth2. |
|
|
| `AUTHENTIK_CONFIG_URL` | Configuration URL for Authentik OpenID Connect. |
|
|
|
|
### OpenAI & Azure Document Intelligence
|
|
|
|
| **Variable** | **Description** | **How to Obtain** |
|
|
|---------------------------------|------------------------------------------|--------------------------------------------------------------------------|
|
|
| `OPENAI_API_KEY` | OpenAI API key for GPT metadata extraction. | [OpenAI API keys](https://platform.openai.com/account/api-keys) |
|
|
| `AZURE_DOCUMENT_INTELLIGENCE_KEY` | Azure Document Intelligence API key for OCR. | [Azure Portal](https://portal.azure.com/) |
|
|
| `AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT` | Endpoint URL for Azure Doc Intelligence API. | [Azure Portal](https://portal.azure.com/) |
|
|
|
|
### Paperless NGX
|
|
|
|
| **Variable** | **Description** |
|
|
|-------------------------------|-----------------------------------------------------|
|
|
| `PAPERLESS_NGX_API_TOKEN` | API token for Paperless NGX. |
|
|
| `PAPERLESS_HOST` | Root URL for Paperless NGX (e.g. `https://paperless.example.com`). |
|
|
|
|
### Dropbox
|
|
|
|
| **Variable** | **Description** | **How to Obtain** |
|
|
|-------------------------|--------------------------------------------------|------------------------------------------------------------------------------------|
|
|
| `DROPBOX_APP_KEY` | Dropbox API app key. | [Dropbox Developer Console](https://www.dropbox.com/developers/apps/create) |
|
|
| `DROPBOX_APP_SECRET` | Dropbox API app secret. | [Dropbox Developer Console](https://www.dropbox.com/developers/apps/create) |
|
|
| `DROPBOX_REFRESH_TOKEN` | OAuth2 refresh token for Dropbox. | Follow Dropbox OAuth flow to retrieve |
|
|
| `DROPBOX_FOLDER` | Default folder path for Dropbox uploads. | e.g. `"/Documents/Uploads"` |
|
|
|
|
### Nextcloud
|
|
|
|
| **Variable** | **Description** |
|
|
|-------------------------|---------------------------------------------------------------|
|
|
| `NEXTCLOUD_UPLOAD_URL` | Nextcloud WebDAV URL (e.g. `https://nc.example.com/remote.php/dav/files/<USERNAME>`). |
|
|
| `NEXTCLOUD_USERNAME` | Nextcloud login username. |
|
|
| `NEXTCLOUD_PASSWORD` | Nextcloud login password. |
|
|
| `NEXTCLOUD_FOLDER` | Destination folder in Nextcloud (e.g. `"/Documents/Uploads"`). |
|
|
|
|
## Configuration Examples
|
|
|
|
### Minimal Configuration
|
|
|
|
This is the minimal configuration needed to run DocuNova with local storage only:
|
|
|
|
```dotenv
|
|
DATABASE_URL=sqlite:///./app/database.db
|
|
REDIS_URL=redis://redis:6379/0
|
|
WORKDIR=/workdir
|
|
GOTENBERG_URL=http://gotenberg:3000
|
|
```
|
|
|
|
### Full Configuration with All Services
|
|
|
|
```dotenv
|
|
# Core settings
|
|
DATABASE_URL=sqlite:///./app/database.db
|
|
REDIS_URL=redis://redis:6379/0
|
|
WORKDIR=/workdir
|
|
GOTENBERG_URL=http://gotenberg:3000
|
|
EXTERNAL_HOSTNAME=docunova.example.com
|
|
|
|
# IMAP settings
|
|
IMAP1_HOST=mail.example.com
|
|
IMAP1_PORT=993
|
|
IMAP1_USERNAME=user@example.com
|
|
IMAP1_PASSWORD=password
|
|
IMAP1_SSL=true
|
|
IMAP1_POLL_INTERVAL_MINUTES=5
|
|
IMAP1_DELETE_AFTER_PROCESS=false
|
|
|
|
# AI services
|
|
OPENAI_API_KEY=sk-...
|
|
AZURE_DOCUMENT_INTELLIGENCE_KEY=...
|
|
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT=https://...
|
|
|
|
# Authentication
|
|
AUTH_ENABLED=true
|
|
AUTHENTIK_CLIENT_ID=...
|
|
AUTHENTIK_CLIENT_SECRET=...
|
|
AUTHENTIK_CONFIG_URL=https://auth.example.com/.well-known/openid-configuration
|
|
|
|
# Storage services
|
|
PAPERLESS_NGX_API_TOKEN=...
|
|
PAPERLESS_HOST=https://paperless.example.com
|
|
|
|
DROPBOX_APP_KEY=...
|
|
DROPBOX_APP_SECRET=...
|
|
DROPBOX_REFRESH_TOKEN=...
|
|
DROPBOX_FOLDER=/Documents/Uploads
|
|
|
|
NEXTCLOUD_UPLOAD_URL=https://nc.example.com/remote.php/dav/files/username
|
|
NEXTCLOUD_USERNAME=username
|
|
NEXTCLOUD_PASSWORD=password
|
|
NEXTCLOUD_FOLDER=/Documents/Uploads
|
|
```
|
|
|
|
## Selective Service Configuration
|
|
|
|
You can choose which document storage services to use by only including the relevant environment variables. For example, if you only want to use Dropbox, include only the Dropbox variables and omit the Paperless NGX and Nextcloud variables.
|
|
|
|
## Configuration File Location
|
|
|
|
The `.env` file should be placed at the root of the project directory. When using Docker Compose, you can reference it with the `env_file` directive in your `docker-compose.yml`.
|