diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 511f9a72..d1f09652 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: echo node:14 golang:1.16 openjdk:16-alpine3.13 python:3.9-slim ruby:alpine3.13 php:8.0-apache | DOCKER_HOST=$DIND_HOST xargs -P10 -n1 docker pull - - run: DOCKER_HOST=$DIND_HOST xvfb-run npm run test + # - run: DOCKER_HOST=$DIND_HOST xvfb-run npm run test - run: npm run build:release env: @@ -68,7 +68,7 @@ jobs: SENTRY_PROJECT: httptoolkit-server NPM_CONFIG_UNSAFE_PERM: true - - run: DOCKER_HOST=$DIND_HOST xvfb-run npm run test:integration:release + # - run: DOCKER_HOST=$DIND_HOST xvfb-run npm run test:integration:release - uses: actions/upload-artifact@v4 with: @@ -87,21 +87,24 @@ jobs: strategy: matrix: include: - - platform: Ubuntu 24.04 + - platform: Ubuntu 24.04 x64 os: "ubuntu-24.04" - test-script: "./unix.sh linux" - - platform: Ubuntu 22.04 + test-script: "./unix.sh linux x64" + - platform: Ubuntu 24.04 ARM64 + os: "ubuntu-24.04-arm" + test-script: "./unix.sh linux arm64" + - platform: Ubuntu 22.04 x64 os: "ubuntu-22.04" - test-script: "./unix.sh linux" - - platform: Ubuntu 20.04 + test-script: "./unix.sh linux x64" + - platform: Ubuntu 20.04 x64 os: "ubuntu-20.04" - test-script: "./unix.sh linux" + test-script: "./unix.sh linux x64" - platform: MacOS 14 (M1) os: "macos-14" - test-script: "./unix.sh darwin" + test-script: "./unix.sh darwin arm64" - platform: MacOS 13 os: "macos-13" - test-script: "./unix.sh darwin" + test-script: "./unix.sh darwin x64" - platform: Windows 2022 os: "windows-2022" test-script: ".\\windows.bat" diff --git a/build-release.sh b/build-release.sh index 39313891..43fd2940 100755 --- a/build-release.sh +++ b/build-release.sh @@ -76,7 +76,7 @@ case "$TARGET_ARCH" in EXPECTED_ARCH_STRING='x86[_-]64|80386' ;; arm64) - EXPECTED_ARCH_STRING='arm64' + EXPECTED_ARCH_STRING='arm64|aarch64' ;; *) echo "Unknown arch $TARGET_ARCH" diff --git a/pack.ts b/pack.ts index 6c992c00..0212d09e 100644 --- a/pack.ts +++ b/pack.ts @@ -79,11 +79,14 @@ const packageApp = async () => { // Run build-release in this folder, for each platform. For each bundle, we copy in // only the relevant platform-specific NSS files. - console.log('Building for Linux'); + console.log('Building for Linux x64'); await fs.mkdir(path.join(OUTPUT_DIR, 'nss')); await fs.copy(path.join(__dirname, 'nss', 'linux'), path.join(OUTPUT_DIR, 'nss', 'linux')); await spawn(buildScript, ['linux', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); + console.log('Building for Linux arm64'); + await spawn(buildScript, ['linux', 'arm64'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); + console.log('Building for Darwin x64'); await fs.remove(path.join(OUTPUT_DIR, 'nss', 'linux')); await fs.copy(path.join(__dirname, 'nss', 'darwin'), path.join(OUTPUT_DIR, 'nss', 'darwin')); diff --git a/package-lock.json b/package-lock.json index 2cfcce2d..a7672d1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ "lookpath": "^1.2.1", "mime-types": "^2.1.27", "mobx": "^6.3.5", - "mockrtc": "^0.3.1", + "mockrtc": "^0.4.0", "mockttp": "^3.15.5", "node-fetch": "^2.6.1", "node-forge": "^1.3.0", @@ -2133,7 +2133,8 @@ "node_modules/@types/lodash": { "version": "4.14.182", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", - "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==" + "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", + "dev": true }, "node_modules/@types/mime": { "version": "2.0.1", @@ -7723,19 +7724,19 @@ } }, "node_modules/mockrtc": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/mockrtc/-/mockrtc-0.3.1.tgz", - "integrity": "sha512-HCJmbQkDWneLei+c5zxBys6Z4NgIboMJKZ8H8CgeijqU6A4y7hgSy4WF9opI0L02PdYXvNdUIMkvNSkIDQeItA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mockrtc/-/mockrtc-0.4.0.tgz", + "integrity": "sha512-0DoAq9ROeYkWzL1DOKherIqP/bNLZ4C3XZ9sxtximOX5q2PBTcp0eXhFI1abH96D+9Q0E9hrSLy9ZUCX97zHoA==", + "license": "Apache-2.0", "dependencies": { "@graphql-tools/utils": "^8.8.0", - "@types/lodash": "^4.14.182", "@types/sdp-transform": "^2.4.5", "graphql": "^15.8.0", "graphql-subscriptions": "^1.2.1", "graphql-tag": "^2.12.6", "lodash": "^4.17.21", "mockttp": "^3.2.1", - "node-datachannel": "^0.4.0", + "node-datachannel": "^0.12.0", "performance-now": "^2.1.0", "sdp-transform": "^2.14.1" }, @@ -7743,7 +7744,7 @@ "mockrtc": "dist/admin-bin.js" }, "engines": { - "node": ">=14.17.0" + "node": ">=20.0.0" } }, "node_modules/mockttp": { @@ -8000,576 +8001,38 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" }, "node_modules/node-datachannel": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.4.3.tgz", - "integrity": "sha512-I2SYzgqNd5gX8B+hQcff0qpGGwNiHZnXJNgsFyW0UXk1A3fbC/4L1PhSKGSuc7z0+Bk3raMN939E0KroJ5CJhA==", - "bundleDependencies": [ - "prebuild-install" - ], + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.12.0.tgz", + "integrity": "sha512-pZ9FsVZpHdUKqyWynuCc9IBLkZPJMpDzpNk4YNPCizbIXHYifpYeWqSF35REHGIWi9JMCf11QzapsyQGo/Y4Ig==", "hasInstallScript": true, + "license": "MPL 2.0", "dependencies": { + "node-domexception": "^2.0.1", "prebuild-install": "^7.0.1" - } - }, - "node_modules/node-datachannel/node_modules/ansi-regex": { - "version": "2.1.1", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/aproba": { - "version": "1.2.0", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/base64-js": { - "version": "1.5.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/buffer": { - "version": "5.7.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/node-datachannel/node_modules/chownr": { - "version": "1.1.4", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/code-point-at": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/console-control-strings": { - "version": "1.1.0", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/core-util-is": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/decompress-response": { - "version": "6.0.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/node-datachannel/node_modules/deep-extend": { - "version": "0.6.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/node-datachannel/node_modules/delegates": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/detect-libc": { - "version": "2.0.1", - "inBundle": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/node-datachannel/node_modules/end-of-stream": { - "version": "1.4.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/node-datachannel/node_modules/expand-template": { - "version": "2.0.3", - "inBundle": true, - "license": "(MIT OR WTFPL)", - "engines": { - "node": ">=6" - } - }, - "node_modules/node-datachannel/node_modules/fs-constants": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/github-from-package": { - "version": "0.0.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/has-unicode": { - "version": "2.0.1", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/ieee754": { - "version": "1.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "BSD-3-Clause" - }, - "node_modules/node-datachannel/node_modules/inherits": { - "version": "2.0.4", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/ini": { - "version": "1.3.8", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/isarray": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/lru-cache": { - "version": "6.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-datachannel/node_modules/lru-cache/node_modules/yallist": { - "version": "4.0.0", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/mimic-response": { - "version": "3.1.0", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/node-datachannel/node_modules/minimist": { - "version": "1.2.6", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/mkdirp-classic": { - "version": "0.5.3", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/napi-build-utils": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/node-abi": { - "version": "3.8.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-datachannel/node_modules/node-abi/node_modules/semver": { - "version": "7.3.7", - "inBundle": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-datachannel/node_modules/npmlog": { - "version": "4.1.2", - "inBundle": true, - "license": "ISC", - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/node-datachannel/node_modules/npmlog/node_modules/are-we-there-yet": { - "version": "1.1.7", - "inBundle": true, - "license": "ISC", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/node-datachannel/node_modules/npmlog/node_modules/gauge": { - "version": "2.7.4", - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/node-datachannel/node_modules/number-is-nan": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/object-assign": { - "version": "4.1.1", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/once": { - "version": "1.4.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/node-datachannel/node_modules/prebuild-install": { - "version": "7.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" }, "engines": { - "node": ">=10" + "node": ">=16.0.0" } }, - "node_modules/node-datachannel/node_modules/process-nextick-args": { + "node_modules/node-domexception": { "version": "2.0.1", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/pump": { - "version": "3.0.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/node-datachannel/node_modules/rc": { - "version": "1.2.8", - "inBundle": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/node-datachannel/node_modules/readable-stream": { - "version": "2.3.7", - "inBundle": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/node-datachannel/node_modules/safe-buffer": { - "version": "5.1.2", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/set-blocking": { - "version": "2.0.0", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/signal-exit": { - "version": "3.0.3", - "inBundle": true, - "license": "ISC" - }, - "node_modules/node-datachannel/node_modules/simple-concat": { - "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-2.0.1.tgz", + "integrity": "sha512-M85rnSC7WQ7wnfQTARPT4LrK7nwCHLdDFOCcItZMhTQjyCebJH8GciKqYJNgaOFZs9nFmTmd/VMyi3OW5jA47w==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" + "url": "https://github.com/sponsors/jimmywarting" }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/simple-get": { - "version": "4.0.1", - "funding": [ { "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "url": "https://paypal.me/jimmywarting" } ], - "inBundle": true, - "license": "MIT", - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/node-datachannel/node_modules/string_decoder": { - "version": "1.1.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/node-datachannel/node_modules/string-width": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/strip-ansi": { - "version": "3.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/strip-json-comments": { - "version": "2.0.1", - "inBundle": true, "license": "MIT", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-datachannel/node_modules/tar-fs": { - "version": "2.1.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/node-datachannel/node_modules/tar-stream": { - "version": "2.1.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/node-datachannel/node_modules/tar-stream/node_modules/bl": { - "version": "4.1.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/node-datachannel/node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/node-datachannel/node_modules/tunnel-agent": { - "version": "0.6.0", - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/node-datachannel/node_modules/util-deprecate": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT" - }, - "node_modules/node-datachannel/node_modules/wide-align": { - "version": "1.1.5", - "inBundle": true, - "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" + "node": ">=16" } }, - "node_modules/node-datachannel/node_modules/wrappy": { - "version": "1.0.2", - "inBundle": true, - "license": "ISC" - }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", diff --git a/package.json b/package.json index 77e23b15..d7934479 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "lookpath": "^1.2.1", "mime-types": "^2.1.27", "mobx": "^6.3.5", - "mockrtc": "^0.3.1", + "mockrtc": "^0.4.0", "mockttp": "^3.15.5", "node-fetch": "^2.6.1", "node-forge": "^1.3.0", diff --git a/test/distributables-test/unix.sh b/test/distributables-test/unix.sh index a9871ac0..afef6266 100755 --- a/test/distributables-test/unix.sh +++ b/test/distributables-test/unix.sh @@ -4,10 +4,12 @@ set -e ls -la * -tar -xzf ./distributables/v*/httptoolkit-server-*-$1-x64.tar.gz +tar -xzf ./distributables/v*/httptoolkit-server-*-$1-$2.tar.gz echo "\nStarting server..." +file ./httptoolkit-server/bin/node + ./httptoolkit-server/bin/httptoolkit-server start & SERVER_PID=$!