Removed dependencies and replaced with custom code: - thiserror: Not used (only pulled by tokio-tungstenite) - hostname: Replaced with /proc/sys/kernel/hostname reader - chrono: Replaced with std::time::SystemTime + custom formatting - base64: Replaced with custom base64 encoder/decoder Benefits: - Binary size: 2.4M → 2.3M (100KB reduction) - Reduced dependency count: 19 → 15 direct dependencies - Added 7 new tests (73 → 80 total tests) - All tests pass Custom implementations: - format_timestamp(): YYYY-MM-DD HH:MM:SS.mmm format - get_hostname(): Read from /proc/sys/kernel/hostname - get_uptime_seconds(): Read from /proc/uptime - base64_encode/decode(): Standard base64 encoding No functionality changes, all existing features work identically.
30 lines
727 B
TOML
30 lines
727 B
TOML
[package]
|
|
name = "towerops-agent"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
snmp = "0.2"
|
|
ureq = { version = "2.10", features = ["json"] }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time", "net"] }
|
|
tokio-tungstenite = { version = "0.21", features = ["rustls-tls-webpki-roots"] }
|
|
futures = "0.3"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
log = { version = "0.4", features = ["std"] }
|
|
clap = { version = "4.0", features = ["derive", "env"] }
|
|
prost = "0.13"
|
|
prost-types = "0.13"
|
|
tiny_http = "0.12"
|
|
anyhow = "1.0"
|
|
socket2 = "0.5"
|
|
rand = "0.8"
|
|
|
|
[build-dependencies]
|
|
prost-build = "0.13"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|