Powershell installer: respect HTTPS_PROXY and ANY_PROXY env vars#2078
Powershell installer: respect HTTPS_PROXY and ANY_PROXY env vars#2078mistydemeo merged 5 commits intoaxodotdev:mainfrom
Conversation
|
Looks like PSScriptAnalyzer has flagged a few things in CI; can you make the suggested changes? |
|
Done! Hope I got the PSScriptAnalyzer lints, I didn't figure out how to run those locally :P |
|
PSScriptAnalyzer worked! Looks like one of the snapshots was missed though - the updated snapshot in the diff is for the wrong change. |
|
Hmm I'm having trouble trying to run that particular test. Probably won't have time to figure out what's going on today |
|
This is what the test outputs, in case you have any tips: https://gist.github.com/zsol/6e7764fa39178bc39a92f7ac3644ccae |
|
Aha, that requires the omnibor CLI tool to be installed. I can go ahead and update that test snapshot for you and push the change to this branch if you like. |
|
Hmm but I thought I specifically installed it using |
|
This is a welcome update to the installer/self update script, but it currently only supports proxies which expect user/pass basic authentication. In other proxies, which are using Kerberos or NTLM, I suppose this method will not be adequate. In such cases, the $proxy.Credentials may need to be grabbed using the following: You may find the type of credential by getting the current user and asking their authentication type (I'm not sure it is reliable or if there is a better way to attempt to find the right 'Credentials'. One could also just try all known methods one after the other until something works) $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent() If 'Kerberos' or 'NTLM' then try: Instead of parsing out the user/pass from HTTP_PROXY. If this is a change you would be open to, I'll check if in the coming days I can find the time to create an Issue/PR. |
|
AFAIU if you don't set the env variables, the script will fall back to the default system-wide proxy (if that's set). I would assume that proxies that require complex authentication would usually be configured properly on the system anyway. Is that not the case for you, @stoating ? |
@zsol, after taking your change and being able to test it thoroughly in the necessary environment, it looks like you are correct 👍. Your merged change appears to address the issues we were having with the standalone install as well. |
This PR makes the Windows Powershell (.ps1) installer respect
HTTPS_PROXYandANY_PROXYas environment variables while fetching a binary.Note
This doesn't support
HTTP_PROXY, orNO_PROXYenv vars, but it's better than nothing.Manual Testing
Details
I've tested it with `cargo-dist` itself:And then, without proxy env vars:
With proxy env vars:
And then if I fire up a proxy server that requires auth, it works again.
See also
#2075 where most of the debugging happened
Closes astral-sh/uv#10709