Files
wehub-resource-sync 19dc5d82a0
Rust / build (push) Failing after 1s
Rust / docker (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:29:44 +08:00

246 lines
7.7 KiB
TOML

[workspace]
members = [".", "crates/rustnet-core", "crates/rustnet-capture", "crates/rustnet-host"]
resolver = "3"
# Shared metadata for every crate in the workspace. Members opt in with
# `<field>.workspace = true`. The binary keeps its own `version` (it tracks the
# user-facing 1.x release line, independent of the 0.x library crates).
[workspace.package]
version = "0.3.0"
authors = ["domcyrus"]
edition = "2024"
rust-version = "1.88.0" # Let-chains require Rust 1.88.0+
repository = "https://github.com/domcyrus/rustnet"
homepage = "https://github.com/domcyrus/rustnet"
license = "Apache-2.0"
# Single source of truth for the internal crate versions (and the few deps
# shared across crates). Bumping a library version is now a one-line edit here
# instead of one edit per member manifest. Members reference these with
# `<dep>.workspace = true`.
[workspace.dependencies]
rustnet-core = { version = "0.3.0", path = "crates/rustnet-core" }
rustnet-capture = { version = "0.3.0", path = "crates/rustnet-capture" }
rustnet-host = { version = "0.3.0", path = "crates/rustnet-host" }
anyhow = "1.0"
log = "0.4"
[package]
name = "rustnet-monitor"
version = "1.4.0"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "A cross-platform network monitoring terminal UI tool built with Rust"
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/rustnet-monitor"
readme = "README.md"
license.workspace = true
keywords = ["network", "monitoring", "tui", "ebpf", "packet-capture"]
categories = ["command-line-utilities", "network-programming", "visualization"]
exclude = [".github/", "scripts/", "tests/", "*.log", "target/", ".gitignore"]
[lib]
name = "rustnet_monitor"
path = "src/lib.rs"
[[bin]]
name = "rustnet"
path = "src/main.rs"
# The bin re-compiles every src/* module that lib.rs also re-exports.
# Running `cargo test` on the bin therefore duplicates every unit test
# under a different crate prefix, which breaks snapshot-test file paths
# (`rustnet__...` vs `rustnet_monitor__...`). Tests live in the lib and
# in `tests/`; the bin is just the entry point.
test = false
[dependencies]
rustnet-core.workspace = true
rustnet-capture.workspace = true
rustnet-host.workspace = true
anyhow.workspace = true
libc = "0.2"
arboard = { version = "3.6", features = ["wayland-data-control"] }
crossterm = "0.29"
crossbeam = "0.8"
dashmap = "6.2"
log.workspace = true
pcap = "2.4.0"
clap = { version = "4.6", features = ["derive"] }
simplelog = "0.12"
chrono = "0.4"
ratatui = { version = "0.30", features = ["all-widgets"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex-lite = "0.1"
# Note: dns-lookup, ring, aes, flate2, and maxminddb moved to rustnet-core,
# which is the only place they are used. They are re-exported transitively
# through the `crate::network` facade in src/network/mod.rs.
[target.'cfg(target_os = "linux")'.dependencies]
# procfs + libbpf-rs moved to the rustnet-host crate (process attribution).
landlock = { version = "0.4", optional = true }
caps = { version = "0.5", optional = true }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_NetworkManagement_Ndis",
"Win32_Networking_WinSock",
"Win32_Security",
"Win32_System_JobObjects",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
] }
# FreeBSD support uses the system's sockstat command for process lookup
# and native libpcap (via pcap crate) for packet capture.
# No additional FreeBSD-specific dependencies required at this time.
[build-dependencies]
anyhow.workspace = true
clap = { version = "4.6", features = ["derive"] }
clap_complete = "4.6"
clap_mangen = "0.3"
[target.'cfg(windows)'.build-dependencies]
http_req = "0.14"
zip = "8.6"
sha2 = "0.11"
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_NetworkManagement_Ndis",
"Win32_Networking_WinSock",
"Win32_Security",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
] }
[features]
# eBPF is enabled by default for enhanced performance on Linux.
# On non-Linux platforms, this feature has no effect as all eBPF code
# and dependencies are Linux-specific (guarded by target_os checks).
# Landlock provides security sandboxing on Linux 5.13+.
# macos-sandbox provides Seatbelt sandboxing on macOS 10.5+ (no extra deps).
default = ["ebpf", "landlock", "macos-sandbox"]
linux-default = ["ebpf"] # Deprecated: kept for backwards compatibility
# eBPF now lives in the rustnet-host crate; this is a passthrough so
# `--features ebpf` (and the default) keep enabling it as before.
ebpf = ["rustnet-host/ebpf"]
landlock = ["dep:landlock", "dep:caps"]
macos-sandbox = []
# Kubernetes pod and container resolution from cgroup paths and (Phase 2) the
# on-disk kubelet pods directory. Linux-only at runtime; no extra dependencies.
kubernetes = ["rustnet-core/kubernetes"]
# Minimal cross configuration to override dependency conflicts
[workspace.metadata.cross.build.env]
passthrough = [
"CARGO_INCREMENTAL",
"CARGO_NET_RETRY",
"CARGO_NET_TIMEOUT",
]
[package.metadata.deb]
maintainer = "domcyrus <domcyrus@example.com>"
copyright = "2024, domcyrus <domcyrus@example.com>"
license-file = ["LICENSE", "4"]
extended-description = """\
A real-time network monitoring terminal UI tool built with Rust.
Features:
- Real-time network monitoring with detailed state information
- Deep packet inspection for HTTP/HTTPS, DNS, SSH, and QUIC
- Connection lifecycle management with configurable timeouts
- Process identification and service name resolution
- Advanced filtering with vim/fzf-style search
- Multi-threaded processing for optimal performance
- eBPF-enhanced process detection on Linux (with automatic fallback)
"""
depends = "libpcap0.8, libelf1"
section = "net"
priority = "optional"
assets = [
[
"target/release/rustnet",
"usr/bin/",
"755",
],
[
"README.md",
"usr/share/doc/rustnet-monitor/",
"644",
],
[
"crates/rustnet-core/assets/services",
"usr/share/rustnet-monitor/",
"644",
],
[
"resources/packaging/linux/graphics/rustnet.png",
"usr/share/icons/hicolor/256x256/apps/",
"644",
],
[
"resources/packaging/linux/rustnet.desktop",
"usr/share/applications/",
"644",
],
]
conf-files = []
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/rustnet", dest = "/usr/bin/rustnet", mode = "755" },
{ source = "README.md", dest = "/usr/share/doc/rustnet-monitor/README.md", mode = "644" },
{ source = "crates/rustnet-core/assets/services", dest = "/usr/share/rustnet-monitor/services", mode = "644" },
{ source = "resources/packaging/linux/graphics/rustnet.png", dest = "/usr/share/icons/hicolor/256x256/apps/rustnet.png", mode = "644" },
{ source = "resources/packaging/linux/rustnet.desktop", dest = "/usr/share/applications/rustnet.desktop", mode = "644" },
]
[package.metadata.generate-rpm.requires]
libpcap = "*"
elfutils-libelf = "*"
[package.metadata.wix]
upgrade-guid = "455c823b-9665-43e0-baa4-bd0fcb762463"
path-guid = "d3a2452e-f04f-4d4f-becf-c3580f49f8fc"
license = false
eula = false
[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
insta = { version = "1", features = ["filters"] }
rustc-hash = "2"
[[bench]]
name = "packet_parsing"
harness = false
[[bench]]
name = "connection_merge"
harness = false
[[bench]]
name = "snapshot"
harness = false
[[bench]]
name = "rate_tracker"
harness = false
[[bench]]
name = "tracker_ingest"
harness = false
[profile.release]
lto = "thin"
codegen-units = 1
[profile.profiling]
inherits = "release"
debug = 2
strip = false