diff --git a/README.md b/README.md index 68587a7..50e31be 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ arguments. Private keys can be generated with `openssl` tool using the `genkeys.sh` script. +Running with log level INFO will log the destination hash generated for the clients +configured private keys and should be provided to peers to add to their configurations. + Command-line options: `-p ` -- required: local UDP port for Reticulum interface @@ -39,4 +42,4 @@ identity `RNS_VPN_SIGNKEY_PATH` -- path to ed25519 signing key in PEM format for Reticulum identity -`RUST_LOG` -- set log level: `trace`, `debug`, `info`, `warn`, `error` +`RUST_LOG` -- adjust log level: `trace`, `debug`, `info` (default), `warn`, `error` diff --git a/src/lib.rs b/src/lib.rs index 0066fb8..23ada51 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,7 +88,8 @@ impl Client { let in_destination = transport .add_destination(id, DestinationName::new("rns_vpn", "client")).await; let in_destination_hash = in_destination.lock().await.desc.address_hash; - log::info!("created in destination: {}", in_destination_hash); + log::info!("created destination: {}", + format!("{}", in_destination_hash).trim_matches('/')); // send announces let announce_loop = async || loop { transport.send_announce(&in_destination, None).await; diff --git a/src/main.rs b/src/main.rs index 5ce0791..34a0adf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,8 @@ async fn main() { toml::from_str(&s).unwrap() }; // init logging - env_logger::Builder::from_env(env_logger::Env::default()).init(); + env_logger::Builder::new().filter_level(log::LevelFilter::Info).parse_default_env() + .init(); log::info!("client start with port {} and forward IP {}", cmd.port, cmd.forward); // client let client = match rns_vpn::Client::new(config) { @@ -51,7 +52,8 @@ async fn main() { rns_vpn::CreateClientError::RiptunError(riptun::Error::Unix { source: nix::errno::Errno::EPERM }) => { - log::error!("EPERM error creating VPN client: need to run with root permissions"); + log::error!("EPERM error creating TUN interface: \ + need to run with root permissions"); process::exit(1) } _ => {