mirror of
https://github.com/ruvnet/RuView
synced 2026-07-30 18:41:42 +00:00
0f8c5c919b
Resolves the review on #989: - **Cross-compile (the appliance blocker):** make wifi-densepose-mat optional and feature-gate it (`mat`), so `cargo build -p wifi-densepose-cli --no-default-features` excludes the mat→nn→ort(ONNX)→openssl-sys chain. Verified: `cargo tree --no-default-features` shows 0 ort/openssl deps → calibration cross-compiles clean for the Pi. - **Security (must-fix before LAN):** - `--token` / CALIBRATE_TOKEN bearer-auth middleware on every route; warns if bound non-loopback without a token. - sanitize client-supplied `room_id` to [A-Za-z0-9_-] (≤64) before it reaches the baseline write path — kills the `../` file-write primitive. + test. - **Perf:** stop locking shared status + cloning SessionStatus on every UDP frame — counters/snapshot flush on the 200 ms tick instead (no CPU starvation under flood). finalize write moved to async `tokio::fs::write`. - **Docs:** ADR-151 STALE wording matches the impl (baseline-id change; drift-threshold = P6 refinement); integration doc gets the `--no-default-features` build + auth/sanitize notes. 35 calibration + 15 CLI tests (no-default) / 20 CLI (default) pass. Co-Authored-By: claude-flow <ruv@ruv.net>
52 lines
1.6 KiB
Rust
52 lines
1.6 KiB
Rust
//! WiFi-DensePose CLI Entry Point
|
|
//!
|
|
//! This is the main entry point for the wifi-densepose command-line tool.
|
|
|
|
use clap::Parser;
|
|
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
|
|
|
|
use wifi_densepose_cli::{Cli, Commands};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> anyhow::Result<()> {
|
|
// Initialize logging
|
|
tracing_subscriber::registry()
|
|
.with(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")))
|
|
.with(tracing_subscriber::fmt::layer().with_target(false))
|
|
.init();
|
|
|
|
let cli = Cli::parse();
|
|
|
|
match cli.command {
|
|
Commands::Calibrate(args) => {
|
|
wifi_densepose_cli::calibrate::execute(args).await?;
|
|
}
|
|
Commands::CalibrateServe(args) => {
|
|
wifi_densepose_cli::calibrate_api::execute(args).await?;
|
|
}
|
|
Commands::Enroll(args) => {
|
|
wifi_densepose_cli::room::enroll(args).await?;
|
|
}
|
|
Commands::TrainRoom(args) => {
|
|
wifi_densepose_cli::room::train_room(args).await?;
|
|
}
|
|
Commands::RoomStatus(args) => {
|
|
wifi_densepose_cli::room::room_status(args).await?;
|
|
}
|
|
Commands::RoomWatch(args) => {
|
|
wifi_densepose_cli::room::room_watch(args).await?;
|
|
}
|
|
#[cfg(feature = "mat")]
|
|
Commands::Mat(mat_cmd) => {
|
|
wifi_densepose_cli::mat::execute(mat_cmd).await?;
|
|
}
|
|
Commands::Version => {
|
|
println!("wifi-densepose {}", env!("CARGO_PKG_VERSION"));
|
|
#[cfg(feature = "mat")]
|
|
println!("MAT module version: {}", wifi_densepose_mat::VERSION);
|
|
}
|
|
}
|
|
|
|
Ok(())
|
|
}
|