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_ICE_SERVERS_URL=http://localhost:9000/iceservers
REACT_APP_VERSION=$npm_package_version
REACT_APP_MAINTENANCE=false

View File

@ -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"

View File

@ -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

View File

@ -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");
}