Add debug logging and fix chain end detection for nftables
All checks were successful
Build and Release / build-and-release (push) Successful in 1m28s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m28s
- Detect chain end with closing brace - Add debug logging to trace nft command execution and port collection - Update version to v0.1.250
This commit is contained in:
parent
a288a8ef9a
commit
92a30913b4
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.248"
|
version = "0.1.249"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -301,7 +301,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.248"
|
version = "0.1.249"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -325,7 +325,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.248"
|
version = "0.1.249"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.249"
|
version = "0.1.250"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -920,12 +920,18 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
let output = match output {
|
let output = match output {
|
||||||
Ok(out) if out.status.success() => out,
|
Ok(out) if out.status.success() => out,
|
||||||
_ => return (String::new(), String::new()),
|
_ => {
|
||||||
|
debug!("Failed to run nft list ruleset");
|
||||||
|
return (String::new(), String::new());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let output_str = match String::from_utf8(output.stdout) {
|
let output_str = match String::from_utf8(output.stdout) {
|
||||||
Ok(s) => s,
|
Ok(s) => s,
|
||||||
Err(_) => return (String::new(), String::new()),
|
Err(_) => {
|
||||||
|
debug!("Failed to parse nft output as UTF-8");
|
||||||
|
return (String::new(), String::new());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut tcp_ports = std::collections::HashSet::new();
|
let mut tcp_ports = std::collections::HashSet::new();
|
||||||
@ -945,8 +951,8 @@ impl SystemdCollector {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset when entering other chains
|
// Reset when exiting chain (closing brace) or entering other chains
|
||||||
if line.starts_with("chain ") && !line.contains("input_wan") {
|
if line == "}" || (line.starts_with("chain ") && !line.contains("input_wan")) {
|
||||||
in_wan_chain = false;
|
in_wan_chain = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -985,6 +991,8 @@ impl SystemdCollector {
|
|||||||
let tcp_str = tcp_vec.iter().map(|p| p.to_string()).collect::<Vec<_>>().join(", ");
|
let tcp_str = tcp_vec.iter().map(|p| p.to_string()).collect::<Vec<_>>().join(", ");
|
||||||
let udp_str = udp_vec.iter().map(|p| p.to_string()).collect::<Vec<_>>().join(", ");
|
let udp_str = udp_vec.iter().map(|p| p.to_string()).collect::<Vec<_>>().join(", ");
|
||||||
|
|
||||||
|
debug!("nftables WAN ports - TCP: '{}', UDP: '{}'", tcp_str, udp_str);
|
||||||
|
|
||||||
(tcp_str, udp_str)
|
(tcp_str, udp_str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.249"
|
version = "0.1.250"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.249"
|
version = "0.1.250"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user