Environment Variables
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.
Example:
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:
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.
Change the
POSTGRES_DB
in thealertdb
service if you want to use a different database nameEditing the overrides file:
alertdb: # Comment or remove the POSTGRES_USER and POSTGRES_PASSWORD if secrets are used for credentials. environment: - POSTGRES_DB=<DB_NAME>
Replace
<DB_NAME>
with the name of the database to create in Postgres to store Alert data.
The following variables in the overrides file are under the yaml # -- Database Settings
comment in the alert service section.
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:
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:
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:
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:
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
The Email Channel environment variables have a prefix of
ALERT_CHANNEL_EMAIL_
The remaining portion of the variable, after the prefix, map to the JavaMail properties if the
'_'
character is replaced with'.'
Examples:
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>
Provider: The environment variables to configure these components start with
ALERT_PROVIDER_
Channel: The environment variables to configure these components start with
ALERT_CHANNEL_
Component: The environment variables to configure these components start with
ALERT_COMPONENT_
Examples
The following are some examples of what can be set. the blackduck-alert.env file has a more comprehensive list.
Provider:
ALERT_PROVIDER_BLACKDUCK_BLACKDUCK_URL=
The URL for the Black Duck server.
Channel:
ALERT_CHANNEL_JIRA_CLOUD_JIRA_CLOUD_URL=
The URL for the Jira Cloud server.ALERT_CHANNEL_EMAIL_MAIL_SMTP_HOST=
The SMTP host used to send email messages.
Component:
ALERT_COMPONENT_AUTHENTICATION_SETTINGS_LDAP_ENABLED=
Boolean to determine if LDAP authentication is used.
Global Distribution Channel Environment Variables
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 |
Jira Server
Environment Variable | Description | Required |
---|---|---|
ALERT_CHANNEL_JIRA_SERVER_JIRA_SERVER_URL | The url of the Jira Server instance. | Yes |
ALERT_CHANNEL_JIRA_SERVER_JIRA_SERVER_USERNAME | The username of the Jira Server user. Note: Unless 'Disable Plugin Check' is checked, the user must be a Jira admin. | No |
ALERT_CHANNEL_JIRA_SERVER_JIRA_SERVER_PASSWORD | The password of the specified Jira Server user. | No |
ALERT_CHANNEL_JIRA_SERVER_JIRA_SERVER_DISABLE_PLUGIN_CHECK | Default: false This will disable checking whether the 'Alert Issue Property Indexer' plugin is installed on the specified Jira instance. Please ensure that the plugin is manually installed before using Alert with Jira. If not, issues created by Alert will not be updated properly. | No |
Settings Environment Variables
More detailed information regarding encryption and proxy can be found in: https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/520618019
Encryption
Environment Variable | Description | Required |
---|---|---|
ALERT_ENCRYPTION_PASSWORD | Used to encrypt the data. It can be any alphanumeric string of eight characters or greater. | No |
ALERT_ENCRYPTION_GLOBAL_SALT | The salt appended to the sensitive information before it is encrypted. | No |
Proxy
Environment Variable | Description | Required |
---|---|---|
ALERT_COMPONENT_SETTINGS_SETTINGS_PROXY_HOST | The host name of the proxy server that will be used for all connections to external systems. | Yes |
ALERT_COMPONENT_SETTINGS_SETTINGS_PROXY_PORT | The port number of the proxy server. | No |
ALERT_COMPONENT_SETTINGS_SETTINGS_PROXY_USERNAME | The username for authenticating with the proxy server. | No |
ALERT_COMPONENT_SETTINGS_SETTINGS_PROXY_PASSWORD | The password for authenticating with the proxy server. | No |
©2023 Synopsys, Inc. All Rights Reserved