Refactor password file creation and cleanup
This commit is contained in:
parent
aa47bca5c4
commit
afd10e2516
@ -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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user