cloud: update cloudflared

This commit is contained in:
Koushik Dutta
2024-08-06 20:44:41 -07:00
parent 724b9332f4
commit 12c734fe1b
4 changed files with 66 additions and 132 deletions

View File

@@ -1,27 +1,27 @@
{
"name": "@scrypted/cloud",
"version": "0.2.29",
"version": "0.2.30",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/cloud",
"version": "0.2.29",
"version": "0.2.30",
"dependencies": {
"@eneris/push-receiver": "^3.1.5",
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",
"bpmux": "^8.2.1",
"cloudflared": "^0.5.2",
"cloudflared": "^0.5.3",
"exponential-backoff": "^3.1.1",
"http-proxy": "^1.18.1",
"nat-upnp": "file:./external/node-nat-upnp"
},
"devDependencies": {
"@types/http-proxy": "^1.17.14",
"@types/http-proxy": "^1.17.15",
"@types/ip": "^1.1.3",
"@types/nat-upnp": "^1.1.5",
"@types/node": "^20.14.6",
"@types/node": "^22.1.0",
"ts-node": "^10.9.2"
}
},
@@ -79,23 +79,22 @@
},
"../../sdk": {
"name": "@scrypted/sdk",
"version": "0.3.46",
"version": "0.3.50",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.18.6",
"adm-zip": "^0.4.13",
"axios": "^1.6.5",
"babel-loader": "^9.1.0",
"babel-plugin-const-enum": "^1.1.0",
"esbuild": "^0.15.9",
"@babel/preset-typescript": "^7.24.7",
"adm-zip": "^0.5.14",
"axios": "^1.7.3",
"babel-loader": "^9.1.3",
"babel-plugin-const-enum": "^1.2.0",
"ncp": "^2.0.0",
"raw-loader": "^4.0.2",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
"ts-loader": "^9.4.2",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.5.0"
"rimraf": "^6.0.1",
"tmp": "^0.2.3",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"webpack": "^5.93.0",
"webpack-bundle-analyzer": "^4.10.2"
},
"bin": {
"scrypted-changelog": "bin/scrypted-changelog.js",
@@ -107,11 +106,11 @@
"scrypted-webpack": "bin/scrypted-webpack.js"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@types/stringify-object": "^4.0.0",
"@types/node": "^22.1.0",
"@types/stringify-object": "^4.0.5",
"stringify-object": "^3.3.0",
"ts-node": "^10.4.0",
"typedoc": "^0.23.21"
"ts-node": "^10.9.2",
"typedoc": "^0.26.5"
}
},
"../../sdk/node_modules/@babel/code-frame": {
@@ -1085,55 +1084,6 @@
"version": "1.2.1",
"license": "MIT"
},
"../../sdk/node_modules/esbuild": {
"version": "0.15.9",
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.15.9",
"@esbuild/linux-loong64": "0.15.9",
"esbuild-android-64": "0.15.9",
"esbuild-android-arm64": "0.15.9",
"esbuild-darwin-64": "0.15.9",
"esbuild-darwin-arm64": "0.15.9",
"esbuild-freebsd-64": "0.15.9",
"esbuild-freebsd-arm64": "0.15.9",
"esbuild-linux-32": "0.15.9",
"esbuild-linux-64": "0.15.9",
"esbuild-linux-arm": "0.15.9",
"esbuild-linux-arm64": "0.15.9",
"esbuild-linux-mips64le": "0.15.9",
"esbuild-linux-ppc64le": "0.15.9",
"esbuild-linux-riscv64": "0.15.9",
"esbuild-linux-s390x": "0.15.9",
"esbuild-netbsd-64": "0.15.9",
"esbuild-openbsd-64": "0.15.9",
"esbuild-sunos-64": "0.15.9",
"esbuild-windows-32": "0.15.9",
"esbuild-windows-64": "0.15.9",
"esbuild-windows-arm64": "0.15.9"
}
},
"../../sdk/node_modules/esbuild-darwin-arm64": {
"version": "0.15.9",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"../../sdk/node_modules/escalade": {
"version": "3.1.1",
"license": "MIT",
@@ -2591,9 +2541,9 @@
"dev": true
},
"node_modules/@types/http-proxy": {
"version": "1.17.14",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz",
"integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==",
"version": "1.17.15",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz",
"integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==",
"dev": true,
"dependencies": {
"@types/node": "*"
@@ -2618,11 +2568,11 @@
}
},
"node_modules/@types/node": {
"version": "20.14.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz",
"integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==",
"version": "22.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz",
"integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==",
"dependencies": {
"undici-types": "~5.26.4"
"undici-types": "~6.13.0"
}
},
"node_modules/acorn": {
@@ -2662,14 +2612,15 @@
},
"node_modules/asynckit": {
"version": "0.4.0",
"license": "MIT"
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz",
"integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==",
"dependencies": {
"follow-redirects": "^1.15.4",
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@@ -2685,9 +2636,9 @@
}
},
"node_modules/cloudflared": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/cloudflared/-/cloudflared-0.5.2.tgz",
"integrity": "sha512-drvrnjGDBUTjDvUgXHrMzqu+PiZ2rdYizr86H18oKy3ak+YjZg1T3RsrpJPBnwQl81/LiH6LYSH6MN9TLR0fkA==",
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/cloudflared/-/cloudflared-0.5.3.tgz",
"integrity": "sha512-v2Hxnm9uZsc3ub4hf7xEzn1MSovY2mGZR2SB/xrvMuV6l+YfFLbE8KYPNuEdpFOS6sWldOvy/bpNhKvMQKsM+Q==",
"hasInstallScript": true,
"bin": {
"cloudflared": "lib/cloudflared.js"
@@ -2695,7 +2646,8 @@
},
"node_modules/combined-stream": {
"version": "1.0.8",
"license": "MIT",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
@@ -2711,7 +2663,8 @@
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"license": "MIT",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
@@ -2755,7 +2708,8 @@
},
"node_modules/form-data": {
"version": "4.0.0",
"license": "MIT",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
@@ -2773,13 +2727,11 @@
}
},
"node_modules/http_ece": {
"version": "1.1.0",
"license": "MIT",
"dependencies": {
"urlsafe-base64": "~1.0.0"
},
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http_ece/-/http_ece-1.2.0.tgz",
"integrity": "sha512-JrF8SSLVmcvc5NducxgyOrKXe3EsyHMgBFgSaIUGmArKe+rwr0uphRkRXvwiom3I+fpIfoItveHrfudL8/rxuA==",
"engines": {
"node": ">=4"
"node": ">=16"
}
},
"node_modules/http-proxy": {
@@ -2812,14 +2764,16 @@
},
"node_modules/mime-db": {
"version": "1.52.0",
"license": "MIT",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"license": "MIT",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
@@ -2832,9 +2786,9 @@
"link": true
},
"node_modules/protobufjs": {
"version": "7.2.6",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz",
"integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==",
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz",
"integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==",
"hasInstallScript": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
@@ -2856,7 +2810,8 @@
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"license": "MIT"
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/requires-port": {
"version": "1.0.0",
@@ -2925,12 +2880,9 @@
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/urlsafe-base64": {
"version": "1.0.0"
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz",
"integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg=="
},
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",

View File

@@ -42,17 +42,17 @@
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk",
"bpmux": "^8.2.1",
"cloudflared": "^0.5.2",
"cloudflared": "^0.5.3",
"exponential-backoff": "^3.1.1",
"http-proxy": "^1.18.1",
"nat-upnp": "file:./external/node-nat-upnp"
},
"devDependencies": {
"@types/http-proxy": "^1.17.14",
"@types/http-proxy": "^1.17.15",
"@types/ip": "^1.1.3",
"@types/nat-upnp": "^1.1.5",
"@types/node": "^20.14.6",
"@types/node": "^22.1.0",
"ts-node": "^10.9.2"
},
"version": "0.2.29"
"version": "0.2.30"
}

View File

@@ -6,7 +6,7 @@ import { httpFetch } from '../../../server/src/fetch/http-fetch';
export async function installCloudflared() {
const pluginVolume = process.env.SCRYPTED_PLUGIN_VOLUME;
const version = 2;
const version = 5;
const cloudflareD = path.join(pluginVolume, 'cloudflare.d', `v${version}`, `${process.platform}-${process.arch}`);
const bin = path.join(cloudflareD, cloudflared.bin);
@@ -18,25 +18,7 @@ export async function installCloudflared() {
recursive: true,
});
}
if (process.platform === 'darwin' && process.arch === 'arm64') {
const bin = path.join(cloudflareD, cloudflared.bin);
mkdirSync(path.dirname(bin), {
recursive: true,
});
const tmp = `${bin}.tmp`;
const stream = await httpFetch({
url: 'https://github.com/scryptedapp/cloudflared/releases/download/2023.8.2/cloudflared-darwin-arm64',
responseType: 'readable',
});
const write = stream.body.pipe(fs.createWriteStream(tmp));
await once(write, 'close');
renameSync(tmp, bin);
fs.chmodSync(bin, 0o0755)
}
else {
await cloudflared.install(bin);
}
await cloudflared.install(bin);
}
return {

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "Node16",
"target": "ES2021",
"resolveJsonModule": true,
"moduleResolution": "Node16",