diff --git a/packages/rocketchat-ldap/config_server.coffee b/packages/rocketchat-ldap/config_server.coffee index 17bb045fbe3..1964aaf48e3 100644 --- a/packages/rocketchat-ldap/config_server.coffee +++ b/packages/rocketchat-ldap/config_server.coffee @@ -1,14 +1,14 @@ MeteorWrapperLdapjs = Npm.require 'ldapjs' Meteor.startup -> - RocketChat.settings.addGroup 'LDAP' - RocketChat.settings.add 'LDAP_Enable', false, { type: 'boolean', group: 'LDAP', public: true } - RocketChat.settings.add 'LDAP_Url', 'ldap://', { type: 'string' , group: 'LDAP', enableQuery: {_id: 'LDAP_Enable', value: true} } - RocketChat.settings.add 'LDAP_Port', '389', { type: 'string' , group: 'LDAP', enableQuery: {_id: 'LDAP_Enable', value: true} } - RocketChat.settings.add 'LDAP_DN', '', { type: 'string' , group: 'LDAP', public: true, enableQuery: {_id: 'LDAP_Enable', value: true} } - RocketChat.settings.add 'LDAP_Bind_Search', '', { type: 'string' , group: 'LDAP', enableQuery: {_id: 'LDAP_Enable', value: true} } - RocketChat.settings.add 'LDAP_Sync_User_Data', false, { type: 'boolean' , group: 'LDAP', enableQuery: {_id: 'LDAP_Enable', value: true} } - RocketChat.settings.add 'LDAP_Sync_User_Data_FieldMap', '{"cn":"name", "mail":"email"}', { type: 'string' , group: 'LDAP', enableQuery: {_id: 'LDAP_Enable', value: true} } + RocketChat.settings.addGroup 'LDAP', -> + @add 'LDAP_Enable', false, { type: 'boolean', public: true } + @add 'LDAP_Url', 'ldap://', { type: 'string' , enableQuery: {_id: 'LDAP_Enable', value: true} } + @add 'LDAP_Port', '389', { type: 'string' , enableQuery: {_id: 'LDAP_Enable', value: true} } + @add 'LDAP_DN', '', { type: 'string' , public: true, enableQuery: {_id: 'LDAP_Enable', value: true} } + @add 'LDAP_Bind_Search', '', { type: 'string' , enableQuery: {_id: 'LDAP_Enable', value: true} } + @add 'LDAP_Sync_User_Data', false, { type: 'boolean' , enableQuery: {_id: 'LDAP_Enable', value: true} } + @add 'LDAP_Sync_User_Data_FieldMap', '{"cn":"name", "mail":"email"}', { type: 'string', enableQuery: {_id: 'LDAP_Enable', value: true} } timer = undefined diff --git a/packages/rocketchat-lib/server/functions/settings.coffee b/packages/rocketchat-lib/server/functions/settings.coffee index b8055d7793d..7cb1a13ab79 100644 --- a/packages/rocketchat-lib/server/functions/settings.coffee +++ b/packages/rocketchat-lib/server/functions/settings.coffee @@ -46,12 +46,16 @@ RocketChat.settings.add = (_id, value, options = {}) -> # Add a setting group # @param {String} _id ### -RocketChat.settings.addGroup = (_id, options = {}) -> +RocketChat.settings.addGroup = (_id, options = {}, cb) -> # console.log '[functions] RocketChat.settings.addGroup -> '.green, 'arguments:', arguments if not _id return false + if _.isFunction(options) + cb = options + options = {} + if not options.i18nLabel? options.i18nLabel = _id @@ -61,12 +65,27 @@ RocketChat.settings.addGroup = (_id, options = {}) -> options.ts = new Date options.hidden = false - return RocketChat.models.Settings.upsert { _id: _id }, + RocketChat.models.Settings.upsert { _id: _id }, $set: options $setOnInsert: type: 'group' createdAt: new Date + if cb? + cb.call + add: (id, value, options = {}) -> + options.group = _id + RocketChat.settings.add id, value, options + + section: (section, cb) -> + cb.call + add: (id, value, options = {}) -> + options.group = _id + options.section = section + RocketChat.settings.add id, value, options + + return + ### # Remove a setting by id diff --git a/packages/rocketchat-lib/server/startup/settings.coffee b/packages/rocketchat-lib/server/startup/settings.coffee index 445bd659196..0a4e79e09c2 100644 --- a/packages/rocketchat-lib/server/startup/settings.coffee +++ b/packages/rocketchat-lib/server/startup/settings.coffee @@ -2,137 +2,159 @@ if not RocketChat.models.Settings.findOneById 'uniqueID' RocketChat.models.Settings.createWithIdAndValue 'uniqueID', Random.id() -RocketChat.settings.addGroup 'Accounts' -RocketChat.settings.add 'Accounts_EmailVerification', false, { type: 'boolean', group: 'Accounts', public: true, section: 'Registration' } -RocketChat.settings.add 'Accounts_ManuallyApproveNewUsers', false, { type: 'boolean', group: 'Accounts', section: 'Registration' } -RocketChat.settings.add 'Accounts_AllowedDomainsList', '', { type: 'string', group: 'Accounts', public: true, section: 'Registration' } - -RocketChat.settings.add 'Accounts_RegistrationForm', 'Public', { type: 'select', group: 'Accounts', public: true, section: 'Registration', values: [ { key: 'Public', i18nLabel: 'Accounts_RegistrationForm_Public' }, { key: 'Disabled', i18nLabel: 'Accounts_RegistrationForm_Disabled' }, { key: 'Secret URL', i18nLabel: 'Accounts_RegistrationForm_Secret_URL' } ] } -RocketChat.settings.add 'Accounts_RegistrationForm_SecretURL', Random.id(), { type: 'string', group: 'Accounts', section: 'Registration' } -RocketChat.settings.add 'Accounts_RegistrationForm_LinkReplacementText', 'New user registration is currently disabled', { type: 'string', group: 'Accounts', section: 'Registration', public: true } -RocketChat.settings.add 'Accounts_Registration_AuthenticationServices_Enabled', true, { type: 'boolean', group: 'Accounts', section: 'Registration', public: true } - -RocketChat.settings.add 'Accounts_PasswordReset', true, { type: 'boolean', group: 'Accounts', public: true, section: 'Registration' } - -RocketChat.settings.add 'Accounts_AvatarResize', true, { type: 'boolean', group: 'Accounts', section: 'Avatar' } -RocketChat.settings.add 'Accounts_AvatarSize', 200, { type: 'int', group: 'Accounts', section: 'Avatar', enableQuery: {_id: 'Accounts_AvatarResize', value: true} } -RocketChat.settings.add 'Accounts_AvatarStoreType', 'GridFS', { type: 'select', group: 'Accounts', section: 'Avatar', values: [ { key: 'GridFS', i18nLabel: 'GridFS' }, { key: 'FileSystem', i18nLabel: 'FileSystem' } ] } -RocketChat.settings.add 'Accounts_AvatarStorePath', '', { type: 'string', group: 'Accounts', section: 'Avatar', enableQuery: {_id: 'Accounts_AvatarStoreType', value: 'FileSystem'} } - -RocketChat.settings.add 'Accounts_OAuth_Facebook', false, { type: 'boolean', group: 'Accounts', section: 'Facebook', public: true } -RocketChat.settings.add 'Accounts_OAuth_Facebook_id', '', { type: 'string', group: 'Accounts', section: 'Facebook', enableQuery: {_id: 'Accounts_OAuth_Facebook', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Facebook_secret', '', { type: 'string', group: 'Accounts', section: 'Facebook', enableQuery: {_id: 'Accounts_OAuth_Facebook', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Google', false, { type: 'boolean', group: 'Accounts', section: 'Google', public: true } -RocketChat.settings.add 'Accounts_OAuth_Google_id', '', { type: 'string', group: 'Accounts', section: 'Google', enableQuery: {_id: 'Accounts_OAuth_Google', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Google_secret', '', { type: 'string', group: 'Accounts', section: 'Google', enableQuery: {_id: 'Accounts_OAuth_Google', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Github', false, { type: 'boolean', group: 'Accounts', section: 'Github', public: true } -RocketChat.settings.add 'Accounts_OAuth_Github_id', '', { type: 'string', group: 'Accounts', section: 'Github', enableQuery: {_id: 'Accounts_OAuth_Github', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Github_secret', '', { type: 'string', group: 'Accounts', section: 'Github', enableQuery: {_id: 'Accounts_OAuth_Github', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Gitlab', false, { type: 'boolean', group: 'Accounts', section: 'Gitlab', public: true } -RocketChat.settings.add 'Accounts_OAuth_Gitlab_id', '', { type: 'string', group: 'Accounts', section: 'Gitlab', enableQuery: {_id: 'Accounts_OAuth_Gitlab', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Gitlab_secret', '', { type: 'string', group: 'Accounts', section: 'Gitlab', enableQuery: {_id: 'Accounts_OAuth_Gitlab', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Linkedin', false, { type: 'boolean', group: 'Accounts', section: 'Linkedin', public: true } -RocketChat.settings.add 'Accounts_OAuth_Linkedin_id', '', { type: 'string', group: 'Accounts', section: 'Linkedin', enableQuery: {_id: 'Accounts_OAuth_Linkedin', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Linkedin_secret', '', { type: 'string', group: 'Accounts', section: 'Linkedin', enableQuery: {_id: 'Accounts_OAuth_Linkedin', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Meteor', false, { type: 'boolean', group: 'Accounts', section: 'Meteor', public: true } -RocketChat.settings.add 'Accounts_OAuth_Meteor_id', '', { type: 'string', group: 'Accounts', section: 'Meteor', enableQuery: {_id: 'Accounts_OAuth_Meteor', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Meteor_secret', '', { type: 'string', group: 'Accounts', section: 'Meteor', enableQuery: {_id: 'Accounts_OAuth_Meteor', value: true} } - -RocketChat.settings.add 'Accounts_OAuth_Twitter', false, { type: 'boolean', group: 'Accounts', section: 'Twitter', public: true } -RocketChat.settings.add 'Accounts_OAuth_Twitter_id', '', { type: 'string', group: 'Accounts', section: 'Twitter', enableQuery: {_id: 'Accounts_OAuth_Twitter', value: true} } -RocketChat.settings.add 'Accounts_OAuth_Twitter_secret', '', { type: 'string', group: 'Accounts', section: 'Twitter', enableQuery: {_id: 'Accounts_OAuth_Twitter', value: true} } - -RocketChat.settings.add 'Accounts_AllowUserProfileChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true } -RocketChat.settings.add 'Accounts_AllowUserAvatarChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true } -RocketChat.settings.add 'Accounts_AllowUsernameChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true } -RocketChat.settings.add 'Accounts_AllowPasswordChange', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true } -RocketChat.settings.add 'Accounts_RequireNameForSignUp', true, { type: 'boolean', group: 'Accounts', section: 'General', public: true } - -RocketChat.settings.add 'Accounts_LoginExpiration', 90, { type: 'int', group: 'Accounts', section: 'General', public: true } - -RocketChat.settings.addGroup 'FileUpload' -RocketChat.settings.add 'FileUpload_Enabled', true, { type: 'boolean', group: 'FileUpload', public: true } -RocketChat.settings.add 'FileUpload_MaxFileSize', 2097152, { type: 'int', group: 'FileUpload', public: true } -RocketChat.settings.add 'FileUpload_MediaTypeWhiteList', 'image/*,audio/*,application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document', { type: 'string', group: 'FileUpload', public: true, i18nDescription: 'FileUpload_MediaTypeWhiteListDescription' } -RocketChat.settings.add 'FileUpload_ProtectFiles', true, { type: 'boolean', group: 'FileUpload', public: true, i18nDescription: 'FileUpload_ProtectFilesDescription' } - - -RocketChat.settings.addGroup 'General' -RocketChat.settings.add 'Site_Url', __meteor_runtime_config__?.ROOT_URL, { type: 'string', group: 'General', i18nDescription: 'Site_Url_Description', public: true } -RocketChat.settings.add 'Site_Name', 'Rocket.Chat', { type: 'string', group: 'General', public: true } -RocketChat.settings.add 'Allow_Invalid_SelfSigned_Certs', false, { type: 'boolean', group: 'General' } -RocketChat.settings.add 'Disable_Favorite_Rooms', false, { type: 'boolean', group: 'General' } -RocketChat.settings.add 'CDN_PREFIX', '', { type: 'string', group: 'General' } -RocketChat.settings.add 'Restart', 'restart_server', { type: 'action', group: 'General', actionText: 'Restart_the_server' } - -RocketChat.settings.add 'UTF8_Names_Validation', '[0-9a-zA-Z-_.]+', { type: 'string', group: 'General', section: 'UTF8', public: true ,i18nDescription: 'UTF8_Names_Validation_Description'} -RocketChat.settings.add 'UTF8_Names_Slugify', true, { type: 'boolean', group: 'General', section: 'UTF8', public: true } - -RocketChat.settings.addGroup 'API' -RocketChat.settings.add 'API_Analytics', '', { type: 'string', group: 'API', public: true } -RocketChat.settings.add 'API_Embed', true, { type: 'boolean', group: 'API', public: true } -RocketChat.settings.add 'API_EmbedDisabledFor', '', { type: 'string', group: 'API', public: true, i18nDescription: 'API_EmbedDisabledFor_Description' } - -RocketChat.settings.addGroup 'SMTP' -RocketChat.settings.add 'SMTP_Host', '', { type: 'string', group: 'SMTP' } -RocketChat.settings.add 'SMTP_Port', '', { type: 'string', group: 'SMTP' } -RocketChat.settings.add 'SMTP_Username', '', { type: 'string', group: 'SMTP' } -RocketChat.settings.add 'SMTP_Password', '', { type: 'string', group: 'SMTP' } -RocketChat.settings.add 'From_Email', '', { type: 'string', group: 'SMTP', placeholder: 'email@domain' } - -RocketChat.settings.add 'Invitation_Subject', 'You have been invited to Rocket.Chat', { type: 'string', group: 'SMTP', section: 'Invitation' } -RocketChat.settings.add 'Invitation_HTML', '

You have been invited to

Rocket.Chat

Go to ' + __meteor_runtime_config__?.ROOT_URL + ' and try the best open source chat solution available today!

', { type: 'string', multiline: true, group: 'SMTP', section: 'Invitation' } -RocketChat.settings.add 'Accounts_Enrollment_Email', '', { type: 'string', multiline: true, group: 'SMTP', section: 'Invitation' } - -RocketChat.settings.addGroup 'Message' -RocketChat.settings.add 'Message_AllowEditing', true, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_AllowEditing_BlockEditInMinutes', 0, { type: 'int', group: 'Message', public: true, i18nDescription: 'Message_AllowEditing_BlockEditInMinutesDescription' } -RocketChat.settings.add 'Message_AllowDeleting', true, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_ShowEditedStatus', true, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_ShowDeletedStatus', false, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_KeepHistory', false, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_MaxAllowedSize', 5000, { type: 'int', group: 'Message', public: true } -RocketChat.settings.add 'Message_ShowFormattingTips', true, { type: 'boolean', group: 'Message', public: true } -RocketChat.settings.add 'Message_AudioRecorderEnabled', true, { type: 'boolean', group: 'Message', public: true, i18nDescription: 'Message_AudioRecorderEnabledDescription' } -RocketChat.settings.add 'Message_GroupingPeriod', 300, { type: 'int', group: 'Message', public: true, i18nDescription: 'Message_GroupingPeriodDescription' } - -RocketChat.settings.addGroup 'Meta' -RocketChat.settings.add 'Meta_language', '', { type: 'string', group: 'Meta' } -RocketChat.settings.add 'Meta_fb_app_id', '', { type: 'string', group: 'Meta' } -RocketChat.settings.add 'Meta_robots', '', { type: 'string', group: 'Meta' } -RocketChat.settings.add 'Meta_google-site-verification', '', { type: 'string', group: 'Meta' } -RocketChat.settings.add 'Meta_msvalidate01', '', { type: 'string', group: 'Meta' } - -RocketChat.settings.addGroup 'Push' -RocketChat.settings.add 'Push_debug', false, { type: 'boolean', group: 'Push', public: true } -RocketChat.settings.add 'Push_enable', true, { type: 'boolean', group: 'Push', public: true } -RocketChat.settings.add 'Push_enable_gateway', true, { type: 'boolean', group: 'Push' } -RocketChat.settings.add 'Push_gateway', 'https://rocket.chat', { type: 'string', group: 'Push' } -RocketChat.settings.add 'Push_production', true, { type: 'boolean', group: 'Push', public: true } -RocketChat.settings.add 'Push_test_push', 'push_test', { type: 'action', group: 'Push', actionText: 'Send_a_test_push_to_my_user' } -RocketChat.settings.add 'Push_apn_passphrase', '', { type: 'string', group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_apn_key', '', { type: 'string', multiline: true, group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_apn_cert', '', { type: 'string', multiline: true, group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_apn_dev_passphrase', '', { type: 'string', group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_apn_dev_key', '', { type: 'string', multiline: true, group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_apn_dev_cert', '', { type: 'string', multiline: true, group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_gcm_api_key', '', { type: 'string', group: 'Push', section: 'Certificates_and_Keys' } -RocketChat.settings.add 'Push_gcm_project_number', '', { type: 'string', group: 'Push', public: true, section: 'Certificates_and_Keys' } - -RocketChat.settings.addGroup 'Layout' -RocketChat.settings.add 'Layout_Home_Title', 'Home', { type: 'string', group: 'Layout', public: true, section: 'Content' } -RocketChat.settings.add 'Layout_Home_Body', 'Welcome to Rocket.Chat
Go to APP SETTINGS -> Layout to customize this intro.', { type: 'string', multiline: true, group: 'Layout', public: true, section: 'Content' } -RocketChat.settings.add 'Layout_Terms_of_Service', 'Terms of Service
Go to APP SETTINGS -> Layout to customize this page.', { type: 'string', multiline: true, group: 'Layout', public: true, section: 'Content' } -RocketChat.settings.add 'Layout_Privacy_Policy', 'Privacy Policy
Go to APP SETTINGS -> Layout to customize this page.', { type: 'string', multiline: true, group: 'Layout', public: true, section: 'Content' } -RocketChat.settings.add 'Layout_Sidenav_Footer', '
with on
', { type: 'string', group: 'Layout', public: true, i18nDescription: 'Layout_Sidenav_Footer_description' } -RocketChat.settings.add 'Layout_Login_Header', '', { type: 'string', multiline: true, group: 'Layout', public: true, section: 'Login' } -RocketChat.settings.add 'Layout_Login_Terms', 'By proceeding to create your account and use Rocket.Chat, you are agreeing to our Terms of Service and Privacy Policy. If you do not agree, you cannot use Rocket.Chat.', { type: 'string', multiline: true, group: 'Layout', public: true, section: 'Login' } +RocketChat.settings.addGroup 'Accounts', -> + @add 'Accounts_AllowUserProfileChange', true, { type: 'boolean', public: true } + @add 'Accounts_AllowUserAvatarChange', true, { type: 'boolean', public: true } + @add 'Accounts_AllowUsernameChange', true, { type: 'boolean', public: true } + @add 'Accounts_AllowPasswordChange', true, { type: 'boolean', public: true } + @add 'Accounts_RequireNameForSignUp', true, { type: 'boolean', public: true } + @add 'Accounts_LoginExpiration', 90, { type: 'int', public: true } + + @section 'Registration', -> + @add 'Accounts_EmailVerification', false, { type: 'boolean', public: true } + @add 'Accounts_ManuallyApproveNewUsers', false, { type: 'boolean' } + @add 'Accounts_AllowedDomainsList', '', { type: 'string', public: true } + @add 'Accounts_RegistrationForm', 'Public', { type: 'select', public: true, values: [ { key: 'Public', i18nLabel: 'Accounts_RegistrationForm_Public' }, { key: 'Disabled', i18nLabel: 'Accounts_RegistrationForm_Disabled' }, { key: 'Secret URL', i18nLabel: 'Accounts_RegistrationForm_Secret_URL' } ] } + @add 'Accounts_RegistrationForm_SecretURL', Random.id(), { type: 'string' } + @add 'Accounts_RegistrationForm_LinkReplacementText', 'New user registration is currently disabled', { type: 'string', public: true } + @add 'Accounts_Registration_AuthenticationServices_Enabled', true, { type: 'boolean', public: true } + @add 'Accounts_PasswordReset', true, { type: 'boolean', public: true } + + @section 'Avatar', -> + @add 'Accounts_AvatarResize', true, { type: 'boolean' } + @add 'Accounts_AvatarSize', 200, { type: 'int', enableQuery: {_id: 'Accounts_AvatarResize', value: true} } + @add 'Accounts_AvatarStoreType', 'GridFS', { type: 'select', values: [ { key: 'GridFS', i18nLabel: 'GridFS' }, { key: 'FileSystem', i18nLabel: 'FileSystem' } ] } + @add 'Accounts_AvatarStorePath', '', { type: 'string', enableQuery: {_id: 'Accounts_AvatarStoreType', value: 'FileSystem'} } + + @section 'Facebook', -> + @add 'Accounts_OAuth_Facebook', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Facebook_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Facebook', value: true} } + @add 'Accounts_OAuth_Facebook_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Facebook', value: true} } + + @section 'Google', -> + @add 'Accounts_OAuth_Google', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Google_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Google', value: true} } + @add 'Accounts_OAuth_Google_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Google', value: true} } + + @section 'Github', -> + @add 'Accounts_OAuth_Github', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Github_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Github', value: true} } + @add 'Accounts_OAuth_Github_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Github', value: true} } + + @section 'Gitlab', -> + @add 'Accounts_OAuth_Gitlab', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Gitlab_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Gitlab', value: true} } + @add 'Accounts_OAuth_Gitlab_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Gitlab', value: true} } + + @section 'Linkedin', -> + @add 'Accounts_OAuth_Linkedin', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Linkedin_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Linkedin', value: true} } + @add 'Accounts_OAuth_Linkedin_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Linkedin', value: true} } + + @section 'Meteor', -> + @add 'Accounts_OAuth_Meteor', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Meteor_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Meteor', value: true} } + @add 'Accounts_OAuth_Meteor_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Meteor', value: true} } + + @section 'Twitter', -> + @add 'Accounts_OAuth_Twitter', false, { type: 'boolean', public: true } + @add 'Accounts_OAuth_Twitter_id', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Twitter', value: true} } + @add 'Accounts_OAuth_Twitter_secret', '', { type: 'string', enableQuery: {_id: 'Accounts_OAuth_Twitter', value: true} } + + +RocketChat.settings.addGroup 'FileUpload', -> + @add 'FileUpload_Enabled', true, { type: 'boolean', public: true } + @add 'FileUpload_MaxFileSize', 2097152, { type: 'int', public: true } + @add 'FileUpload_MediaTypeWhiteList', 'image/*,audio/*,application/pdf,text/plain,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document', { type: 'string', public: true, i18nDescription: 'FileUpload_MediaTypeWhiteListDescription' } + @add 'FileUpload_ProtectFiles', true, { type: 'boolean', public: true, i18nDescription: 'FileUpload_ProtectFilesDescription' } + + +RocketChat.settings.addGroup 'General', -> + @add 'Site_Url', __meteor_runtime_config__?.ROOT_URL, { type: 'string', i18nDescription: 'Site_Url_Description', public: true } + @add 'Site_Name', 'Rocket.Chat', { type: 'string', public: true } + @add 'Allow_Invalid_SelfSigned_Certs', false, { type: 'boolean' } + @add 'Disable_Favorite_Rooms', false, { type: 'boolean' } + @add 'CDN_PREFIX', '', { type: 'string' } + @add 'Restart', 'restart_server', { type: 'action', actionText: 'Restart_the_server' } + + @section 'UTF8', -> + @add 'UTF8_Names_Validation', '[0-9a-zA-Z-_.]+', { type: 'string', public: true, i18nDescription: 'UTF8_Names_Validation_Description'} + @add 'UTF8_Names_Slugify', true, { type: 'boolean', public: true } + + +RocketChat.settings.addGroup 'API', -> + @add 'API_Analytics', '', { type: 'string', public: true } + @add 'API_Embed', true, { type: 'boolean', public: true } + @add 'API_EmbedDisabledFor', '', { type: 'string', public: true, i18nDescription: 'API_EmbedDisabledFor_Description' } + + +RocketChat.settings.addGroup 'SMTP', -> + @add 'SMTP_Host', '', { type: 'string' } + @add 'SMTP_Port', '', { type: 'string' } + @add 'SMTP_Username', '', { type: 'string' } + @add 'SMTP_Password', '', { type: 'string' } + @add 'From_Email', '', { type: 'string', placeholder: 'email@domain' } + + @section 'Invitation', -> + @add 'Invitation_Subject', 'You have been invited to Rocket.Chat', { type: 'string' } + @add 'Invitation_HTML', '

You have been invited to

Rocket.Chat

Go to ' + __meteor_runtime_config__?.ROOT_URL + ' and try the best open source chat solution available today!

', { type: 'string', multiline: true } + @add 'Accounts_Enrollment_Email', '', { type: 'string', multiline: true } + + +RocketChat.settings.addGroup 'Message', -> + @add 'Message_AllowEditing', true, { type: 'boolean', public: true } + @add 'Message_AllowEditing_BlockEditInMinutes', 0, { type: 'int', public: true, i18nDescription: 'Message_AllowEditing_BlockEditInMinutesDescription' } + @add 'Message_AllowDeleting', true, { type: 'boolean', public: true } + @add 'Message_AllowPinning', true, { type: 'boolean', public: true } + @add 'Message_ShowEditedStatus', true, { type: 'boolean', public: true } + @add 'Message_ShowDeletedStatus', false, { type: 'boolean', public: true } + @add 'Message_KeepHistory', false, { type: 'boolean', public: true } + @add 'Message_MaxAllowedSize', 5000, { type: 'int', public: true } + @add 'Message_ShowFormattingTips', true, { type: 'boolean', public: true } + @add 'Message_AudioRecorderEnabled', true, { type: 'boolean', public: true, i18nDescription: 'Message_AudioRecorderEnabledDescription' } + @add 'Message_GroupingPeriod', 300, { type: 'int', public: true, i18nDescription: 'Message_GroupingPeriodDescription' } + + +RocketChat.settings.addGroup 'Meta', -> + @add 'Meta_language', '', { type: 'string' } + @add 'Meta_fb_app_id', '', { type: 'string' } + @add 'Meta_robots', '', { type: 'string' } + @add 'Meta_google-site-verification', '', { type: 'string' } + @add 'Meta_msvalidate01', '', { type: 'string' } + + +RocketChat.settings.addGroup 'Push', -> + @add 'Push_debug', false, { type: 'boolean', public: true } + @add 'Push_enable', true, { type: 'boolean', public: true } + @add 'Push_enable_gateway', true, { type: 'boolean' } + @add 'Push_gateway', 'https://rocket.chat', { type: 'string' } + @add 'Push_production', true, { type: 'boolean', public: true } + @add 'Push_test_push', 'push_test', { type: 'action', actionText: 'Send_a_test_push_to_my_user' } + + @section 'Certificates_and_Keys', -> + @add 'Push_apn_passphrase', '', { type: 'string' } + @add 'Push_apn_key', '', { type: 'string', multiline: true } + @add 'Push_apn_cert', '', { type: 'string', multiline: true } + @add 'Push_apn_dev_passphrase', '', { type: 'string' } + @add 'Push_apn_dev_key', '', { type: 'string', multiline: true } + @add 'Push_apn_dev_cert', '', { type: 'string', multiline: true } + @add 'Push_gcm_api_key', '', { type: 'string' } + @add 'Push_gcm_project_number', '', { type: 'string', public: true } + + +RocketChat.settings.addGroup 'Layout', -> + @add 'Layout_Sidenav_Footer', '
with on
', { type: 'string', public: true, i18nDescription: 'Layout_Sidenav_Footer_description' } + + @section 'Content', -> + @add 'Layout_Home_Title', 'Home', { type: 'string', public: true } + @add 'Layout_Home_Body', 'Welcome to Rocket.Chat
Go to APP SETTINGS -> Layout to customize this intro.', { type: 'string', multiline: true, public: true } + @add 'Layout_Terms_of_Service', 'Terms of Service
Go to APP SETTINGS -> Layout to customize this page.', { type: 'string', multiline: true, public: true } + @add 'Layout_Privacy_Policy', 'Privacy Policy
Go to APP SETTINGS -> Layout to customize this page.', { type: 'string', multiline: true, public: true } + + @section 'Login', -> + @add 'Layout_Login_Header', '', { type: 'string', multiline: true, public: true } + @add 'Layout_Login_Terms', 'By proceeding to create your account and use Rocket.Chat, you are agreeing to our Terms of Service and Privacy Policy. If you do not agree, you cannot use Rocket.Chat.', { type: 'string', multiline: true, public: true } + RocketChat.settings.add 'Statistics_opt_out', false, { type: 'boolean', group: false }