Skip to content

Conversation

@chriswritescode-dev
Copy link
Owner

@chriswritescode-dev chriswritescode-dev commented Feb 11, 2026

Closes #120

Summary

  • Fix ssh-keyscan exit code handling that prevented self-hosted Git servers from connecting
  • Fix SCP-style SSH URLs with custom ports (git@host:port/path) being parsed incorrectly
  • Add "Skip SSH host key verification" checkbox in Add Repository dialog
  • Add "Trust for future connections" checkbox in SSH host key verification dialog
  • Move GitCredential type to shared package for better code organization

Root Cause Fixes

ssh-keyscan exit code

The ssh-keyscan command 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: true and parsing stdout for valid key lines regardless of exit code.

SCP-style SSH URL port parsing

URLs like git@ai.lab:2222/repo.git were parsed incorrectly - the port 2222 was 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 the git@host:port/path pattern and converts it to proper ssh://git@host:port/path format before any parsing occurs.

New Features

  • Skip SSH Verification checkbox on Add Repository form - auto-accepts host keys for self-hosted/internal Git servers
  • Trust for future checkbox on SSH host key dialog - persists trust so the dialog doesn't appear again

Changes

  • backend/src/ipc/sshHostKeyHandler.ts - Fix keyscan parsing, add trustForFuture support
  • backend/src/utils/git-auth.ts - Add normalizeSSHUrl() for SCP-style port handling
  • backend/src/services/git-auth.ts - Normalize URLs before parsing, branch between auto-accept and interactive verification
  • backend/src/services/repo.ts - Normalize URLs at clone entry point, accept skipSSHVerification param
  • backend/src/routes/repos.ts - Thread skipSSHVerification from request body
  • frontend/src/components/repo/AddRepoDialog.tsx - Add skip verification checkbox
  • frontend/src/components/ssh/SSHHostKeyDialog.tsx - Add trust for future checkbox
  • shared/src/schemas/repo.ts - Add skipSSHVerification to CreateRepoRequestSchema
  • Moved GitCredential interface to shared package, updated all imports

@chriswritescode-dev chriswritescode-dev changed the title Add SSH host key trust for future option and move GitCredential to shared types Add skip SSH host key verification and fix self-hosted server support Feb 11, 2026
- Add error handling for auto-accept mode with user-friendly messages
- Improve normalizeSSHUrl to skip already-normalized ssh:// URLs
- Reorder SSH dialog trust checkbox to appear after key details
- Remove duplicate SSH schema definition
- Normalize indentation in sshHostKeyHandler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Private Git repositories support

1 participant