From ac2b66a3395af6a7b19d79120fbce450e3d99f0d Mon Sep 17 00:00:00 2001 From: madonuko Date: Sun, 5 Jul 2026 17:05:30 +0800 Subject: [PATCH 1/3] feat: create lockfile on startup Close #30 --- odorobo/Cargo.toml | 5 ++--- odorobo/src/main.rs | 12 +++++------- odorobo/src/utils/lockfile.rs | 27 +++++++++++++++++++++++++++ odorobo/src/utils/mod.rs | 34 +++++++++++++++------------------- 4 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 odorobo/src/utils/lockfile.rs diff --git a/odorobo/Cargo.toml b/odorobo/Cargo.toml index 91cee6c..cecda2f 100644 --- a/odorobo/Cargo.toml +++ b/odorobo/Cargo.toml @@ -6,7 +6,7 @@ license = "AGPL-3.0-or-later" [dependencies] stable-eyre = { workspace = true } -clap = { workspace = true, features = ["derive", "env"] } +clap = { workspace = true, features = ["derive", "env"] } tokio = { workspace = true, features = ["full"] } reqwest = { workspace = true, features = ["json"] } serde_json = { workspace = true } @@ -42,7 +42,7 @@ ahash = { version = "0.8", features = ["serde"] } ulid = { version = "1.2", features = ["serde", "uuid"] } dirs = "6" bytesize = { version = "2.3", features = ["serde"] } -ipnet = {version = "2.12", features = ["serde", "schemars08"]} +ipnet = { version = "2.12", features = ["serde", "schemars08"] } url = { version = "2.5", features = ["serde"] } async-trait = "0.1" dashmap = "6.1" @@ -63,5 +63,4 @@ aide = { version = "0.15", features = [ schemars = "0.9" - cloud-hypervisor-client = { git = "https://github.com/FyraStack/cloud-hypervisor-client.git" } diff --git a/odorobo/src/main.rs b/odorobo/src/main.rs index 350843f..4a4c359 100644 --- a/odorobo/src/main.rs +++ b/odorobo/src/main.rs @@ -1,12 +1,12 @@ pub mod actors; mod ch_api; +pub mod config; pub mod http_api; +pub mod messages; pub mod networking; mod state; -mod utils; -pub mod messages; -pub mod config; pub mod types; +mod utils; use std::fs; @@ -14,15 +14,16 @@ use clap::Parser; use kameo::actor::Spawn; use stable_eyre::Result; +use crate::actors::agent_actor::AgentActor; use crate::actors::http_actor::HTTPActor; use crate::actors::scheduler_actor::SchedulerActor; use crate::config::Config; use crate::utils::actor_names::{HTTP_API_SERVER, SCHEDULER}; use crate::utils::{actor_names::AGENT, connect_to_swarm, init}; -use crate::actors::agent_actor::AgentActor; #[tokio::main] async fn main() -> Result<()> { + let _ = utils::lockfile::init_lockfile(); let cli_config = config::CliConfig::parse(); // TODO: ask infra team where they want this on the box let config: Config = if let Ok(file) = fs::File::open("config.json") { @@ -35,11 +36,9 @@ async fn main() -> Result<()> { tracing::info!(?config, "Starting odorobo"); - let local_peer_id = connect_to_swarm().unwrap(); tracing::info!(?local_peer_id, "Peer ID"); - // start agents let agent_actor = AgentActor::spawn(config.clone()); agent_actor.register(AGENT).await?; @@ -55,7 +54,6 @@ async fn main() -> Result<()> { http_actor.wait_for_shutdown().await; } - agent_actor.wait_for_shutdown().await; Ok(()) diff --git a/odorobo/src/utils/lockfile.rs b/odorobo/src/utils/lockfile.rs new file mode 100644 index 0000000..1890f75 --- /dev/null +++ b/odorobo/src/utils/lockfile.rs @@ -0,0 +1,27 @@ +use tokio::io::AsyncWriteExt; + +const LOCKFILE: &str = "/var/lock/odorobo.lock"; + +// `Option` needed since `std::mem::take` requires `impl Default` +pub struct Lockfile(Option); + +impl Drop for Lockfile { + fn drop(&mut self) { + std::mem::drop(std::mem::take(&mut self.0).expect("None in Lockfile")); + _ = std::fs::remove_file(LOCKFILE) + .inspect_err(|e| tracing::warn!(?LOCKFILE, ?e, "cannot remove lockfile")); + } +} + +/// Create an odorobo lockfile +/// +/// See #30, only 1 instance of odorobo should run. +pub async fn init_lockfile() -> Result { + let mut f = tokio::fs::File::create_new(LOCKFILE) + .await + .map_err(|e| format!("Cannot create lockfile at {LOCKFILE}: {e:?}"))?; + f.write_all(&std::process::id().to_ne_bytes()) + .await + .map_err(|e| format!("cannot write to {LOCKFILE}: {e:?}"))?; + Ok(Lockfile(Some(f))) +} diff --git a/odorobo/src/utils/mod.rs b/odorobo/src/utils/mod.rs index 01c7125..f85de5f 100644 --- a/odorobo/src/utils/mod.rs +++ b/odorobo/src/utils/mod.rs @@ -1,17 +1,18 @@ -pub mod actor_names; pub mod actor_cache; +pub mod actor_names; +pub mod lockfile; use aide::OperationIo; -use stable_eyre::{Result, Report}; -use tracing::level_filters::LevelFilter; -use tracing_subscriber::EnvFilter; -use thiserror::Error; +use api_error::ApiError; use kameo::prelude::*; use libp2p::futures::StreamExt; use libp2p::swarm::{NetworkBehaviour, SwarmEvent}; use libp2p::{PeerId, mdns, noise, tcp, yamux}; +use stable_eyre::{Report, Result}; +use thiserror::Error; +use tracing::level_filters::LevelFilter; use tracing::{debug, error, info, trace, warn}; -use api_error::ApiError; +use tracing_subscriber::EnvFilter; // todo: wrap with axum-responses, return this type on request failure #[derive(Error, Debug, ApiError, OperationIo)] @@ -26,21 +27,18 @@ impl From> for OdoroboError { fn from(value: kameo::error::SendError) -> Self { let kameo_error = value.to_string(); error!(?value); - OdoroboError::Report(value.err().unwrap_or_else(|| { - Report::msg(format!("could not unwrap kameo error: {kameo_error}")) - })) + OdoroboError::Report( + value.err().unwrap_or_else(|| { + Report::msg(format!("could not unwrap kameo error: {kameo_error}")) + }), + ) } } #[cfg(test)] mod tests { use super::*; - use axum::{ - http::StatusCode, - body::Body, http::Request, - routing::get, - Router, - }; + use axum::{Router, body::Body, http::Request, http::StatusCode, routing::get}; use http_body_util::BodyExt; use tower::ServiceExt; @@ -50,7 +48,8 @@ mod tests { #[tokio::test] async fn test_error() { - let response = Router::new().route("/", get(handler)) + let response = Router::new() + .route("/", get(handler)) .oneshot(Request::get("/").body(Body::empty()).unwrap()) .await .unwrap(); @@ -64,7 +63,6 @@ mod tests { } } - pub fn env_filter(debug_target: Option<&str>) -> EnvFilter { let env = std::env::var("ODOROBO_LOG").unwrap_or_else(|_| "".into()); @@ -110,8 +108,6 @@ pub fn init_default() -> Result<()> { init(None) } - - #[derive(NetworkBehaviour)] pub struct ProductionBehaviour { kameo: remote::Behaviour, From e7f08f590db00b3d4646ba7fba686a37097a4c32 Mon Sep 17 00:00:00 2001 From: madonuko Date: Sun, 5 Jul 2026 18:11:17 +0800 Subject: [PATCH 2/3] feat: watch for termsigs --- Cargo.lock | 11 +++++++++++ odorobo/Cargo.toml | 1 + odorobo/src/main.rs | 31 ++++++++++++++++++++++++++++--- odorobo/src/utils/lockfile.rs | 27 +++++++++++++++++++++------ 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a573c2..8265cec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2922,6 +2922,7 @@ dependencies = [ "schemars 0.9.0", "serde", "serde_json", + "signal-hook", "stable-eyre", "sysinfo", "thiserror 2.0.18", @@ -3958,6 +3959,16 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a0c28ca5908dbdbcd52e6fdaa00358ab88637f8ab33e1f188dd510eb44b53d" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.8" diff --git a/odorobo/Cargo.toml b/odorobo/Cargo.toml index cecda2f..9890606 100644 --- a/odorobo/Cargo.toml +++ b/odorobo/Cargo.toml @@ -64,3 +64,4 @@ schemars = "0.9" cloud-hypervisor-client = { git = "https://github.com/FyraStack/cloud-hypervisor-client.git" } +signal-hook = "0.4.4" diff --git a/odorobo/src/main.rs b/odorobo/src/main.rs index 4a4c359..85f209f 100644 --- a/odorobo/src/main.rs +++ b/odorobo/src/main.rs @@ -9,6 +9,8 @@ pub mod types; mod utils; use std::fs; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; use clap::Parser; use kameo::actor::Spawn; @@ -21,9 +23,7 @@ use crate::config::Config; use crate::utils::actor_names::{HTTP_API_SERVER, SCHEDULER}; use crate::utils::{actor_names::AGENT, connect_to_swarm, init}; -#[tokio::main] -async fn main() -> Result<()> { - let _ = utils::lockfile::init_lockfile(); +fn main() -> Result<()> { let cli_config = config::CliConfig::parse(); // TODO: ask infra team where they want this on the box let config: Config = if let Ok(file) = fs::File::open("config.json") { @@ -33,7 +33,32 @@ async fn main() -> Result<()> { }; init(Some("odorobo"))?; + let term = utils::lockfile::register_termsigs()?; + let _lock = utils::lockfile::init_lockfile() + .map_err(|e| stable_eyre::eyre::eyre!("cannot init lockfile").wrap_err(e))?; + mainloop(term, cli_config, config) +} + +fn mainloop(term: Arc, cli_config: config::CliConfig, config: Config) -> Result<()> { + let runtime = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .expect("can't build tokio"); + let handle = runtime.spawn(inner_main(cli_config, config)); + + loop { + if handle.is_finished() { + break runtime.block_on(handle).expect("cannot join main thread"); + } + if term.load(Ordering::Relaxed) { + handle.abort(); + stable_eyre::eyre::bail!("Exit due to termination signal"); + } + } +} + +async fn inner_main(cli_config: config::CliConfig, config: Config) -> Result<()> { tracing::info!(?config, "Starting odorobo"); let local_peer_id = connect_to_swarm().unwrap(); diff --git a/odorobo/src/utils/lockfile.rs b/odorobo/src/utils/lockfile.rs index 1890f75..cd70447 100644 --- a/odorobo/src/utils/lockfile.rs +++ b/odorobo/src/utils/lockfile.rs @@ -1,12 +1,13 @@ -use tokio::io::AsyncWriteExt; +use std::io::Write; const LOCKFILE: &str = "/var/lock/odorobo.lock"; // `Option` needed since `std::mem::take` requires `impl Default` -pub struct Lockfile(Option); +pub struct Lockfile(Option); impl Drop for Lockfile { fn drop(&mut self) { + tracing::debug!("dropping Lockfile"); std::mem::drop(std::mem::take(&mut self.0).expect("None in Lockfile")); _ = std::fs::remove_file(LOCKFILE) .inspect_err(|e| tracing::warn!(?LOCKFILE, ?e, "cannot remove lockfile")); @@ -16,12 +17,26 @@ impl Drop for Lockfile { /// Create an odorobo lockfile /// /// See #30, only 1 instance of odorobo should run. -pub async fn init_lockfile() -> Result { - let mut f = tokio::fs::File::create_new(LOCKFILE) - .await +pub fn init_lockfile() -> Result { + tracing::trace!("creating lockfile at {LOCKFILE}"); + let mut f = std::fs::File::create_new(LOCKFILE) .map_err(|e| format!("Cannot create lockfile at {LOCKFILE}: {e:?}"))?; f.write_all(&std::process::id().to_ne_bytes()) - .await .map_err(|e| format!("cannot write to {LOCKFILE}: {e:?}"))?; + f.flush() + .map_err(|e| format!("cannot flush {LOCKFILE}: {e:?}"))?; Ok(Lockfile(Some(f))) } + +/// Register termination signals to watch +/// +/// We need to tidy up lockfiles before exiting. Watching these signals can give us a chance to +/// actually clean things up. +pub fn register_termsigs() -> std::io::Result> { + let term = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)); + for sig in signal_hook::consts::TERM_SIGNALS { + signal_hook::flag::register_conditional_shutdown(*sig, 1, std::sync::Arc::clone(&term))?; + signal_hook::flag::register(*sig, std::sync::Arc::clone(&term))?; + } + Ok(term) +} From 472f0e02c596198071fd343d4e19a1c8c1649c17 Mon Sep 17 00:00:00 2001 From: madonuko Date: Fri, 17 Jul 2026 00:40:55 +0800 Subject: [PATCH 3/3] fix(config): correct bool flag behaviour --- Cargo.lock | 220 +++++++++++++++++++++--------------------- odorobo/src/config.rs | 2 +- 2 files changed, 111 insertions(+), 111 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed88e48..d0ce890 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,7 +107,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -196,7 +196,7 @@ checksum = "e3ff2de1c418b9a8db3f062ab918fb5c478fa0377e048432b46aaaeef72e7a8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -229,7 +229,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", "synstructure", ] @@ -241,7 +241,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -282,7 +282,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -445,7 +445,7 @@ dependencies = [ "axum", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -509,9 +509,9 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" -version = "2.13.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" [[package]] name = "blake2" @@ -581,9 +581,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.66" +version = "1.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" dependencies = [ "find-msvc-tools", "jobserver", @@ -599,9 +599,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" @@ -665,9 +665,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.1" +version = "4.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +checksum = "dd059f9da4f5c36b3787f65d38ccaab1cc315f07b01f89abc8359ee6a8205011" dependencies = [ "clap_builder", "clap_derive", @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b" dependencies = [ "anstream", "anstyle", @@ -694,7 +694,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -792,7 +792,7 @@ checksum = "1c7e7913ec01ed98b697e62f8d3fd63c86dc6cccaf983c7eebc64d0e563b0ad9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -919,7 +919,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -942,7 +942,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -953,7 +953,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -993,7 +993,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccc2776f0c61eca1ca32528f85548abd1a4be8fb53d1b21c013e4f18da1e7090" dependencies = [ "data-encoding", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -1066,7 +1066,7 @@ checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -1141,7 +1141,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -1324,7 +1324,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -1376,12 +1376,12 @@ dependencies = [ [[package]] name = "fyra-proc-macros" version = "0.1.0" -source = "git+https://github.com/FyraLabs/fyra-proc-macros#c739d1ed4eedfa47d28b048ca8d5724b4dcdd57c" +source = "git+https://github.com/FyraLabs/fyra-proc-macros#5f5f4a26ccbd227471dc55e971e1e62714d79b4f" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -1550,7 +1550,7 @@ dependencies = [ "idna", "ipnet", "once_cell", - "rand 0.9.4", + "rand 0.9.5", "ring", "socket2 0.5.10", "thiserror 2.0.18", @@ -1573,7 +1573,7 @@ dependencies = [ "moka", "once_cell", "parking_lot", - "rand 0.9.4", + "rand 0.9.5", "resolv-conf", "smallvec", "thiserror 2.0.18", @@ -1622,9 +1622,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" dependencies = [ "bytes", "http 1.4.2", @@ -1632,9 +1632,9 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" dependencies = [ "bytes", "futures-core", @@ -1709,7 +1709,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.4", + "socket2 0.6.5", "system-configuration", "tokio", "tower-service", @@ -1913,7 +1913,7 @@ dependencies = [ "hyper", "hyper-util", "log", - "rand 0.9.4", + "rand 0.9.5", "tokio", "url", "xmltree", @@ -1952,7 +1952,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" dependencies = [ - "socket2 0.6.4", + "socket2 0.6.5", "widestring", "windows-registry", "windows-result", @@ -2017,7 +2017,7 @@ dependencies = [ "quote", "rustc_version", "simd_cesu8", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2036,7 +2036,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" dependencies = [ "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2090,7 +2090,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2183,7 +2183,7 @@ dependencies = [ "parking_lot", "pin-project", "quick-protobuf", - "rand 0.8.6", + "rand 0.8.7", "rw-stream-sink", "thiserror 2.0.18", "tracing", @@ -2230,7 +2230,7 @@ dependencies = [ "libp2p-swarm", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.6", + "rand 0.8.7", "regex", "serde", "sha2", @@ -2249,7 +2249,7 @@ dependencies = [ "hkdf", "multihash", "prost", - "rand 0.8.6", + "rand 0.8.7", "serde", "sha2", "thiserror 2.0.18", @@ -2275,7 +2275,7 @@ dependencies = [ "libp2p-swarm", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.6", + "rand 0.8.7", "serde", "sha2", "smallvec", @@ -2297,7 +2297,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.6", + "rand 0.8.7", "smallvec", "socket2 0.5.10", "tokio", @@ -2334,7 +2334,7 @@ dependencies = [ "multiaddr", "multihash", "quick-protobuf", - "rand 0.8.6", + "rand 0.8.7", "snow", "static_assertions", "thiserror 2.0.18", @@ -2357,7 +2357,7 @@ dependencies = [ "libp2p-tls", "quinn", "quinn-proto", - "rand 0.8.6", + "rand 0.8.7", "ring", "rustls", "socket2 0.5.10", @@ -2379,7 +2379,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.6", + "rand 0.8.7", "serde", "smallvec", "tracing", @@ -2400,7 +2400,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "multistream-select", - "rand 0.8.6", + "rand 0.8.7", "smallvec", "tokio", "tracing", @@ -2415,7 +2415,7 @@ checksum = "dd297cf53f0cb3dee4d2620bb319ae47ef27c702684309f682bdb7e55a18ae9c" dependencies = [ "heck", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2429,7 +2429,7 @@ dependencies = [ "if-watch", "libc", "libp2p-core", - "socket2 0.6.4", + "socket2 0.6.5", "tokio", "tracing", ] @@ -2509,7 +2509,7 @@ checksum = "32d59e20403c7d08fe62b4376edfe5c7fb2ef1e6b1465379686d0f21c8df444b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2553,7 +2553,7 @@ checksum = "757aee279b8bdbb9f9e676796fd459e4207a1f986e87886700abf589f5abf771" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -2600,9 +2600,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" dependencies = [ "libc", "wasi", @@ -3054,7 +3054,7 @@ checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3199,7 +3199,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3222,7 +3222,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3261,7 +3261,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.6.4", + "socket2 0.6.5", "thiserror 2.0.18", "tokio", "tracing", @@ -3301,7 +3301,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.4", + "socket2 0.6.5", "tracing", "windows-sys 0.61.2", ] @@ -3329,9 +3329,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -3340,9 +3340,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -3419,7 +3419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52b7d0e298a1b2f2f46c8d5da944c80ed1e5e6b032521cc44ee2b1dcbe2b94a" dependencies = [ "network-interface", - "rand 0.8.6", + "rand 0.8.7", "thiserror 1.0.69", ] @@ -3473,14 +3473,14 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] name = "regex" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -3490,9 +3490,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" dependencies = [ "aho-corasick", "memchr", @@ -3665,9 +3665,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.41" +version = "0.23.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138" dependencies = [ "aws-lc-rs", "once_cell", @@ -3820,7 +3820,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3885,7 +3885,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3896,7 +3896,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -3944,7 +3944,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4027,9 +4027,9 @@ dependencies = [ [[package]] name = "simd_cesu8" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" dependencies = [ "rustc_version", "simdutf8", @@ -4088,9 +4088,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", "windows-sys 0.61.2", @@ -4150,7 +4150,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4171,9 +4171,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.118" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" dependencies = [ "proc-macro2", "quote", @@ -4197,7 +4197,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4267,7 +4267,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4278,14 +4278,14 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", ] @@ -4332,9 +4332,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -4347,9 +4347,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.52.3" +version = "1.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +checksum = "317fafbbe3f02fc663dad00ea6186197de963cd4190e86a26d8d0fae095539af" dependencies = [ "bytes", "libc", @@ -4357,7 +4357,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.4", + "socket2 0.6.5", "tokio-macros", "tracing", "windows-sys 0.61.2", @@ -4371,7 +4371,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4492,7 +4492,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4564,7 +4564,7 @@ dependencies = [ "http 1.4.2", "httparse", "log", - "rand 0.9.4", + "rand 0.9.5", "sha1", "thiserror 2.0.18", ] @@ -4593,7 +4593,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "470dbf6591da1b39d43c14523b2b469c86879a53e8b758c8e090a470fe7b1fbe" dependencies = [ - "rand 0.9.4", + "rand 0.9.5", "serde", "uuid", "web-time", @@ -4660,9 +4660,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.4" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" dependencies = [ "getrandom 0.4.3", "js-sys", @@ -4758,7 +4758,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", "wasm-bindgen-shared", ] @@ -4890,7 +4890,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -4901,7 +4901,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -5107,7 +5107,7 @@ dependencies = [ "nohash-hasher", "parking_lot", "pin-project", - "rand 0.8.6", + "rand 0.8.7", "static_assertions", ] @@ -5122,7 +5122,7 @@ dependencies = [ "nohash-hasher", "parking_lot", "pin-project", - "rand 0.9.4", + "rand 0.9.5", "static_assertions", "web-time", ] @@ -5155,7 +5155,7 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", "synstructure", ] @@ -5176,7 +5176,7 @@ checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -5196,7 +5196,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", "synstructure", ] @@ -5217,7 +5217,7 @@ checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] @@ -5250,11 +5250,11 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 2.0.119", ] [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/odorobo/src/config.rs b/odorobo/src/config.rs index ac54acb..44c59ce 100644 --- a/odorobo/src/config.rs +++ b/odorobo/src/config.rs @@ -136,7 +136,7 @@ pub struct Config { pub network: NetworkConfig, /// Ignore lockfiles and do not create a lockfile - #[clap(long)] + #[clap(long, action = clap::ArgAction::SetTrue)] pub no_lockfile: Option, }