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,154 @@
import bannersConfigSchema from '@rocket.chat/abac/docs/classification-banners.schema.json';
import { settingsRegistry } from '../../../server/settings';
const abacEnabledQuery = { _id: 'ABAC_Enabled', value: true };
const virtruPdpQuery = [abacEnabledQuery, { _id: 'ABAC_PDP_Type', value: 'virtru' }];
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('General', async function () {
await this.with(
{
enterprise: true,
modules: ['abac'],
},
async function () {
await this.add('ABAC_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC',
i18nDescription: 'ABAC_Enabled_Description',
});
await this.add('ABAC_PDP_Type', 'local', {
type: 'select',
public: true,
section: 'ABAC',
invalidValue: 'local',
values: [
{ key: 'local', i18nLabel: 'ABAC_PDP_Type_Local' },
{ key: 'virtru', i18nLabel: 'ABAC_PDP_Type_Virtru' },
],
alert: 'ABAC_PDP_Type_Switch_Alert',
enableQuery: abacEnabledQuery,
});
await this.add('ABAC_Attribute_Store', 'local', {
type: 'select',
public: true,
section: 'ABAC_Virtru_PDP_Configuration',
invalidValue: 'local',
values: [
{ key: 'local', i18nLabel: 'ABAC_Attribute_Store_Local' },
{ key: 'virtru', i18nLabel: 'ABAC_Attribute_Store_Virtru' },
],
i18nDescription: 'ABAC_Attribute_Store_Description',
alert: 'ABAC_Attribute_Store_Switch_Alert',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_ShowAttributesInRooms', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC',
enableQuery: abacEnabledQuery,
});
await this.add('ABAC_Classification_Banners_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC_Classification_Banners',
enableQuery: abacEnabledQuery,
i18nDescription: 'ABAC_Classification_Banners_Enabled_Description',
});
await this.add('ABAC_Classification_Banners_Config', '', {
type: 'code',
code: 'application/json',
multiline: true,
public: true,
invalidValue: '',
section: 'ABAC_Classification_Banners',
enableQuery: [abacEnabledQuery, { _id: 'ABAC_Classification_Banners_Enabled', value: true }],
i18nDescription: 'ABAC_Classification_Banners_Config_Description',
schema: bannersConfigSchema,
});
await this.add('Abac_Cache_Decision_Time_Seconds', 300, {
type: 'int',
public: true,
section: 'ABAC',
invalidValue: 0,
enableQuery: abacEnabledQuery,
});
// Virtru PDP Configuration
await this.add('ABAC_Virtru_Base_URL', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Client_ID', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Client_Secret', '', {
type: 'password',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_OIDC_Endpoint', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_OIDC_Endpoint_Description',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Default_Entity_Key', 'emailAddress', {
type: 'select',
public: false,
invalidValue: 'emailAddress',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Default_Entity_Key_Description',
values: [
{ key: 'emailAddress', i18nLabel: 'ABAC_Virtru_Entity_Key_Email' },
{ key: 'oidcIdentifier', i18nLabel: 'ABAC_Virtru_Entity_Key_OIDC' },
],
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Attribute_Namespace', 'example.com', {
type: 'string',
public: false,
invalidValue: 'example.com',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Attribute_Namespace_Description',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Sync_Interval', '*/5 * * * *', {
type: 'string',
public: false,
invalidValue: '*/5 * * * *',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Sync_Interval_Description',
enableQuery: virtruPdpQuery,
});
await this.add(
'ABAC_Virtru_Test_Connection',
{ method: 'GET', path: '/v1/abac/pdp/health' },
{
type: 'action',
actionText: 'ABAC_Virtru_Test_Connection_Action',
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
},
);
},
);
});
}

View File

@@ -0,0 +1,63 @@
import { settingsRegistry } from '../../../server/settings';
export const addSettings = async (): Promise<void> => {
const omnichannelEnabledQuery = { _id: 'Livechat_enabled', value: true };
return settingsRegistry.addGroup('Omnichannel', async function () {
await this.add('Merged_Contacts_Count', 0, {
type: 'int',
hidden: true,
});
await this.add('Resolved_Conflicts_Count', 0, {
type: 'int',
hidden: true,
});
await this.add('Contacts_Importer_Count', 0, {
type: 'int',
hidden: true,
});
await this.add('Advanced_Contact_Upsell_Views_Count', 0, {
type: 'int',
hidden: true,
});
await this.add('Advanced_Contact_Upsell_Clicks_Count', 0, {
type: 'int',
hidden: true,
});
return this.with(
{
enterprise: true,
modules: ['livechat-enterprise', 'contact-id-verification'],
section: 'Contact_identification',
enableQuery: omnichannelEnabledQuery,
public: true,
},
async function () {
await this.add('Livechat_Block_Unknown_Contacts', false, {
type: 'boolean',
invalidValue: false,
});
await this.add('Livechat_Block_Unverified_Contacts', false, {
type: 'boolean',
invalidValue: false,
});
await this.add('Livechat_Require_Contact_Verification', 'never', {
type: 'select',
values: [
{ key: 'never', i18nLabel: 'Never' },
{ key: 'once', i18nLabel: 'Once' },
{ key: 'always', i18nLabel: 'On_All_Contacts' },
],
invalidValue: 'never',
});
},
);
});
};

View File

@@ -0,0 +1,26 @@
import { settingsRegistry } from '../../../server/settings';
export async function addSettings(): Promise<void> {
await settingsRegistry.addGroup('Device_Management', async function () {
await this.with(
{
enterprise: true,
modules: ['device-management'],
},
async function () {
await this.add('Device_Management_Enable_Login_Emails', true, {
type: 'boolean',
public: true,
invalidValue: true,
});
await this.add('Device_Management_Allow_Login_Email_preference', true, {
type: 'boolean',
public: true,
invalidValue: true,
enableQuery: { _id: 'Device_Management_Enable_Login_Emails', value: true },
});
},
);
});
}

View File

@@ -0,0 +1,2 @@
import './settings';
import './settings.internalService';

View File

@@ -0,0 +1,316 @@
import { settingsRegistry } from '../../../server/settings';
export const ldapIntervalValuesToCronMap: Record<string, string> = {
every_1_hour: '0 * * * *',
every_6_hours: '0 */6 * * *',
every_12_hours: '0 */12 * * *',
every_24_hours: '0 0 * * *',
every_48_hours: '0 0 */2 * *',
};
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('LDAP', async function () {
const enableQuery = { _id: 'LDAP_Enable', value: true };
await this.with(
{
tab: 'LDAP_Enterprise',
enterprise: true,
modules: ['ldap-enterprise'],
},
async function () {
await this.section('LDAP_DataSync_BackgroundSync', async function () {
await this.add('LDAP_Background_Sync', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
const backgroundSyncQuery = [enableQuery, { _id: 'LDAP_Background_Sync', value: true }];
const backgroundUpdateQuery = [...backgroundSyncQuery, { _id: 'LDAP_Background_Sync_Keep_Existant_Users_Updated', value: true }];
await this.add('LDAP_Background_Sync_Interval', 'every_24_hours', {
type: 'select',
values: [
{
key: 'every_1_hour',
i18nLabel: 'every_hour',
},
{
key: 'every_6_hours',
i18nLabel: 'every_six_hours',
},
{
key: 'every_12_hours',
i18nLabel: 'every_12_hours',
},
{
key: 'every_24_hours',
i18nLabel: 'every_24_hours',
},
{
key: 'every_48_hours',
i18nLabel: 'every_48_hours',
},
],
enableQuery: backgroundSyncQuery,
invalidValue: 'every_24_hours',
});
await this.add('LDAP_Background_Sync_Import_New_Users', true, {
type: 'boolean',
enableQuery: backgroundSyncQuery,
invalidValue: true,
});
await this.add('LDAP_Background_Sync_Keep_Existant_Users_Updated', true, {
type: 'boolean',
enableQuery: backgroundSyncQuery,
invalidValue: true,
});
await this.add('LDAP_Background_Sync_Merge_Existent_Users', false, {
type: 'boolean',
enableQuery: [...backgroundUpdateQuery, { _id: 'LDAP_Merge_Existing_Users', value: true }],
invalidValue: false,
});
await this.add('LDAP_Background_Sync_Disable_Missing_Users', false, {
type: 'boolean',
enableQuery: backgroundUpdateQuery,
invalidValue: false,
});
await this.add('LDAP_Background_Sync_Avatars', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
await this.add('LDAP_Background_Sync_Avatars_Interval', '0 0 * * *', {
type: 'string',
enableQuery: [enableQuery, { _id: 'LDAP_Background_Sync_Avatars', value: true }],
invalidValue: '0 0 * * *',
});
});
await this.section('LDAP_DataSync_Advanced', async function () {
await this.add('LDAP_Sync_User_Active_State', 'disable', {
type: 'select',
values: [
{ key: 'none', i18nLabel: 'LDAP_Sync_User_Active_State_Nothing' },
{ key: 'disable', i18nLabel: 'LDAP_Sync_User_Active_State_Disable' },
{ key: 'enable', i18nLabel: 'LDAP_Sync_User_Active_State_Enable' },
{ key: 'both', i18nLabel: 'LDAP_Sync_User_Active_State_Both' },
],
i18nDescription: 'LDAP_Sync_User_Active_State_Description',
enableQuery: { _id: 'LDAP_Enable', value: true },
invalidValue: 'none',
});
await this.add('LDAP_User_Search_AttributesToQuery', '*,+', {
type: 'string',
enableQuery: { _id: 'LDAP_Enable', value: true },
invalidValue: '*,+',
});
});
await this.section('LDAP_DataSync_AutoLogout', async function () {
await this.add('LDAP_Sync_AutoLogout_Enabled', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
await this.add('LDAP_Sync_AutoLogout_Interval', '*/5 * * * *', {
type: 'string',
enableQuery: [enableQuery, { _id: 'LDAP_Sync_AutoLogout_Enabled', value: true }],
invalidValue: '',
});
});
await this.section('LDAP_DataSync_CustomFields', async function () {
await this.add('LDAP_Sync_Custom_Fields', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
await this.add('LDAP_CustomFieldMap', '{}', {
type: 'code',
code: 'application/json',
multiline: true,
enableQuery: [enableQuery, { _id: 'LDAP_Sync_Custom_Fields', value: true }],
invalidValue: '{}',
});
});
await this.section('LDAP_DataSync_Roles', async function () {
await this.add('LDAP_Sync_User_Data_Roles', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
const syncRolesQuery = [enableQuery, { _id: 'LDAP_Sync_User_Data_Roles', value: true }];
await this.add('LDAP_Sync_User_Data_Roles_AutoRemove', false, {
type: 'boolean',
enableQuery: syncRolesQuery,
invalidValue: false,
});
await this.add('LDAP_Sync_User_Data_Roles_BaseDN', '', {
type: 'string',
enableQuery: syncRolesQuery,
invalidValue: '',
});
await this.add('LDAP_Sync_User_Data_Roles_GroupMembershipValidationStrategy', 'each_group', {
type: 'select',
values: [
{ key: 'each_group', i18nLabel: 'LDAP_Sync_User_Data_GroupMembershipValidationStrategy_EachGroup' },
{ key: 'once', i18nLabel: 'LDAP_Sync_User_Data_GroupMembershipValidationStrategy_Once' },
],
enableQuery: syncRolesQuery,
invalidValue: 'each_group',
});
await this.add('LDAP_Sync_User_Data_Roles_Filter', '(&(cn=#{groupName})(memberUid=#{username}))', {
type: 'string',
enableQuery: syncRolesQuery,
invalidValue: '',
});
await this.add('LDAP_Sync_User_Data_RolesMap', '{\n\t"rocket-admin": "admin",\n\t"tech-support": "support"\n}', {
type: 'code',
multiline: true,
public: false,
code: 'application/json',
enableQuery: syncRolesQuery,
invalidValue: '',
});
});
await this.section('LDAP_DataSync_Channels', async function () {
await this.add('LDAP_Sync_User_Data_Channels', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
});
const syncChannelsQuery = [enableQuery, { _id: 'LDAP_Sync_User_Data_Channels', value: true }];
await this.add('LDAP_Sync_User_Data_Channels_Admin', 'rocket.cat', {
type: 'string',
enableQuery: syncChannelsQuery,
invalidValue: 'rocket.cat',
});
await this.add('LDAP_Sync_User_Data_Channels_BaseDN', '', {
type: 'string',
enableQuery: syncChannelsQuery,
invalidValue: '',
});
await this.add('LDAP_Sync_User_Data_Channels_GroupMembershipValidationStrategy', 'each_group', {
type: 'select',
values: [
{ key: 'each_group', i18nLabel: 'LDAP_Sync_User_Data_GroupMembershipValidationStrategy_EachGroup' },
{ key: 'once', i18nLabel: 'LDAP_Sync_User_Data_GroupMembershipValidationStrategy_Once' },
],
enableQuery: syncChannelsQuery,
invalidValue: 'each_group',
});
await this.add('LDAP_Sync_User_Data_Channels_Filter', '(&(cn=#{groupName})(memberUid=#{username}))', {
type: 'string',
enableQuery: syncChannelsQuery,
invalidValue: '',
});
await this.add(
'LDAP_Sync_User_Data_ChannelsMap',
'{\n\t"employee": "general",\n\t"techsupport": [\n\t\t"helpdesk",\n\t\t"support"\n\t]\n}',
{
type: 'code',
multiline: true,
public: false,
code: 'application/json',
enableQuery: syncChannelsQuery,
invalidValue: '',
},
);
await this.add('LDAP_Sync_User_Data_Channels_Enforce_AutoChannels', false, {
type: 'boolean',
enableQuery: syncChannelsQuery,
invalidValue: false,
});
});
await this.section('LDAP_DataSync_Teams', async function () {
await this.add('LDAP_Enable_LDAP_Groups_To_RC_Teams', false, {
type: 'boolean',
enableQuery: { _id: 'LDAP_Enable', value: true },
invalidValue: false,
});
const enableQueryTeams = { _id: 'LDAP_Enable_LDAP_Groups_To_RC_Teams', value: true };
await this.add('LDAP_Groups_To_Rocket_Chat_Teams', '{}', {
type: 'code',
code: 'application/json',
multiline: true,
enableQuery: enableQueryTeams,
invalidValue: '{}',
});
await this.add('LDAP_Validate_Teams_For_Each_Login', false, {
type: 'boolean',
enableQuery: enableQueryTeams,
invalidValue: false,
});
await this.add('LDAP_Teams_BaseDN', '', {
type: 'string',
enableQuery: enableQueryTeams,
invalidValue: '',
});
await this.add('LDAP_Teams_Name_Field', 'ou,cn', {
type: 'string',
enableQuery: enableQueryTeams,
invalidValue: '',
});
await this.add('LDAP_Query_To_Get_User_Teams', '(&(ou=*)(uniqueMember=#{userdn}))', {
type: 'string',
enableQuery: enableQueryTeams,
invalidValue: '',
});
});
await this.section('LDAP_DataSync_ABAC', async function () {
await this.add('LDAP_Background_Sync_ABAC_Attributes', false, {
type: 'boolean',
enableQuery,
invalidValue: false,
modules: ['abac', 'ldap-enterprise'],
});
await this.add('LDAP_Background_Sync_ABAC_Attributes_Interval', '0 0 * * *', {
type: 'string',
enableQuery: [enableQuery, { _id: 'LDAP_Background_Sync_ABAC_Attributes', value: true }],
invalidValue: '0 0 * * *',
modules: ['abac', 'ldap-enterprise'],
});
await this.add('LDAP_ABAC_AttributeMap', '{}', {
type: 'code',
code: 'application/json',
multiline: true,
enableQuery: [enableQuery, { _id: 'LDAP_Background_Sync_ABAC_Attributes', value: true }],
invalidValue: '{}',
modules: ['abac', 'ldap-enterprise'],
});
});
},
);
});
}

View File

@@ -0,0 +1,66 @@
import { settingsRegistry } from '../../../server/settings';
export function addSettings(): void {
void settingsRegistry.addGroup('Outlook_Calendar', async function () {
await this.with(
{
enterprise: true,
modules: ['outlook-calendar'],
},
async function () {
await this.add('Outlook_Calendar_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
});
await this.add('Outlook_Calendar_Exchange_Url', '', {
type: 'string',
public: true,
invalidValue: '',
placeholder: 'https://exchange.example.com/',
});
await this.add('Outlook_Calendar_Outlook_Url', '', {
type: 'string',
public: true,
invalidValue: '',
placeholder: 'https://exchange.example.com/owa/#path=/calendar/view/Month',
});
await this.add(
'Calendar_MeetingUrl_Regex',
'(?:[?&]callUrl=([^\n&<]+))|(?:(?:%3F)|(?:%26))callUrl(?:%3D)((?:(?:[^\n&<](?!%26)))+[^\n&<]?)',
{
type: 'string',
public: true,
invalidValue: '',
},
);
await this.add('Calendar_BusyStatus_Enabled', true, {
type: 'boolean',
public: true,
invalidValue: false,
});
/**
* const defaultMapping = {
* 'rocket.chat': {
* Enabled: true,
* Exchange_Url: 'https://owa.dev.rocket.chat/',
* Outlook_Url: 'https://owa.dev.rocket.chat/owa/#path=/calendar'
* },
* };
*/
await this.add('Outlook_Calendar_Url_Mapping', '{}', {
type: 'code',
multiline: true,
public: true,
code: 'application/json',
invalidValue: '{}',
});
},
);
});
}

View File

@@ -0,0 +1,130 @@
import {
defaultAuthnContextTemplate,
defaultAuthRequestTemplate,
defaultLogoutResponseTemplate,
defaultLogoutRequestTemplate,
defaultNameIDTemplate,
defaultIdentifierFormat,
defaultAuthnContext,
defaultMetadataTemplate,
defaultMetadataCertificateTemplate,
} from '../../../server/lib/saml/lib/constants';
import { settingsRegistry } from '../../../server/settings';
export const addSettings = async function (name: string): Promise<void> {
await settingsRegistry.addGroup('SAML', async function () {
await this.with(
{
tab: 'SAML_Enterprise',
enterprise: true,
modules: ['saml-enterprise'],
},
async function () {
await this.section('SAML_Section_4_Roles', async function () {
// Roles Settings
await this.add(`SAML_Custom_${name}_role_attribute_sync`, false, {
type: 'boolean',
i18nLabel: 'SAML_Role_Attribute_Sync',
i18nDescription: 'SAML_Role_Attribute_Sync_Description',
invalidValue: false,
});
await this.add(`SAML_Custom_${name}_role_attribute_name`, '', {
type: 'string',
i18nLabel: 'SAML_Role_Attribute_Name',
i18nDescription: 'SAML_Role_Attribute_Name_Description',
invalidValue: '',
});
});
await this.section('SAML_Section_6_Advanced', async function () {
await this.add(`SAML_Custom_${name}_identifier_format`, defaultIdentifierFormat, {
type: 'string',
invalidValue: defaultIdentifierFormat,
i18nLabel: 'SAML_Identifier_Format',
i18nDescription: 'SAML_Identifier_Format_Description',
});
await this.add(`SAML_Custom_${name}_NameId_template`, defaultNameIDTemplate, {
type: 'string',
invalidValue: defaultNameIDTemplate,
i18nLabel: 'SAML_NameIdPolicy_Template',
i18nDescription: 'SAML_NameIdPolicy_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_custom_authn_context`, defaultAuthnContext, {
type: 'string',
invalidValue: defaultAuthnContext,
i18nLabel: 'SAML_Custom_Authn_Context',
i18nDescription: 'SAML_Custom_Authn_Context_description',
});
await this.add(`SAML_Custom_${name}_authn_context_comparison`, 'exact', {
type: 'select',
values: [
{ key: 'better', i18nLabel: 'Better' },
{ key: 'exact', i18nLabel: 'Exact' },
{ key: 'maximum', i18nLabel: 'Maximum' },
{ key: 'minimum', i18nLabel: 'Minimum' },
],
invalidValue: 'exact',
i18nLabel: 'SAML_Custom_Authn_Context_Comparison',
});
await this.add(`SAML_Custom_${name}_AuthnContext_template`, defaultAuthnContextTemplate, {
type: 'string',
invalidValue: defaultAuthnContextTemplate,
i18nLabel: 'SAML_AuthnContext_Template',
i18nDescription: 'SAML_AuthnContext_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_AuthRequest_template`, defaultAuthRequestTemplate, {
type: 'string',
invalidValue: defaultAuthRequestTemplate,
i18nLabel: 'SAML_AuthnRequest_Template',
i18nDescription: 'SAML_AuthnRequest_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_LogoutResponse_template`, defaultLogoutResponseTemplate, {
type: 'string',
invalidValue: defaultLogoutResponseTemplate,
i18nLabel: 'SAML_LogoutResponse_Template',
i18nDescription: 'SAML_LogoutResponse_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_LogoutRequest_template`, defaultLogoutRequestTemplate, {
type: 'string',
invalidValue: defaultLogoutRequestTemplate,
i18nLabel: 'SAML_LogoutRequest_Template',
i18nDescription: 'SAML_LogoutRequest_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_MetadataCertificate_template`, defaultMetadataCertificateTemplate, {
type: 'string',
invalidValue: defaultMetadataCertificateTemplate,
i18nLabel: 'SAML_MetadataCertificate_Template',
i18nDescription: 'SAML_Metadata_Certificate_Template_Description',
multiline: true,
});
await this.add(`SAML_Custom_${name}_Metadata_template`, defaultMetadataTemplate, {
type: 'string',
invalidValue: defaultMetadataTemplate,
i18nLabel: 'SAML_Metadata_Template',
i18nDescription: 'SAML_Metadata_Template_Description',
multiline: true,
});
});
await this.section('SAML_Section_5_Mapping', async function () {
// Data Mapping Settings
await this.add(
`SAML_Custom_${name}_user_data_custom_fieldmap`,
'{"custom1":"custom1", "custom2":"custom2", "custom3":"custom3"}',
{
type: 'string',
invalidValue: '',
i18nLabel: 'SAML_Custom_user_data_custom_fieldmap',
i18nDescription: 'SAML_Custom_user_data_custom_fieldmap_description',
multiline: true,
},
);
});
},
);
});
};

View File

@@ -0,0 +1,15 @@
import { ServiceClassInternal } from '@rocket.chat/core-services';
import type { IEnterpriseSettings } from '@rocket.chat/core-services';
import type { ISetting } from '@rocket.chat/core-typings';
import { changeSettingValue } from './settings';
export class EnterpriseSettings extends ServiceClassInternal implements IEnterpriseSettings {
protected name = 'ee-settings';
protected override internal = true;
changeSettingValue(record: ISetting): undefined | ISetting['value'] {
return changeSettingValue(record);
}
}

View File

@@ -0,0 +1,65 @@
/* eslint-disable react-hooks/rules-of-hooks */
import type { ISetting, SettingValue, LicenseModule } from '@rocket.chat/core-typings';
import { License } from '@rocket.chat/license';
import { Settings } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';
import { settings, SettingsEvents } from '../../../server/settings';
import { use } from '../../../server/settings/Middleware';
export function changeSettingValue(record: Pick<ISetting, 'value' | 'enterprise' | 'invalidValue' | 'modules'>): SettingValue {
if (!record.enterprise) {
return record.value;
}
if (!License.hasValidLicense()) {
return record.invalidValue;
}
if (!record.modules?.length) {
return record.value;
}
for (const moduleName of record.modules) {
if (!License.hasModule(moduleName as LicenseModule)) {
return record.invalidValue;
}
}
return record.value;
}
settings.set = use(settings.set, (context, next) => {
const [record] = context;
if (!record.enterprise) {
return next(...context);
}
const value = changeSettingValue(record);
return next({ ...record, value });
});
SettingsEvents.on('fetch-settings', (settings): void => {
for (const setting of settings) {
const changedValue = changeSettingValue(setting);
if (changedValue === undefined) {
continue;
}
setting.value = changedValue;
}
});
async function updateSettings(): Promise<void> {
const enterpriseSettings = await Settings.findEnterpriseSettings();
void enterpriseSettings.forEach((record: ISetting) => settings.set(record));
}
Meteor.startup(async () => {
await updateSettings();
License.onValidateLicense(updateSettings);
License.onInvalidateLicense(updateSettings);
License.onRemoveLicense(updateSettings);
});

View File

@@ -0,0 +1,57 @@
import { settingsRegistry } from '../../../server/settings';
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('Video_Conference', async function () {
await this.with(
{
enterprise: true,
modules: ['videoconference-enterprise'],
},
async function () {
await this.add('VideoConf_Enable_DMs', true, {
type: 'boolean',
public: true,
invalidValue: true,
});
await this.add('VideoConf_Enable_Channels', true, {
type: 'boolean',
public: true,
invalidValue: true,
});
await this.add('VideoConf_Enable_Groups', true, {
type: 'boolean',
public: true,
invalidValue: true,
});
await this.add('VideoConf_Enable_Teams', true, {
type: 'boolean',
public: true,
invalidValue: true,
});
const discussionsEnabled = { _id: 'Discussion_enabled', value: true };
await this.add('VideoConf_Enable_Persistent_Chat', false, {
type: 'boolean',
public: true,
invalidValue: false,
alert: 'VideoConf_Enable_Persistent_Chat_Alert',
enableQuery: [discussionsEnabled],
});
const persistentChatEnabled = { _id: 'VideoConf_Enable_Persistent_Chat', value: true };
await this.add('VideoConf_Persistent_Chat_Discussion_Name', 'Video Call Chat', {
type: 'string',
public: true,
invalidValue: 'Conference Call Chat History',
i18nDescription: 'VideoConf_Persistent_Chat_Discussion_Name_Description',
enableQuery: [discussionsEnabled, persistentChatEnabled],
});
},
);
});
}

View File

@@ -0,0 +1,87 @@
import { settingsRegistry } from '../../../server/settings';
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('VoIP_TeamCollab', async function () {
await this.with(
{
enterprise: true,
modules: ['teams-voip'],
},
async function () {
await this.section('VoIP_TeamCollab_WebRTC', async function () {
await this.add('VoIP_TeamCollab_Screen_Sharing_Enabled', true, {
type: 'boolean',
public: true,
invalidValue: false,
i18nDescription: 'VoIP_TeamCollab_Screen_Sharing_Enabled_Description',
});
await this.add('VoIP_TeamCollab_Mobile_Ringing_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
alert: 'VoIP_TeamCollab_Mobile_Ringing_Enabled_Alert',
i18nDescription: 'VoIP_TeamCollab_Mobile_Ringing_Enabled_Description',
});
await this.add('VoIP_TeamCollab_Ice_Servers', 'stun:stun.l.google.com:19302', {
type: 'string',
public: true,
invalidValue: '',
});
await this.add('VoIP_TeamCollab_Ice_Gathering_Timeout', 5000, {
type: 'int',
public: true,
invalidValue: 5000,
});
});
await this.section('VoIP_TeamCollab_SIP_Integration', async function () {
await this.add('VoIP_TeamCollab_SIP_Integration_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
});
await this.add('VoIP_TeamCollab_SIP_Integration_For_Internal_Calls', false, {
type: 'boolean',
public: true,
invalidValue: false,
alert: 'VoIP_TeamCollab_Internal_SIP_Beta_Alert',
});
await this.add('VoIP_TeamCollab_Drachtio_Host', '', {
type: 'string',
public: false,
invalidValue: '',
});
await this.add('VoIP_TeamCollab_Drachtio_Port', 9022, {
type: 'int',
public: false,
invalidValue: 9022,
});
await this.add('VoIP_TeamCollab_Drachtio_Password', '', {
type: 'password',
secret: true,
invalidValue: '',
});
await this.add('VoIP_TeamCollab_SIP_Server_Host', '', {
type: 'string',
public: false,
invalidValue: '',
});
await this.add('VoIP_TeamCollab_SIP_Server_Port', 5060, {
type: 'int',
public: false,
invalidValue: 5060,
});
});
},
);
});
}