From 826eec2e4fe29860d23cf6c2276390b5c7f26a09 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Tue, 7 Apr 2020 10:10:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Update=20supervisor=20to=20node1?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-type: patch Signed-off-by: Cameron Diver --- Dockerfile | 2 +- build-conf/node-sums.txt | 10 +++++----- package-lock.json | 30 +++++++++++++++++++++++------- package.json | 2 +- src/compose/network-manager.ts | 5 +---- src/device-api/v2.ts | 5 +++-- src/network.ts | 2 +- tsconfig.json | 1 + 8 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27c7658b..4e1e7023 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG ARCH=amd64 -ARG NODE_VERSION=10.19.0 +ARG NODE_VERSION=12.16.2 FROM balenalib/$ARCH-alpine-supervisor-base:3.11 as BUILD diff --git a/build-conf/node-sums.txt b/build-conf/node-sums.txt index 9a74d59c..d5a652b0 100644 --- a/build-conf/node-sums.txt +++ b/build-conf/node-sums.txt @@ -1,5 +1,5 @@ -c1e6e0ee0f3c903151d4118e7068d4ae5ef5b408c969d792b0a4af6dfe04275a node-no-intl-v10.19.0-linux-alpine-amd64.tar.gz -ba33990227362ecfe238839ee5e7611b55f3faf860fc44ce694a0aeebb265c2f node-no-intl-v10.19.0-linux-alpine-i386.tar.gz -e015cba0a644f9e08a641affec25afc047af8d0103c9353550c12734bba3b423 node-no-intl-v10.19.0-linux-alpine-armv7hf.tar.gz -9890e656869591cd3f0efeb10046103d324cd48147d40d6d7f6efd1eb680694c node-no-intl-v10.19.0-linux-alpine-aarch64.tar.gz -1227cda220cf86d72f1c57790660a3e3ec007ee6946cf4d92f73692eaae3874b node-no-intl-v10.19.0-linux-alpine-rpi.tar.gz +6d4ab189ece76bed2f40cffe1f1b4dd2d2a805e6fe10c577ae5ce89fce2ad53b node-no-intl-v12.16.2-linux-alpine-amd64.tar.gz +6d81db43dc1285656f6d95807e237e51d33774bed5daafad7f706a4e68b6b546 node-no-intl-v12.16.2-linux-alpine-i386.tar.gz +d964c84be94d0cf3f30f4c4d61d3f2e0d5439b43137c938d0a0df1b6860961fb node-no-intl-v12.16.2-linux-alpine-aarch64.tar.gz +00ac31e6e43319cc3786c0eb97784dad91b5152c5f8be31889215801dcab7712 node-no-intl-v12.16.2-linux-alpine-armv7hf.tar.gz +8c1cfa75a1523a5b21060201178f4a8cd51f492c93693ecfbd67e8b0a49b23f1 node-no-intl-v12.16.2-linux-alpine-rpi.tar.gz diff --git a/package-lock.json b/package-lock.json index d70a5a1e..4ecfd0bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -435,9 +435,9 @@ } }, "@types/node": { - "version": "10.17.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.17.tgz", - "integrity": "sha512-gpNnRnZP3VWzzj5k3qrpRC6Rk3H/uclhAVo1aIvwzK5p5cOrs9yEyQ8H/HBsBY0u5rrWxXEiVPQ0dEB6pkjE8Q==", + "version": "12.12.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.35.tgz", + "integrity": "sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ==", "dev": true }, "@types/optimist": { @@ -4590,7 +4590,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4608,11 +4609,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4630,7 +4633,8 @@ }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", @@ -4762,17 +4766,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4789,6 +4796,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4872,6 +4880,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4995,6 +5004,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9651,6 +9661,12 @@ "tar-stream": "^2.1.0" }, "dependencies": { + "@types/node": { + "version": "10.17.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.19.tgz", + "integrity": "sha512-46/xThm3zvvc9t9/7M3AaLEqtOpqlYYYcCZbpYVAQHG20+oMZBkae/VMrn4BTi6AJ8cpack0mEXhGiKmDNbLrQ==", + "dev": true + }, "bl": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", diff --git a/package.json b/package.json index 12e9491e..0f17b51d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/mocha": "^5.2.7", "@types/morgan": "^1.9.0", "@types/mz": "0.0.32", - "@types/node": "^10.17.17", + "@types/node": "^12.12.6", "@types/request": "^2.48.4", "@types/rimraf": "^2.0.4", "@types/rwlock": "^5.0.2", diff --git a/src/compose/network-manager.ts b/src/compose/network-manager.ts index 355c2fb4..850662ac 100644 --- a/src/compose/network-manager.ts +++ b/src/compose/network-manager.ts @@ -42,10 +42,7 @@ export class NetworkManager { return this.getAll().filter((network: Network) => network.appId === appId); } - public async get(network: { - name: string; - appId: number; - }): Bluebird { + public async get(network: { name: string; appId: number }): Promise { const dockerNet = await this.docker .getNetwork(Network.generateDockerName(network.appId, network.name)) .inspect(); diff --git a/src/device-api/v2.ts b/src/device-api/v2.ts index 41dda0d0..659a2d8a 100644 --- a/src/device-api/v2.ts +++ b/src/device-api/v2.ts @@ -490,12 +490,13 @@ export function createV2Api(router: Router, applications: ApplicationManager) { containerId, }); res.status(200); - journald.stdout.pipe(res); + // We know stdout will be present + journald.stdout!.pipe(res); res.on('close', () => { journald.kill('SIGKILL'); }); journald.on('exit', () => { - journald.stdout.unpipe(); + journald.stdout!.unpipe(); res.end(); }); }); diff --git a/src/network.ts b/src/network.ts index 7736710e..c0d06043 100644 --- a/src/network.ts +++ b/src/network.ts @@ -80,7 +80,7 @@ export const startConnectivityCheck = _.once( customMonitor( { - host: parsedUrl.hostname, + host: parsedUrl.hostname ?? undefined, port: port || (parsedUrl.protocol === 'https' ? 443 : 80), path: parsedUrl.path || '/', interval: 10 * 1000, diff --git a/tsconfig.json b/tsconfig.json index 91f9edfd..ac51fe59 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "target": "ES2019", "module": "commonjs", "noImplicitAny": true, "preserveConstEnums": true,