Merge pull request #2008 from balena-os/nodejs-14

Update to nodejs 14
This commit is contained in:
bulldozer-balena[bot] 2022-09-15 22:31:17 +00:00 committed by GitHub
commit 4ba7a24980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 877 additions and 272 deletions

View File

@ -7,7 +7,7 @@ testfs:
# in the `testfs` configuration.
filesystem:
/mnt/boot/config.json:
from: test/data/config.json
from: test/data/testconfig.json
/mnt/boot/config.txt:
from: test/data/mnt/boot/config.txt
/mnt/boot/device-type.json:

View File

@ -8,7 +8,7 @@ ARG PREFIX=library
###################################################
# Build the supervisor dependencies
###################################################
FROM balenalib/${ARCH}-alpine-node:12-run as build-base
FROM balenalib/${ARCH}-alpine-node:14-run as build-base
ARG PREFIX
# Sanity check to prevent a prefix for a non-official docker image being
@ -101,18 +101,18 @@ COPY typings ./typings
COPY src ./src
COPY test ./test
# Run type checking and unit/legacy tests here
# to prevent setting up a test environment that will
# Run type checking and unit/legacy tests here
# to prevent setting up a test environment that will
# most likely fail.
# For now this also runs the legacy tests, that are slow, this is a
# For now this also runs the legacy tests, that are slow, this is a
# forcing function to finish the split between unit/integration
RUN npm run test
# When running tests from a container built from this stage,
# When running tests from a container built from this stage,
# skip the mocha-pod setup
ENV MOCHAPOD_SKIP_SETUP=1
# This command will be used by default when running integration tests
# This command will be used by default when running integration tests
# from this stage
CMD npm run test:integration

1118
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -32,11 +32,11 @@
"dbus": "^1.0.7",
"mdns-resolver": "^1.0.0",
"semver": "^7.3.2",
"sqlite3": "^4.1.1",
"sqlite3": "^5.0.11",
"systeminformation": "^5.6.10"
},
"engines": {
"node": "^12.16.2",
"node": "^14.20.0",
"npm": "^6.14.4"
},
"devDependencies": {
@ -59,7 +59,7 @@
"@types/mocha": "^8.2.2",
"@types/mock-fs": "^4.13.0",
"@types/morgan": "^1.9.0",
"@types/node": "^12.12.54",
"@types/node": "^14.18.28",
"@types/request": "^2.48.5",
"@types/rewire": "^2.5.28",
"@types/rimraf": "^2.0.4",

View File

@ -137,15 +137,14 @@ export function getIPAddresses(): string[] {
// - the docker network for the supervisor API (supervisor0)
// - custom docker network bridges (br- + 12 hex characters)
const networkInterfaces = os.networkInterfaces();
return Object.keys(networkInterfaces)
.filter((iface) => shouldReportInterface(iface))
.map((iface) => networkInterfaces[iface])
.flatMap((validInterfaces) => {
return Object.entries(networkInterfaces)
.filter(([iface]) => shouldReportInterface(iface))
.flatMap(([, validInterfaces]) => {
return (
validInterfaces
// Only report valid ipv6 and ipv4 addresses
.filter((ip) => shouldReportIPv6(ip) || shouldReportIPv4(ip))
.map(({ address }) => address)
?.filter((ip) => shouldReportIPv6(ip) || shouldReportIPv4(ip))
.map(({ address }) => address) ?? []
);
});
}