fixing deploymennt
This commit is contained in:
@@ -267,7 +267,17 @@ os.makedirs(directory_path, exist_ok=True)
|
||||
ALLOW_IMAGE_GENERATION = env_bool("ALLOW_IMAGE_GENERATION", False)
|
||||
ALLOW_INTERNET_ACCESS = env_bool("ALLOW_INTERNET_ACCESS", True)
|
||||
|
||||
if DJANGO_ENV in {"prod", "beta"} and (
|
||||
not SECRET_KEY or "dev-only" in SECRET_KEY or SECRET_KEY.startswith("django-insecure")
|
||||
):
|
||||
raise ValueError("DJANGO_SECRET_KEY must be set to a real secret in prod/beta.")
|
||||
if DJANGO_ENV in {"prod", "beta"}:
|
||||
# Compose treats $ in .env as variable expansion — escape each $ as $$.
|
||||
if not SECRET_KEY:
|
||||
raise ValueError(
|
||||
"DJANGO_SECRET_KEY is empty in prod/beta. Set it in the control-node "
|
||||
"secret (~/Documents/secrets/chat_backend/chat_backend_<env>.env). "
|
||||
"If the value contains $, write $$ or Compose will strip/empty it."
|
||||
)
|
||||
if SECRET_KEY.startswith("django-insecure") or "dev-only" in SECRET_KEY:
|
||||
raise ValueError(
|
||||
"DJANGO_SECRET_KEY still looks like a placeholder "
|
||||
"(starts with 'django-insecure' or contains 'dev-only'). "
|
||||
"Replace it with a real random secret and redeploy."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user