Skip to content

Environment Variables

Environment Variables

You can use environment variables to substitute parts of your nzyme-node and nzyme-tap configuration files. This can be very useful for dynamic deployments in container environments or similar situations.

To substitute a part of your configuration files, you can use the following syntax:

${ENV_VARIABLE_NAME} 

It would look like this in a nzyme-node configuration file:

interfaces: {
  rest_listen_uri: "https://"${REST_LISTEN_URI_HOST}":22900/"
  http_external_uri: ${HTTP_EXTERNAL_URI}
}

Warning

The node configuration syntax expects environment variables outside of double quotes like you see in the example.

A nzyme-tap configuration file would look like this:

[general]
leader_secret = "${NZYME_LEADER_SECRET}"
leader_uri = "https://nzyme.example.org:22900/"
accept_insecure_certs = ${ACCEPT_INSECURE_CERTS}

[wifi_interfaces.${ADAPTER_1_NAME}]
active = ${ADAPTER_1_ACTIVE}
channels_2g = ${ADAPTER_1_2G_CHANNELS}
channels_5g = ${ADAPTER_1_5G_CHANNELS}
channels_6g = ${ADAPTER_1_6G_CHANNELS}

[wifi_interfaces.${ADAPTER_2_NAME}]
active = ${ADAPTER_2_ACTIVE}
channels_2g = ${ADAPTER_2_2G_CHANNELS}
channels_5g = ${ADAPTER_2_5G_CHANNELS}
channels_6g = ${ADAPTER_2_6G_CHANNELS}

[performance]
ethernet_brokers = 1
wifi_brokers = 1
wifi_broker_buffer_capacity = ${PERF_WIFI_BROKER_CAPACITY}
ethernet_broker_buffer_capacity = 65535

Note that you can replace any part of a variable if needed. The boot process of nzyme-node or nzyme-tap will abort if a referenced environment variable is not set.