Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable ssl warnings if we've turned off SSL validation #60

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.11.10 AS base-deps
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.12.01 AS base-deps

SHELL ["/bin/bash", "-c"]

Expand Down
8 changes: 7 additions & 1 deletion bento_wes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def _to_bool(val: str) -> bool:

BENTO_DEBUG: bool = _to_bool(os.environ.get("BENTO_DEBUG", os.environ.get("FLASK_DEBUG", "false")))
CELERY_DEBUG: bool = _to_bool(os.environ.get("CELERY_DEBUG", ""))
BENTO_VALIDATE_SSL: bool = _to_bool(os.environ.get("BENTO_VALIDATE_SSL", str(not BENTO_DEBUG)))

if not BENTO_VALIDATE_SSL:
# If we've turned off SSL validation, suppress insecure connection warnings
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

AUTHZ_URL: str = _get_from_environ_or_fail("BENTO_AUTHZ_SERVICE_URL").strip().rstrip("/")
SERVICE_REGISTRY_URL: str = _get_from_environ_or_fail("SERVICE_REGISTRY_URL").strip().rstrip("/")
Expand All @@ -45,7 +51,7 @@ class Config:
BENTO_URL: str = os.environ.get("BENTO_URL", "http://127.0.0.1:5000/")

BENTO_DEBUG: bool = BENTO_DEBUG
BENTO_VALIDATE_SSL: bool = _to_bool(os.environ.get("BENTO_VALIDATE_SSL", str(not BENTO_DEBUG)))
BENTO_VALIDATE_SSL: bool = BENTO_VALIDATE_SSL

DATABASE: str = os.environ.get("DATABASE", "bento_wes.db")
SERVICE_ID = SERVICE_ID
Expand Down
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.11.10 AS base-deps
FROM ghcr.io/bento-platform/bento_base_image:python-debian-2023.12.01 AS base-deps

LABEL org.opencontainers.image.description="Local development image for Bento WES."
LABEL devcontainer.metadata='[{ \
Expand Down
Loading