feat(git): server-configured SSH key and host trust for git_push/git_fetch #7
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!7
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/t-71"
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?
git_pushandgit_fetchnow work out the deck's SSH setup on every call and pass it to git asGIT_SSH_COMMAND. The setup has four parts:OMP_DECK_SSH_PRIVATE_KEY, written to<ssh home>/id_deck.env(0600). A hand-placed<ssh home>/id_deckis used when the variable is unset.<ssh home>/known_hosts(StrictHostKeyChecking=accept-new).OMP_DECK_SSH_KNOWN_HOSTS.BatchMode=yes, so ssh never waits for a password.The SSH home defaults to
<data dir>/ssh;OMP_DECK_SSH_HOMEoverrides it. With noOMP_DECK_SSH_*variable set and noid_deckfile, git and ssh behave exactly as before. When ssh rejects a host key, the error now includes recovery steps.A new Settings → Git section, backed by
GET /api/git/ssh,POST /api/git/ssh/generateandPOST /api/git/ssh/forget:The feature works on Linux and macOS only; on Windows it does nothing. The changes are documented in
docs/configuration.mdanddocs/git-tools.md, with a CHANGELOG entry.Decisions
// Git SSH (git_push / git_fetch)section ofpackages/protocol/src/index.ts, using the same divider header as the existing Forgejo section.ssh-keygen -yorssh-keygen -lfails on the configured key,GET /api/git/sshsets bothpublicKeyandfingerprintto null and reports the error inerror.prepareDeckSshtests are skipped on Windows, sinceprocess.platformcan't be faked reliably and the feature does nothing there.Verification
bun run typecheckat the repo root: protocol, server and web all exit 0.bun testinapps/server: 637 pass, 0 fail. This includes 12 new cases inapps/server/src/bridge/git-tools/ssh.test.ts:<data dir>/sshhome;GIT_SSH_COMMAND;managed-envvsprocess-envas the key source;id_deck.envwhen the key variable is cleared, and falling back to a hand-placedid_deck;ssh-keygen -loutput.planned_label#248