mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-09 19:57:49 +02:00
Persist secret key in data folder (#620)
* Persist secret key in data folder * use random secret key by default in prod * fix e2e test
This commit is contained in:
@@ -6,6 +6,7 @@ Production settings for linkding webapp
|
||||
# noinspection PyUnresolvedReferences
|
||||
import os
|
||||
|
||||
from django.core.management.utils import get_random_secret_key
|
||||
from .base import *
|
||||
|
||||
# Turn of debug mode
|
||||
@@ -15,10 +16,10 @@ SASS_PROCESSOR_ENABLED = False
|
||||
|
||||
# Try read secret key from file
|
||||
try:
|
||||
with open(os.path.join(BASE_DIR, "secretkey.txt")) as f:
|
||||
with open(os.path.join(BASE_DIR, "data", "secretkey.txt")) as f:
|
||||
SECRET_KEY = f.read().strip()
|
||||
except:
|
||||
pass
|
||||
SECRET_KEY = get_random_secret_key()
|
||||
|
||||
# Set ALLOWED_HOSTS
|
||||
# By default look in the HOST_NAME environment variable, if that is not set then allow all hosts
|
||||
|
Reference in New Issue
Block a user