Repository navigation
Conversation
…in sops A node's identity is now its ed25519 ssh host key, whose age recipient is already in the config as ark.hostKey. headscale-provision mints one reusable pre-auth key per node, encrypts it to that recipient and serves the ciphertext from nginx under /tailnet/; at boot a node fetches its file, decrypts it with its host key (ssh-to-age) and hands it to `tailscale up`. The shared headscale_preauth_key secret, its sqlite import and headscale's legacy plaintext-key path go away, and keys are per node, so one can be expired on its own. The joining side is one module, flake.nixosModules.ark-tailnet, which den.aspects.tailnet wraps for hosts and the sivrad microVM imports directly. The VM gets an ssh host key of its own on a small volume (_vm.nix: sshDir, hostKey); its recipient is read off that volume after its first boot and the host answers for it in ark.tailnet.nodes. Until then the VM boots without joining. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEzZFR72jxE52YHecT3vc7
…adam A VM's disk is its host's to read, so a host key of its own buys the VM nothing on the tailnet: headscale now encrypts sivrad's key to adam's recipient (ark.tailnet.guests), adam's tailnet-authkey fetches it with its own and leaves it in the live credentials share, and the VM waits for it there (ark.tailnet.keyFile). No recipient to read off the VM, no second deploy: `just rebuild-ark` is all adam and sivrad need, and the vps can be deployed before or after; until it serves the keys, adam stays on the tailnet as it is and sivrad keeps trying. The VM keeps its own ssh host key on its volume for a stable ssh identity, which is all it is for now. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEzZFR72jxE52YHecT3vc7
k2on
pushed a commit
that referenced
this pull request
Oct 18, 2026
…behind Kanidm at sivrad.koon.us/browser' (#4) from sivrad/os:chrome-in-container into main
k2on
pushed a commit
that referenced
this pull request
Oct 18, 2026
…watchable over noVNC' (#4) from sivrad/os:chrome-in-container into main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Declarative tailnet joining without a
headscale_preauth_keysecret in sops. A host's identity is its ed25519 ssh host key, whose age recipient is already in the config asark.hostKey. A VM's identity is its host: whatever is on the VM's disk its host can read anyway, so the host answers for it.headscale-provision) mints one reusable pre-auth key per node withheadscale preauthkeys create, encrypts it to the node's recipient withage, and keeps only the ciphertext under/var/lib/tailnet-keys/pub/, which nginx serves athttps://vpn.<domain>/tailnet/<node>.age. The key id and recipient are kept beside it; a changed recipient expires the old key and mints a new one.tailnet-authkeyat boot: it fetches its file, decrypts it with its host key (ssh-to-age -private-key, the same conversion sops-nix does) into/run/tailnet/<host>, andtailscaled-autoconnectuses that. It also fetches the keys of its guests (ark.tailnet.guests, encrypted to the host's recipient) and installs each at the file the guest reads. Retried while headscale does not serve them yet.ark.tailnet.keyFileto where its host leaves the key and waits for it. For sivrad that is/run/host-credentials/tailnet-authkey, in the live virtiofs share adam already uses for the Signal account, so the key shows up in the running VM whenever adam gets it.flake.nixosModules.ark-tailnet.den.aspects.tailnetwraps it for hosts (recipient =ark.hostKey); the sivrad microVM imports it directly throughspecialArgs.ssh.imgvolume (/var/lib/ssh), so its ssh identity survives rebuilds. It is not used for the tailnet.headscale_preauth_keysecret (both declarations), the sqlite insert, and with it the dependence on headscale's legacy plaintext-key path (kept only "for backwards compatibility" since 0.28).The ciphertexts are public by design: only the matching host key opens them, so joining as a node takes its host's ssh host key, exactly as with sops before.
Deploying
No order.
just rebuild-arkis all adam and sivrad need: adam is already on the tailnet and keeps its node key, and both keep retrying until the vps serves their keys. The vps needs the new config once, whenever it gets deployed, since only headscale can mint keys. Deploy it before or after.Afterwards, optional:
headscale preauthkeys list, thenheadscale preauthkeys expire --id <id>for the legacy one. Already-joined nodes keep their node keys.secrets/vars/headscale_preauth_key.yamlin the secrets repo is now unused and can be deleted.known_hostsentry forsivrad.<tailnet domain>will need updating.Not covered: cale still uses
koonFeatureTailscale(interactive OIDC login), as it is a personal laptop rather than an ark host.Verification
The flake could not be evaluated here (the secrets submodule and the
den/nixpkgsinputs are not reachable from this session), so this is parse-checked only. Points worth a look on the first deploy: theheadscale preauthkeys create -o jsonoutput haskeyandidfields as expected for 0.28, andage -dwith thessh-to-age -private-keyidentity opens a file encrypted to thessh-to-agerecipient.🤖 Generated with Claude Code
https://claude.ai/code/session_01YEzZFR72jxE52YHecT3vc7