diff --git a/.env.localhost b/.env.localhost index ed0eeafcc3f..4b8da96deee 100644 --- a/.env.localhost +++ b/.env.localhost @@ -19,6 +19,7 @@ ENABLE_DEV_BACKEND_API="true" #FEATURE_DEFAULT_LOGIN_TEMPORARY_CLIENT="false" #FEATURE_APPLOCK_UNFOCUS_TIMEOUT="30" #FEATURE_APPLOCK_SCHEDULED_TIMEOUT="30" +#FEATURE_ENABLE_MLS="true" #FEATURE_USE_CORE_CRYPTO="true" # staging diff --git a/server/config/client.config.ts b/server/config/client.config.ts index 45e42389a69..8230538a83c 100644 --- a/server/config/client.config.ts +++ b/server/config/client.config.ts @@ -63,6 +63,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) { ENABLE_ENFORCE_DESKTOP_APPLICATION_ONLY: env.FEATURE_ENABLE_ENFORCE_DESKTOP_APPLICATION_ONLY == 'true', ENABLE_EXTRA_CLIENT_ENTROPY: env.FEATURE_ENABLE_EXTRA_CLIENT_ENTROPY == 'true', ENABLE_MEDIA_EMBEDS: env.FEATURE_ENABLE_MEDIA_EMBEDS != 'false', + ENABLE_MLS: env.FEATURE_ENABLE_MLS == 'true', ENABLE_PROTEUS_CORE_CRYPTO: env.FEATURE_ENABLE_PROTEUS_CORE_CRYPTO == 'true', ENABLE_SSO: env.FEATURE_ENABLE_SSO == 'true', ENFORCE_CONSTANT_BITRATE: env.FEATURE_ENFORCE_CONSTANT_BITRATE == 'true', diff --git a/server/config/env.ts b/server/config/env.ts index e135893e441..7103c1d4011 100644 --- a/server/config/env.ts +++ b/server/config/env.ts @@ -78,6 +78,8 @@ export type Env = { FEATURE_ALLOWED_FILE_UPLOAD_EXTENSIONS: string; /** will enable the MLS protocol */ + FEATURE_ENABLE_MLS?: string; + FEATURE_USE_CORE_CRYPTO?: string; FEATURE_MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD?: string; diff --git a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx index c734c341488..f39792e4aca 100644 --- a/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx +++ b/src/script/components/Modals/GroupCreation/GroupCreationModal.tsx @@ -81,12 +81,15 @@ const GroupCreationModal: React.FC = ({ } = useKoSubscribableChildren(teamState, ['isTeam', 'isMLSEnabled', 'isProtocolToggleEnabledForUser']); const {self: selfUser} = useKoSubscribableChildren(userState, ['self']); - const enableMLSToggle = isMLSEnabledForTeam && isProtocolToggleEnabledForUser; + const isMLSFeatureEnabled = Config.getConfig().FEATURE.ENABLE_MLS; + + const enableMLSToggle = isMLSFeatureEnabled && isMLSEnabledForTeam && isProtocolToggleEnabledForUser; //if feature flag is set to false or mls is disabled for current team use proteus as default - const defaultProtocol = isMLSEnabledForTeam - ? teamState.teamFeatures()?.mls?.config.defaultProtocol - : ConversationProtocol.PROTEUS; + const defaultProtocol = + isMLSFeatureEnabled && isMLSEnabledForTeam + ? teamState.teamFeatures()?.mls?.config.defaultProtocol + : ConversationProtocol.PROTEUS; const protocolOptions: ProtocolOption[] = ([ConversationProtocol.PROTEUS, ConversationProtocol.MLS] as const).map( protocol => ({ diff --git a/src/script/util/util.ts b/src/script/util/util.ts index 3b8251868ac..df66753fc91 100644 --- a/src/script/util/util.ts +++ b/src/script/util/util.ts @@ -25,6 +25,7 @@ import {Runtime} from '@wireapp/commons'; import {isTabKey} from './KeyboardUtil'; import {getLogger} from './Logger'; +import {Config} from '../Config'; import type {Conversation} from '../entity/Conversation'; import {AuthError} from '../error/AuthError'; @@ -303,7 +304,7 @@ export const setContextMenuPosition = (event: React.KeyboardEvent) => { const supportsSecretStorage = () => !Runtime.isDesktopApp() || !!window.systemCrypto; // disables mls for old 'broken' desktop clients, see https://github.com/wireapp/wire-desktop/pull/6094 -export const supportsMLS = () => supportsSecretStorage(); +export const supportsMLS = () => Config.getConfig().FEATURE.ENABLE_MLS && supportsSecretStorage(); export const incomingCssClass = 'content-animation-incoming-horizontal-left';