Repository navigation
feat(windows): honor HTTPS_PROXY, HTTP_PROXY and NO_PROXY in PowerShell scripts - #14
Open
fivetran-paulharper wants to merge 3 commits into
Open
fivetran-paulharper wants to merge 3 commits into
fivetran-paulharper wants to merge 3 commits into
Conversation
…ll scripts Windows PowerShell 5.1 ignores the proxy environment variables that curl reads on Linux, so install.ps1 and the manager's upgrade command could not reach GitHub, the image registry or the Fivetran API from a proxied host unless the user set a .NET proxy in the same session. Both scripts now build a System.Net.WebProxy from HTTPS_PROXY (or HTTP_PROXY), including URL credentials, and translate NO_PROXY entries into bypass rules with curl's host-and-subdomains semantics. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Exercises HTTPS_PROXY with credentials and NO_PROXY, the HTTP_PROXY fallback, the no-op path, and an invalid proxy URL through the upgrade command, and asserts that install.ps1 carries the same function body so the two copies cannot drift apart. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ystem proxy Corporate proxies on Windows commonly require NTLM or Kerberos, which .NET only answers when told to. Both the proxy built from the environment (when its URL carries no credentials) and the Internet Options default now use the current Windows identity. When no proxy variables are set, the scripts also print the system proxy in effect for the registry host, so a stalled install shows what it is going through. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
fivetran-paulharper
marked this pull request as ready for review
October 30, 2026 21:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
install.ps1andproxy-agent-manager.ps1 upgradework from behind a network proxy by honoring the same environment variablescurlalready reads on Linux:HTTPS_PROXY(falling back toHTTP_PROXY) andNO_PROXY.Windows PowerShell 5.1, which is what ships on Windows Server, ignores these variables. Until now a proxied host could only reach GitHub, the image registry and the Fivetran API if the user first set
[System.Net.WebRequest]::DefaultWebProxyby hand in the same session, which is what the docs in fivetran/engineering#286828 currently tell them to do. That instruction also doesn't carry into the dashboard's one-line install command, which runs the installer in a childpowershellprocess.What changed
Set-WebProxyFromEnvironmentin both scripts. Builds aSystem.Net.WebProxyfromHTTPS_PROXYorHTTP_PROXYand sets it as the process default, so everyInvoke-WebRequest/Invoke-RestMethodin the script goes through it. Credentials in the URL (http://user:pass@host:port) are passed asNetworkCredentialand kept out of the printed address.NO_PROXYentries become bypass rules with curl's semantics: each entry matches the host and its subdomains, with or without a leading dot. CIDR ranges are not supported.(407) Proxy Authentication RequiredfromInvoke-WebRequest). Both the env-var proxy, when its URL carries no credentials, and the Internet Options default now use the current Windows identity.upgrade, the one command that makes a web request.start,stop,restart,statusandlogsare unaffected.The function is duplicated rather than shared because the two scripts are downloaded independently. A Pester test asserts the two copies are identical (modulo
Write-Log) so they can't drift.What this does not do
install.ps1withirmbefore any of our code runs, so this change can't help that request. A companion change in fivetran/engineering sets the proxy in that child process before the fetch (branchpaulh/proxy-agent-windows-install-command-proxy, PR to follow). Downloading the script first, as the README shows, already works.proxy_host/proxy_portinconfig.jsonto reach Fivetran at runtime. Both remain the user's responsibility; setting daemon-wide proxy settings and restarting the Docker service from an installer seemed too invasive for a shared host.Testing
tests/pwsh/Manager.Tests.ps1: six new cases under "behind a network proxy" coveringHTTPS_PROXYwith credentials andNO_PROXYbypass matching, theHTTP_PROXYfallback with Windows credentials, a stand-in Internet Options proxy being kept, reported and given Windows credentials, a direct connection reporting nothing, an invalid proxy URL (fails before contacting the registry), and the install/manager function parity check.Stacking
Stacked on #13 so the new tests run in its CI. Independent of #12.
🤖 Generated with Claude Code