Skip to content

Environment Variables

Some env variables are secrets and are marked as secret. See the next section for a definition of a secret env variable.

Database

  • MARIADB_PORT: MariaDB service port, defaults to 3306
  • MARIADB_ROOT_PASSWORD: secret Root password for database.
  • MARIADB_USER: Username of the database
  • MARIADB_PASSWORD: secret Password of MARIADB_USER
  • MARIADB_DATABASE: Name of the database
  • MARIADB_HOST: Database host

Api

  • API_PORT: Port where the backend API listens to
  • MQTT_BROKER_URL: URL of MQTT Broker where the backend API connects to

Grafana

  • GRAFANA_PORT: Port where Grafana listens to
  • GRAFANA_USER: Grafana username
  • GRAFANA_PASSWORD: secret Grafana password

Generating Secure Secrets

Every secret (password) should be a cryptographically strong 32 byte hex string. An example would be aa19eed475700617f31d41ba4ccc2a57a501e314700f93fbb9d8c4e24b7970ed

If you are on linux you can generate one with the following command:

1
openssl rand -hex 32

On windows its the following Powershell code:

1
2
3
4
5
ForEach-Object {
    $bytes = New-Object byte[] 32
    [System.Security.Cryptography.RandomNumberGenerator]::Fill($bytes)
    ($bytes | ForEach-Object ToString x2) -join ''
}

Env variables and gitlab

  • TODO: write about gitlab variables when a pipeline is setup