Switched from surge-ping Rust library to system ping command (iputils) to avoid requiring CAP_NET_RAW capability for ICMP ping. Changes: - Use tokio::process::Command to execute /bin/ping or /bin/ping6 - Parse response time from ping output (time=X.XX ms) - Removed surge-ping and rand dependencies from Cargo.toml - Added tokio "process" feature Benefits: - No special capabilities required (ping binary has setuid root) - Works in restricted container environments - Already available in Docker image (iputils package) - More portable across different container runtimes The system ping command is already installed in the Docker image and has setuid root permissions, allowing it to create raw sockets without requiring the container to have CAP_NET_RAW.
41 lines
1,017 B
TOML
41 lines
1,017 B
TOML
[package]
|
|
name = "towerops-agent"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
netsnmp-sys = "0.1"
|
|
libc = "0.2"
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "net", "signal", "io-util", "process"] }
|
|
thiserror = "2"
|
|
tokio-tungstenite = { version = "0.28", features = ["rustls-tls-webpki-roots"] }
|
|
tokio-rustls = "0.26"
|
|
futures = "0.3"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
clap = { version = "4.5", features = ["derive", "env"] }
|
|
prost = "0.14"
|
|
prost-types = "0.14"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
russh = "0.57"
|
|
async-trait = "0.1"
|
|
home = "=0.5.12"
|
|
zeroize = { version = "1", features = ["derive"] }
|
|
anyhow = "1.0"
|
|
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
|
|
sha2 = "0.10"
|
|
|
|
[dev-dependencies]
|
|
regex = "1"
|
|
|
|
[build-dependencies]
|
|
prost-build = "0.14"
|
|
cc = "1.0"
|
|
chrono = "0.4"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|