habitat-sh / on-prem-builder

Scripts to stand up an on-premise Habitat Builder Depot
Apache License 2.0
41 stars 34 forks source link

HTTP{S}_PROXY could be in upper or lowercase #180

Closed sandratiffin closed 5 years ago

sandratiffin commented 5 years ago

In scripts/hab-sup.service.sh, Environment settings are configured for the hap-sup service if uppercase HTTP_PROXY/HTTPS_PROXY environment variables are set.

Some apps need these variables to be in lowercase, so the script should look for those and set environment_proxy configs accordingly.

predominant commented 5 years ago

@sandratiffin the environment for builder only needs uppercase, as that is what is checked and used within builder. Do you have a debug trace / log showing where you are having issues with proxy environment variables?

sandratiffin commented 5 years ago

The customer I'm working with uses lowercase variables, so the script doesn't detect them, and they weren't able to reach the public builder till they worked around it. They did so by adding the following line to the service definition: EnvironmentFile=<filename> and the file contained

http_proxy=<proxy url>
https_proxy=<proxy url>

I am sure it would be fine to set them in uppercase for hab's purposes; the issue is not detecting valid proxy variables and using them for hab because they are defined in lowercase. Some apps like wget only accept lowercase, but most apps that accept uppercase also accept lowercase, hence they use lowercase.

predominant commented 5 years ago

You're right, some applications accept only upper/lower case. However the environment being populated only checks uppercase. So I feel they should be specified in uppercase.

eeyun commented 5 years ago

I agree but its such a trivial fix i've gone ahead and added support to the script.

fixed by #183