From 7f54153a1be89de236864856d3e45e673da6c20d Mon Sep 17 00:00:00 2001 From: francescocapuano Date: Wed, 10 May 2023 14:11:41 +0200 Subject: [PATCH] Add DOCKER_STEPCA_INIT_PASSWORD_FILE variable for docker secrets Add the management of the DOCKER_STEPCA_INIT_PASSWORD_FILE variable. over DOCKER_STEPCA_INIT_PASSWORD. If both are used only DOCKER_STEPCA_INIT_PASSWORD_FILE will be used. --- docker/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 93312ca8..33a14b4d 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -46,7 +46,10 @@ function step_ca_init () { --provisioner-password-file "${STEPPATH}/provisioner_password" --address "${DOCKER_STEPCA_INIT_ADDRESS}" ) - if [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then + if [ -n "${DOCKER_STEPCA_INIT_PASSWORD_FILE}" ]; then + cat < "${DOCKER_STEPCA_INIT_PASSWORD_FILE}" > "${STEPPATH}/password" + cat < "${DOCKER_STEPCA_INIT_PASSWORD_FILE}" > "${STEPPATH}/provisioner_password" + elif [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/password" echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/provisioner_password" else