Add skip SSH host key verification and fix self-hosted server support #121
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.
Closes #120
Summary
ssh-keyscanexit code handling that prevented self-hosted Git servers from connectinggit@host:port/path) being parsed incorrectlyRoot Cause Fixes
ssh-keyscan exit code
The
ssh-keyscancommand returns exit code 1 when some key types aren't supported (common on self-hosted servers), even though valid keys are present in stdout. The previous code rejected non-zero exit codes entirely, so the SSH host key dialog never appeared.Fixed by using
ignoreExitCode: trueand parsing stdout for valid key lines regardless of exit code.SCP-style SSH URL port parsing
URLs like
git@ai.lab:2222/repo.gitwere parsed incorrectly - the port2222was treated as part of the path (per SCP syntax rules, the colon is a path separator). This caused SSH to connect on port 22 instead of 2222.Fixed by adding
normalizeSSHUrl()which detects thegit@host:port/pathpattern and converts it to properssh://git@host:port/pathformat before any parsing occurs.New Features
Changes
backend/src/ipc/sshHostKeyHandler.ts- Fix keyscan parsing, add trustForFuture supportbackend/src/utils/git-auth.ts- AddnormalizeSSHUrl()for SCP-style port handlingbackend/src/services/git-auth.ts- Normalize URLs before parsing, branch between auto-accept and interactive verificationbackend/src/services/repo.ts- Normalize URLs at clone entry point, accept skipSSHVerification parambackend/src/routes/repos.ts- Thread skipSSHVerification from request bodyfrontend/src/components/repo/AddRepoDialog.tsx- Add skip verification checkboxfrontend/src/components/ssh/SSHHostKeyDialog.tsx- Add trust for future checkboxshared/src/schemas/repo.ts- Add skipSSHVerification to CreateRepoRequestSchema