]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Enhancement: allow disabling the filesystem consumer (#9199)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Sun, 23 Feb 2025 21:52:41 +0000 (13:52 -0800)
committerGitHub <noreply@github.com>
Sun, 23 Feb 2025 21:52:41 +0000 (13:52 -0800)
docker/rootfs/etc/s6-overlay/s6-rc.d/svc-consumer/run
docs/configuration.md
docs/setup.md

index 3e1c0472b4785e8cf840cd867a8154787b947b0d..209803d41439d110bddb6595dedef8481a6847dc 100755 (executable)
@@ -1,10 +1,18 @@
 #!/command/with-contenv /usr/bin/bash
 # shellcheck shell=bash
 
-cd ${PAPERLESS_SRC_DIR}
 
-if [[ -n "${USER_IS_NON_ROOT}" ]]; then
-       exec python3 manage.py document_consumer
+if [[ -n "${PAPERLESS_CONSUMER_DISABLE}" ]]; then
+       echo "[svc-consumer] Consumer is disabled, exiting"
+       # https://skarnet.org/software/s6/s6-svc.html
+       s6-svc -Od .
+
 else
-       exec s6-setuidgid paperless python3 manage.py document_consumer
+       cd ${PAPERLESS_SRC_DIR}
+
+       if [[ -n "${USER_IS_NON_ROOT}" ]]; then
+               exec python3 manage.py document_consumer
+       else
+               exec s6-setuidgid paperless python3 manage.py document_consumer
+       fi
 fi
index 3724c792d210ef7f40b647d3964d6826ed1ae079..441d4610522fd475651eb64fd05f1382ccb52c90 100644 (file)
@@ -1030,6 +1030,11 @@ be used with caution!
 
 ## Document Consumption {#consume_config}
 
+#### [`PAPERLESS_CONSUMER_DISABLE=<bool>`](#PAPERLESS_CONSUMER_DISABLE) {#PAPERLESS_CONSUMER_DISABLE}
+
+: Completely disable the directory-based consumer in docker. If you don't plan to consume documents
+via the consumption directory, you can disable the consumer to save resources.
+
 #### [`PAPERLESS_CONSUMER_DELETE_DUPLICATES=<bool>`](#PAPERLESS_CONSUMER_DELETE_DUPLICATES) {#PAPERLESS_CONSUMER_DELETE_DUPLICATES}
 
 : When the consumer detects a duplicate document, it will not touch
index f2b82d070932da37a894342901ccc96bc1c19136..e337a492a2616de1cbfa261cba9eb1259a23a56f 100644 (file)
@@ -714,6 +714,8 @@ the Pi and configuring some options in paperless can help improve
 performance immensely:
 
 -   Stick with SQLite to save some resources.
+-   If you do not need the filesystem-based consumer, consider disabling it
+    entirely by setting [`PAPERLESS_CONSUMER_DISABLE`](configuration.md#PAPERLESS_CONSUMER_DISABLE) to `true`.
 -   Consider setting [`PAPERLESS_OCR_PAGES`](configuration.md#PAPERLESS_OCR_PAGES) to 1, so that paperless will
     only OCR the first page of your documents. In most cases, this page
     contains enough information to be able to find it.