Hi
In the documentation of chirpstack Configuration - ChirpStack open-source LoRaWAN® Network Server documentation it says:
Values in the configuration file can be substituted by environment variables. Example:
[integration.mqtt] server="tcp://$MQTT_BROKER_HOST:1883/" json=true
In the above example,
$MQTT_BROKER_HOST
gets replaced if theMQTT_BROKER_HOST
variable is set, with the value of this environment variable.
But in the documentation of the gateway-bridge Configuration - ChirpStack open-source LoRaWAN® Network Server documentation it says:
Although using the configuration file is recommended, it is also possible to use environment variables to set configuration variables. Configuration dots
.
are replaced with double underscores__
.Example:
[backend.semtech_udp] udp_bind="0.0.0.0:1700"
Can be set using the environment variable:
BACKEND__SEMTECH_UDP__UDP_BIND="0.0.0.0:1700"
If I understand correctly, on the gateway-brigde side, I can omit an entry on the toml file and pass it instead via an environment variable as longs as dots are replaced with double underscores. But does this also apply in the chirpstack service as well?
In chirpstack I want to set the value of the api.secret
in the .env
file (I want to deploy it with docker), so should I do this?
# .env file
API_SECRET=......
---------
# docker-compose.yml
services:
chirpstack:
image: chirpstack/chirpstack:4
...
environment:
...
- API_SECRET=${API_SECRET}
---------------
# configuration/chirpstack/chirpstack.toml
[api]
bind="0.0.0.0:8080"
secret="${API_SECRET}"
or can I also do this?
# .env file
API_SECRET=......
---------
# docker-compose.yml
services:
chirpstack:
image: chirpstack/chirpstack:4
...
environment:
...
- API__SECRET=${API_SECRET}
---------------
# configuration/chirpstack/chirpstack.toml
[api]
bind="0.0.0.0:8080"
# omitting it here, passed via API__SECRET
# secret="${API_SECRET}"
Thanks.