A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Add ability to provide the configuration file path using an env variable
hashworks4269074944a9
diff --git a/docs/configuration.md b/docs/configuration.mdindex 488a6f11f..d6041f0a5 100644--- a/docs/configuration.md+++ b/docs/configuration.md@@ -10,12 +10,10 @@ run paperless, these settings have to be defined in different places.- If you are running paperless on anything else, paperless will searchfor the configuration file in these locations and use the first oneit finds:-- ```- /path/to/paperless/paperless.conf- /etc/paperless.conf- /usr/local/etc/paperless.conf- ```+ - The environment variable `PAPERLESS_CONFIGURATION_PATH`+ - `/path/to/paperless/paperless.conf`+ - `/etc/paperless.conf`+ - `/usr/local/etc/paperless.conf`## Required services@@ -678,7 +676,7 @@ paperless will process in parallel on a single document.count, with a slight favor towards threads per worker:| CPU core count | Workers | Threads |- |----------------|---------|---------|+ | -------------- | ------- | ------- || > 1 | > 1 | > 1 || > 2 | > 2 | > 1 || > 4 | > 2 | > 2 |diff --git a/src/paperless/settings.py b/src/paperless/settings.pyindex db26ba3b3..e16662c5a 100644--- a/src/paperless/settings.py+++ b/src/paperless/settings.py@@ -17,7 +17,10 @@ from django.utils.translation import gettext_lazy as _from dotenv import load_dotenv# Tap paperless.conf if it's available-if os.path.exists("../paperless.conf"):+configuration_path = os.getenv("PAPERLESS_CONFIGURATION_PATH")+if configuration_path and os.path.exists(configuration_path):+ load_dotenv(configuration_path)+elif os.path.exists("../paperless.conf"):load_dotenv("../paperless.conf")elif os.path.exists("/etc/paperless.conf"):load_dotenv("/etc/paperless.conf")