diff --git a/.env.demo b/.env.demo index ff890ae6..58771890 100644 --- a/.env.demo +++ b/.env.demo @@ -10,6 +10,7 @@ NEXTCLOUD_UPLOAD_URL=https://nextcloud.example.com/remote.php/dav/files/ AUTHENTIK_CLIENT_ID= AUTHENTIK_CLIENT_SECRET= -AUTHENTIK_CONFIG_URL= \ No newline at end of file +AUTHENTIK_CONFIG_URL= \ No newline at end of file diff --git a/README.md b/README.md index f9cf9c43..9c3ee1c9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Document Processing System +# DocuNova ## 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. - **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` | | `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 (Multiple Mailboxes) @@ -145,7 +146,7 @@ This project uses Celery (with Redis) for asynchronous task management and Goten ### Services in `docker-compose.yml` -Below is the default structure (simplified): +Below is the default structure: ```yaml services: @@ -153,7 +154,7 @@ services: image: christianlouis/document-processor:latest container_name: document_api 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: - PYTHONPATH=/app env_file: @@ -164,7 +165,7 @@ services: - redis - worker volumes: - - /var/docparse/workdir:/workdir + - /var/docparse/workdir:/workdir worker: image: christianlouis/document-processor:latest @@ -179,7 +180,7 @@ services: - redis - gotenberg volumes: - - /var/docparse/workdir:/workdir + - /var/docparse/workdir:/workdir gotenberg: image: gotenberg/gotenberg:latest diff --git a/app/config.py b/app/config.py index 2523557a..e341772f 100644 --- a/app/config.py +++ b/app/config.py @@ -30,6 +30,7 @@ class Settings(BaseSettings): azure_region: str azure_endpoint: str gotenberg_url: str + external_hostname: str = "localhost" # Default to localhost # Authentik authentik_client_id: Optional[str] = None diff --git a/app/main.py b/app/main.py index cff56a6e..91c2e8bf 100644 --- a/app/main.py +++ b/app/main.py @@ -30,7 +30,7 @@ SESSION_SECRET = config( 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) 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: app.add_middleware(TrustedHostMiddleware, allowed_hosts=[ - "docparse.hosterra.net", + settings.external_hostname, "localhost", "127.0.0.1" ])