Gitlab Mirroring not working behind proxy

Hi!

I am trying to mirror my gitlab repository to github (push to https repo).

I am running gitlab with docker behind a corporate proxy.

It seems that the mirrored repository is trying to push directly and is ignoring any http_proxy kind of environment variable.

how can I configure my outbout proxy?

Hi @rvalle

Can you try this https://docs.gitlab.com/omnibus/settings/environment-variables.html

OK,

I see, and do you know to which component I have to add the settings? is it gitaly that is responsible for the mirroring? or Sidekiq?

And also because I run gitlab as Doker, do I have to add this to the GITLAB_OMNIBUS_CONFIG env variable?

I set gitlab_rails['env'] for all components. It doesn’t work.
And I failed to find any error logs in Where are the mirroring logs? (#275988) · Issues · GitLab.org / GitLab · GitLab.
No idea how to debug it.

Setting the proxy on omnibus_gitconfig will be work fine :wink:

omnibus_gitconfig['system'] = {
  "http" => ["proxy=http://proxy.example.com:8080"],
  "https" => ["proxy=http://proxy.example.com:8080"]
}

After the release of version 17.0, omnibus_config was removed, so the proxy can no longer be configured there. It needs to be configured where necessary. In my instance, I had to specify http_proxy in lowercase and HTTP_PROXY in uppercase, as well as the other proxy directives. This way, the git mirror repositories also work 100%.

# Environment settings for Gitaly
gitaly['env'] = {
  'http_proxy' => "http://proxyserver.example.com:8080",
  'https_proxy' => "http://proxyserver.example.com:8080",
  'no_proxy' => ".example.com, .example2.com, .example3.com, .example4.com",
  'HTTP_PROXY' => "http://proxyserver.example.com:8080",
  'HTTPS_PROXY' => "http://proxyserver.example.com:8080",
  'NO_PROXY' => ".example.com, .example2.com, .example3.com, .example4.com"
}

# Environment settings for Rails
gitlab_rails['env'] = {
  'http_proxy' => "http://proxyserver.example.com:8080",
  'https_proxy' => "http://proxyserver.example.com:8080",
  'no_proxy' => ".example.com, .example2.com, .example3.com, .example4.com",
  'PLANTUML_ENCODING' => "deflate",
  'HTTP_PROXY' => "http://proxyserver.example.com:8080",
  'HTTPS_PROXY' => "http://proxyserver.example.com:8080",
  'NO_PROXY' => ".example.com, .example2.com, .example3.com, .example4.com"
}

# Environment settings for Workhorse
gitlab_workhorse['env'] = {
  'http_proxy' => "http://proxyserver.example.com:8080",
  'https_proxy' => "http://proxyserver.example.com:8080",
  'no_proxy' => ".example.com, .example2.com, .example3.com, .example4.com",
  'HTTP_PROXY' => "http://proxyserver.example.com:8080",
  'HTTPS_PROXY' => "http://proxyserver.example.com:8080",
  'NO_PROXY' => ".example.com, .example2.com, .example3.com, .example4.com"
}

# Proxy settings for Rails
gitlab_rails['http_proxy'] = "http://proxyserver.example.com:8080"
gitlab_rails['https_proxy'] = "http://proxyserver.example.com:8080"
gitlab_rails['HTTP_PROXY'] = "http://proxyserver.example.com:8080"
gitlab_rails['HTTPS_PROXY'] = "http://proxyserver.example.com:8080"

# Proxy settings for Shell
gitlab_shell['http_proxy'] = "http://proxyserver.example.com:8080"
gitlab_shell['https_proxy'] = "http://proxyserver.example.com:8080"
gitlab_shell['HTTP_PROXY'] = "http://proxyserver.example.com:8080"
gitlab_shell['HTTPS_PROXY'] = "http://proxyserver.example.com:8080"

1 Like

Thanks!

In my case, to enable push mirroring through our proxy, I only needed to add

gitaly["env"] = {
  https_proxy: "http://proxy.example.org:8080",
  no_proxy: "localhost,..."
}

I already had gitlab_rails["env"] configured with these values for other purposes, e.g. access to our S3 buckets. I do not use the uppercase values for our Omnibus-based CE instance (running via docker compose), currently at 17.0.1. No clue why you seem to need them.
FTR, I added an http_proxy setting only to gitlab_rails["env"] to make Microsoft Teams notifications work. Wherever possible, I prefer to use HTTPS-only :smile_cat: