diff --git a/.changeset/swift-penguins-help.md b/.changeset/swift-penguins-help.md new file mode 100644 index 000000000000..09588cc8771a --- /dev/null +++ b/.changeset/swift-penguins-help.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': major +--- + +Change the E2EE setting - "Access unencrypted content in encrypted rooms" default value, making the current behavior not allow to send unencrypted messages in end-to-end encrypted channels. diff --git a/apps/meteor/server/settings/e2e.ts b/apps/meteor/server/settings/e2e.ts index dfaabdc3f237..8d80ad5b8c18 100644 --- a/apps/meteor/server/settings/e2e.ts +++ b/apps/meteor/server/settings/e2e.ts @@ -10,7 +10,7 @@ export const createE2ESettings = () => alert: 'E2E_Enable_alert', }); - await this.add('E2E_Allow_Unencrypted_Messages', true, { + await this.add('E2E_Allow_Unencrypted_Messages', false, { type: 'boolean', public: true, enableQuery: { _id: 'E2E_Enable', value: true }, diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index 6bbe89a1726b..c77d750b25c4 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -46,5 +46,6 @@ import './v310'; import './v311'; import './v312'; import './v313'; +import './v314'; export * from './xrun'; diff --git a/apps/meteor/server/startup/migrations/v314.ts b/apps/meteor/server/startup/migrations/v314.ts new file mode 100644 index 000000000000..0b46cc42838a --- /dev/null +++ b/apps/meteor/server/startup/migrations/v314.ts @@ -0,0 +1,21 @@ +import { Settings } from '@rocket.chat/models'; + +import { addMigration } from '../../lib/migrations'; + +addMigration({ + version: 314, + name: 'Update default behavior of E2E_Allow_Unencrypted_Messages setting, to not allow un-encrypted messages by default.', + async up() { + await Settings.updateOne( + { + _id: 'E2E_Allow_Unencrypted_Messages', + }, + { + $set: { + value: false, + packageValue: false, + }, + }, + ); + }, +});