From 68826aa1d07e3afb29cb3f6469d542db45025bb8 Mon Sep 17 00:00:00 2001 From: nthouliss Date: Thu, 15 Jun 2023 16:38:58 +1000 Subject: [PATCH] Edit env vars --- .env | 1 - docker-compose.yml | 1 - render.yaml | 14 ++++++++++++-- src/network/Session.ts | 6 ++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.env b/.env index e3dcab2..5e6a920 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ REACT_APP_BROKER_URL=http://localhost:9000 -REACT_APP_ICE_SERVERS_URL=http://localhost:9000/iceservers REACT_APP_VERSION=$npm_package_version REACT_APP_MAINTENANCE=false diff --git a/docker-compose.yml b/docker-compose.yml index 19fb374..e93a304 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,6 @@ services: - 3000:3000 environment: REACT_APP_BROKER_URL: "http://localhost:9000" - REACT_APP_ICE_SERVERS_URL: "http://localhost:9000/iceservers" REACT_APP_VERSION: "1.10.2" REACT_APP_MAINTENANCE: "false" diff --git a/render.yaml b/render.yaml index f893d9e..9be5946 100644 --- a/render.yaml +++ b/render.yaml @@ -23,10 +23,20 @@ services: - path: /* name: X-Robots-Tag value: noindex + envVars: + - key: REACT_APP_BROKER_URL + fromService: + type: web + name: "Owlbear Rodeo Backend" + envVarKey: RENDER_EXTERNAL_URL + - key: REACT_APP_MAINTENANCE + value: false + - key: REACT_APP_VERSION + value: "1.10.2" # A Docker web service - type: web name: Owlbear Rodeo Backend - env: docker + runtime: docker region: oregon # optional (defaults to oregon) check other regions here: https://render.com/docs/regions plan: free branch: "feature/open-source" # optional (defaults to master) @@ -36,6 +46,6 @@ services: healthCheckPath: /health envVars: - key: ORIGIN_WHITELIST - value: $RENDER_EXTERNAL_HOSTNAME + value: RENDER_EXTERNAL_HOSTNAME - key: PORT value: 9000 \ No newline at end of file diff --git a/src/network/Session.ts b/src/network/Session.ts index c112df5..5fa1a88 100644 --- a/src/network/Session.ts +++ b/src/network/Session.ts @@ -64,7 +64,7 @@ class Session extends EventEmitter { async connect() { try { if ( - !process.env.REACT_APP_ICE_SERVERS_URL || + !process.env.REACT_APP_BROKER_URL || process.env.REACT_APP_MAINTENANCE === "true" ) { this.emit("status", "offline"); @@ -75,7 +75,9 @@ class Session extends EventEmitter { parser: msgParser, transports: ["websocket"], }); - const response = await fetch(process.env.REACT_APP_ICE_SERVERS_URL); + const response = await fetch( + `${process.env.REACT_APP_BROKER_URL}/iceservers` + ); if (!response.ok) { throw Error("Unable to fetch ICE servers"); }