github icon indicating copy to clipboard operation
github copied to clipboard

Support for the NO_PROXY environment variable

Open ianprime0509 opened this issue 1 year ago • 0 comments

Currently, this plugin recognizes the HTTP_PROXY/http_proxy environment variable if no explicit proxy configuration is provided, but ignores the common NO_PROXY/no_proxy environment variables to specify hosts to exclude from proxy use. Unfortunately, this causes issues in some corporate environments where the HTTP_PROXY environment variable is set to enable internet traffic to go through a proxy, but GitHub Enterprise is hosted internally and should be excluded from proxy use via NO_PROXY.

The obvious workaround is to set "proxy": false in the configuration, but it might be useful to respect NO_PROXY when reading the proxy configuration from the HTTP_PROXY environment variable to avoid needing to configure anything manually. The format of NO_PROXY isn't entirely standard, but there are some commonalities among implementations detailed here: https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/

It looks like this was briefly discussed in #356, with some potential code to handle it: https://github.com/semantic-release/github/pull/356#issuecomment-809976721 It was argued there that recognizing it would be unnecessary complexity, given only one domain is accessed, but I think it does make sense given the scenario described above, where the necessary environment variables are already set to auto-configure most applications, but this plugin only respects one of them, leading to incorrect results unless manual configuration is used.

ianprime0509 avatar Nov 23 '22 15:11 ianprime0509