From 66a730733dc9965ebd223333ba3cc200f688c4cc Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Thu, 28 Jul 2022 01:05:09 +0700 Subject: [PATCH] fix --- data/helpers/init.sh | 4 +++- start.sh | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/helpers/init.sh b/data/helpers/init.sh index 2035fad..a84157e 100644 --- a/data/helpers/init.sh +++ b/data/helpers/init.sh @@ -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 diff --git a/start.sh b/start.sh index f7c848c..655808b 100755 --- a/start.sh +++ b/start.sh @@ -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"