-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Deployment Fingerprint (#30411)
- Loading branch information
Showing
21 changed files
with
395 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@rocket.chat/meteor": minor | ||
"@rocket.chat/core-typings": minor | ||
"@rocket.chat/model-typings": minor | ||
"@rocket.chat/rest-typings": minor | ||
--- | ||
|
||
Create a deployment fingerprint to identify possible deployment changes caused by database cloning. A question to the admin will confirm if it's a regular deployment change or an intent of a new deployment and correct identification values as needed. | ||
The fingerprint is composed by `${siteUrl}${dbConnectionString}` and hashed via `sha256` in `base64`. | ||
An environment variable named `AUTO_ACCEPT_FINGERPRINT`, when set to `true`, can be used to auto-accept an expected fingerprint change as a regular deployment update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Box } from '@rocket.chat/fuselage'; | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import type { ReactElement } from 'react'; | ||
import React from 'react'; | ||
|
||
import GenericModal from './GenericModal'; | ||
|
||
type FingerprintChangeModalProps = { | ||
onConfirm: () => void; | ||
onCancel: () => void; | ||
onClose: () => void; | ||
}; | ||
|
||
const FingerprintChangeModal = ({ onConfirm, onCancel, onClose }: FingerprintChangeModalProps): ReactElement => { | ||
const t = useTranslation(); | ||
return ( | ||
<GenericModal | ||
variant='warning' | ||
title={t('Unique_ID_change_detected')} | ||
onConfirm={onConfirm} | ||
onClose={onClose} | ||
onCancel={onCancel} | ||
confirmText={t('New_workspace')} | ||
cancelText={t('Configuration_update')} | ||
> | ||
<Box | ||
is='p' | ||
mbe={16} | ||
dangerouslySetInnerHTML={{ | ||
__html: t('Unique_ID_change_detected_description'), | ||
}} | ||
/> | ||
<Box | ||
is='p' | ||
mbe={16} | ||
dangerouslySetInnerHTML={{ | ||
__html: t('Unique_ID_change_detected_learn_more_link'), | ||
}} | ||
/> | ||
</GenericModal> | ||
); | ||
}; | ||
|
||
export default FingerprintChangeModal; |
47 changes: 47 additions & 0 deletions
47
apps/meteor/client/components/FingerprintChangeModalConfirmation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Box } from '@rocket.chat/fuselage'; | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import type { ReactElement } from 'react'; | ||
import React from 'react'; | ||
|
||
import GenericModal from './GenericModal'; | ||
|
||
type FingerprintChangeModalConfirmationProps = { | ||
onConfirm: () => void; | ||
onCancel: () => void; | ||
newWorkspace: boolean; | ||
}; | ||
|
||
const FingerprintChangeModalConfirmation = ({ | ||
onConfirm, | ||
onCancel, | ||
newWorkspace, | ||
}: FingerprintChangeModalConfirmationProps): ReactElement => { | ||
const t = useTranslation(); | ||
return ( | ||
<GenericModal | ||
variant='warning' | ||
title={newWorkspace ? t('Confirm_new_workspace') : t('Confirm_configuration_update')} | ||
onConfirm={onConfirm} | ||
onCancel={onCancel} | ||
cancelText={t('Back')} | ||
confirmText={newWorkspace ? t('Confirm_new_workspace') : t('Confirm_configuration_update')} | ||
> | ||
<Box | ||
is='p' | ||
mbe={16} | ||
dangerouslySetInnerHTML={{ | ||
__html: newWorkspace ? t('Confirm_new_workspace_description') : t('Confirm_configuration_update_description'), | ||
}} | ||
/> | ||
<Box | ||
is='p' | ||
mbe={16} | ||
dangerouslySetInnerHTML={{ | ||
__html: t('Unique_ID_change_detected_learn_more_link'), | ||
}} | ||
/> | ||
</GenericModal> | ||
); | ||
}; | ||
|
||
export default FingerprintChangeModalConfirmation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { LogLevelSetting } from '@rocket.chat/logger'; | ||
import { logLevel } from '@rocket.chat/logger'; | ||
import { Settings } from '@rocket.chat/models'; | ||
|
||
const LogLevel = await Settings.getValueById('Log_Level'); | ||
if (LogLevel) { | ||
logLevel.emit('changed', LogLevel as LogLevelSetting); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.