Alert supports initial configuration of the Alert application such as configuring authentication, database, providers, and channels using environment variables. What you don’t configure here, you can configure in the Alert GUI.
Environment variable values are only used if there is no configuration data for the corresponding component in the database. Refer to the Environment Variable Classifications to understand how environment variables pertain to Alert configuration data. Edit the docker-compose.local-overrides.yml
file to include the environment variables.
Editing the overrides file
Verify that
alert:
is uncommented from the service section, otherwise uncomment thealert:
ofdocker-compose.local-overrides.yml
.Uncomment
environment:
from the alert service section ofdocker-compose.local-overrides.yml
.Environment variables have the format
- <VARIABLE_NAME>=<VARIABLE_VALUE>
Environment variables are commented out in the
docker-compose.local-overrides.yml
file.Uncomment the environment variables to be used from the
environment:
section of the alert service.
...
Code Block |
---|
alert: environment: - ALERT_HOSTNAME=localhost |
Alert hostname variable
The ALERT_HOSTNAME
environment variable must be specified in order for Alert to generate and use certificates correctly.
Add the
ALERT_HOSTNAME
environment variable. (The value must be the hostname only.)Editing overrides file:
Code Block alert: environment: - ALERT_HOSTNAME=<NEW_HOST_NAME>
Replace
<NEW_HOST_NAME>
with the hostname of the machine on which Alert is installed.
Do not add the protocol or scheme to the value of the variable, for example:
Good format:
ALERT_HOSTNAME=myhost.example.com
Bad format:
ALERT_HOSTNAME=https://myhost.example.com
Alert database variables
There are more environment variables that control how Alert connects to a database, independent of the user and password secrets. These include POSTGRES_DB
in the alertdb service, and ALERT_DB_HOST
, ALERT_DB_PORT
, and ALERT_DB_NAME
in the alert service.
...
Add the
ALERT_DB_HOST
environment variable only if the alertdb service is using a different hostname (The value must be the hostname only of the database.)Editing overrides file:
Code Block alert: environment: - ALERT_DB_HOST=<DB_HOST_NAME>
Replace
<DB_HOST_NAME>
with the hostname of the machine where Postgres is installed.Do not add the protocol, also known as scheme to the value of the variable.
Good:
ALERT_DB_HOST=myhost.example.com
Bad:
ALERT_DB_HOST=https://myhost.example.com
Add the
ALERT_DB_PORT
environment variable if the alertdb service is running on a different port than the defaultEditing overrides file:
Code Block alert: environment: - ALERT_DB_PORT=<DB_PORT>
Replace
<DB_PORT>
with the port used by the Postgres database (default is 5432)
Add the ALERT_DB_NAME environment variable if the
POSTGRES_DB
variable name of thealertdb
service is not the defaultEditing overrides file:
Code Block alert: environment: - ALERT_DB_NAME=<DB_NAME>
Replace
<DB_NAME>
with the name of the database created in Postgres to store Alert data<DB_NAME>
Should match the value in thePOSTGRES_DB
variable of thealertdb
service
Alert logging level variable
To change the logging level of Alert add the following environment variable to the deployment.
Editing overrides file:
Code Block alert: environment: - ALERT_LOGGING_LEVEL=DEBUG
Set the value to one of the following:
DEBUG
ERROR
INFO
TRACE
WARN
Email channel environment variables
A majority of the Email Channel environment variables that can be set are related to JavaMail configuration properties. The JavaMail properties can be found here at JavaMail Properties
...
ALERT_CHANNEL_EMAIL_MAIL_SMTP_HOST
maps tomail.smtp.host
ALERT_CHANNEL_EMAIL_MAIL_SMTP_PORT
maps tomail.smtp.port
Environment variable classifications
There are certain classifications with the environment variables expressed by a specific naming convention: ALERT_<CLASSIFICATION>_<ITEM_NAME>_<CONFIGURATION_PROPERTY>
...
Global Distribution Channel Environment Variables
...
Environment Variable
...
Description
...
Environment Variable | Description | Required |
---|---|---|
ALERT_CHANNEL_EMAIL_MAIL_SMTP_HOST | The host name of the email server to be used for sending emails to recipients. | Yes |
ALERT_CHANNEL_EMAIL_MAIL_SMTP_FROM | The email address of the sender that Alert will use for sending emails. | Yes |
ALERT_CHANNEL_EMAIL_MAIL_SMTP_PORT | The port number of the SMTP server. | No |
ALERT_CHANNEL_EMAIL_MAIL_SMTP_AUTH | Default: false Flag for Alert to use SMTP authentication when connecting to the SMTP server. Setting this true will make username and password required. | No |
ALERT_CHANNEL_EMAIL_MAIL_SMTP_USERNAME | The username for authenticating with the SMTP server. | No |
ALERT_CHANNEL_EMAIL_MAIL_SMTP_PASSWORD | The password for authenticating with the SMTP server. | No |
...