You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some time I have been running Netbox in a docker container ( Netbox docker 2.9.1 ) behind a web proxy. Previously I use the upper case HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables on the container and everything I was using worked ( Newsfeed, Device Type library Import Plugin )
In addition to this I use an internal git repository for which the host is the NO_PROXY variable. Syncing this repo has always worked. I did on occasion try to sync from a GitHub repo but was never able to make this work. ( I now suspect that under the hood requests was ignoring the Uppercase Proxy variables.)
I came across the HTTP_PROXIES env variable and was able to get GitHub working with this but that broke Local repos as the Python request library does not handle no_proxy correctly when proxies are set this way. ( ref HTTP_PROXIES no_proxy option gets completely ignored #18112 ).
This week I fetched the latest Netbox Docker v 3.0.2 and they have added a the HTTP_PROXIES env variable in the configuration.py and populate it from HTTP_PROXY, HTTPS_PROXY. ( ref Add HTTP_PROXIES related parameters #1255) This breaks the local repo fetch as now it tries to go via proxy but GitHub then works, same issue I previous saw. If I override the env with HTTP_PROXIES = {} I am back to local sync working but proxies not being used for GitHub .
In trying to figure this all out it looks like the requests library has know of the issue with HTTP_PROXIES for 7 years and have not fixed it so I don't hold much hope of ant solution from there. After going down many Rabbit holes I found that requests seems to fully support the lower case env variables http_proxy, https_proxy and no_proxy. I removed the upper case env variable and add the lower case ones and in my testing all outbound connection work, newsfeed, plugin and git sysnc to both internal and external. I was able to remove the HTTP_PROXIES = {} from my config as the default implementation only uses the upper case env variable so this end up as none and has no effect. It also seems if you set both upper and lower the lower versions are still use by requests and both local and remote repo sync work
Edit 20.12.2024 - It look like the newsfeed was cached, starting the containers today without the uppercase the newsfeed is broken, add then back and it works again.
I am working in docker but I see no reason this should be any different in a non-docker install so I ask here no in the Netbox docker discussions.
So that come to the crux of the matter :
What is the point of HTTP_PROXIES, why is not recommended to just use http_proxy, https_proxy and no_proxy env variables and be done with it ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For some time I have been running Netbox in a docker container ( Netbox docker 2.9.1 ) behind a web proxy. Previously I use the upper case HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables on the container and everything I was using worked ( Newsfeed, Device Type library Import Plugin )
In addition to this I use an internal git repository for which the host is the NO_PROXY variable. Syncing this repo has always worked. I did on occasion try to sync from a GitHub repo but was never able to make this work. ( I now suspect that under the hood requests was ignoring the Uppercase Proxy variables.)
I came across the HTTP_PROXIES env variable and was able to get GitHub working with this but that broke Local repos as the Python request library does not handle no_proxy correctly when proxies are set this way. ( ref HTTP_PROXIES no_proxy option gets completely ignored #18112 ).
This week I fetched the latest Netbox Docker v 3.0.2 and they have added a the HTTP_PROXIES env variable in the configuration.py and populate it from HTTP_PROXY, HTTPS_PROXY. ( ref Add HTTP_PROXIES related parameters #1255) This breaks the local repo fetch as now it tries to go via proxy but GitHub then works, same issue I previous saw. If I override the env with HTTP_PROXIES = {} I am back to local sync working but proxies not being used for GitHub .
In trying to figure this all out it looks like the requests library has know of the issue with HTTP_PROXIES for 7 years and have not fixed it so I don't hold much hope of ant solution from there. After going down many Rabbit holes I found that requests seems to fully support the lower case env variables http_proxy, https_proxy and no_proxy. I removed the upper case env variable and add the lower case ones and in my testing all outbound connection work, newsfeed, plugin and git sysnc to both internal and external. I was able to remove the HTTP_PROXIES = {} from my config as the default implementation only uses the upper case env variable so this end up as none and has no effect. It also seems if you set both upper and lower the lower versions are still use by requests and both local and remote repo sync work
Edit 20.12.2024 - It look like the newsfeed was cached, starting the containers today without the uppercase the newsfeed is broken, add then back and it works again.
I am working in docker but I see no reason this should be any different in a non-docker install so I ask here no in the Netbox docker discussions.
So that come to the crux of the matter :
What is the point of HTTP_PROXIES, why is not recommended to just use http_proxy, https_proxy and no_proxy env variables and be done with it ?
Domoninc
Beta Was this translation helpful? Give feedback.
All reactions