sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.27k forks source link

Support SSH cloning natively #56093

Open eseliger opened 1 year ago

eseliger commented 1 year ago

Today, we kind of support cloning via SSH from various code hosts. For gitolite, this is even the only way.

The setup is cumbersome, requires going into the deployment, and can cause someone to mess up the environment. Admins need to mount SSH config files into the gitserver deployment, create a known_hosts file, and so forth. For every deployment model we have, this works slightly differently.

Thus, repository cloning via SSH, and gitolite in general, are not supported on Sourcegraph Cloud either - the customer does not have access to the deployment here. At larger customers, the same could be true for a site-admin of Sourcegraph - they might not have access to the deployment itself which could be managed by a different team.

We know how to feed SSH certificates successfully to git from go through our self-made SSH agent package which we use to supply user-provided SSH keys for pushing commits from batch changes. We should allow to set the keys and known host sha in the external service config instead of having to mount things into the gitserver deployment.

Having it accessible outside of gitserver also makes it much easier to add connection checks and such for these configurations.

/cc @sourcegraph/source

github-actions[bot] commented 1 year ago

Hey, @sourcegraph/code-search - Batch Changes has been mentioned. Let's take a look.