fix(web-probe): harden sentinel dashboard validation

This commit is contained in:
Codex
2026-06-26 17:50:52 +00:00
parent 1599367eeb
commit f6225f0e12
3 changed files with 196 additions and 50 deletions
+3 -3
View File
@@ -119,8 +119,8 @@ export function parseNodeWebProbeSentinelOptions(args: string[]): NodeWebProbeSe
} else if (sentinelActionRaw === "dashboard") {
const dashboardAction = parseWebProbeSentinelDashboardAction(args[1]);
const timeoutMs = positiveIntegerOption(args, "--timeout-ms", 30000, 120000);
const waitTimeoutMs = positiveIntegerOption(args, "--wait-timeout-ms", Math.max(90000, timeoutMs + 30000), 600000);
const commandTimeoutSeconds = positiveIntegerOption(args, "--command-timeout-seconds", Math.ceil(waitTimeoutMs / 1000) + 45, 900);
const waitTimeoutMs = positiveIntegerOption(args, "--wait-timeout-ms", Math.max(60000, timeoutMs + 15000), 600000);
const commandTimeoutSeconds = positiveIntegerOption(args, "--command-timeout-seconds", Math.min(900, Math.max(120, Math.ceil(waitTimeoutMs / 1000) + 30)), 900);
sentinel = {
kind: "dashboard",
action: dashboardAction,
@@ -134,7 +134,7 @@ export function parseNodeWebProbeSentinelOptions(args: string[]): NodeWebProbeSe
waitTimeoutMs,
timeoutSeconds: commandTimeoutSeconds,
commandTimeoutSeconds,
fullPage: !args.includes("--no-full-page"),
fullPage: args.includes("--full-page") && !args.includes("--no-full-page"),
raw: args.includes("--raw"),
};
} else {