From cef88e2894edcbb7cc0382a6a98807e708fa0faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 26 Oct 2022 13:58:41 +0200 Subject: [PATCH 1/3] Add option to allow ICE server fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .env.example | 1 + src/ClientContext.tsx | 3 +++ src/matrix-utils.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/.env.example b/.env.example index 7359d2c..963a584 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ # Used for determining the homeserver to use for short urls etc. # VITE_DEFAULT_HOMESERVER=http://localhost:8008 +# VITE_FALLBACK_ICE_ALLOWED=true # Used for submitting debug logs to an external rageshake server # VITE_RAGESHAKE_SUBMIT_URL=http://localhost:9110/api/submit diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index c7095b7..e5109b6 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -34,6 +34,7 @@ import { initClient, defaultHomeserver, CryptoStoreIntegrityError, + fallbackICEServerAllowed, } from "./matrix-utils"; import { widget } from "./widget"; import { translatedError } from "./TranslatedError"; @@ -130,6 +131,7 @@ export const ClientProvider: FC = ({ children }) => { accessToken: access_token, userId: user_id, deviceId: device_id, + fallbackICEServerAllowed: fallbackICEServerAllowed, }, true ), @@ -145,6 +147,7 @@ export const ClientProvider: FC = ({ children }) => { accessToken: access_token, userId: user_id, deviceId: device_id, + fallbackICEServerAllowed: fallbackICEServerAllowed, }, false // Don't need the crypto store just to log out ); diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 282e1b7..5a92772 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -24,6 +24,8 @@ import { getUrlParams } from "./UrlParams"; export const defaultHomeserver = (import.meta.env.VITE_DEFAULT_HOMESERVER as string) ?? `${window.location.protocol}//${window.location.host}`; +export const fallbackICEServerAllowed = + import.meta.env.VITE_FALLBACK_ICE_ALLOWED === "true"; export const defaultHomeserverHost = new URL(defaultHomeserver).host; @@ -152,6 +154,7 @@ export async function initClient( // so we don't want API calls taking ages, we'd rather they just fail. localTimeoutMs: 5000, useE2eForGroupCall: e2eEnabled, + fallbackICEServerAllowed: fallbackICEServerAllowed, }); try { From c4c99c4bcbece29c1e034e67d325b7bcd9faf6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 26 Oct 2022 14:27:41 +0200 Subject: [PATCH 2/3] Use a better var name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .env.example | 2 +- src/matrix-utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 963a584..7b63f42 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ # Used for determining the homeserver to use for short urls etc. # VITE_DEFAULT_HOMESERVER=http://localhost:8008 -# VITE_FALLBACK_ICE_ALLOWED=true +# VITE_FALLBACK_STUN_ALLOWED=true # Used for submitting debug logs to an external rageshake server # VITE_RAGESHAKE_SUBMIT_URL=http://localhost:9110/api/submit diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 5a92772..8f6b781 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -25,7 +25,7 @@ export const defaultHomeserver = (import.meta.env.VITE_DEFAULT_HOMESERVER as string) ?? `${window.location.protocol}//${window.location.host}`; export const fallbackICEServerAllowed = - import.meta.env.VITE_FALLBACK_ICE_ALLOWED === "true"; + import.meta.env.VITE_FALLBACK_STUN_ALLOWED === "true"; export const defaultHomeserverHost = new URL(defaultHomeserver).host; From e01136e6bb06eecc650a35c946e23dcc2a27686b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 26 Oct 2022 16:33:22 +0200 Subject: [PATCH 3/3] Change default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 7b63f42..6da40c1 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ # Used for determining the homeserver to use for short urls etc. # VITE_DEFAULT_HOMESERVER=http://localhost:8008 -# VITE_FALLBACK_STUN_ALLOWED=true +# VITE_FALLBACK_STUN_ALLOWED=false # Used for submitting debug logs to an external rageshake server # VITE_RAGESHAKE_SUBMIT_URL=http://localhost:9110/api/submit