Use vault

This commit is contained in:
2024-04-14 11:22:35 +02:00
parent 45c567410e
commit ba8612b990
3 changed files with 22 additions and 2 deletions

12
scripts/env.sh Normal file
View File

@@ -0,0 +1,12 @@
#! /usr/bin/env sh
response=`curl -X 'GET' "https://$VAULT_HOST/v1/$VAULT_SECRET_PATH" -s \
-H 'accept: application/json' \
-H "X-Vault-Token: $VAULT_TOKEN"`
data=`echo $response | jq -r '.data.data'`
for key in $(echo "$data" | jq -r 'keys[]'); do
value=$(echo "$data" | jq -r ".\"$key\"") # Corrected syntax
echo "$key"="$value"
done

5
scripts/start.sh Normal file
View File

@@ -0,0 +1,5 @@
#! /usr/bin/env sh
export $(/env.sh)
exec /usr/local/bin/book_library_server