This commit is contained in:
Vassiliy Yegorov
2022-07-28 01:05:09 +07:00
parent 8a786f7861
commit 66a730733d
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
apk add jq curl
VAULT_HOST=0.0.0.0:8200
root_token=$(cat /helpers/keys.json | jq -r '.root_token')
unseal_vault() {
@@ -14,7 +16,7 @@ then
unseal_vault
else
echo "Vault not initialized"
curl -s --request POST --data '{"secret_shares": 1, "secret_threshold": 1}' ${VAULT_HOST}/v1/sys/init > /helpers/keys.json
curl -s --request POST --data '{"secret_shares": 1, "secret_threshold": 1}' http://${VAULT_HOST}/v1/sys/init > /helpers/keys.json
root_token=$(cat /helpers/keys.json | jq -r '.root_token')
unseal_vault

View File

@@ -5,12 +5,10 @@
exit 1
}
source .env
docker compose up -d
while [[ ! $(docker inspect -f {{.State.Health.Status}} vault) == "healthy" ]]; do
sleep 0.5;
done
docker exec vault /bin/sh -c "export VAULT_HOST=${VAULT_HOST} && source /helpers/init.sh"
docker exec vault /bin/sh -c "source /helpers/init.sh"