chore: serialize ssh bootstrap key repairs
This commit is contained in:
committed by
GitHub
parent
439021f798
commit
31abf40722
@@ -44,6 +44,14 @@ lib.mkIf userExists {
|
||||
set -eu
|
||||
|
||||
PASSPHRASE=$(cat /var/lib/secrets/ssh-passphrase)
|
||||
lock_dir="${keyPath}.lock"
|
||||
|
||||
if ! mkdir "$lock_dir"; then
|
||||
echo "Factory SSH key setup is already running." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rmdir "$lock_dir"' EXIT
|
||||
|
||||
generate_factory_key() {
|
||||
ssh-keygen -q -N "$PASSPHRASE" -t ed25519 -f "${keyPath}"
|
||||
|
||||
Reference in New Issue
Block a user