feat(doctor): add repair/force flows

This commit is contained in:
Peter Steinberger
2026-01-08 21:47:35 +01:00
parent 712a7dddf6
commit 2d4ec35e1c
7 changed files with 80 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ export type ServiceConfigIssue = {
code: string;
message: string;
detail?: string;
level?: "recommended" | "aggressive";
};
export type ServiceConfigAudit = {
@@ -84,6 +85,7 @@ async function auditSystemdUnit(
code: "systemd-after-network-online",
message: "Missing systemd After=network-online.target",
detail: unitPath,
level: "recommended",
});
}
if (!parsed.wants.has("network-online.target")) {
@@ -91,6 +93,7 @@ async function auditSystemdUnit(
code: "systemd-wants-network-online",
message: "Missing systemd Wants=network-online.target",
detail: unitPath,
level: "recommended",
});
}
if (!isRestartSecPreferred(parsed.restartSec)) {
@@ -98,6 +101,7 @@ async function auditSystemdUnit(
code: "systemd-restart-sec",
message: "RestartSec does not match the recommended 5s",
detail: unitPath,
level: "recommended",
});
}
}
@@ -121,6 +125,7 @@ async function auditLaunchdPlist(
code: "launchd-run-at-load",
message: "LaunchAgent is missing RunAtLoad=true",
detail: plistPath,
level: "recommended",
});
}
if (!hasKeepAlive) {
@@ -128,6 +133,7 @@ async function auditLaunchdPlist(
code: "launchd-keep-alive",
message: "LaunchAgent is missing KeepAlive=true",
detail: plistPath,
level: "recommended",
});
}
}
@@ -141,6 +147,7 @@ function auditGatewayCommand(
issues.push({
code: "gateway-command-missing",
message: "Service command does not include the gateway subcommand",
level: "aggressive",
});
}
}