tfutils / tfenv

Terraform version manager
MIT License
4.48k stars 454 forks source link

Add flag to use proxy when calling `tfenv install` #326

Closed torbendury closed 2 years ago

torbendury commented 2 years ago

Hello everyone,

I have no clue how to configure tfenv to respect e.g. a company proxy. Do I need to set global variables? Is it a big deal to add a --proxy flag to the tool? Unfortunately, I'm not able to use tfenv otherwise without access to the public internet. Which global environment variables does it respect?

worzel666 commented 2 years ago

General practise for proxies is to export all of http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY which will be picked up by the subsequent cURL commands run by the script.

torbendury commented 2 years ago

Hey, thanks for the quick response. curl was the keyword to know, so the environment variables should be pulled from there.

Am I able to force tfenv to use IPv4? My proxy has some issues with IPv6.

torbendury commented 2 years ago

I think I can close this for now.

Again, for anyone looking into this who has issues with their company proxy using IPv4, you can hack your way into it when checking out the repository with something like this:

  sed -i 's/--tlsv1.2/--tlsv1.2 --ipv4/g' "$WORKSPACE/.tfenv/lib/helpers.sh"

@worzel666 thanks for the hints regarding tfenv utilizing curl under the hood.