diff --git a/.gitignore b/.gitignore index 1de5659..3208d77 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -target \ No newline at end of file +target +pg_data \ No newline at end of file diff --git a/tfclient/src/apiworker.rs b/tfclient/src/apiworker.rs index 2d1c2fc..b410f4a 100644 --- a/tfclient/src/apiworker.rs +++ b/tfclient/src/apiworker.rs @@ -3,6 +3,7 @@ use base64::Engine; use chrono::Local; use log::{error, info, warn}; use url::Url; +use trifid_pki::ca::NebulaCAPool; use trifid_pki::cert::{serialize_ed25519_public, serialize_x25519_public}; use trifid_pki::ed25519_dalek::{SecretKey, SigningKey}; use trifid_pki::rand_core::OsRng; diff --git a/tfclient/src/config.rs b/tfclient/src/config.rs index f65831e..9d86a0b 100644 --- a/tfclient/src/config.rs +++ b/tfclient/src/config.rs @@ -1,12 +1,12 @@ -use std::collections::HashMap; + use std::error::Error; use std::fs; -use std::net::{Ipv4Addr, SocketAddrV4}; -use ipnet::Ipv4Net; + + use log::{debug, info}; use serde::{Deserialize, Serialize}; -use trifid_pki::ca::NebulaCAPool; -use crate::dirs::{get_cdata_dir, get_cdata_file, get_config_dir, get_config_file, get_data_dir}; + +use crate::dirs::{get_cdata_dir, get_cdata_file, get_config_dir, get_config_file}; pub const DEFAULT_PORT: u16 = 8157; fn default_port() -> u16 { DEFAULT_PORT } diff --git a/tfclient/src/daemon.rs b/tfclient/src/daemon.rs index 64ff697..00c56a2 100644 --- a/tfclient/src/daemon.rs +++ b/tfclient/src/daemon.rs @@ -5,7 +5,7 @@ use log::{error, info}; use crate::apiworker::{apiworker_main, APIWorkerMessage}; use crate::config::load_config; -use crate::main; + use crate::nebulaworker::{nebulaworker_main, NebulaWorkerMessage}; use crate::socketworker::{socketworker_main, SocketWorkerMessage}; use crate::timerworker::{timer_main, TimerWorkerMessage}; diff --git a/tfclient/src/socketclient.rs b/tfclient/src/socketclient.rs index 5ce1337..62e0449 100644 --- a/tfclient/src/socketclient.rs +++ b/tfclient/src/socketclient.rs @@ -1,5 +1,5 @@ use std::error::Error; -use std::io::{BufRead, BufReader, BufWriter, Write}; +use std::io::{BufRead, BufReader, Write}; use std::net::{IpAddr, SocketAddr, TcpStream}; use log::{error, info}; use crate::config::TFClientConfig; @@ -8,7 +8,7 @@ use crate::socketworker::{ctob, DisconnectReason, JSON_API_VERSION, JsonMessage} pub fn enroll(code: &str, config: &TFClientConfig) -> Result<(), Box> { info!("Connecting to local command socket..."); let mut stream = TcpStream::connect(SocketAddr::new(IpAddr::from([127, 0, 0, 1]), config.listen_port))?; - let mut stream2 = stream.try_clone()?; + let stream2 = stream.try_clone()?; let mut reader = BufReader::new(&stream2); info!("Sending Hello..."); diff --git a/tfclient/src/socketworker.rs b/tfclient/src/socketworker.rs index 6085826..21e0d6d 100644 --- a/tfclient/src/socketworker.rs +++ b/tfclient/src/socketworker.rs @@ -2,10 +2,10 @@ use std::error::Error; use std::{io, thread}; -use std::io::{BufRead, BufReader, BufWriter, Read, Write}; +use std::io::{BufRead, BufReader, BufWriter, Write}; use std::net::{IpAddr, Shutdown, SocketAddr, TcpListener, TcpStream}; use std::sync::mpsc::{Receiver, TryRecvError}; -use clap::builder::Str; + use log::{debug, error, info, trace, warn}; use serde::{Deserialize, Serialize}; use crate::apiworker::APIWorkerMessage;