Skip to content

Commit f29c3c3

Browse files
committed
Add GO_WEB_URL to replace FRONTEND_URL internally
GO_WEB_URL includes scheme
1 parent 540d961 commit f29c3c3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

api/management/commands/cron_job_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def handle(self, *args, **options):
3636
project_id = parsed_url.path.strip("/")
3737
api_key = parsed_url.username
3838

39-
SENTRY_INGEST = f"https://{parsed_url.hostname}"
39+
SENTRY_INGEST = f"{parsed_url.scheme}://{parsed_url.hostname}"
4040

4141
for cronjob in SentryMonitor.choices:
4242
job, schedule = cronjob

main/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
DJANGO_ADDITIONAL_ALLOWED_HOSTS=(list, []), # Eg: api.go.ifrc.org, goadmin.ifrc.org, dsgocdnapi.azureedge.net
3131
GO_ENVIRONMENT=(str, "development"), # staging, production
3232
#
33-
FRONTEND_URL=str,
3433
API_FQDN=str, # https://goadmin.ifrc.org
34+
FRONTEND_URL=str, # https://go.ifrc.org
3535
# Database
3636
DJANGO_DB_NAME=str,
3737
DJANGO_DB_USER=str,
@@ -145,6 +145,9 @@ def parse_domain(env_key: str) -> str:
145145

146146

147147
GO_API_URL = parse_domain("API_FQDN")
148+
GO_WEB_URL = parse_domain("FRONTEND_URL")
149+
FRONTEND_URL = urlparse(GO_WEB_URL).hostname # XXX: Deprecated. Slowly remove this from codebase
150+
148151
INTERNAL_IPS = ["127.0.0.1"]
149152
if env("DOCKER_HOST_IP"):
150153
INTERNAL_IPS.append(env("DOCKER_HOST_IP"))
@@ -627,8 +630,6 @@ def log_render_extra_context(record):
627630
GO_FTPPASS = env("GO_FTPPASS")
628631
GO_DBPASS = env("GO_DBPASS")
629632

630-
# MISC
631-
FRONTEND_URL = env("FRONTEND_URL")
632633

633634
# COUNTRY PAGE
634635
NS_CONTACT_USERNAME = env("NS_CONTACT_USERNAME")

0 commit comments

Comments
 (0)