Skip to content

Commit f8c2460

Browse files
committed
settings clean up + spectacular settings server fix
1 parent 3f8d909 commit f8c2460

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

chord_metadata_service/metadata/settings.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from bento_lib.logging.structured import configure_structlog, configure_structlog_uvicorn
1919
from bento_lib.service_info.types import GA4GHServiceType
2020
from structlog.stdlib import get_logger
21-
from urllib.parse import quote, urlparse
21+
from urllib.parse import urlparse
2222
from dotenv import load_dotenv
2323

2424
from .. import __version__
@@ -109,10 +109,6 @@ def str_to_bool(value: str | None) -> bool:
109109

110110
SERVICE_TEMP = os.environ.get("KATSU_TEMP", os.environ.get("SERVICE_TEMP"))
111111

112-
# - DRS URL - by default in Bento Singularity context, use internal NGINX DRS (to avoid auth hassles)
113-
NGINX_INTERNAL_SOCKET = quote(os.environ.get("NGINX_INTERNAL_SOCKET", "/chord/tmp/nginx_internal.sock"), safe="")
114-
DRS_URL = os.environ.get("DRS_URL", f"http+unix://{NGINX_INTERNAL_SOCKET}/api/drs").strip().rstrip("/")
115-
116112
# Application definition
117113

118114
INSTALLED_APPS = (["daphne"] if os.environ.get("BENTO_CONTAINER_LOCAL") else []) + [
@@ -374,8 +370,8 @@ def get_secret(path):
374370

375371
# SPECTACULAR_SETTINGS['SERVERS'] defines the url to which calls are made when
376372
# testing a request within the swagger UI
377-
if CHORD_URL:
378-
SPECTACULAR_SETTINGS["SERVERS"] = [{"url": CHORD_URL + FORCE_SCRIPT_NAME}]
373+
if SERVICE_URL_BASE_PATH:
374+
SPECTACULAR_SETTINGS["SERVERS"] = [{"url": SERVICE_URL_BASE_PATH}]
379375

380376
# ----------------------------------------------------------------------------------------------------------------------
381377

0 commit comments

Comments
 (0)