if PAPERLESS_URL is set and ALLOWED_HOSTS is NOT set
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
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>
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