Skip to content

Commit 3d10380

Browse files
committed
refactor(git): support local signing only
1 parent a6030b0 commit 3d10380

8 files changed

Lines changed: 83 additions & 266 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ GIT_SIGNING_KEY="$HOME/.ssh/devbox-key" \
7575
./scripts/bootstrap/configure-git.sh --profile devbox --non-interactive
7676
```
7777

78-
Only set `OP_SSH_VAULT` for human-operated machines where the 1Password SSH
79-
agent is installed and reachable from the relevant shell/session.
78+
Commit signing supports one unattended mode: an unencrypted local SSH private
79+
key plus the agentless signer installed by `scripts/bootstrap/install.sh`.
8080

8181
Do not put identity-specific values in tracked files. `configure-git.sh` writes
8282
them to `~/.gitconfig.local`. On devboxes, use the human-provisioned local SSH

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pins.
7272

7373
Keep these out of Git:
7474

75-
- Git identity, signing keys, and 1Password SSH agent vault selection.
75+
- Git identity and signing keys.
7676
- Infisical workspace/project auth and 1Password human vault references.
7777
- SSH private keys, certificates, Tizen archives, and device keys.
7878
- Codex auth, Browser approvals, sessions, caches, worktrees, and app state.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
unset SSH_AUTH_SOCK
3+
exec /usr/bin/ssh-keygen "$@"

docs/bootstrap.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,11 @@ they contain the same public key. The key must already be present in both roles
192192
for SSH pushes and `Verified` commits to work. This dual-use setup is convenient,
193193
but revoking or rotating the local key affects both operations.
194194

195-
The generated Git config signs directly from the local private key. For an
196-
unencrypted local key, setup installs an owner-only signing program under
197-
`~/.local/libexec/uinaf/` and configures Git to clear `SSH_AUTH_SOCK` before it
198-
invokes `ssh-keygen`, so an ambient SSH agent is not consulted at commit time.
199-
When the supplied signing public key matches an unencrypted
200-
`GIT_SSH_IDENTITY_FILE`, setup writes the validated private key path to Git
201-
automatically. Encrypted identities retain the public signing key for
202-
agent-backed signing. Setting `OP_SSH_VAULT` selects the matching `.pub` file
203-
and the 1Password signing program instead. The generated
195+
The generated Git config signs directly from the unencrypted local private key.
196+
The dotfile install provides an owner-only signing program under
197+
`~/.local/libexec/uinaf/`; Git uses it to clear `SSH_AUTH_SOCK` before invoking
198+
`ssh-keygen`, so ambient agents are never part of commit signing. Encrypted,
199+
public-key-only, and 1Password-backed signing are unsupported. The generated
204200
`~/.ssh/github.config` block uses the same key for `github.com` without routing
205201
through the 1Password agent. The tracked SSH entrypoint includes that dedicated
206202
file before the untouched `~/.ssh/config.local`, so local global directives and
@@ -258,8 +254,8 @@ GIT_SIGNING_KEY="$HOME/.ssh/devbox-key" \
258254
./scripts/bootstrap/configure-git.sh --profile devbox --non-interactive
259255
```
260256

261-
Only set `OP_SSH_VAULT` on human-operated machines where the 1Password SSH
262-
agent is installed and reachable from that shell/session.
257+
Commit signing requires a human-provisioned, owner-only, unencrypted local SSH
258+
private key. Agent-backed signing is unsupported.
263259

264260
Devbox Git config writes identity and `/opt/homebrew` Git safe-directory state
265261
to `~/.gitconfig.local`, not to the tracked shared config. When

docs/chezmoi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Use chezmoi source attributes instead of literal target filenames:
1414
| `chezmoi/dot_gitconfig` | `~/.gitconfig` |
1515
| `chezmoi/private_dot_config/mise/config.toml` | `~/.config/mise/config.toml` |
1616
| `chezmoi/private_dot_ssh/private_config` | `~/.ssh/config` |
17+
| `chezmoi/private_dot_local/private_libexec/private_uinaf/private_executable_git-ssh-sign-agentless` | `~/.local/libexec/uinaf/git-ssh-sign-agentless` |
1718
| `chezmoi/private_dot_config/zed/private_settings.json` | `~/.config/zed/settings.json` |
1819

1920
The `private_` attribute is used for parent config directories and files that

0 commit comments

Comments
 (0)