Respect HTTP proxy environment variables
benz0li opened this issue · 2 comments
@japrescott As already explained in my emails:
One can configure urllib3.PoolManager
’s ca_certs
via environment variable LIGHTLY_CA_CERTS
.
Lines 225 to 242 in 715844b
lightly/lightly/openapi_generated/swagger_client/rest.py
Lines 83 to 105 in 715844b
But as long as configuration.proxy
remains unset, there is no way that urllib3.ProxyManager
(and thus a HTTP Proxy) is used.
lightly/lightly/openapi_generated/swagger_client/rest.py
Lines 83 to 85 in 715844b
Not only configuration.ssl_ca_cert
but also configuration.proxy
should be settable via an environment variable to fully support running behind a corporate proxy/firewall.
Usually this is done by common environment variables like HTTP_PROXY
, HTTPS_PROXY
, ALL_PROXY
(or their lowercase counterparts).
Current workaround for the Lightly worker: Mounting a patched rest.py
to /home/boris/openapi/build/swagger_client/swagger_client/rest.py
.
Patch: Inserting configuration.proxy = "http://<host>:<port>"
just before
lightly/lightly/openapi_generated/swagger_client/rest.py
Lines 83 to 85 in 715844b
Hey @benz0li
Thanks a lot for opening a issue.
The proxy
variable will need to be set within the get_api_client_configuration fn.
Will open a PR later today