Skip to content

Commit

Permalink
fix: NO_PROXY env var no longer be respected over npm_config_noproxy …
Browse files Browse the repository at this point in the history
…env var (#8295)

Co-authored-by: Zach Bloomquist <github@chary.us>
  • Loading branch information
jennifer-shehane and flotwig authored Aug 24, 2020
1 parent 0777f96 commit eac7859
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/https-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fs-extra": "8.1.0",
"lodash": "4.17.19",
"node-forge": "0.9.0",
"proxy-from-env": "1.1.0",
"proxy-from-env": "1.0.0",
"semaphore": "1.1.0"
},
"devDependencies": {
Expand Down
7 changes: 6 additions & 1 deletion packages/https-proxy/test/integration/proxy_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,13 @@ describe('Proxy', () => {

context('with an upstream proxy', () => {
beforeEach(function () {
// PROXY vars should override npm_config vars, so set them to cause failures if they are used
// @see https://github.com/cypress-io/cypress/pull/8295
process.env.npm_config_proxy = process.env.npm_config_https_proxy = 'http://erroneously-used-npm-proxy.invalid'
process.env.npm_config_noproxy = 'just,some,nonsense'

process.env.NO_PROXY = ''
process.env.HTTP_PROXY = (process.env.HTTPS_PROXY = 'http://localhost:9001')
process.env.HTTP_PROXY = process.env.HTTPS_PROXY = 'http://localhost:9001'

this.upstream = new DebugProxy({
keepRequests: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"concat-stream": "1.6.2",
"debug": "4.1.1",
"lodash": "4.17.19",
"proxy-from-env": "1.1.0"
"proxy-from-env": "1.0.0"
},
"devDependencies": {
"@cypress/debugging-proxy": "2.0.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/network/test/unit/agent_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ describe('lib/agent', function () {
context(testCase.name, function () {
beforeEach(function () {
if (testCase.proxyUrl) {
// PROXY vars should override npm_config vars, so set them to cause failures if they are used
// @see https://github.com/cypress-io/cypress/pull/8295
process.env.npm_config_proxy = process.env.npm_config_https_proxy = 'http://erroneously-used-npm-proxy.invalid'
process.env.npm_config_noproxy = 'just,some,nonsense'

process.env.HTTP_PROXY = process.env.HTTPS_PROXY = testCase.proxyUrl
process.env.NO_PROXY = ''
}
Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/util/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const loadSystemProxySettings = () => {
debug('found proxy environment variables %o', _.pick(process.env, [
'NO_PROXY', 'HTTP_PROXY', 'HTTPS_PROXY',
'no_proxy', 'http_proxy', 'https_proxy',
'npm_config_proxy', 'npm_config_https_proxy',
'npm_config_proxy', 'npm_config_https_proxy', 'npm_config_noproxy',
]))

;['NO_PROXY', 'HTTP_PROXY', 'HTTPS_PROXY'].forEach(copyLowercaseEnvToUppercase)
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20423,7 +20423,12 @@ proxy-addr@~2.0.5:
forwarded "~0.1.2"
ipaddr.js "1.9.1"

proxy-from-env@1.1.0, proxy-from-env@^1.0.0:
proxy-from-env@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee"
integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=

proxy-from-env@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
Expand Down

4 comments on commit eac7859

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on eac7859 Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/linux-x64/circle-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-430136/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/circle-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-430125/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on eac7859 Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-x64/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/5.0.1/win32-x64/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-x64/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-x64/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on eac7859 Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-ia32/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/5.0.1/win32-ia32/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-ia32/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/win32-ia32/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.zip npm install https://cdn.cypress.io/beta/npm/5.0.1/appveyor-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-34826702/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on eac7859 Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.1/darwin-x64/circle-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-430320/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.1/circle-develop-eac7859fccf1de06122f845fa55b70b51d1dc705-430151/cypress.tgz

Please sign in to comment.