feat: strengthen module contracts and shared WebUI runtime
This commit is contained in:
@@ -72,8 +72,19 @@ def _validate_production_startup() -> None:
|
||||
"off",
|
||||
}
|
||||
if throttle_enabled and not os.getenv("REDIS_URL", "").strip():
|
||||
allow_process_local = os.getenv(
|
||||
"GOVOPLAN_ALLOW_PROCESS_LOCAL_LOGIN_THROTTLE",
|
||||
"false",
|
||||
).strip().lower() in {"1", "true", "yes", "on"}
|
||||
if not allow_process_local:
|
||||
raise RuntimeError(
|
||||
"Production login throttling requires REDIS_URL. "
|
||||
"Set GOVOPLAN_ALLOW_PROCESS_LOCAL_LOGIN_THROTTLE=true only "
|
||||
"for an explicitly single-process deployment."
|
||||
)
|
||||
logger.warning(
|
||||
"Redis is not configured; login throttling is process-local and will not coordinate horizontally"
|
||||
"Redis is not configured; login throttling is explicitly limited "
|
||||
"to this process"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user