diff --git a/Pipfile b/Pipfile index 48759307c..f6301b98f 100644 --- a/Pipfile +++ b/Pipfile @@ -42,6 +42,7 @@ whoosh="~=2.7.4" inotifyrecursive = "~=0.3.4" ocrmypdf = "*" tqdm = "*" +tika = "*" [dev-packages] coveralls = "*" diff --git a/docker/hub/docker-compose.tika.yml b/docker/hub/docker-compose.tika.yml new file mode 100644 index 000000000..af8f575a0 --- /dev/null +++ b/docker/hub/docker-compose.tika.yml @@ -0,0 +1,43 @@ +version: "3.4" +services: + broker: + image: redis:6.0 + restart: always + + webserver: + image: jonaswinkler/paperless-ng:0.9.9 + restart: always + depends_on: + - broker + ports: + - 8000:8000 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000"] + interval: 30s + timeout: 10s + retries: 5 + volumes: + - data:/usr/src/paperless/data + - media:/usr/src/paperless/media + - ./export:/usr/src/paperless/export + - ./consume:/usr/src/paperless/consume + env_file: docker-compose.env + environment: + PAPERLESS_REDIS: redis://broker:6379 + PAPERLESS_TIKA_ENABLED: 1 + PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000 + PAPERLESS_TIKA_ENDPOINT: http://tika:9998 + + gotenberg: + image: thecodingmachine/gotenberg + restart: unless-stopped + environment: + DISABLE_GOOGLE_CHROME: 1 + + tika: + image: apache/tika + restart: unless-stopped + +volumes: + data: + media: diff --git a/docker/local/docker-compose.tika.yml b/docker/local/docker-compose.tika.yml new file mode 100644 index 000000000..889713908 --- /dev/null +++ b/docker/local/docker-compose.tika.yml @@ -0,0 +1,43 @@ +version: "3.4" +services: + broker: + image: redis:6.0 + restart: always + + webserver: + build: . + restart: always + depends_on: + - broker + ports: + - 8000:8000 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000"] + interval: 30s + timeout: 10s + retries: 5 + volumes: + - data:/usr/src/paperless/data + - media:/usr/src/paperless/media + - ./export:/usr/src/paperless/export + - ./consume:/usr/src/paperless/consume + env_file: docker-compose.env + environment: + PAPERLESS_REDIS: redis://broker:6379 + PAPERLESS_TIKA_ENABLED: 1 + PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000 + PAPERLESS_TIKA_ENDPOINT: http://tika:9998 + + gotenberg: + image: thecodingmachine/gotenberg + restart: unless-stopped + environment: + DISABLE_GOOGLE_CHROME: 1 + + tika: + image: apache/tika + restart: unless-stopped + +volumes: + data: + media: diff --git a/docs/configuration.rst b/docs/configuration.rst index 5ccb80b3a..49c95bff1 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -277,6 +277,35 @@ PAPERLESS_OCR_USER_ARG= {"deskew": true, "optimize": 3, "unpaper_args": "--pre-rotate 90"} +.. _configuration-tika: + +Tika settings +############# + +Paperless can make use of `Tika `_ and +`Gotenberg `_ for parsing and +converting "Office" documents (such as ".doc", ".xlsx" and ".odt"). If you +wish to use this, you must provide a Tika server and a Gotenberg server, +configure their endpoints, and enable the feature. + +If you run paperless on docker, you can add those services to the docker-compose +file (see the examples provided). + +PAPERLESS_TIKA_ENABLED= + Enable (or disable) the Tika parser. + + Defaults to false. + +PAPERLESS_TIKA_ENDPOINT= + Set the endpoint URL were Paperless can reach your Tika server. + + Defaults to "http://localhost:9998". + +PAPERLESS_TIKA_GOTENBERG_ENDPOINT= + Set the endpoint URL were Paperless can reach your Gotenberg server. + + Defaults to "http://localhost:3000". + Software tweaks ############### diff --git a/src-ui/src/app/app.component.ts b/src-ui/src/app/app.component.ts index 330f8f157..1c2001043 100644 --- a/src-ui/src/app/app.component.ts +++ b/src-ui/src/app/app.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { AppViewService } from './services/app-view.service'; @Component({ selector: 'app-root', @@ -7,7 +8,8 @@ import { Component } from '@angular/core'; }) export class AppComponent { - constructor () { + constructor (appViewService: AppViewService) { + appViewService.updateDarkModeSettings() (window as any).pdfWorkerSrc = '/assets/js/pdf.worker.min.js'; } diff --git a/src-ui/src/app/components/app-frame/app-frame.component.html b/src-ui/src/app/components/app-frame/app-frame.component.html index d191ec0de..6fd2a579e 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.html +++ b/src-ui/src/app/components/app-frame/app-frame.component.html @@ -1,6 +1,8 @@