diff --git a/Cargo.lock b/Cargo.lock index 82b9757..9a174a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "oblivion" -version = "2.0.0" +version = "2.0.1" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index b2b06bf..27b3e13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oblivion" -version = "2.0.0" +version = "2.0.1" authors = ["苏向夜 "] description = "Rust High Concurrency Implementation of Oblivion, an End-to-End Encryption Protocol Based on ECDHE Encryption Algorithm" edition = "2021" diff --git a/src/lib.rs b/src/lib.rs index 4debce3..f5df95f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -140,3 +140,5 @@ macro_rules! regex_route { ); }}; } + +pub static VERSION: &'static str = env!("CARGO_PKG_VERSION"); diff --git a/src/models/server.rs b/src/models/server.rs index c108119..2ce4a75 100644 --- a/src/models/server.rs +++ b/src/models/server.rs @@ -3,6 +3,7 @@ use std::net::SocketAddr; use std::sync::Arc; use crate::utils::gear::Socket; +use crate::VERSION; use anyhow::{Error, Result}; use chrono::Local; @@ -138,6 +139,19 @@ impl Server { std::process::exit(0); }); + #[cfg(feature = "unsafe")] + println!( + "Oblivion version {}, using '{}'", + VERSION.bright_yellow(), + "p256".bright_red() + ); + #[cfg(not(feature = "unsafe"))] + println!( + "Oblivion version {}, using '{}'", + VERSION.bright_yellow(), + "ring".bright_green() + ); + println!( "Starting server at {}", format!("Oblivion://{}:{}/", self.host, self.port).bright_cyan()