From e125d32c857abb7bb7820d0cd2c71f282afdaef0 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Wed, 31 Jul 2024 12:13:33 +0200 Subject: [PATCH 1/3] chore: Allow running in dev mode without TLS --- server/Server.ts | 2 +- server/config/server.config.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Server.ts b/server/Server.ts index 665349889e8..53ca376233a 100644 --- a/server/Server.ts +++ b/server/Server.ts @@ -236,7 +236,7 @@ class Server { if (this.server) { reject('Server is already running.'); } else if (this.config.PORT_HTTP) { - if (this.config.DEVELOPMENT) { + if (this.config.DEVELOPMENT && this.config.DEVELOPMENT_ENABLE_TLS) { const options = { cert: fs.readFileSync(this.config.SSL_CERTIFICATE_PATH), key: fs.readFileSync(this.config.SSL_CERTIFICATE_KEY_PATH), diff --git a/server/config/server.config.ts b/server/config/server.config.ts index 1bda4a7bf7a..10b8061e63f 100644 --- a/server/config/server.config.ts +++ b/server/config/server.config.ts @@ -99,6 +99,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) { BACKEND_REST: urls.api, BACKEND_WS: urls.ws, DEVELOPMENT: nodeEnv === 'development', + DEVELOPMENT_ENABLE_TLS: urls.base.startsWith('https://'), ENFORCE_HTTPS: env.ENFORCE_HTTPS != 'false', ENVIRONMENT: nodeEnv, GOOGLE_WEBMASTER_ID: env.GOOGLE_WEBMASTER_ID, From a3158fedf243a802c2e2424a7781def20c3d0d29 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Wed, 31 Jul 2024 12:14:21 +0200 Subject: [PATCH 2/3] chore: Add local backend config to .env.localhost --- .env.localhost | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.localhost b/.env.localhost index 6386fdd7d21..4e9363e91bb 100644 --- a/.env.localhost +++ b/.env.localhost @@ -5,7 +5,7 @@ APP_BASE="https://local.zinfra.io:8081" FORCED_CONFIG_URL="https://github.com/wireapp/wire-web-config-wire" -CSP_EXTRA_CONNECT_SRC="http://localhost:32123, ws://localhost:32123, https://*.zinfra.io, https://*.wire.link, https://*.wire.com, https://api.raygun.io, wss://*.zinfra.io, wss://*.wire.link, wss://prod-nginz-ssl.wire.com, https://wire.count.ly, https://balderdash.hogwash.work:9000, https://balderdash.hogwash.work:5556, https://accounts.google.com, https://oauth2.googleapis.com/token" +CSP_EXTRA_CONNECT_SRC="http://localhost:4570, http://localhost:32123, ws://localhost:32123, https://*.zinfra.io, https://*.wire.link, https://*.wire.com, https://api.raygun.io, wss://*.zinfra.io, wss://*.wire.link, wss://prod-nginz-ssl.wire.com, https://wire.count.ly, https://balderdash.hogwash.work:9000, https://balderdash.hogwash.work:5556, https://accounts.google.com, https://oauth2.googleapis.com/token" CSP_EXTRA_IMG_SRC="https://*.zinfra.io, https://*.wire.com, https://*.wire.link" CSP_EXTRA_SCRIPT_SRC="http://localhost:32123, https://*.zinfra.io, https://*.wire.com, https://*.wire.link, https://api.raygun.io" ENFORCE_HTTPS="false" @@ -30,3 +30,7 @@ BACKEND_WS="wss://staging-nginz-ssl.zinfra.io" # BACKEND_REST="https://prod-nginz-https.wire.com" # BACKEND_WS="wss://prod-nginz-ssl.wire.com" +# local +# BACKEND_REST="http://localhost:8080" +# BACKEND_WS="ws://localhost:8080" +# APP_BASE="http://localhost:8081" From 818fa89ac31e2b382dc69f900f3b20ce1eaa5daa Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Wed, 31 Jul 2024 14:23:40 +0200 Subject: [PATCH 3/3] chore: Clarify comment about connecting to a local backend Co-authored-by: Timothy LeBon --- .env.localhost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.localhost b/.env.localhost index 4e9363e91bb..4b8da96deee 100644 --- a/.env.localhost +++ b/.env.localhost @@ -30,7 +30,7 @@ BACKEND_WS="wss://staging-nginz-ssl.zinfra.io" # BACKEND_REST="https://prod-nginz-https.wire.com" # BACKEND_WS="wss://prod-nginz-ssl.wire.com" -# local +# Use these vars if you are running a local backend. (Rare) # BACKEND_REST="http://localhost:8080" # BACKEND_WS="ws://localhost:8080" # APP_BASE="http://localhost:8081"