chaoss / chaoss/grimoirelab

Add support for SOCKS5 proxy to docker images

Open
#334 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
625
Forks
231
PR merge metrics
No merged PRs in 30d

Description

To be able to connect to company internal git repositories it would be great if Socks5 proxies would be supported.

Currently the docker image doesn't support Socks5 and errors with the message if a Socks5 proxy is configured via environment variables.

I have tried adding the capability by updating the entrypoint. However that doesn't resolve the issue yet. For testing purposes I'm running the Socks5 proxy on my host machine, which I can reach using `host.docker.internal` from my containers.

```bash
#!/usr/bin/env bash

set -e

if [ ! -z "$all_proxy" ] || [ ! -z "$http_proxy" ] || [ ! -z "$https_proxy" ] ; then
temp_all=$all_proxy
temp_http=$http_proxy
temp_https=$https_proxy
unset all_proxy
unset http_proxy
unset https_proxy
pip3 install --user --upgrade pysocks
all_proxy=$temp_all
http_proxy=$temp_http
https_proxy=$temp_https
fi

/usr/local/bin/sirmordred "$@"
```

```yml
grimoirelab:
image: "grimoirelab/installed:${GRIMOIRELAB_VERSION}"
restart: on-failure
environment:
all_proxy: socks5://host.docker.internal
http_proxy: socks5://host.docker.internal
https_proxy: socks5://host.docker.internal
no_proxy: es01,es02,kibiter,elasticsearch,mariadb,github.com
entrypoint: [ "/grimoirelab-entrypoint.sh" ]
command: [ "-c", "/infra.cfg", "/dashboard.cfg", "/project.cfg", "/override.cfg" ]
```

I have tried the image manually using docker-compose exec, trying to clone the repos via the cli and tried as well via curl. Both are working.

```bash
$ docker-compose exec grimoirelab /bin/bash
curl -L https://bitbucket.internal.my.org
git clone .....
```

So it seems some issue with the python code not following these environment variables properly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.