Refactor password file creation and cleanup

This commit is contained in:
Joerg Heinemann 2026-02-03 17:18:46 +01:00 committed by GitHub
parent aa47bca5c4
commit afd10e2516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,8 +61,7 @@ EncryptionPwdDir="$(step path)/encryption"
PwdFile="$EncryptionPwdDir/ca.pwd" PwdFile="$EncryptionPwdDir/ca.pwd"
ProvisionerPwdFile="$EncryptionPwdDir/provisioner.pwd" ProvisionerPwdFile="$EncryptionPwdDir/provisioner.pwd"
$STD mkdir -p "$EncryptionPwdDir" mkdir -p "$EncryptionPwdDir"
$STD gpg --gen-random --armor 2 32 >"$PwdFile" $STD gpg --gen-random --armor 2 32 >"$PwdFile"
$STD gpg --gen-random --armor 2 32 >"$ProvisionerPwdFile" $STD gpg --gen-random --armor 2 32 >"$ProvisionerPwdFile"
@ -77,16 +76,9 @@ $STD step ca init \
--password-file="$PwdFile" \ --password-file="$PwdFile" \
--provisioner-password-file="$ProvisionerPwdFile" --provisioner-password-file="$ProvisionerPwdFile"
echo ln -s "$PwdFile" "$(step path)/password.txt"
echo "Make a note of the root fingerprint!"
echo "You'll need it in future steps to establish trust with your CA from other environments or hosts."
echo
$STD ln -s "$PwdFile" "$(step path)/password.txt"
chown -R step:step $(step path) chown -R step:step $(step path)
chmod -R 700 $(step path) chmod -R 700 $(step path)
msg_ok "Initialized step-ca" msg_ok "Initialized step-ca"
msg_info "Add ACME provisioner" msg_info "Add ACME provisioner"