parent
c5fbcfc902
commit
ba15ba725a
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../../settings'; |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settings.addGroup('Accounts', function() { |
||||
settingsRegistry.addGroup('Accounts', function() { |
||||
this.section('Two Factor Authentication', function() { |
||||
const enable2FA = { |
||||
_id: 'Accounts_TwoFactorAuthentication_Enabled', |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settings.addGroup('Analytics', function addSettings() { |
||||
settingsRegistry.addGroup('Analytics', function addSettings() { |
||||
this.section('Piwik', function() { |
||||
const enableQuery = { _id: 'PiwikAnalytics_enabled', value: true }; |
||||
this.add('PiwikAnalytics_enabled', false, { |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settings.addGroup('General', function() { |
||||
settingsRegistry.addGroup('General', function() { |
||||
this.section('REST API', function() { |
||||
this.add('API_Upper_Count_Limit', 100, { type: 'int', public: false }); |
||||
this.add('API_Default_Count', 50, { type: 'int', public: false }); |
@ -1,2 +1,2 @@ |
||||
import './startup.js'; |
||||
import './startup'; |
||||
import './loginHandler.js'; |
||||
|
@ -1,20 +0,0 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
|
||||
Meteor.startup(function() { |
||||
const enableQuery = { |
||||
_id: 'AutoLinker', |
||||
value: true, |
||||
}; |
||||
|
||||
settings.add('AutoLinker', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nLabel: 'Enabled' }); |
||||
|
||||
settings.add('AutoLinker_StripPrefix', false, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_StripPrefix_Description', enableQuery }); |
||||
settings.add('AutoLinker_Urls_Scheme', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settings.add('AutoLinker_Urls_www', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settings.add('AutoLinker_Urls_TLD', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settings.add('AutoLinker_UrlsRegExp', '(://|www\\.).+', { type: 'string', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settings.add('AutoLinker_Email', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settings.add('AutoLinker_Phone', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_Phone_Description', enableQuery }); |
||||
}); |
@ -0,0 +1,20 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
const enableQuery = { |
||||
_id: 'AutoLinker', |
||||
value: true, |
||||
}; |
||||
|
||||
settingsRegistry.add('AutoLinker', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nLabel: 'Enabled' }); |
||||
|
||||
settingsRegistry.add('AutoLinker_StripPrefix', false, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_StripPrefix_Description', enableQuery }); |
||||
settingsRegistry.add('AutoLinker_Urls_Scheme', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settingsRegistry.add('AutoLinker_Urls_www', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settingsRegistry.add('AutoLinker_Urls_TLD', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settingsRegistry.add('AutoLinker_UrlsRegExp', '(://|www\\.).+', { type: 'string', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settingsRegistry.add('AutoLinker_Email', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, enableQuery }); |
||||
settingsRegistry.add('AutoLinker_Phone', true, { type: 'boolean', group: 'Message', section: 'AutoLinker', public: true, i18nDescription: 'AutoLinker_Phone_Description', enableQuery }); |
||||
}); |
@ -1,9 +1,9 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.addGroup('Bots', function() { |
||||
settingsRegistry.addGroup('Bots', function() { |
||||
this.add('BotHelpers_userFields', '_id, name, username, emails, language, utcOffset', { |
||||
type: 'string', |
||||
section: 'Helpers', |
@ -1,9 +0,0 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { Permissions } from '../../models'; |
||||
|
||||
Meteor.startup(function() { |
||||
Permissions.create('post-readonly', ['admin', 'owner', 'moderator']); |
||||
Permissions.create('set-readonly', ['admin', 'owner']); |
||||
Permissions.create('set-react-when-readonly', ['admin', 'owner']); |
||||
}); |
@ -1,9 +0,0 @@ |
||||
import { settings } from '../../settings'; |
||||
|
||||
settings.add('HexColorPreview_Enabled', true, { |
||||
type: 'boolean', |
||||
i18nLabel: 'Enabled', |
||||
group: 'Message', |
||||
section: 'Hex_Color_Preview', |
||||
public: true, |
||||
}); |
@ -0,0 +1,9 @@ |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settingsRegistry.add('HexColorPreview_Enabled', true, { |
||||
type: 'boolean', |
||||
i18nLabel: 'Enabled', |
||||
group: 'Message', |
||||
section: 'Hex_Color_Preview', |
||||
public: true, |
||||
}); |
@ -1 +1,11 @@ |
||||
import '../lib/common'; |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { Tracker } from 'meteor/tracker'; |
||||
|
||||
|
||||
import { settings } from '../../settings/client'; |
||||
|
||||
Meteor.startup(function() { |
||||
Tracker.autorun(function() { |
||||
Meteor.absoluteUrl.defaultOptions.secure = Boolean(settings.get('Force_SSL')); |
||||
}); |
||||
}); |
||||
|
@ -1,9 +0,0 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.onload('Force_SSL', function(key, value) { |
||||
Meteor.absoluteUrl.defaultOptions.secure = value; |
||||
}); |
||||
}); |
@ -1,2 +1,10 @@ |
||||
import './cors'; |
||||
import '../lib/common'; |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.watch('Force_SSL', (value) => { |
||||
Meteor.absoluteUrl.defaultOptions.secure = Boolean(value); |
||||
}); |
||||
}); |
||||
|
@ -1,9 +1,9 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.addGroup('AtlassianCrowd', function() { |
||||
settingsRegistry.addGroup('AtlassianCrowd', function() { |
||||
const enableQuery = { _id: 'CROWD_Enable', value: true }; |
||||
const enableSyncQuery = [enableQuery, { _id: 'CROWD_Sync_User_Data', value: true }]; |
||||
|
@ -1,9 +0,0 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { Permissions } from '../../../models'; |
||||
|
||||
Meteor.startup(() => { |
||||
if (Permissions) { |
||||
Permissions.create('manage-sounds', ['admin']); |
||||
} |
||||
}); |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../../settings'; |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settings.addGroup('CustomSoundsFilesystem', function() { |
||||
settingsRegistry.addGroup('CustomSoundsFilesystem', function() { |
||||
this.add('CustomSounds_Storage_Type', 'GridFS', { |
||||
type: 'select', |
||||
values: [{ |
@ -1,41 +0,0 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
|
||||
Meteor.startup(() => { |
||||
settings.addGroup('Discussion', function() { |
||||
// the channel for which discussions are created if none is explicitly chosen
|
||||
|
||||
this.add('Discussion_enabled', true, { |
||||
group: 'Discussion', |
||||
i18nLabel: 'Enable', |
||||
type: 'boolean', |
||||
public: true, |
||||
}); |
||||
}); |
||||
|
||||
const globalQuery = { |
||||
_id: 'RetentionPolicy_Enabled', |
||||
value: true, |
||||
}; |
||||
|
||||
settings.add('RetentionPolicy_DoNotPruneDiscussion', true, { |
||||
group: 'RetentionPolicy', |
||||
section: 'Global Policy', |
||||
type: 'boolean', |
||||
public: true, |
||||
i18nLabel: 'RetentionPolicy_DoNotPruneDiscussion', |
||||
i18nDescription: 'RetentionPolicy_DoNotPruneDiscussion_Description', |
||||
enableQuery: globalQuery, |
||||
}); |
||||
|
||||
settings.add('RetentionPolicy_DoNotPruneThreads', true, { |
||||
group: 'RetentionPolicy', |
||||
section: 'Global Policy', |
||||
type: 'boolean', |
||||
public: true, |
||||
i18nLabel: 'RetentionPolicy_DoNotPruneThreads', |
||||
i18nDescription: 'RetentionPolicy_DoNotPruneThreads_Description', |
||||
enableQuery: globalQuery, |
||||
}); |
||||
}); |
@ -0,0 +1,37 @@ |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settingsRegistry.addGroup('Discussion', function() { |
||||
// the channel for which discussions are created if none is explicitly chosen
|
||||
|
||||
this.add('Discussion_enabled', true, { |
||||
group: 'Discussion', |
||||
i18nLabel: 'Enable', |
||||
type: 'boolean', |
||||
public: true, |
||||
}); |
||||
}); |
||||
|
||||
const globalQuery = { |
||||
_id: 'RetentionPolicy_Enabled', |
||||
value: true, |
||||
}; |
||||
|
||||
settingsRegistry.add('RetentionPolicy_DoNotPruneDiscussion', true, { |
||||
group: 'RetentionPolicy', |
||||
section: 'Global Policy', |
||||
type: 'boolean', |
||||
public: true, |
||||
i18nLabel: 'RetentionPolicy_DoNotPruneDiscussion', |
||||
i18nDescription: 'RetentionPolicy_DoNotPruneDiscussion_Description', |
||||
enableQuery: globalQuery, |
||||
}); |
||||
|
||||
settingsRegistry.add('RetentionPolicy_DoNotPruneThreads', true, { |
||||
group: 'RetentionPolicy', |
||||
section: 'Global Policy', |
||||
type: 'boolean', |
||||
public: true, |
||||
i18nLabel: 'RetentionPolicy_DoNotPruneThreads', |
||||
i18nDescription: 'RetentionPolicy_DoNotPruneThreads_Description', |
||||
enableQuery: globalQuery, |
||||
}); |
@ -1,10 +0,0 @@ |
||||
import { settings } from '../../settings'; |
||||
|
||||
settings.add('Accounts_OAuth_Dolphin_URL', '', { type: 'string', group: 'OAuth', public: true, section: 'Dolphin', i18nLabel: 'URL' }); |
||||
settings.add('Accounts_OAuth_Dolphin', false, { type: 'boolean', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Enable' }); |
||||
settings.add('Accounts_OAuth_Dolphin_id', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_id' }); |
||||
settings.add('Accounts_OAuth_Dolphin_secret', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Secret', secret: true }); |
||||
settings.add('Accounts_OAuth_Dolphin_login_style', 'redirect', { type: 'select', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Login_Style', persistent: true, values: [{ key: 'redirect', i18nLabel: 'Redirect' }, { key: 'popup', i18nLabel: 'Popup' }, { key: '', i18nLabel: 'Default' }] }); |
||||
settings.add('Accounts_OAuth_Dolphin_button_label_text', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text', persistent: true }); |
||||
settings.add('Accounts_OAuth_Dolphin_button_label_color', '#FFFFFF', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color', persistent: true }); |
||||
settings.add('Accounts_OAuth_Dolphin_button_color', '#1d74f5', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Color', persistent: true }); |
@ -0,0 +1,10 @@ |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_URL', '', { type: 'string', group: 'OAuth', public: true, section: 'Dolphin', i18nLabel: 'URL' }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin', false, { type: 'boolean', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Enable' }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_id', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_id' }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_secret', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Secret', secret: true }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_login_style', 'redirect', { type: 'select', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Login_Style', persistent: true, values: [{ key: 'redirect', i18nLabel: 'Redirect' }, { key: 'popup', i18nLabel: 'Popup' }, { key: '', i18nLabel: 'Default' }] }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_button_label_text', '', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text', persistent: true }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_button_label_color', '#FFFFFF', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color', persistent: true }); |
||||
settingsRegistry.add('Accounts_OAuth_Dolphin_button_color', '#1d74f5', { type: 'string', group: 'OAuth', section: 'Dolphin', i18nLabel: 'Accounts_OAuth_Custom_Button_Color', persistent: true }); |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
settings.addGroup('E2E Encryption', function() { |
||||
settingsRegistry.addGroup('E2E Encryption', function() { |
||||
this.add('E2E_Enable', false, { |
||||
type: 'boolean', |
||||
i18nLabel: 'Enabled', |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../../settings'; |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settings.addGroup('EmojiCustomFilesystem', function() { |
||||
settingsRegistry.addGroup('EmojiCustomFilesystem', function() { |
||||
this.add('EmojiUpload_Storage_Type', 'GridFS', { |
||||
type: 'select', |
||||
values: [{ |
@ -1,5 +0,0 @@ |
||||
import { settings } from '../../../settings'; |
||||
|
||||
settings.addGroup('Logs', function() { |
||||
this.add('Log_Exceptions_to_Channel', '', { type: 'string' }); |
||||
}); |
@ -0,0 +1,5 @@ |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settingsRegistry.addGroup('Logs', function() { |
||||
this.add('Log_Exceptions_to_Channel', '', { type: 'string' }); |
||||
}); |
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../../settings'; |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settings.addGroup('FileUpload', function() { |
||||
settingsRegistry.addGroup('FileUpload', function() { |
||||
this.add('FileUpload_Enabled', true, { |
||||
type: 'boolean', |
||||
public: true, |
@ -1,9 +1,9 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.addGroup('Accounts', function() { |
||||
settingsRegistry.addGroup('Accounts', function() { |
||||
this.section('Iframe', function() { |
||||
this.add('Accounts_iframe_enabled', false, { type: 'boolean', public: true }); |
||||
this.add('Accounts_iframe_url', '', { type: 'string', public: true }); |
@ -1,9 +1,9 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
|
||||
import { settings } from '../../settings'; |
||||
import { settingsRegistry } from '../../settings/server'; |
||||
|
||||
Meteor.startup(function() { |
||||
settings.addGroup('IRC_Federation', function() { |
||||
settingsRegistry.addGroup('IRC_Federation', function() { |
||||
this.add('IRC_Enabled', false, { |
||||
type: 'boolean', |
||||
i18nLabel: 'Enabled', |
@ -0,0 +1,18 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { Tracker } from 'meteor/tracker'; |
||||
|
||||
import { settings } from '../../../settings/client'; |
||||
|
||||
Meteor.startup(() => { |
||||
Tracker.autorun(() => { |
||||
const value = settings.get('Site_Url'); |
||||
if (value == null || value.trim() === '') { |
||||
return; |
||||
} |
||||
(window as any).__meteor_runtime_config__.ROOT_URL = value; |
||||
|
||||
if (Meteor.absoluteUrl.defaultOptions && Meteor.absoluteUrl.defaultOptions.rootUrl) { |
||||
Meteor.absoluteUrl.defaultOptions.rootUrl = value; |
||||
} |
||||
}); |
||||
}); |
@ -1,63 +0,0 @@ |
||||
/* eslint no-multi-spaces: 0 */ |
||||
/* eslint comma-spacing: 0 */ |
||||
import { capitalize } from '@rocket.chat/string-helpers'; |
||||
|
||||
import { settings } from '../../../settings'; |
||||
|
||||
export function addOAuthService(name, values = {}) { |
||||
name = name.toLowerCase().replace(/[^a-z0-9_]/g, ''); |
||||
name = capitalize(name); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }` , values.enabled || false , { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Enable', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-url` , values.serverURL || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'URL', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-token_path` , values.tokenPath || '/oauth/token' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Token_Path', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-token_sent_via` , values.tokenSentVia || 'payload' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Token_Sent_Via', persistent: true, values: [{ key: 'header', i18nLabel: 'Header' }, { key: 'payload', i18nLabel: 'Payload' }] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-identity_token_sent_via`, values.identityTokenSentVia || 'default' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Identity_Token_Sent_Via', persistent: true, values: [{ key: 'default', i18nLabel: 'Same_As_Token_Sent_Via' }, { key: 'header', i18nLabel: 'Header' }, { key: 'payload', i18nLabel: 'Payload' }] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-identity_path` , values.identityPath || '/me' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Identity_Path', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-authorize_path` , values.authorizePath || '/oauth/authorize' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Authorize_Path', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-scope` , values.scope || 'openid' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Scope', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-access_token_param` , values.accessTokenParam || 'access_token' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Access_Token_Param', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-id` , values.clientId || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_id', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-secret` , values.clientSecret || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Secret', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-login_style` , values.loginStyle || 'popup' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Login_Style', persistent: true, values: [{ key: 'redirect', i18nLabel: 'Redirect' }, { key: 'popup', i18nLabel: 'Popup' }, { key: '', i18nLabel: 'Default' }] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-button_label_text` , values.buttonLabelText || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-button_label_color` , values.buttonLabelColor || '#FFFFFF' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-button_color` , values.buttonColor || '#1d74f5' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Color', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-key_field` , values.keyField || 'username' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Key_Field', persistent: true, values: [{ key: 'username', i18nLabel: 'Username' }, { key: 'email', i18nLabel: 'Email' }] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-username_field` , values.usernameField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Username_Field', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-email_field` , values.emailField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Email_Field', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-name_field` , values.nameField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Name_Field', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-avatar_field` , values.avatarField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Avatar_Field', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-roles_claim` , values.rolesClaim || 'roles', { type: 'string', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Roles_Claim', |
||||
enterprise: true, |
||||
invalidValue: 'roles', |
||||
modules: ['oauth-enterprise'] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-groups_claim` , values.groupsClaim || 'groups', { type: 'string', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Groups_Claim', |
||||
enterprise: true, |
||||
invalidValue: 'groups', |
||||
modules: ['oauth-enterprise'] }); |
||||
|
||||
settings.add(`Accounts_OAuth_Custom-${ name }-channels_admin` , values.channelsAdmin || 'rocket.cat' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Channel_Admin', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-map_channels` , values.mapChannels || false, { type: 'boolean', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Map_Channels', |
||||
enterprise: true, |
||||
invalidValue: false, |
||||
modules: ['oauth-enterprise'] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-merge_roles` , values.mergeRoles || false, { type: 'boolean', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Merge_Roles', |
||||
enterprise: true, |
||||
invalidValue: false, |
||||
modules: ['oauth-enterprise'] }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-merge_users`, values.mergeUsers || false, { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Merge_Users', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-show_button` , values.showButton || true , { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Show_Button_On_Login_Page', persistent: true }); |
||||
settings.add(`Accounts_OAuth_Custom-${ name }-groups_channel_map` , values.channelsMap || '{\n\t"rocket-admin": "admin",\n\t"tech-support": "support"\n}' , { type: 'code' , multiline: true, code: 'application/json', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Channel_Map', persistent: true }); |
||||
} |
@ -0,0 +1,63 @@ |
||||
/* eslint no-multi-spaces: 0 */ |
||||
/* eslint comma-spacing: 0 */ |
||||
import { capitalize } from '@rocket.chat/string-helpers'; |
||||
|
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
export function addOAuthService(name: string, values: { [k: string]: string | boolean| undefined } = {}): void { |
||||
name = name.toLowerCase().replace(/[^a-z0-9_]/g, ''); |
||||
name = capitalize(name); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }` , values.enabled || false , { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Enable', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-url` , values.serverURL || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'URL', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-token_path` , values.tokenPath || '/oauth/token' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Token_Path', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-token_sent_via` , values.tokenSentVia || 'payload' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Token_Sent_Via', persistent: true, values: [{ key: 'header', i18nLabel: 'Header' }, { key: 'payload', i18nLabel: 'Payload' }] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-identity_token_sent_via`, values.identityTokenSentVia || 'default' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Identity_Token_Sent_Via', persistent: true, values: [{ key: 'default', i18nLabel: 'Same_As_Token_Sent_Via' }, { key: 'header', i18nLabel: 'Header' }, { key: 'payload', i18nLabel: 'Payload' }] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-identity_path` , values.identityPath || '/me' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Identity_Path', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-authorize_path` , values.authorizePath || '/oauth/authorize' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Authorize_Path', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-scope` , values.scope || 'openid' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Scope', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-access_token_param` , values.accessTokenParam || 'access_token' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Access_Token_Param', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-id` , values.clientId || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_id', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-secret` , values.clientSecret || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Secret', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-login_style` , values.loginStyle || 'popup' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Login_Style', persistent: true, values: [{ key: 'redirect', i18nLabel: 'Redirect' }, { key: 'popup', i18nLabel: 'Popup' }, { key: '', i18nLabel: 'Default' }] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-button_label_text` , values.buttonLabelText || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Text', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-button_label_color` , values.buttonLabelColor || '#FFFFFF' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Label_Color', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-button_color` , values.buttonColor || '#1d74f5' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Button_Color', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-key_field` , values.keyField || 'username' , { type: 'select' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Key_Field', persistent: true, values: [{ key: 'username', i18nLabel: 'Username' }, { key: 'email', i18nLabel: 'Email' }] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-username_field` , values.usernameField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Username_Field', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-email_field` , values.emailField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Email_Field', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-name_field` , values.nameField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Name_Field', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-avatar_field` , values.avatarField || '' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Avatar_Field', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-roles_claim` , values.rolesClaim || 'roles', { type: 'string', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Roles_Claim', |
||||
enterprise: true, |
||||
invalidValue: 'roles', |
||||
modules: ['oauth-enterprise'] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-groups_claim` , values.groupsClaim || 'groups', { type: 'string', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Groups_Claim', |
||||
enterprise: true, |
||||
invalidValue: 'groups', |
||||
modules: ['oauth-enterprise'] }); |
||||
|
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-channels_admin` , values.channelsAdmin || 'rocket.cat' , { type: 'string' , group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Channel_Admin', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-map_channels` , values.mapChannels || false, { type: 'boolean', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Map_Channels', |
||||
enterprise: true, |
||||
invalidValue: false, |
||||
modules: ['oauth-enterprise'] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-merge_roles` , values.mergeRoles || false, { type: 'boolean', |
||||
group: 'OAuth', |
||||
section: `Custom OAuth: ${ name }`, |
||||
i18nLabel: 'Accounts_OAuth_Custom_Merge_Roles', |
||||
enterprise: true, |
||||
invalidValue: false, |
||||
modules: ['oauth-enterprise'] }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-merge_users`, values.mergeUsers || false, { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Merge_Users', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-show_button` , values.showButton || true , { type: 'boolean', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Show_Button_On_Login_Page', persistent: true }); |
||||
settingsRegistry.add(`Accounts_OAuth_Custom-${ name }-groups_channel_map` , values.channelsMap || '{\n\t"rocket-admin": "admin",\n\t"tech-support": "support"\n}' , { type: 'code' , multiline: true, code: 'application/json', group: 'OAuth', section: `Custom OAuth: ${ name }`, i18nLabel: 'Accounts_OAuth_Custom_Channel_Map', persistent: true }); |
||||
} |
@ -1,14 +1,14 @@ |
||||
import PasswordPolicy from './PasswordPolicyClass'; |
||||
import { settings } from '../../../settings'; |
||||
import { settings } from '../../../settings/server'; |
||||
|
||||
export const passwordPolicy = new PasswordPolicy(); |
||||
|
||||
settings.get('Accounts_Password_Policy_Enabled', (key, value) => { passwordPolicy.enabled = value; }); |
||||
settings.get('Accounts_Password_Policy_MinLength', (key, value) => { passwordPolicy.minLength = value; }); |
||||
settings.get('Accounts_Password_Policy_MaxLength', (key, value) => { passwordPolicy.maxLength = value; }); |
||||
settings.get('Accounts_Password_Policy_ForbidRepeatingCharacters', (key, value) => { passwordPolicy.forbidRepeatingCharacters = value; }); |
||||
settings.get('Accounts_Password_Policy_ForbidRepeatingCharactersCount', (key, value) => { passwordPolicy.forbidRepeatingCharactersCount = value; }); |
||||
settings.get('Accounts_Password_Policy_AtLeastOneLowercase', (key, value) => { passwordPolicy.mustContainAtLeastOneLowercase = value; }); |
||||
settings.get('Accounts_Password_Policy_AtLeastOneUppercase', (key, value) => { passwordPolicy.mustContainAtLeastOneUppercase = value; }); |
||||
settings.get('Accounts_Password_Policy_AtLeastOneNumber', (key, value) => { passwordPolicy.mustContainAtLeastOneNumber = value; }); |
||||
settings.get('Accounts_Password_Policy_AtLeastOneSpecialCharacter', (key, value) => { passwordPolicy.mustContainAtLeastOneSpecialCharacter = value; }); |
||||
settings.watch('Accounts_Password_Policy_Enabled', (value) => { passwordPolicy.enabled = value; }); |
||||
settings.watch('Accounts_Password_Policy_MinLength', (value) => { passwordPolicy.minLength = value; }); |
||||
settings.watch('Accounts_Password_Policy_MaxLength', (value) => { passwordPolicy.maxLength = value; }); |
||||
settings.watch('Accounts_Password_Policy_ForbidRepeatingCharacters', (value) => { passwordPolicy.forbidRepeatingCharacters = value; }); |
||||
settings.watch('Accounts_Password_Policy_ForbidRepeatingCharactersCount', (value) => { passwordPolicy.forbidRepeatingCharactersCount = value; }); |
||||
settings.watch('Accounts_Password_Policy_AtLeastOneLowercase', (value) => { passwordPolicy.mustContainAtLeastOneLowercase = value; }); |
||||
settings.watch('Accounts_Password_Policy_AtLeastOneUppercase', (value) => { passwordPolicy.mustContainAtLeastOneUppercase = value; }); |
||||
settings.watch('Accounts_Password_Policy_AtLeastOneNumber', (value) => { passwordPolicy.mustContainAtLeastOneNumber = value; }); |
||||
settings.watch('Accounts_Password_Policy_AtLeastOneSpecialCharacter', (value) => { passwordPolicy.mustContainAtLeastOneSpecialCharacter = value; }); |
||||
|
@ -1,6 +1,6 @@ |
||||
import { settings } from '../../../settings'; |
||||
import { settingsRegistry } from '../../../settings/server'; |
||||
|
||||
settings.addGroup('Email', function() { |
||||
settingsRegistry.addGroup('Email', function() { |
||||
this.section('Style', function() { |
||||
this.add('email_plain_text_only', false, { |
||||
type: 'boolean', |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue