From e6a13dde72a82d23a94a15dbb0c26e6f2e90f382 Mon Sep 17 00:00:00 2001
From: Tushar <codingid6@gmail.com>
Date: Wed, 12 Apr 2023 06:38:31 +0000
Subject: [PATCH] Fix env vars for react wrapper

---
 .env        | 5 ++++-
 .gitpod.yml | 7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.env b/.env
index 76320cb..226e9dd 100644
--- a/.env
+++ b/.env
@@ -36,7 +36,10 @@ HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey
 HASURA_GRAPHQL_JWT_SECRET={"type":"RS256","jwk_url":"http://fusionauth:9011/.well-known/jwks.json"}
 HASURA_GRAPHQL_DATABASE_URL=postgres://$TSDB_POSTGRES_USER:$TSDB_POSTGRES_PASSWORD@tsdb:5432/postgres?sslmode=disable
 
-#react wrapper
+#react wrapper 
+# http://service-name is not going to work as we are building a static build
+# and serving it through nginx
+# use actual IP address instead
 REACT_APP_ENKETO_URL=http://enketo-express:8065
 REACT_APP_FORM_MANAGER_URL=http://form-manager:3006
 REACT_APP_HASURA_URL=http://gql:8080
\ No newline at end of file
diff --git a/.gitpod.yml b/.gitpod.yml
index c8ac34f..ced4180 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -24,9 +24,10 @@ tasks:
       # sed -i~ "/^MINIO_ENDPOINT=/s/=.*/=9000-${GITPOD_WORKSPACE_URL:8}/" .env
       # sed -i~ "/^MINIO_PORT=/s/=.*/=80/" .env
       # sed -i~ "/^MINIO_USE_SSL=/s/=.*/=true/" .env
-      # sed -i~ "/^REACT_APP_ENKETO_URL=/s/=.*/=https\:\/\/8065-${GITPOD_WORKSPACE_URL:8}/" .env
-      # sed -i~ "/^REACT_APP_FORM_MANAGER_URL=/s/=.*/=https\:\/\/3006-${GITPOD_WORKSPACE_URL:8}/" .env
-      # sed -i~ "/^REACT_APP_HASURA_URL=/s/=.*/=https\:\/\/8080-${GITPOD_WORKSPACE_URL:8}/" .env
+      # Replace env vars for react wrapper
+      sed -i~ "/^REACT_APP_ENKETO_URL=/s/=.*/=https\:\/\/8065-${GITPOD_WORKSPACE_URL:8}/" .env
+      sed -i~ "/^REACT_APP_FORM_MANAGER_URL=/s/=.*/=https\:\/\/3006-${GITPOD_WORKSPACE_URL:8}/" .env
+      sed -i~ "/^REACT_APP_HASURA_URL=/s/=.*/=https\:\/\/8080-${GITPOD_WORKSPACE_URL:8}/" .env
       
       docker-compose up -d
       gp sync-done setup
-- 
GitLab