Make GIT_SSH_COMMAND envvar optional

Is it possible to make the setting of GIT_SSH_COMMAND optional? We have a product setup with a lot of repositories that need to be checked out if someone starts developing. As an optimization, we use the following ssh-command in git:
core.sshcommand=ssh -o ControlMaster=auto -o ControlPath="/build/.ssh/ssh-%r@%h:%p" -o ControlPersist=60 -o BatchMode=yes
core.sshcommand=ssh -o ControlMaster=auto -o ControlPath="/build/.ssh/ssh-%r@%h:%p" -o ControlPersist=60 -o BatchMode=yes
This saves us from creating too many ssh connections to our gitlab instance and having to process a handshake for everyone. Coder breaks this by using the coder gitssh as ssh command via envvar. Sadly, this does not only eliminate the performance optimization, it also runs into a coder rate limit:
You've been rate limited for sending more than 512 requests in 1m0s.
Run 'coder gitssh --help' for usage.
fatal: Could not read from remote repository.
You've been rate limited for sending more than 512 requests in 1m0s.
Run 'coder gitssh --help' for usage.
fatal: Could not read from remote repository.
As a workaround, we would like to use an ssh-agent instance (maybe forwarded into the WS via ssh) and the multiplexed socket - but for this to work we need to get rid of this envvar.
6 Replies
kyle
kyle2y ago
You should be able to override it with env in Terraform:
GIT_SSH_COMMAND: ""
GIT_SSH_COMMAND: ""
We should probably make this more obvious though... and maybe disable it by default.
JanL
JanL2y ago
I think it's a good mechanism in general that works for most usecases. One improvement might be to cache the API requests for the SSH key for a short while (1 sec would already fix the rate limiting)
kyle
kyle2y ago
Ahh, got it. We could certainly do that. Could you open an issue for that? I'm happy it works in most scenarios!
JanL
JanL2y ago
GitHub
Cache ssh-auth requests within the coder agent · Issue #5605 · code...
We have a project with hundreds of submodules. The checkout process of this runs in the coder agent api ratelimit: You've been rate limited for sending more than 512 requests in 1m0s. Run &...
JanL
JanL2y ago
thank you!
kyle
kyle2y ago
Thanks!
Want results from more Discord servers?
Add your server