Docker and network server configuration file

Hi there

Trying to deploy the network server using docker.
Even updating the env vars, it seems the container does not take it.

My composer:

version: "2"
services:
  chirpstack-network-server:
    image: chirpstack/chirpstack-network-server
    environment:
      - DB_AUTOMIGRATE=true
      - NET_ID=010203
      - BAND=AU_915_928
      - REDIS_URL=redis://redis:6379
      - GW_MQTT_SERVER=tcp://mosquitto:1883
      - GW_SERVER_JWT_SECRET=**VERYVERYSECRET**

As simple as that.
However, in my logs I get:

19/02/2020 12:08:01WARN[0000] No configuration file found, using defaults. See: https://www.chirpstack.io/network-server/install/config/
19/02/2020 12:08:01INFO[0000] starting ChirpStack Network Server            band=EU_863_870 docs="https://www.chirpstack.io/" net_id=000000 version=3.7.0-5-g69d47bd

Is there a dictionary about env vars ?

Where does the configuration file must be locate on docker image ?

None of those environment variables have the proper prefixes on them. Check out https://github.com/brocaar/chirpstack-docker for an example of switching between config file format and ENV var. For example, BAND should be NETWORK_SERVER.BAND.NAME.

Great. That was what I was looking for.

May I assume same rule for all ?
i.e.

[general]
log_level=4

Would be
GENERAL.LOG_LEVEL = 4

and so ?

Correct. Although I just realized the syntax in the -env file needs an update, it will currently throw a warning when using . instead of __ (double underscore). I will PR that.

1 Like

As I use Rancher, just made a little job for those who need the env vars table, it is not exhaustive as for the frequency I use there is no extra channel configs.
Hope it can save someone’s time

GENERAL__LOG_LEVEL=4
POSTGRESQL__DSN="postgres://loraserver_ns:password*@localhost/loraserver_ns?sslmode=disable"
POSTGRESQL__AUTOMIGRATE=true
REDIS__URL="redis://localhost:6379"
REDIS__MAX_IDLE=10
REDIS__IDLE_TIMEOUT=5m0s
NETWORK_SERVER__NET_ID=000000
NETWORK_SERVER__DEDUPLICATION_DELAY=200ms
NETWORK_SERVER__DEVICE_SESSION_TTL=744h0m0s
NETWORK_SERVER__GET_DOWNLINK_DATA_DELAY=100ms
NETWORK_SERVER__BAND__NAME=AU_915_928
NETWORK_SERVER__BAND__DWELL_TIME_400ms=false
NETWORK_SERVER__BAND__REPEATER_COMPATIBLE=false
NETWORK_SERVER__NETWORK_SETTINGS__INSTALLATION_MARGIN=10
NETWORK_SERVER__NETWORK_SETTINGS__RX_WINDOW=0
NETWORK_SERVER__NETWORK_SETTINGS__RX1_DELAY=1
NETWORK_SERVER__NETWORK_SETTINGS__RX1_DR_OFFSET=0
NETWORK_SERVER__NETWORK_SETTINGS__RX2_DR=-1
NETWORK_SERVER__NETWORK_SETTINGS__RX2_FREQUENCY=-1
NETWORK_SERVER__NETWORK_SETTINGS__DOWNLINK_TX_POWER=-1
NETWORK_SERVER__NETWORK_SETTINGS__DISABLE_MAC_COMMANDS=false
NETWORK_SERVER__NETWORK_SETTINGS__DISABLE_ADR=false
NETWORK_SERVER__NETWORK_SETTINGS__CLASS_B__PING_SLOT_DR=0
NETWORK_SERVER__NETWORK_SETTINGS__CLASS_B__PING_SLOT_FREQUENCY=0
NETWORK_SERVER__NETWORK_SETTINGS__REJOIN_REQUEST__ENABLE=false
NETWORK_SERVER__NETWORK_SETTINGS__REJOIN_REQUESTMAX_COUNT_N=0
NETWORK_SERVER__NETWORK_SETTINGS__REJOIN_REQUEST__MAX_TIME_N=0
NETWORK_SERVER__SCHEDULER__SCHEDULER_INTERVAL=1s
NETWORK_SERVER__SCHEDULER__CLASS_C__DOWNLINK_LOCK_DURATION=2s
NETWORK_SERVER__API__BIND="0.0.0.0:8000"
NETWORK_SERVER__API__CA_CERT=""
NETWORK_SERVER__API__TLS_CERT=""
NETWORK_SERVER__API__TLS_KEY=""
NETWORK_SERVER__GATEWAY__BACKEND__TYPE=mqtt
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__UPLINK_TOPIC_TEMPLATE="gateway/+/rx"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__DOWNLINK_TOPIC_TEMPLATE="gateway/{{ .MAC }}/tx"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__STATS_TOPIC_TEMPLATE="gateway/+/stats"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__ACK_TOPIC_TEMPLATE="gateway/+/ack"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__CONFIG_TOPIC_TEMPLATE="gateway/{{ .MAC }}/config"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__SERVER="tcp://localhost:1883"
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__USERNAME=""
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__PASSWORD=""
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__QOS=0
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__CLEAN_SESSION=true
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__CLIENT_ID=""
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__CA_CERT=""
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__TLS_CERT=""
NETWORK_SERVER__GATEWAY__BACKEND__MQTT__TLS_KEY=""
METRICS__TIMEZONE=America/Sao_Paulo
METRICS__REDIS__AGGREGATION_INTERVALS=["MINUTE", "HOUR", "DAY", "MONTH"]
METRICS__MINUTE_AGGREGATION_TTL=2h0m0s
METRICS__HOUR_AGGREGATION_TTL=48h0m0s
METRICS__DAY_AGGREGATION_TTL=2160h0m0s
METRICS__MONTH_AGGREGATION_TTL=17520h0m0s
JOIN_SERVER__RESOLVE_JOIN_EUI=false
JOIN_SERVER__RESOLVE_DOMAIN_SUFFIX=".joineuis.lora-alliance.org"
JOIN_SERVER__DEFAULT__SERVER="http://localhost:8003"
JOIN_SERVER__DEFAULT__CA_CERT=""
JOIN_SERVER__DEFAULT__TLS_CERT=""
JOIN_SERVER__DEFAULT__TLS_KEY=""
NETWORK_CONTROLLER__SERVER=""
NETWORK_CONTROLLER__CA_CERT=""
NETWORK_CONTROLLER__TLS_CERT=""
NETWORK_CONTROLLER__TLS_KEY=""