mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import urllib.parse
|
||||
|
||||
from django.core.checks import Warning, register
|
||||
@@ -58,3 +59,20 @@ def check_base_url_is_url(app_configs, **kwargs):
|
||||
)]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
@register("bsmain")
|
||||
def check_proxy_env_vars_consistency(app_configs, **kwargs):
|
||||
# in this check we straight-up check the os.environ: we can't rely on settings.BEHIND_HTTPS_PROXY to have been set
|
||||
# since it's Docker-only.
|
||||
|
||||
if (
|
||||
os.getenv("BEHIND_HTTPS_PROXY", "False").lower() in ("true", "1", "yes") and
|
||||
os.getenv("BEHIND_PLAIN_HTTP_PROXY", "False").lower() in ("true", "1", "yes")
|
||||
):
|
||||
return [Warning(
|
||||
"BEHIND_HTTPS_PROXY and BEHIND_PLAIN_HTTP_PROXY are mutually exclusive.",
|
||||
id="bsmain.W004",
|
||||
)]
|
||||
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user