mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-24 01:02:45 -05:00
Allow users to set a combined certificte and key file for additional certificates in the SSL context
This commit is contained in:
@@ -67,11 +67,20 @@ def __get_float(key: str, default: float) -> float:
|
||||
return float(os.getenv(key, default))
|
||||
|
||||
|
||||
def __get_path(key: str, default: Union[PathLike, str]) -> Path:
|
||||
def __get_path(
|
||||
key: str,
|
||||
default: Optional[Union[PathLike, str]] = None,
|
||||
) -> Optional[Path]:
|
||||
"""
|
||||
Return a normalized, absolute path based on the environment variable or a default
|
||||
Return a normalized, absolute path based on the environment variable or a default,
|
||||
if provided. If not set and no default, returns None
|
||||
"""
|
||||
return Path(os.environ.get(key, default)).resolve()
|
||||
if key in os.environ:
|
||||
return Path(os.environ[key]).resolve()
|
||||
elif default is not None:
|
||||
return Path(default).resolve()
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def __get_list(
|
||||
@@ -477,6 +486,8 @@ CSRF_COOKIE_NAME = f"{COOKIE_PREFIX}csrftoken"
|
||||
SESSION_COOKIE_NAME = f"{COOKIE_PREFIX}sessionid"
|
||||
LANGUAGE_COOKIE_NAME = f"{COOKIE_PREFIX}django_language"
|
||||
|
||||
EMAIL_CERTIFICATE_FILE = __get_path("PAPERLESS_EMAIL_CERTIFICATE_FILE")
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Database #
|
||||
|
Reference in New Issue
Block a user