Fix remaining gaps in remote commit signing via forwarded SSH agent - #136
Merged
Conversation
The LaunchAgent previously set the session-wide SSH_AUTH_SOCK default straight to Secretive's socket, so any process that never sources .zshrc (GUI apps, tools that spawn non-interactive shells, including Claude Code's own tool calls) stayed on the local agent even with a live forwarded connection. Now it points at the same stable symlink zshrc.symlink uses, seeding it to the local socket on first run in case no shell has initialized it yet.
git commit -S needs the exact public key to ask the agent for, and signingkey was hardcoded per machine, so signing only ever worked with whichever key happened to live on that specific host, even when SSH_AUTH_SOCK correctly pointed at a forwarded agent. Now agent.pub tracks whichever key is actually active, captured from the forwarded agent when one is live and from user.localSigningKey (a new, machine-specific gitconfig setting) otherwise. user.signingkey then points at agent.pub instead of a fixed key file.
signingkey and the gpg/commit sections were previously set up by hand on each machine outside of bootstrap. Four of those five settings are now identical everywhere (signingkey points at the agent.pub indirection rather than a fixed key file), so the template bakes them in directly. localSigningKey is the one value that's genuinely machine-specific: bootstrap finds it by looking for a .pub file under Secretive's PublicKeys directory, falling back to a placeholder with instructions when no key exists yet.
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
Follow-up to #135. Live testing surfaced two remaining gaps that kept commit signing from actually routing through a forwarded agent, plus a bootstrap improvement discovered along the way.
SSH_AUTH_SOCKdefault pointed straight at Secretive's socket, so any process that never sources.zshrc(GUI apps, tools that spawn non-interactive shells, including Claude Code's own tool calls) stayed on the local agent even with a live forwarded connection. It now points at the sameagent.socksymlinkzshrc.symlinkmaintains, seeding it to the local socket on first run.git commit -Sneeds the exact public key to ask the agent for, andsigningkeywas hardcoded per machine, so signing only worked with whichever key lived on that specific host, even onceSSH_AUTH_SOCKcorrectly pointed at a forwarded agent.agent.pubnow tracks whichever key is actually active, captured from the forwarded agent when one is live and from a newuser.localSigningKeygitconfig setting otherwise.signingkeypoints at theagent.pubindirection;localSigningKeyis discovered by looking for a.pubfile under Secretive'sPublicKeysdirectory, falling back to a placeholder when no key exists yet.Test plan
GitHub@secretive.Phil's-MacBook-Neo.local, confirmed viagit log --show-signature.SSH_AUTH_SOCKdefault without needing.zshrcto run.git/gitconfig.local.symlink) and confirmsetup_gitconfigproduces a working config, including the no-key-yet placeholder path.