Print admin username and pw after init

This commit is contained in:
Carl Tashian 2023-01-10 09:57:47 -08:00
parent 328276eaeb
commit dc8b196823
No known key found for this signature in database

View file

@ -34,12 +34,16 @@ function generate_password () {
# Initialize a CA if not already initialized # Initialize a CA if not already initialized
function step_ca_init () { function step_ca_init () {
DOCKER_STEPCA_INIT_PROVISIONER_NAME="${DOCKER_STEPCA_INIT_PROVISIONER_NAME:-admin}"
DOCKER_STEPCA_INIT_ADMIN_SUBJECT="${DOCKER_STEPCA_INIT_ADMIN_SUBJECT:-step}"
local -a setup_args=( local -a setup_args=(
--name "${DOCKER_STEPCA_INIT_NAME}" --name "${DOCKER_STEPCA_INIT_NAME}"
--dns "${DOCKER_STEPCA_INIT_DNS_NAMES}" --dns "${DOCKER_STEPCA_INIT_DNS_NAMES}"
--provisioner "${DOCKER_STEPCA_INIT_PROVISIONER_NAME:-admin}" --provisioner "${DOCKER_STEPCA_INIT_PROVISIONER_NAME}"
--password-file "${STEPPATH}/password" --password-file "${STEPPATH}/password"
--provisioner-password-file "${STEPPATH}/provisioner_password" --provisioner-password-file "${STEPPATH}/provisioner_password"
--admin-subject "${DOCKER_STEPCA_INIT_ADMIN_SUBJECT}"
--address ":9000" --address ":9000"
) )
if [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then if [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then
@ -61,7 +65,7 @@ function step_ca_init () {
step ca init "${setup_args[@]}" step ca init "${setup_args[@]}"
echo "" echo ""
if [ -n "${DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT}" ]; then if [ -n "${DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT}" ]; then
echo "👉 Your CA administrative username is: step" echo "👉 Your CA administrative username is: ${DOCKER_STEPCA_INIT_ADMIN_SUBJECT}"
fi fi
echo "👉 Your CA administrative password is: $(< $STEPPATH/provisioner_password )" echo "👉 Your CA administrative password is: $(< $STEPPATH/provisioner_password )"
echo "🤫 This will only be displayed once." echo "🤫 This will only be displayed once."