Skip to content

Env Vars

Malwatch provides support for environment variables across almost every cfg variable. Shown below is how they are mapped:

cfg/cfg.toml

Cfg Variable Env Variable
Identifier IDENTIFIER
Cores CORES
Threads THREADS

cfg/secrets.toml

Cfg Variable Env Variable
PagerDuty.Token PD_TOKEN
SMTP.Hostname SMTP_HOSTNAME
SMTP.Port SMTP_PORT
SMTP.User SMTP_USER
SMTP.Pass SMTP_PASS
JSON.User JSON_USER
JSON.Pass JSON_PASS
S3.Endpoint S3_ENDPOINT
S3.Region S3_REGION
S3.Bucket S3_BUCKET
S3.Key S3_KEY
S3.Secret S3_SECRET

Secrets for git are uniquely defined based on their index within the configuration. For example:

Cfg Variable Env Variable
Git.Endpoint GIT_0_ENDPOINT
Git.User GIT_0_USER
Git.Token GIT_0_TOKEN
Cfg Variable Env Variable
Git.Endpoint GIT_1_ENDPOINT
Git.User GIT_1_USER
Git.Token GIT_1_TOKEN

Above would be the equivalent of:

[[GIT]]
  Endpoint = GIT_0_ENDPOINT
  User = GIT_0_USER
  Token = GIT_0_TOKEN

[[GIT]]
  Endpoint = GIT_1_ENDPOINT
  User = GIT_1_USER
  Token = GIT_1_TOKEN

Each additional repo has an increment in the env variable relative to its index position in the cfg.