A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
fix(tika): adapt to Gotenberg 7 API
Uli Fahrer2dcacaee147a
diff --git a/docker/compose/docker-compose.postgres-tika.yml b/docker/compose/docker-compose.postgres-tika.ymlindex 93fff4afc..f301b0d3c 100644--- a/docker/compose/docker-compose.postgres-tika.yml+++ b/docker/compose/docker-compose.postgres-tika.yml@@ -75,10 +75,10 @@ services:PAPERLESS_TIKA_ENDPOINT: http://tika:9998gotenberg:- image: thecodingmachine/gotenberg+ image: gotenberg/gotenberg:7restart: unless-stoppedenvironment:- DISABLE_GOOGLE_CHROME: 1+ CHROMIUM_DISABLE_ROUTES: 1tika:image: apache/tikadiff --git a/docker/compose/docker-compose.sqlite-tika.yml b/docker/compose/docker-compose.sqlite-tika.ymlindex 5dfff0830..f50e51aab 100644--- a/docker/compose/docker-compose.sqlite-tika.yml+++ b/docker/compose/docker-compose.sqlite-tika.yml@@ -64,10 +64,10 @@ services:PAPERLESS_TIKA_ENDPOINT: http://tika:9998gotenberg:- image: thecodingmachine/gotenberg+ image: gotenberg/gotenberg:7restart: unless-stoppedenvironment:- DISABLE_GOOGLE_CHROME: 1+ CHROMIUM_DISABLE_ROUTES: 1tika:image: apache/tikadiff --git a/docs/configuration.rst b/docs/configuration.rstindex c5bb811f6..7d079a96c 100644--- a/docs/configuration.rst+++ b/docs/configuration.rst@@ -402,7 +402,7 @@ Tika settings#############Paperless can make use of `Tika <https://tika.apache.org/>`_ and-`Gotenberg <https://thecodingmachine.github.io/gotenberg/>`_ for parsing and+`Gotenberg <https://gotenberg.dev/>`_ for parsing andconverting "Office" documents (such as ".doc", ".xlsx" and ".odt"). If youwish to use this, you must provide a Tika server and a Gotenberg server,configure their endpoints, and enable the feature.@@ -444,10 +444,10 @@ requires are as follows:# ...gotenberg:- image: thecodingmachine/gotenberg+ image: gotenberg/gotenberg:7restart: unless-stoppedenvironment:- DISABLE_GOOGLE_CHROME: 1+ CHROMIUM_DISABLE_ROUTES: 1tika:image: apache/tikadiff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rstindex 25a1b7f6f..f3ea612a0 100644--- a/docs/troubleshooting.rst+++ b/docs/troubleshooting.rst@@ -101,22 +101,22 @@ You may experience these errors when using the optional TIKA integration:.. code::- requests.exceptions.HTTPError: 504 Server Error: Gateway Timeout for url: http://gotenberg:3000/convert/office+ requests.exceptions.HTTPError: 504 Server Error: Gateway Timeout for url: http://gotenberg:3000/forms/libreoffice/convert-Gotenberg is a server that converts Office documents into PDF documents and has a default timeout of 10 seconds.+Gotenberg is a server that converts Office documents into PDF documents and has a default timeout of 30 seconds.When conversion takes longer, Gotenberg raises this error.-You can increase the timeout by configuring an environment variable for gotenberg (see also `here <https://thecodingmachine.github.io/gotenberg/#environment_variables.default_wait_timeout>`__).+You can increase the timeout by configuring an environment variable for Gotenberg (see also `here <https://gotenberg.dev/docs/modules/api#properties>`__).If using docker-compose, this is achieved by the following configuration change in the ``docker-compose.yml`` file:.. code:: yamlgotenberg:- image: thecodingmachine/gotenberg+ image: gotenberg/gotenberg:7restart: unless-stoppedenvironment:- DISABLE_GOOGLE_CHROME: 1- DEFAULT_WAIT_TIMEOUT: 30+ CHROMIUM_DISABLE_ROUTES: 1+ API_PROCESS_TIMEOUT: 60Permission denied errors in the consumption directory#####################################################diff --git a/scripts/start_services.sh b/scripts/start_services.shindex e2fc740a4..ecc842715 100755--- a/scripts/start_services.sh+++ b/scripts/start_services.sh@@ -1,4 +1,4 @@docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -v paperless_pgdata:/var/lib/postgresql/data -d postgres:13docker run -d -p 6379:6379 redis:latest-docker run -p 3000:3000 -d thecodingmachine/gotenberg+docker run -p 3000:3000 -d gotenberg/gotenberg:7docker run -p 9998:9998 -d apache/tikadiff --git a/src/paperless_tika/parsers.py b/src/paperless_tika/parsers.pyindex 6b0f62ada..e6924ed92 100644--- a/src/paperless_tika/parsers.py+++ b/src/paperless_tika/parsers.py@@ -67,7 +67,7 @@ class TikaDocumentParser(DocumentParser):def convert_to_pdf(self, document_path, file_name):pdf_path = os.path.join(self.tempdir, "convert.pdf")gotenberg_server = settings.PAPERLESS_TIKA_GOTENBERG_ENDPOINT- url = gotenberg_server + "/convert/office"+ url = gotenberg_server + "/forms/libreoffice/convert"self.log("info", f"Converting {document_path} to PDF as {pdf_path}")files = {"files": (file_name or os.path.basename(document_path),