]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
add "localhost" to ALLOWED_HOSTS 700/head
authorFlorian Brandes <florian.brandes@posteo.de>
Tue, 12 Apr 2022 12:39:08 +0000 (14:39 +0200)
committerFlorian Brandes <florian.brandes@posteo.de>
Tue, 12 Apr 2022 12:39:08 +0000 (14:39 +0200)
if PAPERLESS_URL is set and ALLOWED_HOSTS is NOT set

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
docs/configuration.rst
src/paperless/settings.py

index 3541f2e07d895d2fcdb25666b244d3d62d0a825b..c1f27c5d4768383cfae44fce4da1cee9a1803f80 100644 (file)
@@ -170,6 +170,9 @@ PAPERLESS_ALLOWED_HOSTS=<comma-separated-list>
 
     Can also be set using PAPERLESS_URL (see above).
 
+    If manually set, please remember to include "localhost". Otherwise docker
+    healthcheck will fail.
+
     Defaults to "*", which is all hosts.
 
 PAPERLESS_CORS_ALLOWED_HOSTS=<comma-separated-list>
index b267ee10f0342e0cf300dd3fdebccd5b0b4856e0..e720a69467fb82e3871d90195b2ff527c18a3897 100644 (file)
@@ -251,7 +251,8 @@ if _paperless_url:
     if _allowed_hosts:
         ALLOWED_HOSTS.append(_paperless_uri.hostname)
     else:
-        ALLOWED_HOSTS = [_paperless_uri.hostname]
+        # always allow localhost. Necessary e.g. for healthcheck in docker.
+        ALLOWED_HOSTS = [_paperless_uri.hostname] + ["localhost"]
 
 # The secret key has a default that should be fine so long as you're hosting
 # Paperless on a closed network.  However, if you're putting this anywhere