Handle idempotent way the encryption key

This commit is contained in:
Zoltan Papp 2023-10-06 14:37:24 +02:00
parent 672b4c0401
commit d25f543913
2 changed files with 5 additions and 0 deletions

View File

@ -170,6 +170,10 @@ if [ "$NETBIRD_DASH_AUTH_USE_AUDIENCE" = "false" ]; then
export NETBIRD_AUTH_PKCE_AUDIENCE=
fi
# Read the encryption key
encKey=$(grep DataStoreEncryptionKey management.json | awk -F'"' '{$0=$4}1')
export NETBIRD_DATASTORE_ENC_KEY=$encKey
env | grep NETBIRD
envsubst <docker-compose.yml.tmpl >docker-compose.yml

View File

@ -27,6 +27,7 @@
"Password": null
},
"Datadir": "",
"DataStoreEncryptionKey": "$NETBIRD_DATASTORE_ENC_KEY",
"HttpConfig": {
"Address": "0.0.0.0:$NETBIRD_MGMT_API_PORT",
"AuthIssuer": "$NETBIRD_AUTH_AUTHORITY",