Edit env vars

This commit is contained in:
nthouliss 2023-06-15 16:38:58 +10:00
parent d5312fd4fd
commit 68826aa1d0
4 changed files with 16 additions and 6 deletions

1
.env
View File

@ -1,4 +1,3 @@
REACT_APP_BROKER_URL=http://localhost:9000 REACT_APP_BROKER_URL=http://localhost:9000
REACT_APP_ICE_SERVERS_URL=http://localhost:9000/iceservers
REACT_APP_VERSION=$npm_package_version REACT_APP_VERSION=$npm_package_version
REACT_APP_MAINTENANCE=false REACT_APP_MAINTENANCE=false

View File

@ -17,7 +17,6 @@ services:
- 3000:3000 - 3000:3000
environment: environment:
REACT_APP_BROKER_URL: "http://localhost:9000" REACT_APP_BROKER_URL: "http://localhost:9000"
REACT_APP_ICE_SERVERS_URL: "http://localhost:9000/iceservers"
REACT_APP_VERSION: "1.10.2" REACT_APP_VERSION: "1.10.2"
REACT_APP_MAINTENANCE: "false" REACT_APP_MAINTENANCE: "false"

View File

@ -23,10 +23,20 @@ services:
- path: /* - path: /*
name: X-Robots-Tag name: X-Robots-Tag
value: noindex 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 # A Docker web service
- type: web - type: web
name: Owlbear Rodeo Backend name: Owlbear Rodeo Backend
env: docker runtime: docker
region: oregon # optional (defaults to oregon) check other regions here: https://render.com/docs/regions region: oregon # optional (defaults to oregon) check other regions here: https://render.com/docs/regions
plan: free plan: free
branch: "feature/open-source" # optional (defaults to master) branch: "feature/open-source" # optional (defaults to master)
@ -36,6 +46,6 @@ services:
healthCheckPath: /health healthCheckPath: /health
envVars: envVars:
- key: ORIGIN_WHITELIST - key: ORIGIN_WHITELIST
value: $RENDER_EXTERNAL_HOSTNAME value: RENDER_EXTERNAL_HOSTNAME
- key: PORT - key: PORT
value: 9000 value: 9000

View File

@ -64,7 +64,7 @@ class Session extends EventEmitter {
async connect() { async connect() {
try { try {
if ( if (
!process.env.REACT_APP_ICE_SERVERS_URL || !process.env.REACT_APP_BROKER_URL ||
process.env.REACT_APP_MAINTENANCE === "true" process.env.REACT_APP_MAINTENANCE === "true"
) { ) {
this.emit("status", "offline"); this.emit("status", "offline");
@ -75,7 +75,9 @@ class Session extends EventEmitter {
parser: msgParser, parser: msgParser,
transports: ["websocket"], 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) { if (!response.ok) {
throw Error("Unable to fetch ICE servers"); throw Error("Unable to fetch ICE servers");
} }