Merge branch '1.23.X' into 1.23.X-merge-to-2.X.X-2

# Conflicts:
#	docker/debian-base.dockerfile
This commit is contained in:
Louis Lam
2023-12-01 15:50:35 +08:00
13 changed files with 77 additions and 34 deletions

View File

@@ -43,6 +43,7 @@ if (process.platform === "win32") {
"/usr/bin/chromium",
"/usr/bin/chromium-browser",
"/usr/bin/google-chrome",
"/snap/bin/chromium", // Ubuntu
];
} else if (process.platform === "darwin") {
allowedList = [

View File

@@ -1,6 +1,6 @@
const { MonitorType } = require("./monitor-type");
const { UP } = require("../../src/util");
const childProcess = require("child_process");
const childProcessAsync = require("promisify-child-process");
/**
* A TailscalePing class extends the MonitorType.
@@ -37,12 +37,9 @@ class TailscalePing extends MonitorType {
*/
async runTailscalePing(hostname, interval) {
let timeout = interval * 1000 * 0.8;
let res = childProcess.spawnSync("tailscale", [ "ping", hostname ], {
let res = await childProcessAsync.spawn("tailscale", [ "ping", "--c", "1", hostname ], {
timeout: timeout
});
if (res.error) {
throw new Error(`Execution error: ${res.error.message}`);
}
if (res.stderr && res.stderr.toString()) {
throw new Error(`Error in output: ${res.stderr.toString()}`);
}