"https_proxy=xxxx" env variable causes Entware update check to fail.
Starting from version 5.0, if I run https_proxy=xxxx amtm, all the Entware servers fail to reach, while other modules are fine. The issue is not present in 4.x.
https_proxy=xxxx opkg update itself works as expected.
What do you expect me to do?
I use curl -IsL https://$server | head -n 1 | grep 'OK\|Found' to check if they are responding. The three servers are bin.entware.net, entware.diversion.ch and mirrors.cernet.edu.cn/entware
Can you play around and see if curl needs a proxy option added to the command? I have currently no way of testing a proxy environment.
Sorry, I should've clarified a few things.
- It seems that the "curl" from firmware (i.e.
/usr/sbin/curl) doesn't support proxies, thus ignoring these env vars, so there's no issue used this way. - Because of the reason above, I mount the "curl" from "entware" (i.e.
/opt/bin/curl) to override the/usr/sbin/curl. - As a consequence, when using the
/opt/bin/curlwith a proxy, executingcurl -IsL https://bin.entware.net, and when succeeding, the output is:Note there're two extra lines, which cause
curl -IsL https://$server/ | head -n 1 | grep 'OK\|Found'to always return false.
So this's NOT necessarily a bug when running on its bare bones, but it may cause this issue when used with the "curl" supporting proxies and used with one.
-------Edit------
If curl is installed from "entware", /opt/bin has precedence above /usr/sbin in $PATH and is used with a proxy, the problem also occurs.
If curl is installed from "entware", /opt/bin has precedence above /usr/sbin in $PATH and is used with a proxy, the problem also occurs.
I would prefer not to have to change the new method with curl instead of the venerable ping to determine if a server is reachable during the install and subsequent Entware operations within amtm. It gets convoluted quickly in the code logic.
As you are the only one reporting this so far I can offer to modify the logic to use /opt/bin/curl if present. But this only comes into effect for operations after Entware is installed and you'd have to install the package yourself to benefit from it.
Are you still looking for a resolution of this?
Say, if you increase | head -n 1 to | head -n 4 or so will it work with a proxy?
Sorry for the late reply.
Yes. | head -n 3 does the job.
The output is: