Skip to content

Commit

Permalink
Simplify URL configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Oct 3, 2024
1 parent daf736f commit cd62d52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dev.env
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
DATAPORTAL_URL=http://dataportal-backend:3000/
DATAPORTAL_PUBLIC_URL=http://localhost:8080/
DATAPORTAL_URL=http://dataportal-backend:3000
DATAPORTAL_PUBLIC_URL=http://localhost:8080
DVAS_PASSWORD=test
DVAS_USERNAME=test
DVAS_ACCESS_TOKEN=test
DVAS_PORTAL_URL=http://dvas.test/
DVAS_PORTAL_URL=http://dvas.test

PID_SERVICE_URL=http://pid-service:5800/pid/
PID_SERVICE_URL=http://pid-service:5800
PID_SERVICE_TEST_ENV=True

STORAGE_SERVICE_URL=http://storage-service:5900/
STORAGE_SERVICE_URL=http://storage-service:5900
STORAGE_SERVICE_USER=test
STORAGE_SERVICE_PASSWORD=test

Expand Down
3 changes: 1 addition & 2 deletions src/processing/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import re


class Config:
Expand All @@ -15,7 +14,7 @@ def __init__(self, environ=os.environ) -> None:
environ.get("DATA_SUBMISSION_USERNAME", "admin"),
environ.get("DATA_SUBMISSION_PASSWORD", "admin"),
)
self.pid_service_url = re.sub(r"(/pid)?/?$", "", environ["PID_SERVICE_URL"])
self.pid_service_url = environ["PID_SERVICE_URL"].rstrip("/")
self.is_production = environ["PID_SERVICE_TEST_ENV"].lower() != "true"
self.freeze_after_days = int(environ["FREEZE_AFTER_DAYS"])
self.freeze_model_after_days = int(environ["FREEZE_MODEL_AFTER_DAYS"])
Expand Down

0 comments on commit cd62d52

Please sign in to comment.