mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-28 13:48:49 +08:00

Integrates Vault PKI service as a service addon. Also adds some helper scripts to help setup the CA in Vault, as well as some docs to explain how to use them. Originally based from https://github.com/mteodor/vault. Signed-off-by: Joao Matos <joao@tritao.eu> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
23 lines
522 B
Bash
23 lines
522 B
Bash
#!/usr/bin/dumb-init /bin/sh
|
|
|
|
VAULT_CONFIG_DIR=/vault/config
|
|
|
|
docker-entrypoint.sh server &
|
|
VAULT_PID=$!
|
|
|
|
sleep 2
|
|
|
|
echo $MF_VAULT_UNSEAL_KEY_1
|
|
echo $MF_VAULT_UNSEAL_KEY_2
|
|
echo $MF_VAULT_UNSEAL_KEY_3
|
|
|
|
if [[ ! -z "${MF_VAULT_UNSEAL_KEY_1}" ]] &&
|
|
[[ ! -z "${MF_VAULT_UNSEAL_KEY_2}" ]] &&
|
|
[[ ! -z "${MF_VAULT_UNSEAL_KEY_3}" ]]; then
|
|
echo "Unsealing Vault"
|
|
vault operator unseal ${MF_VAULT_UNSEAL_KEY_1}
|
|
vault operator unseal ${MF_VAULT_UNSEAL_KEY_2}
|
|
vault operator unseal ${MF_VAULT_UNSEAL_KEY_3}
|
|
fi
|
|
|
|
wait $VAULT_PID |