Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
160 lines (106 loc) · 11.6 KB

manage-settings-using-environmental-variables.md

File metadata and controls

160 lines (106 loc) · 11.6 KB

Manage Settings Using Environmental Variables

In software configuration, environmental variables play a crucial role in managing settings. Rocket.Chat leverages environmental variables to provide a flexible and efficient way to manage settings. This guide will provide a comprehensive overview of how Rocket.Chat manages settings using environmental variables

When starting your server, you can set any settings value via an environment variable. You will only have to know the setting ID and the data type of the setting (boolean, string, integer, etc.).

Basic Settings

NameData Type
_idSettingId = string
type
  • boolean
  • timezone
  • string
  • relativeUrl
  • password
  • int
  • select
  • multiSelect
  • language
  • color
  • font
  • code
  • action
  • asset
  • roomPick
  • group
  • date
publicboolean
envboolean
group (Optional)GroupId = SettingId
section (Optional)SectionName = string
tab (Optional)TabId = SettingId
i18nLabelstring
value

SettingValue can be one of the following types:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined
packageValue

SettingValue can be one of the following types:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined
blockedboolean
enableQuery (Optional)string
displayQuery (Optional)string
sorternumber
properties (Optional)unknown
enterprise (Optional)boolean
requiredOnWizard (Optional)boolean
hidden (Optional)boolean
modules (Optional)Array
invalidValue (Optional)

SettingValue can be one of the following values:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined
valueSource (Optional)string
secret (Optional)boolean
i18nDescription (Optional)string
autocomplete (Optional)boolean
processEnvValue (Optional)

SettingValue can be one of the following values:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined
meteorSettingsValue (Optional)

SettingValue can be one of the following values:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined
tsDate
createdAtDate
_updatedAt (Optional)Date
multiline (Optional)boolean
values (Optional)Array
placeholder (Optional)string
wizard (Optional)
  • step: number
  • order: number
persistent (Optional)boolean
readonly (Optional)boolean
alert (Optional)string
private (Optional)boolean

Group Settings

NameData Type
_idstring
hiddenboolean
blockedboolean
tsDate
sorternumber
i18nLabelstring
displayQuerystring
i18nDescriptionstring
valueundefined
typegroup
alertstring

Enterprise Settings

NameData Type
enterprisetrue
invalidValue

SettingValue can be one of the following values:

  • string
  • boolean
  • number
  • SettingValueMultiSelect
  • Date
  • AssetValue
  • undefined

Color Settings

NameData Type
typecolor
editorSettingEditor
packageEditor (Optional)SettingEditor

Action Settings

NameData Type
typeaction
valuestring
actionText (Optional)string

Code Settings

NameData Type
typeaction
valuestring
actionText (Optional)string

Asset Settings

NameData Type
typeasset
valueAssetValue
fileConstraintsIRocketChatAssetConstraint
assetstring

SelectOption Settings

NameData Type
key

The type can be:

  • string
  • number
i18nLabelstring

Editor Settings

NameData Type
COLORcolor
EXPRESSIONexpression

Date Settings

NameData Type
typeDate
valueDate

Statistics Settings

Name Data Type
account2fa (Optional) boolean
cannedResponsesEnabled (Optional) boolean
e2e (Optional) boolean
e2eDefaultDirectRoom (Optional) boolean
e2eDefaultPrivateRoom (Optional) boolean
smtpHost (Optional) string
smtpPort (Optional) string
fromEmail (Optional) string
fileUploadEnable (Optional) boolean
frameworkDevMode (Optional) boolean
frameworkEnable (Optional) boolean
surveyEnabled (Optional) boolean
updateChecker (Optional) boolean
liveStream (Optional) boolean
broadcasting (Optional) boolean
allowEditing (Optional) boolean
allowDeleting (Optional) boolean
allowUnrecognizedSlashCommand (Optional) boolean
allowBadWordsFilter (Optional) boolean
readReceiptEnabled (Optional) boolean
readReceiptStoreUsers (Optional) boolean
otrEnable (Optional) boolean
pushEnable (Optional) boolean
globalSearchEnabled (Optional) boolean
threadsEnabled (Optional) boolean
bigBlueButton (Optional) boolean
jitsiEnabled (Optional) boolean
webRTCEnableChannel (Optional) boolean
webRTCEnablePrivate (Optional) boolean
webRTCEnableDirect (Optional) boolean

Settings Actions

You can take the following actions while configuring your workspace settings:

  • Set the setting values for the first time.
  • Overwrite setting values.
  • Block settings from being changed.
  • Hide settings.
  • Set any wizard setting as mandatory.

Let's look at these options in detail.

Set Setting

To set a setting for the first time, you need only to add the environment variable SETTING_ID=VALUE when starting the server.

For example:

FileUpload_Storage_Type=hiGoogleCloudStorage

{% hint style="info" %} This only works if the setting isn't already set; hence it's most useful for setting on the initial start. If the setting already has a value, you will need to use overwrite setting. {% endhint %}

Overwrite Setting

You can overwrite any setting by setting an environment variable prefixed with OVERWRITE_SETTING_<Setting Id>.

For example:

OVERWRITE_SETTING_FileUpload_Storage_Type=GoogleCloudStorage

Settings capable of this can be seen when hovered in the Administration > Workspace > Settings section.

Block Settings

You can block a setting from being changed by specifying the SETTINGS_BLOCKED environment variable. It is a comma-separated list. You need to add any setting you want to block to this list.

For example:

{% code overflow="wrap" %}

SETTINGS_BLOCKED=FileUpload_Storage_Type,FileUpload_GoogleStorage_AccessId,FileUpload_GoogleStorage_Secret

{% endcode %}

As an administrator, you can't change this from the UI. You must remove it from the list and reboot the server to change this setting.

Hide Settings

You can hide settings from the client by using the SETTINGS_HIDDEN environment variable.

For example:

SETTINGS_HIDDEN=FileUpload_GoogleStorage_AccessId,FileUpload_GoogleStorage_Secret

{% hint style="info" %} Take extra caution here because the client needs settings like FileUpload_Storage_Type, so it can not be hidden. {% endhint %}

Required Wizard Settings

You can force settings to be required on wizard pages by using the SETTINGS_REQUIRED_ON_WIZARD environment variable.

For example:

SETTINGS_REQUIRED_ON_WIZARD=Organization_Type,Organization_Name

Rocket.Chat's use of environmental variables for managing your workspace settings provides a powerful and flexible configuration mechanism.