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
_id
SettingId
= string
type
boolean
timezone
string
relativeUrl
password
int
select
multiSelect
language
color
font
code
action
asset
roomPick
group
date
public
boolean
env
boolean
group
(Optional)
GroupId
= SettingId
section
(Optional)
SectionName
= string
tab
(Optional)
TabId
= SettingId
i18nLabel
string
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
blocked
boolean
enableQuery
(Optional)
string
displayQuery
(Optional)
string
sorter
number
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
ts
Date
createdAt
Date
_updatedAt
(Optional)
Date
multiline
(Optional)
boolean
values
(Optional)
Array
placeholder
(Optional)
string
wizard
(Optional)
step
: numberorder
: number
persistent
(Optional)
boolean
readonly
(Optional)
boolean
alert
(Optional)
string
private
(Optional)
boolean
Group Settings
_id
string
hidden
boolean
blocked
boolean
ts
Date
sorter
number
i18nLabel
string
displayQuery
string
i18nDescription
string
value
undefined
type
group
alert
string
Enterprise Settings
enterprise
true
invalidValue
SettingValue
can be one of the following values:
string
boolean
number
SettingValueMultiSelect
Date
AssetValue
undefined
Color Settings
type
color
editor
SettingEditor
packageEditor
(Optional)
SettingEditor
Action Settings
type
action
value
string
actionText
(Optional)
string
Code Settings
type
action
value
string
actionText
(Optional)
string
Asset Settings
type
asset
value
AssetValue
fileConstraints
IRocketChatAssetConstraint
asset
string
SelectOption Settings
key
The type can be:
string
number
i18nLabel
string
Editor Settings
COLOR
color
EXPRESSION
expression
Date Settings
type
Date
value
Date
Statistics Settings
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:
Overwrite Setting
You can overwrite any setting by setting an environment variable prefixed with OOVERWRITE_SETTING_<Setting Id>
.
For example:
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:
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:
Required Wizard Settings
You can force settings to be required on wizard pages by using the SETTINGS_REQUIRED_ON_WIZARD
environment variable.
For example:
Rocket.Chat's use of environmental variables for managing your workspace settings provides a powerful and flexible configuration mechanism.
Last updated