Fallback to /bin/ping if ping is not found

This commit is contained in:
Louis Lam 2023-01-12 01:04:58 +08:00
parent cc4ed308b0
commit d9f12a6376
3 changed files with 28 additions and 26 deletions

50
package-lock.json generated
View File

@ -1,15 +1,16 @@
{
"name": "uptime-kuma",
"version": "1.19.3",
"version": "1.19.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "uptime-kuma",
"version": "1.19.3",
"version": "1.19.4",
"license": "MIT",
"dependencies": {
"@grpc/grpc-js": "~1.7.3",
"@louislam/ping": "~0.4.2-mod.0",
"@louislam/sqlite3": "15.1.2",
"args-parser": "~1.3.0",
"axios": "~0.27.0",
@ -48,7 +49,6 @@
"password-hash": "~1.2.2",
"pg": "~8.8.0",
"pg-connection-string": "~2.5.0",
"ping": "~0.4.2",
"prom-client": "~13.2.0",
"prometheus-api-metrics": "~3.2.1",
"protobufjs": "~7.1.1",
@ -3161,6 +3161,19 @@
"resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.5.1.tgz",
"integrity": "sha512-oTFmkyv5MhgkHdZhoe5lwRoKW0t4njPvK3g7ODvK/prkoC5bwylKcyQJMsmjvgHBXoy4u5iLnB5yQ7AljouHAA=="
},
"node_modules/@louislam/ping": {
"version": "0.4.2-mod.0",
"resolved": "https://registry.npmjs.org/@louislam/ping/-/ping-0.4.2-mod.0.tgz",
"integrity": "sha512-cyHnJHsMkC+sFU32GBzX5SlwdTb+BIBlwsdwsDm+AS9jcS1sz7JPBrdCStqpNkVn5lUUQZ7Ak5DRwlWuwJOYAg==",
"dependencies": {
"command-exists": "~1.2.9",
"q": "1.x",
"underscore": "^1.12.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/@louislam/sqlite3": {
"version": "15.1.2",
"resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.1.2.tgz",
@ -13502,18 +13515,6 @@
"node": ">=0.10.0"
}
},
"node_modules/ping": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/ping/-/ping-0.4.2.tgz",
"integrity": "sha512-1uAw0bzHtrPbPo2s6no06oZAzY6KqKclEJR1JRZKIHKXKlPdrz9N0/1MPPB+BbrvMjN3Mk0pcod3bfLNZFRo9w==",
"dependencies": {
"q": "1.x",
"underscore": "^1.12.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/pirates": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz",
@ -19462,6 +19463,16 @@
"resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.5.1.tgz",
"integrity": "sha512-oTFmkyv5MhgkHdZhoe5lwRoKW0t4njPvK3g7ODvK/prkoC5bwylKcyQJMsmjvgHBXoy4u5iLnB5yQ7AljouHAA=="
},
"@louislam/ping": {
"version": "0.4.2-mod.0",
"resolved": "https://registry.npmjs.org/@louislam/ping/-/ping-0.4.2-mod.0.tgz",
"integrity": "sha512-cyHnJHsMkC+sFU32GBzX5SlwdTb+BIBlwsdwsDm+AS9jcS1sz7JPBrdCStqpNkVn5lUUQZ7Ak5DRwlWuwJOYAg==",
"requires": {
"command-exists": "~1.2.9",
"q": "1.x",
"underscore": "^1.12.0"
}
},
"@louislam/sqlite3": {
"version": "15.1.2",
"resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.1.2.tgz",
@ -27316,15 +27327,6 @@
"integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==",
"dev": true
},
"ping": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/ping/-/ping-0.4.2.tgz",
"integrity": "sha512-1uAw0bzHtrPbPo2s6no06oZAzY6KqKclEJR1JRZKIHKXKlPdrz9N0/1MPPB+BbrvMjN3Mk0pcod3bfLNZFRo9w==",
"requires": {
"q": "1.x",
"underscore": "^1.12.0"
}
},
"pirates": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz",

View File

@ -67,6 +67,7 @@
},
"dependencies": {
"@grpc/grpc-js": "~1.7.3",
"@louislam/ping": "~0.4.2-mod.0",
"@louislam/sqlite3": "15.1.2",
"args-parser": "~1.3.0",
"axios": "~0.27.0",
@ -105,7 +106,6 @@
"password-hash": "~1.2.2",
"pg": "~8.8.0",
"pg-connection-string": "~2.5.0",
"ping": "~0.4.2",
"prom-client": "~13.2.0",
"prometheus-api-metrics": "~3.2.1",
"protobufjs": "~7.1.1",

View File

@ -1,5 +1,5 @@
const tcpp = require("tcp-ping");
const ping = require("ping");
const ping = require("@louislam/ping");
const { R } = require("redbean-node");
const { log, genSecret } = require("../src/util");
const passwordHash = require("./password-hash");