mirror of https://github.com/zulip/zulip.git
provisioning: Support non-RSA SSH keys.
Use the parts of the JSON to determine the files it should create.
This commit is contained in:
parent
41f509170b
commit
f0b11d62f6
|
@ -63,10 +63,13 @@ function install_keys() {
|
|||
--secret-id "$SSH_SECRET_ID" \
|
||||
--query SecretString)"
|
||||
mkdir -p "$SSHDIR"
|
||||
echo "$KEYDATA" | jq -r .public | base64 -d >"$SSHDIR/id_rsa.pub"
|
||||
echo "$KEYDATA" | jq -r .private | base64 -d >"$SSHDIR/id_rsa"
|
||||
for KEYFILE in $(echo "$KEYDATA" | jq -r 'keys[]'); do
|
||||
echo "$KEYDATA" | jq -r ".[\"$KEYFILE\"]" | base64 -d >"$SSHDIR/$KEYFILE"
|
||||
if [[ "$KEYFILE" != *".pub" ]]; then
|
||||
chmod 600 "$SSHDIR/$KEYFILE"
|
||||
fi
|
||||
done
|
||||
chown -R "$USERNAME:$USERNAME" "$SSHDIR"
|
||||
chmod 600 "$SSHDIR/id_rsa"
|
||||
}
|
||||
install_keys root
|
||||
|
||||
|
|
Loading…
Reference in New Issue