Conversation: gitaly-ssh command
Feature Flag Name: gitaly_fetch_ref
-
~"Client Implementation": #584 (closed)#585 (closed) https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14588 (one side remote) -
~"Acceptance Testing":
We need to be able to pull from a Git repository on another Gitaly server.
Our idea is to re-use the SSHUploadPack RPC with a mock SSH transport like we do in the SSHUploadPack tests. This means we should take the test helper executable we use there and modify it into something we can use in production code.
I propose the following:
- executable in
cmd/gitaly-ssh/main.go - in source installations this will end up as
/home/git/gitaly/gitaly-ssh - in omnibus this will end up as
/opt/gitlab/embedded/bin/gitaly-ssh - we add a config.toml option
gitaly_libexec_dirand use that to build the path to the executable
Example invocation:
export GITALY_TOKEN='123secret'
export GIT_SSH_COMMAND='/path/to/gitaly-ssh tcp://1.2.3.4:6000 upload-pack "{Repository: bla bla first request as JSON}"'
git clone git@localhost:foo/bar.git
The JSON can be encoded/decoded with jsonpb and SSHUploadPackRequest.encode_json.
Edited by Andrew Newdigate