From f738cb43c34e79c6254738aeb18a3579fb35c000 Mon Sep 17 00:00:00 2001 From: Carl Tashian Date: Wed, 18 Aug 2021 13:37:58 -0700 Subject: [PATCH] Make the default provisioner name optional; change DNS names variable name --- docker/entrypoint.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index eb764bd4..1f48c028 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -8,11 +8,7 @@ set -eo pipefail export STEPPATH=$(step path) # List of env vars required for step ca init -declare -ra REQUIRED_INIT_VARS=(DOCKER_STEPCA_INIT_NAME DOCKER_STEPCA_INIT_DNS DOCKER_STEPCA_INIT_EMAIL) - -# optional: -# DOCKER_STEPCA_INIT_PASSWORD (initial CA password) -# DOCKER_STEPCA_INIT_SSH (boolean: given a non-empty value, create an SSH CA) +declare -ra REQUIRED_INIT_VARS=(DOCKER_STEPCA_INIT_NAME DOCKER_STEPCA_INIT_DNS_NAMES) # Ensure all env vars required to run step ca init are set. function init_if_possible () { @@ -40,8 +36,8 @@ function generate_password () { function step_ca_init () { local -a setup_args=( --name "${DOCKER_STEPCA_INIT_NAME}" - --dns "${DOCKER_STEPCA_INIT_DNS}" - --provisioner "${DOCKER_STEPCA_INIT_EMAIL}" + --dns "${DOCKER_STEPCA_INIT_DNS_NAMES}" + --provisioner "${DOCKER_STEPCA_INIT_PROVISIONER_NAME:-admin}" --password-file "${STEPPATH}/password" --address ":9000" ) @@ -61,4 +57,4 @@ if [ ! -f "${STEPPATH}/config/ca.json" ]; then init_if_possible fi -exec "${@}" \ No newline at end of file +exec "${@}"