From 20b8dc60c1c3469dadebaef9c11a6a29a2eb6f2e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 20 Feb 2026 19:26:41 +0530 Subject: [PATCH] fix: use environment variable for BACKEND_URL --- docker-compose.yaml | 2 +- scripts/setup_custom_domain.sh | 8 ++++++++ scripts/setup_remote.sh | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index e02384d..e27360b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -151,7 +151,7 @@ services: image: ${REGISTRY:-dograhai}/dograh-ui:latest environment: # Server-side URL (SSR, internal Docker network) - BACKEND_URL: "http://api:8000" + BACKEND_URL: "${BACKEND_URL:-http://api:8000}" NODE_ENV: "oss" # Flag to enable/ disable posthog and sentry ENABLE_TELEMETRY: "${ENABLE_TELEMETRY:-true}" diff --git a/scripts/setup_custom_domain.sh b/scripts/setup_custom_domain.sh index 90fb386..58ebb8c 100755 --- a/scripts/setup_custom_domain.sh +++ b/scripts/setup_custom_domain.sh @@ -250,6 +250,14 @@ echo -e "${BLUE}[6/8] Updating environment variables...${NC}" if [[ -f ".env" ]]; then # Update BACKEND_API_ENDPOINT to use domain sed -i.bak "s|^BACKEND_API_ENDPOINT=.*|BACKEND_API_ENDPOINT=https://$DOMAIN_NAME|" .env + # Update BACKEND_URL if present, otherwise add it + if grep -q "^BACKEND_URL=" .env; then + sed -i.bak "s|^BACKEND_URL=.*|BACKEND_URL=https://$DOMAIN_NAME|" .env + else + echo "" >> .env + echo "# Backend URL for UI" >> .env + echo "BACKEND_URL=https://$DOMAIN_NAME" >> .env + fi # Update TURN_HOST to use domain sed -i.bak "s|^TURN_HOST=.*|TURN_HOST=$DOMAIN_NAME|" .env rm -f .env.bak diff --git a/scripts/setup_remote.sh b/scripts/setup_remote.sh index a734fc6..a5d7b3d 100755 --- a/scripts/setup_remote.sh +++ b/scripts/setup_remote.sh @@ -173,6 +173,9 @@ cat > .env << ENV_EOF # Backend API endpoint (for remote deployment) BACKEND_API_ENDPOINT=https://$SERVER_IP +# Backend URL for UI +BACKEND_URL=https://$SERVER_IP + # TURN Server Configuration (time-limited credentials via TURN REST API) TURN_HOST=$SERVER_IP TURN_SECRET=$TURN_SECRET