Полностью доведена production-логика AWG2 harness по up2: strict execution, tc parser, anti-torrent, status и документация

This commit is contained in:
2026-05-09 23:38:53 +05:00
parent e7818054e8
commit d9f140b3e0
18 changed files with 699 additions and 146 deletions
+11 -12
View File
@@ -5,15 +5,7 @@ use std::{
time::{Duration, Instant},
};
use crate::{
config::Config,
docker,
firewall,
iface,
netns::build_transport,
reboot,
traffic,
};
use crate::{config::Config, docker, firewall, iface, netns::build_transport, reboot, traffic};
use tracing::{error, info};
#[derive(Debug, Clone, Default)]
@@ -70,7 +62,9 @@ pub fn run(cfg: Config) -> anyhow::Result<()> {
} else {
set_ok(&state, "periodic firewall reconcile ok");
}
thread::sleep(Duration::from_secs(cfg.traffic.reconcile_interval_secs.max(5)));
thread::sleep(Duration::from_secs(
cfg.traffic.reconcile_interval_secs.max(5),
));
}
}
@@ -79,7 +73,13 @@ fn docker_events_loop(cfg: &Config, state: &Arc<Mutex<LastActionState>>) -> anyh
use std::process::{Command, Stdio};
let mut child = Command::new("docker")
.args(["events", "--filter", "event=start", "--format", "{{.Actor.Attributes.name}}"])
.args([
"events",
"--filter",
"event=start",
"--format",
"{{.Actor.Attributes.name}}",
])
.stdout(Stdio::piped())
.spawn()?;
@@ -150,4 +150,3 @@ fn persist_state(state: &LastActionState) {
);
let _ = fs::write(LAST_STATE_FILE, content);
}