Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ matrix:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: ['xvfb','libasound2','libx11-6','libglib2.0-0','libgtk2.0-0','libatk1.0-0','libgdk-pixbuf2.0-0','libcairo2','libfreetype6','libfontconfig1','libxcomposite1','libasound2','libxdamage1','libxext6','libxfixes3','libnss3','libnspr4','libgconf-2-4','libexpat1','libdbus-1-3','libudev1']
script:
- pyenv global 2.7
# test node-webkit usage
- ./scripts/test-node-webkit.sh

Expand Down
41 changes: 40 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const makeDir = require('make-dir');
// for fetching binaries
const fetch = require('node-fetch');
const tar = require('tar');
const url = require('url');

let npgVersion = 'unknown';
try {
Expand All @@ -24,6 +25,34 @@ try {
// do nothing
}

function should_proxy(uri, noProxyList) {
const { hostname, port } = url.parse(uri);

/* TODO: Default ports as defined by the protocol should still
match, they currently will not if the noProxyList entry
explicitly specifies the default port. */

// eslint-disable-next-line eqeqeq
const portMatch = (entry) => entry.port === undefined || entry.port == port;

for (let i = 0; i < noProxyList && noProxyList.length; i++) {
const entry = noProxyList[i];
if (!portMatch(entry)) {
continue;
}
// TODO: Deal with 'partial wildcards': *.foo.com
if (entry.hostSuffix === '*') {
return false;
}
const rightSideMatch = hostname.indexOf(entry.hostSuffix, hostname.length, entry.hostSuffix.length);
if (rightSideMatch > -1) {
return false;
}
}

return true;
}

function place_binary(uri, targetDir, opts, callback) {
log.http('GET', uri);

Expand Down Expand Up @@ -54,8 +83,18 @@ function place_binary(uri, targetDir, opts, callback) {
process.env.http_proxy ||
process.env.HTTP_PROXY ||
process.env.npm_config_proxy;
const noProxy = opts.noproxy ||
process.env.no_proxy ||
process.env.NO_PROXY ||
process.env.npm_config_noproxy;
// TODO: IPv6 address + port support.
const noProxyList = noProxy && noProxy.split(',').map((e) => {
const [hostSuffix, port] = e.split(':');
return { hostSuffix, port };
});

let agent;
if (proxyUrl) {
if (proxyUrl && should_proxy(sanitized, noProxyList)) {
const ProxyAgent = require('https-proxy-agent');
agent = new ProxyAgent(proxyUrl);
log.http('download', 'proxy agent configured using: "%s"', proxyUrl);
Expand Down
1 change: 1 addition & 0 deletions lib/node-pre-gyp.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ proto.configDefs = {
debug: Boolean, // 'build'
directory: String, // bin
proxy: String, // 'install'
noproxy: String, // 'install'
loglevel: String // everywhere
};

Expand Down
296 changes: 296 additions & 0 deletions lib/util/abi_crosswalk.json
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,54 @@
"node_abi": 83,
"v8": "8.4"
},
"14.18.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.18.3": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.19.3": {
"node_abi": 83,
"v8": "8.4"
},
"14.20.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.20.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.0": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.1": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.2": {
"node_abi": 83,
"v8": "8.4"
},
"14.21.3": {
"node_abi": 83,
"v8": "8.4"
},
"15.0.0": {
"node_abi": 88,
"v8": "8.6"
Expand Down Expand Up @@ -2587,6 +2635,66 @@
"node_abi": 93,
"v8": "9.4"
},
"16.13.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.13.2": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.14.2": {
"node_abi": 93,
"v8": "9.4"
},
"16.15.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.15.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.16.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.17.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.17.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.18.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.18.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.19.0": {
"node_abi": 93,
"v8": "9.4"
},
"16.19.1": {
"node_abi": 93,
"v8": "9.4"
},
"16.20.0": {
"node_abi": 93,
"v8": "9.4"
},
"17.0.0": {
"node_abi": 102,
"v8": "9.5"
Expand All @@ -2598,5 +2706,193 @@
"17.1.0": {
"node_abi": 102,
"v8": "9.5"
},
"17.2.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.3.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.3.1": {
"node_abi": 102,
"v8": "9.6"
},
"17.4.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.5.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.6.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.1": {
"node_abi": 102,
"v8": "9.6"
},
"17.7.2": {
"node_abi": 102,
"v8": "9.6"
},
"17.8.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.9.0": {
"node_abi": 102,
"v8": "9.6"
},
"17.9.1": {
"node_abi": 102,
"v8": "9.6"
},
"18.0.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.1.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.2.0": {
"node_abi": 108,
"v8": "10.1"
},
"18.3.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.4.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.5.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.6.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.7.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.8.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.9.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.9.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.10.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.11.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.12.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.12.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.13.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.1": {
"node_abi": 108,
"v8": "10.2"
},
"18.14.2": {
"node_abi": 108,
"v8": "10.2"
},
"18.15.0": {
"node_abi": 108,
"v8": "10.2"
},
"18.16.0": {
"node_abi": 108,
"v8": "10.2"
},
"19.0.0": {
"node_abi": 111,
"v8": "10.7"
},
"19.0.1": {
"node_abi": 111,
"v8": "10.7"
},
"19.1.0": {
"node_abi": 111,
"v8": "10.7"
},
"19.2.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.3.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.4.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.5.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.6.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.6.1": {
"node_abi": 111,
"v8": "10.8"
},
"19.7.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.8.0": {
"node_abi": 111,
"v8": "10.8"
},
"19.8.1": {
"node_abi": 111,
"v8": "10.8"
},
"19.9.0": {
"node_abi": 111,
"v8": "10.8"
},
"20.0.0": {
"node_abi": 115,
"v8": "11.3"
}
}