Skip to content

Commit 2f2ddc2

Browse files
committed
feat(git): support local personal signing keys
1 parent 1a41551 commit 2f2ddc2

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

docs/bootstrap.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,44 @@ Chrome vertical tabs are a local browser preference. Quit Chrome first, then:
159159
./scripts/bootstrap/configure-chrome.sh
160160
```
161161

162+
### Local Git Signing Key
163+
164+
Personal Macs may use an existing 1Password SSH key for autonomous Git signing
165+
without depending on the 1Password SSH agent at commit time. This is a one-time
166+
human bootstrap: open the SSH Key item in 1Password, export its private key in
167+
OpenSSH format without a passphrase, and save it to an owner-only path such as
168+
`~/.ssh/personal_ed25519`. Leaving the export unencrypted is required for
169+
unattended signing and means any process running as the local user can use the
170+
key. Keep 1Password as the recovery copy and do not copy the exported file into
171+
this repository.
172+
173+
Derive the public key and lock the file permissions before configuration:
174+
175+
```zsh
176+
chmod 0600 ~/.ssh/personal_ed25519
177+
ssh-keygen -y -f ~/.ssh/personal_ed25519 > ~/.ssh/personal_ed25519.pub
178+
chmod 0644 ~/.ssh/personal_ed25519.pub
179+
```
180+
181+
Configure the exported key for commit signing and, when the same key is already
182+
registered for GitHub SSH authentication, for GitHub pushes:
183+
184+
```zsh
185+
GIT_SIGNING_KEY="$HOME/.ssh/personal_ed25519.pub" \
186+
GIT_SSH_IDENTITY_FILE="$HOME/.ssh/personal_ed25519" \
187+
./scripts/bootstrap/configure-git.sh --profile personal
188+
```
189+
190+
GitHub tracks authentication and signing registrations separately even when
191+
they contain the same public key. The key must already be present in both roles
192+
for SSH pushes and `Verified` commits to work. This dual-use setup is convenient,
193+
but revoking or rotating the local key affects both operations.
194+
195+
The generated Git config signs directly from the local key. The generated
196+
`~/.ssh/config.local` block uses the same key for `github.com` without routing
197+
through the 1Password agent. Other SSH hosts keep their existing agent or
198+
host-specific configuration.
199+
162200
Verify:
163201

164202
```zsh

scripts/bootstrap/configure-git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ fi
300300
install -m 0600 "$tmp" "$gitconfig_local"
301301
printf 'wrote %s\n' "$gitconfig_local"
302302

303-
if [ "$profile" = "devbox" ]; then
303+
if [ -n "$git_ssh_identity_file" ]; then
304304
write_github_ssh_config "$git_ssh_identity_file"
305305
fi
306306

0 commit comments

Comments
 (0)