runner: sync SSH keys from Forgejo instead of hardcoding them #3
Loading…
Reference in a new issue
No description provided.
Delete branch "ssh-keys-from-forgejo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The template carried two hardcoded public keys that had gone stale — neither is on the Forgejo account any more, so a freshly provisioned runner was only reachable with old keys.
Now nothing is baked in.
/usr/local/sbin/sync-ssh-keysmirrorshttps://git.kristofferopsahl.com/kristofferopsahl.keysintokristoffer'sauthorized_keysduring provisioning (retried for ~5 min) and then hourly viasync-ssh-keys.timer. A failed, empty or malformed download leaves the last good file in place, so a Forgejo outage never locks anyone out.Tested on the live
ci-grantory-01with the exact script and units from this template: failure path leaves the file untouched; a real sync yields the three keys from Forgejo; fresh login + sudo still work. Not tested: a from-scratch cloud-init provision with this template (YAML parses, script passessh -n).Consequence to be aware of: whoever controls the SSH keys on that Forgejo account has sudo on the runners.
🤖 Generated with Claude Code