feat: update environment configuration and README for DocuNova branding

This commit is contained in:
Christian Krakau-Louis
2025-03-28 23:49:07 +01:00
parent ef6ea291d5
commit 219a252090
4 changed files with 12 additions and 9 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ NEXTCLOUD_UPLOAD_URL=https://nextcloud.example.com/remote.php/dav/files/<USERNAM
NEXTCLOUD_FOLDER="<NEXTCLOUD_FOLDER_PATH>" NEXTCLOUD_FOLDER="<NEXTCLOUD_FOLDER_PATH>"
PAPERLESS_NGX_URL=https://paperless.example.com/api/documents/post_document/ PAPERLESS_NGX_URL=https://paperless.example.com/api/documents/post_document/
PAPERLESS_HOST=https://paperless.example.com PAPERLESS_HOST=https://paperless.example.com
EXTERNAL_HOSTNAME=docunova.example.com
# **Tokens/API Credentials** # **Tokens/API Credentials**
AWS_ACCESS_KEY_ID="<AWS_ACCESS_KEY>" AWS_ACCESS_KEY_ID="<AWS_ACCESS_KEY>"
@@ -53,4 +54,4 @@ AUTH_ENABLED=true
SESSION_SECRET=<atLeast32Characters> SESSION_SECRET=<atLeast32Characters>
AUTHENTIK_CLIENT_ID=<yourAuthentikAppClientID> AUTHENTIK_CLIENT_ID=<yourAuthentikAppClientID>
AUTHENTIK_CLIENT_SECRET=<yourAuthentikAppClientSecret> AUTHENTIK_CLIENT_SECRET=<yourAuthentikAppClientSecret>
AUTHENTIK_CONFIG_URL=<ConfigUrlOfYourApp, e.g. https://authentik.example.com/application/o/document-parser/.well-known/openid-configuration> AUTHENTIK_CONFIG_URL=<ConfigUrlOfYourApp, e.g. https://authentik.example.com/application/o/docunova/.well-known/openid-configuration>
+5 -4
View File
@@ -1,8 +1,8 @@
# Document Processing System # DocuNova
## Overview ## Overview
This project automates the handling, extraction, and processing of documents using a variety of services, including: DocuNova automates the handling, extraction, and processing of documents using a variety of services, including:
- **OpenAI** for metadata extraction and text refinement. - **OpenAI** for metadata extraction and text refinement.
- **Dropbox** and **Nextcloud** for file storage and uploads. - **Dropbox** and **Nextcloud** for file storage and uploads.
@@ -52,6 +52,7 @@ The `.env` file drives all configuration. This table breaks down key variables
| `REDIS_URL` | URL for Redis, used by Celery for broker & result store. | `redis://redis:6379/0` | | `REDIS_URL` | URL for Redis, used by Celery for broker & result store. | `redis://redis:6379/0` |
| `WORKDIR` | Working directory for the application. | `/workdir` | | `WORKDIR` | Working directory for the application. | `/workdir` |
| `GOTENBERG_URL` | Gotenberg PDF processing URL. | `http://gotenberg:3000` | | `GOTENBERG_URL` | Gotenberg PDF processing URL. | `http://gotenberg:3000` |
| `EXTERNAL_HOSTNAME` | The external hostname for the application. | `docunova.example.com` |
### IMAP Configuration (Multiple Mailboxes) ### IMAP Configuration (Multiple Mailboxes)
@@ -145,7 +146,7 @@ This project uses Celery (with Redis) for asynchronous task management and Goten
### Services in `docker-compose.yml` ### Services in `docker-compose.yml`
Below is the default structure (simplified): Below is the default structure:
```yaml ```yaml
services: services:
@@ -153,7 +154,7 @@ services:
image: christianlouis/document-processor:latest image: christianlouis/document-processor:latest
container_name: document_api container_name: document_api
working_dir: /workdir working_dir: /workdir
command: ["sh", "-c", "cd /app && uvicorn app.main:app --host 0.0.0.0 --port 8000"] command: ["sh", "-c", "cd /app && uvicorn app.main:app --host 0.0.0.0 --port 8000 --proxy-headers"]
environment: environment:
- PYTHONPATH=/app - PYTHONPATH=/app
env_file: env_file:
+1
View File
@@ -30,6 +30,7 @@ class Settings(BaseSettings):
azure_region: str azure_region: str
azure_endpoint: str azure_endpoint: str
gotenberg_url: str gotenberg_url: str
external_hostname: str = "localhost" # Default to localhost
# Authentik # Authentik
authentik_client_id: Optional[str] = None authentik_client_id: Optional[str] = None
+2 -2
View File
@@ -30,7 +30,7 @@ SESSION_SECRET = config(
default="YOUR_DEFAULT_SESSION_SECRET_MUST_BE_32_CHARS_OR_MORE" default="YOUR_DEFAULT_SESSION_SECRET_MUST_BE_32_CHARS_OR_MORE"
) )
app = FastAPI(title="Document Processing API") app = FastAPI(title="DocuNova")
# 1) Session Middleware (for request.session to work) # 1) Session Middleware (for request.session to work)
app.add_middleware(SessionMiddleware, secret_key=SESSION_SECRET) app.add_middleware(SessionMiddleware, secret_key=SESSION_SECRET)
@@ -40,7 +40,7 @@ app.add_middleware(ProxyHeadersMiddleware, trusted_hosts="*")
# 3) (Optional but recommended) Restrict valid hosts: # 3) (Optional but recommended) Restrict valid hosts:
app.add_middleware(TrustedHostMiddleware, allowed_hosts=[ app.add_middleware(TrustedHostMiddleware, allowed_hosts=[
"docparse.hosterra.net", settings.external_hostname,
"localhost", "localhost",
"127.0.0.1" "127.0.0.1"
]) ])