Add ability to provide the configuration file path using an env variable

This commit is contained in:
hashworks
2022-12-21 22:28:16 +01:00
committed by Trenton H
parent 686e3201ba
commit ef38e53444
2 changed files with 9 additions and 8 deletions

View File

@@ -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")