Документация и runtime: полный production-fix по fix6 без legacy

This commit is contained in:
2026-05-10 22:58:59 +05:00
parent 83c4e3ba05
commit 819cc9c308
12 changed files with 106 additions and 267 deletions
+14 -3
View File
@@ -130,13 +130,18 @@ impl Config {
fn check_host_tools(&self) -> anyhow::Result<()> {
let mut required = vec!["tc", "ip", "wg", "docker", "modprobe"];
if !crate::netns::nsenter_available() {
eprintln!("nsenter is not available, will use docker exec fallback");
} else {
required.push("nsenter");
anyhow::bail!("required host tool not found in PATH: nsenter");
}
required.push("nsenter");
if self.anti_torrent.enabled {
required.push("nft");
}
if self.reboot.enabled {
required.push("systemctl");
}
if self.swap.enabled {
required.extend(["fallocate", "chmod", "mkswap", "swapon", "sysctl"]);
}
for tool in required {
if !tool_exists(tool) {
@@ -199,6 +204,12 @@ fn tool_exists(tool: &str) -> bool {
"modprobe" => &[&["--version"]],
"nsenter" => &[&["--help"]],
"nft" => &[&["--version"]],
"systemctl" => &[&["--version"], &["--help"]],
"fallocate" => &[&["--help"]],
"chmod" => &[&["--help"]],
"mkswap" => &[&["--help"]],
"swapon" => &[&["--help"]],
"sysctl" => &[&["--version"], &["--help"]],
_ => &[&["--version"], &["--help"], &["-V"]],
};