|
95 | 95 | ("PUSH_NOTIFICATIONS_VAPID_SUBJECT", str), |
96 | 96 | # Whether to initiate new activeness probes |
97 | 97 | ("ACTIVENESS_PROBES_ENABLED", bool), |
98 | | - # Listmonk (mailing list) |
99 | | - ("LISTMONK_ENABLED", bool), |
| 98 | + # Listmonk (mailing list, gated at runtime by the `listmonk_enabled` feature flag) |
100 | 99 | ("LISTMONK_BASE_URL", str), |
101 | 100 | ("LISTMONK_API_USERNAME", str), |
102 | 101 | ("LISTMONK_API_KEY", str), |
@@ -150,6 +149,16 @@ def check_config(cfg: dict[str, Any]) -> None: |
150 | 149 | if not cfg["STRIPE_API_KEY"] or not cfg["STRIPE_WEBHOOK_SECRET"] or not cfg["STRIPE_RECURRING_PRODUCT_ID"]: |
151 | 150 | raise Exception("Stripe credentials must be configured in production") |
152 | 151 |
|
| 152 | + # Listmonk is gated at runtime by the `listmonk_enabled` feature flag, which can be flipped on |
| 153 | + # remotely at any time, so prod must always have the Listmonk credentials present. |
| 154 | + if ( |
| 155 | + not cfg["LISTMONK_BASE_URL"] |
| 156 | + or not cfg["LISTMONK_API_USERNAME"] |
| 157 | + or not cfg["LISTMONK_API_KEY"] |
| 158 | + or not cfg["LISTMONK_LIST_ID"] |
| 159 | + ): |
| 160 | + raise Exception("Listmonk credentials must be configured in production") |
| 161 | + |
153 | 162 | # The following features are gated at runtime by feature flags (`strong_verification_enabled`, |
154 | 163 | # `postal_verification_enabled`, `recaptcha_enabled`), which can be flipped on remotely at any |
155 | 164 | # time, so prod must always have their credentials present. |
|
0 commit comments