snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import { useStableCallback } from '@rocket.chat/fuselage-hooks';
import { useState } from 'react';
import DisableE2EEModal from './DisableE2EEModal';
import ResetKeysE2EEModal from './ResetKeysE2EEModal';
const STEPS = {
DISABLE_E2EE: 'DISABLE_E2EE',
RESET_ROOM_KEY: 'RESET_ROOM_KEY',
};
export type BaseDisableE2EEModalProps = {
onConfirm: () => void;
onClose: () => void;
roomType: string;
roomId: string;
canResetRoomKey: boolean;
};
const BaseDisableE2EEModal = ({ onConfirm, onClose, roomType, roomId, canResetRoomKey }: BaseDisableE2EEModalProps) => {
const [step, setStep] = useState(STEPS.DISABLE_E2EE);
const onResetRoomKey = useStableCallback(() => {
setStep(STEPS.RESET_ROOM_KEY);
});
if (step === STEPS.RESET_ROOM_KEY && canResetRoomKey) {
return <ResetKeysE2EEModal roomType={roomType} roomId={roomId} onCancel={onClose} />;
}
return (
<DisableE2EEModal
onConfirm={onConfirm}
onCancel={onClose}
roomType={roomType}
canResetRoomKey={canResetRoomKey}
onResetRoomKey={onResetRoomKey}
/>
);
};
export default BaseDisableE2EEModal;

View File

@@ -0,0 +1,52 @@
import { Accordion, AccordionItem, Box, Button } from '@rocket.chat/fuselage';
import { GenericModal } from '@rocket.chat/ui-client';
import { Trans, useTranslation } from 'react-i18next';
export type DisableE2EEModalProps = {
onConfirm: () => void;
onCancel: () => void;
roomType: string;
canResetRoomKey: boolean;
onResetRoomKey: () => void;
};
const DisableE2EEModal = ({ onConfirm, onCancel, roomType, canResetRoomKey, onResetRoomKey }: DisableE2EEModalProps) => {
const { t } = useTranslation();
return (
<GenericModal
icon='key'
title={t('E2E_disable_encryption')}
variant='warning'
confirmText={t('E2E_disable_encryption')}
onConfirm={onConfirm}
onCancel={onCancel}
onDismiss={() => undefined}
annotation={t('Proceed_with_caution')}
>
<Box marginBlockEnd={16} is='p'>
<Trans i18nKey='E2E_disable_encryption_description' tOptions={{ roomType }} />
</Box>
{canResetRoomKey && (
<>
<Box marginBlockEnd={16} is='p'>
{t('E2E_disable_encryption_reset_keys_description')}
</Box>
<Accordion>
<AccordionItem title={t('E2E_reset_encryption_keys')}>
<Box marginBlockEnd={16} is='p'>
{t('E2E_reset_encryption_keys_description')}
</Box>
<Button secondary danger small onClick={onResetRoomKey}>
{t('E2E_reset_encryption_keys_button', { roomType })}
</Button>
</AccordionItem>
</Accordion>
</>
)}
</GenericModal>
);
};
export default DisableE2EEModal;

View File

@@ -0,0 +1,30 @@
import { Box } from '@rocket.chat/fuselage';
import { GenericModal } from '@rocket.chat/ui-client';
import { useTranslation } from 'react-i18next';
export type EnableE2EEModalProps = {
onConfirm: () => void;
onClose: () => void;
roomType: string;
};
const EnableE2EEModal = ({ onConfirm, onClose, roomType }: EnableE2EEModalProps) => {
const { t } = useTranslation();
return (
<GenericModal
icon='key'
title={t('E2E_enable_encryption')}
variant='warning'
confirmText={t('E2E_enable_encryption')}
onConfirm={onConfirm}
onCancel={onClose}
>
<Box marginBlockEnd={16} is='p'>
{t('E2E_enable_encryption_description', { roomType })}
</Box>
</GenericModal>
);
};
export default EnableE2EEModal;

View File

@@ -0,0 +1,62 @@
import { Box, ModalFooterAnnotation, ModalIcon } from '@rocket.chat/fuselage';
import { ExternalLink, GenericModal } from '@rocket.chat/ui-client';
import { useToastMessageDispatch } from '@rocket.chat/ui-contexts';
import { Trans, useTranslation } from 'react-i18next';
import { links } from '../../../../lib/links';
import { useE2EEResetRoomKey } from '../../hooks/useE2EEResetRoomKey';
const E2EE_RESET_KEY_LINK = links.go.e2eeGuide;
export type ResetKeysE2EEModalProps = {
roomType: string;
roomId: string;
onCancel: () => void;
};
const ResetKeysE2EEModal = ({ roomType, roomId, onCancel }: ResetKeysE2EEModalProps) => {
const { t } = useTranslation();
const resetRoomKeyMutation = useE2EEResetRoomKey();
const dispatchToastMessage = useToastMessageDispatch();
const handleResetRoomKey = () => {
resetRoomKeyMutation.mutate(
{ roomId },
{
onSuccess: () => {
dispatchToastMessage({ type: 'success', message: t('E2E_reset_encryption_keys_success') });
},
onError: () => {
dispatchToastMessage({ type: 'error', message: t('E2E_reset_encryption_keys_error') });
},
onSettled: () => {
onCancel();
},
},
);
};
return (
<GenericModal
icon={<ModalIcon color='danger' name='key' />}
title={t('E2E_reset_encryption_keys')}
variant='danger'
confirmText={t('E2E_reset_encryption_keys')}
dontAskAgain={<ModalFooterAnnotation>{t('This_action_cannot_be_undone')}</ModalFooterAnnotation>}
onCancel={onCancel}
onConfirm={handleResetRoomKey}
onDismiss={() => undefined}
>
<Box marginBlockEnd={16} is='p'>
<Trans i18nKey='E2E_reset_encryption_keys_modal_description' tOptions={{ roomType }}>
Resetting E2EE keys is only recommend if no {roomType} member has a valid key to regain access to the previously encrypted
content. All members may lose access to previously encrypted content.
<ExternalLink to={E2EE_RESET_KEY_LINK}>Learn more</ExternalLink> about resetting encryption keys. Proceed with caution.
</Trans>
</Box>
</GenericModal>
);
};
export default ResetKeysE2EEModal;