ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[autofix.ci] apply automated fixes

authored by

autofix-ci[bot] and committed by
GitHub
750f6567 37c05e3c

+42 -19
+1 -1
wire/cli/src/tracing_setup.rs
··· 66 66 pub fn setup_logging(verbosity: Verbosity<WarnLevel>, clobber_lock: Arc<Mutex<()>>) { 67 67 let filter = verbosity.log_level_filter().as_trace(); 68 68 let registry = tracing_subscriber::registry(); 69 - 69 + 70 70 let layer = tracing_subscriber::fmt::layer::<Registry>() 71 71 .without_time() 72 72 .with_target(false)
+9 -4
wire/key_agent/src/main.rs
··· 10 10 use prost::Message; 11 11 use prost::bytes::Bytes; 12 12 use sha2::{Digest, Sha256}; 13 - use std::fmt; 14 - use std::fmt::Display; 15 13 use std::os::unix::fs::PermissionsExt; 16 14 use std::os::unix::fs::chown; 17 15 use std::path::{Path, PathBuf}; ··· 27 25 } 28 26 29 27 fn pretty_keyspec(spec: &KeySpec) -> String { 30 - format!("{} {}:{} {}", spec.destination, spec.user, spec.group, spec.permissions) 28 + format!( 29 + "{} {}:{} {}", 30 + spec.destination, spec.user, spec.group, spec.permissions 31 + ) 31 32 } 32 33 33 34 #[tokio::main] ··· 49 50 50 51 let digest = Sha256::digest(&key_bytes).to_vec(); 51 52 52 - println!("Writing {}, {:?} bytes of data", pretty_keyspec(&spec), key_bytes.len()); 53 + println!( 54 + "Writing {}, {:?} bytes of data", 55 + pretty_keyspec(&spec), 56 + key_bytes.len() 57 + ); 53 58 54 59 if digest != spec.digest { 55 60 return Err(anyhow::anyhow!(
+11 -6
wire/lib/src/commands/interactive.rs
··· 2 2 // Copyright 2024-2025 wire Contributors 3 3 4 4 use nix::sys::termios::{LocalFlags, SetArg, Termios, tcgetattr, tcsetattr}; 5 - use std::fmt::Debug; 6 5 use nix::{ 7 6 poll::{PollFd, PollFlags, PollTimeout, poll}, 8 7 unistd::{pipe as posix_pipe, read as posix_read, write as posix_write}, ··· 10 9 use portable_pty::{NativePtySystem, PtySize}; 11 10 use rand::distr::Alphabetic; 12 11 use std::collections::VecDeque; 12 + use std::fmt::Debug; 13 13 use std::sync::mpsc::{self, Sender}; 14 14 use std::sync::{Condvar, Mutex}; 15 15 use std::thread::JoinHandle; ··· 18 18 os::fd::{AsFd, OwnedFd}, 19 19 sync::Arc, 20 20 }; 21 - use tracing::{Span, debug, error, info, trace, warn}; 22 21 use tracing::instrument; 22 + use tracing::{Span, debug, error, info, trace, warn}; 23 23 24 24 use crate::SubCommandModifiers; 25 25 use crate::commands::CommandArguments; ··· 79 79 stderr_collection: Arc<Mutex<VecDeque<String>>>, 80 80 stdout_collection: Arc<Mutex<VecDeque<String>>>, 81 81 completion_status: Arc<CompletionStatus>, 82 - span: Span 82 + span: Span, 83 83 } 84 84 85 85 /// the underlying command began ··· 223 223 stderr_collection: stderr_collection.clone(), 224 224 stdout_collection: stdout_collection.clone(), 225 225 completion_status: completion_status.clone(), 226 - span: Span::current() 226 + span: Span::current(), 227 227 }; 228 228 229 229 std::thread::spawn(move || dynamic_watch_sudo_stdout(arguments)) ··· 235 235 posix_pipe().map_err(|x| HiveLibError::CommandError(CommandError::PosixPipe(x)))?; 236 236 237 237 std::thread::spawn(move || { 238 - watch_stdin_from_user(&cancel_stdin_pipe_r, master_writer, &write_stdin_pipe_r, Span::current()) 238 + watch_stdin_from_user( 239 + &cancel_stdin_pipe_r, 240 + master_writer, 241 + &write_stdin_pipe_r, 242 + Span::current(), 243 + ) 239 244 }); 240 245 241 246 info!("Setup threads"); ··· 485 490 cancel_pipe_r: &OwnedFd, 486 491 mut master_writer: MasterWriter, 487 492 write_pipe_r: &OwnedFd, 488 - span: Span 493 + span: Span, 489 494 ) -> Result<(), CommandError> { 490 495 const WRITER_POSITION: usize = 0; 491 496 const SIGNAL_POSITION: usize = 1;
+1 -4
wire/lib/src/commands/mod.rs
··· 156 156 .map(SubcommandLog::Internal) 157 157 .unwrap_or(SubcommandLog::Raw(line.into())); 158 158 159 - if !matches!( 160 - log, 161 - SubcommandLog::Internal(LogMessage::Msg { .. }) 162 - ) { 159 + if !matches!(log, SubcommandLog::Internal(LogMessage::Msg { .. })) { 163 160 return None; 164 161 } 165 162
+5 -1
wire/lib/src/hive/node.rs
··· 361 361 let length = steps.len(); 362 362 363 363 for (position, step) in steps.iter().enumerate() { 364 - event!(Level::INFO, step = step.to_string(), progress = format!("{}/{length}", position + 1)); 364 + event!( 365 + Level::INFO, 366 + step = step.to_string(), 367 + progress = format!("{}/{length}", position + 1) 368 + ); 365 369 366 370 step.execute(&mut self.context).await.inspect_err(|_| { 367 371 error!("Failed to execute `{step}`");
+15 -3
wire/lib/src/hive/steps/ping.rs
··· 27 27 #[instrument(skip_all, name = "ping")] 28 28 async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> { 29 29 loop { 30 - event!(Level::INFO, status = "attempting", host = ctx.node.target.get_preferred_host()?.to_string()); 30 + event!( 31 + Level::INFO, 32 + status = "attempting", 33 + host = ctx.node.target.get_preferred_host()?.to_string() 34 + ); 31 35 32 36 if ctx 33 37 .node ··· 35 39 .await 36 40 .is_ok() 37 41 { 38 - event!(Level::INFO, status = "success", host = ctx.node.target.get_preferred_host()?.to_string()); 42 + event!( 43 + Level::INFO, 44 + status = "success", 45 + host = ctx.node.target.get_preferred_host()?.to_string() 46 + ); 39 47 return Ok(()); 40 48 } 41 49 42 50 // ? will take us out if we ran out of hosts 43 - event!(Level::WARN, status = "failed to ping", host = ctx.node.target.get_preferred_host()?.to_string()); 51 + event!( 52 + Level::WARN, 53 + status = "failed to ping", 54 + host = ctx.node.target.get_preferred_host()?.to_string() 55 + ); 44 56 ctx.node.target.host_failed(); 45 57 } 46 58 }