Skip to content

GitLab Pages http_proxy configuration is different from all other services

Most Services

doc/settings/environment-variables.md shows how to use env to configure http_proxy for various services:

# Needed for proxying Git clones
gitaly['env'] = {
    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
    "no_proxy" => "unix"  # Workaround for https://gitlab.com/gitlab-org/gitaly/-/issues/1447
}

gitlab_workhorse['env'] = {
    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
}

# If you use the docker registry
registry['env'] = {
    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
}

These environment variables are set for the service when it is launched via chpst -e, e.g.

gitlab-pages

However, gitlab-pages does things differently and has a special variable:

This makes switching to chpst (like e.g. gitlab-workhorse) more challenging.

This was added in b1138be7.

How to fix

I'll assume that GitLab will not want to remove the gitlab_pages['http_proxy'] configuration option (although that would be the easiest fix), since that would break existing configurations.

That means, in order to move gitlab-pages to launch via chpst, the recipe will need to copy gitlab_pages['http_proxy'] into gitlab_pages['env']['http_proxy'].

Edited by Jonathon Reinhart