aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/config.py')
-rw-r--r--webmentions_ssg/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/webmentions_ssg/config.py b/webmentions_ssg/config.py
index 1c7d44e..28cea64 100644
--- a/webmentions_ssg/config.py
+++ b/webmentions_ssg/config.py
@@ -5,7 +5,6 @@
"""Define application settings for production, development, and testing."""
import logging
-import secrets
def normalize_allowed_hostnames(value: object) -> set[str]:
@@ -26,7 +25,8 @@ def normalize_allowed_hostnames(value: object) -> set[str]:
class DefaultConfig:
TESTING = False
DEBUG = False
- SECRET_KEY = secrets.token_urlsafe()
+ # Production must provide a persistent, random key through configuration.
+ SECRET_KEY = None
BOOTSTRAP_SERVE_LOCAL = True
# BOOTSTRAP_BOOTSWATCH_THEME = "Materia"
# Secure by default; deployment configuration can override these values.
@@ -82,6 +82,8 @@ class DefaultConfig:
class DevelopmentConfig(DefaultConfig):
DEBUG = True
+ # Only for local debug use; production rejects this as an insecure value.
+ SECRET_KEY = "INSECURE_DEVELOPMENT_ONLY_SECRET_KEY"
SESSION_COOKIE_SECURE = False
LOG_FILE = "testing/webmentions-ssg.log"
LOG_LEVEL = logging.DEBUG