From 8d2fada4910ea8afbd7af086a88d1b6095891d3d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:22:29 -0700 Subject: [PATCH] Chore: support allauth disable unknown account emails --- docs/configuration.md | 6 ++++++ src/paperless/settings.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 47d4ef254..c48a4b0df 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -631,6 +631,12 @@ If both the [PAPERLESS_ACCOUNT_DEFAULT_GROUPS](#PAPERLESS_ACCOUNT_DEFAULT_GROUPS If you do not have a working email server set up you should set this to 'none'. +#### [`PAPERLESS_ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS=`](#PAPERLESS_ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS) {#PAPERLESS_ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS} + +: See the relevant [django-allauth documentation](https://docs.allauth.org/en/latest/account/configuration.html) + + Defaults to True (from allauth) + #### [`PAPERLESS_DISABLE_REGULAR_LOGIN=`](#PAPERLESS_DISABLE_REGULAR_LOGIN) {#PAPERLESS_DISABLE_REGULAR_LOGIN} : Disables the regular frontend username / password login, i.e. once you have setup SSO. Note that this setting does not disable the Django admin login nor logging in with local credentials via the API. To prevent access to the Django admin, consider blocking `/admin/` in your [web server or reverse proxy configuration](https://github.com/paperless-ngx/paperless-ngx/wiki/Using-a-Reverse-Proxy-with-Paperless-ngx). diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 6199bc632..a83706571 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -508,6 +508,11 @@ ACCOUNT_EMAIL_VERIFICATION = os.getenv( "optional", ) +ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS = __get_boolean( + "PAPERLESS_ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS", + "True", +) + ACCOUNT_SESSION_REMEMBER = __get_boolean("PAPERLESS_ACCOUNT_SESSION_REMEMBER", "True") SESSION_EXPIRE_AT_BROWSER_CLOSE = not ACCOUNT_SESSION_REMEMBER SESSION_COOKIE_AGE = int(