Skip to content

Commit f71e6e2

Browse files
authored
chore(release): bump version to 1.2.3 (#18)
- Update version to 1.2.3 in Cargo.toml files - Enhance setup command output with clearer messages - Improve error handling and user feedback in VPN commands - Refactor comments for better clarity in main.rs
1 parent dca8ab2 commit f71e6e2

5 files changed

Lines changed: 264 additions & 179 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[package]
66
name = "akon"
7-
version = "1.2.2"
7+
version = "1.2.3"
88
edition = "2021"
99
authors = ["vcwild"]
1010
description = "A CLI tool for managing VPN connections with OpenConnect"

akon-core/Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "akon-core"
4-
version = "1.2.2"
4+
version = "1.2.3"
55

66
[features]
77
default = []
@@ -15,35 +15,35 @@ dead_code = "deny"
1515
# Workspace dependencies
1616
anyhow.workspace = true
1717
base32.workspace = true
18+
chrono = "0.4"
19+
data-encoding = "2.9.0"
1820
keyring.workspace = true
21+
nix.workspace = true
22+
regex = "1.10"
1923
secrecy.workspace = true
2024
serde.workspace = true
25+
sha1 = "0.10.6"
2126
thiserror.workspace = true
27+
tokio.workspace = true
2228
toml.workspace = true
2329
totp-lite.workspace = true
2430
tracing-journald.workspace = true
2531
tracing-subscriber.workspace = true
2632
tracing.workspace = true
27-
tokio.workspace = true
28-
nix.workspace = true
29-
data-encoding = "2.9.0"
30-
sha1 = "0.10.6"
31-
regex = "1.10"
32-
chrono = "0.4"
3333
# lazy_static is optional and enabled via the `mock-keyring` feature
34-
lazy_static = { version = "1.5", optional = true }
34+
lazy_static = {version = "1.5", optional = true}
3535

3636
# Network interruption detection dependencies
37-
zbus = "4.0"
38-
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
37+
reqwest = {version = "0.12", default-features = false, features = ["rustls-tls"]}
3938
url = "2.5"
39+
zbus = "4.0"
4040

4141
[dev-dependencies]
4242
cargo-tarpaulin = "0.27"
43-
serde_json = "1.0"
43+
criterion = "0.5"
4444
hex = "0.4"
45+
lazy_static = "1.5"
46+
serde_json = "1.0"
4547
tempfile = "3.0"
46-
criterion = "0.5"
4748
tokio-test = "0.4"
4849
wiremock = "0.6"
49-
lazy_static = "1.5"

src/cli/setup.rs

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ use std::io::{self, Write};
1313

1414
/// Run the setup command
1515
pub fn run_setup() -> Result<(), AkonError> {
16+
println!("[SETUP] {}", "akon VPN Setup".bright_white().bold());
1617
println!(
17-
"{} {}",
18-
"🔐".bright_magenta(),
19-
"akon VPN Setup".bright_white().bold()
18+
"{}",
19+
"========================================".bright_white()
2020
);
21-
println!("{}", "=================".bright_white());
2221
println!();
2322
println!(
2423
"{}",
@@ -38,7 +37,7 @@ pub fn run_setup() -> Result<(), AkonError> {
3837
if let Ok(true) = toml_config::config_exists() {
3938
println!(
4039
"{} {}",
41-
"".bright_yellow(),
40+
"[WARN]".bright_yellow(),
4241
"Existing configuration detected.".bright_yellow()
4342
);
4443
if !prompt_yes_no("Overwrite existing setup?", false)? {
@@ -72,7 +71,7 @@ pub fn run_setup() -> Result<(), AkonError> {
7271
println!();
7372
println!(
7473
"{} {}",
75-
"💾".bright_cyan(),
74+
"[SAVE]".bright_cyan(),
7675
"Saving configuration...".bright_white()
7776
);
7877

@@ -85,15 +84,15 @@ pub fn run_setup() -> Result<(), AkonError> {
8584

8685
println!(
8786
"{} {}",
88-
"".bright_green(),
87+
"[OK]".bright_green().bold(),
8988
"Setup complete!".bright_green().bold()
9089
);
9190
println!();
9291
println!("{}", "You can now use:".bright_white());
93-
println!(" {} - Connect to VPN", "akon vpn on".bright_cyan());
94-
println!(" {} - Disconnect from VPN", "akon vpn off".bright_cyan());
92+
println!(" {} - Connect to VPN", "akon vpn on".bright_cyan());
93+
println!(" {} - Disconnect from VPN", "akon vpn off".bright_cyan());
9594
println!(
96-
" {} - Generate OTP token manually",
95+
" {} - Generate OTP token manually",
9796
"akon get-password".bright_cyan()
9897
);
9998

@@ -110,9 +109,13 @@ fn check_keyring_availability() -> Result<(), AkonError> {
110109
Ok(())
111110
}
112111
Err(AkonError::Keyring(_)) => {
113-
println!("❌ Keyring is not available or locked.");
114-
println!("Please ensure your system keyring is unlocked and available.");
115-
println!("On GNOME systems, this is usually handled automatically.");
112+
println!(
113+
"{} {}",
114+
"[ERROR]".bright_red().bold(),
115+
"Keyring is not available or locked.".bright_red().bold()
116+
);
117+
println!(" Please ensure your system keyring is unlocked and available.");
118+
println!(" On GNOME systems, this is usually handled automatically.");
116119
Err(AkonError::Keyring(
117120
akon_core::error::KeyringError::ServiceUnavailable,
118121
))
@@ -299,7 +302,7 @@ fn collect_reconnection_config(
299302

300303
println!();
301304
println!(
302-
"{} {}",
305+
" {} {}",
303306
"✓".bright_green(),
304307
"Reconnection configuration validated".bright_green()
305308
);
@@ -321,7 +324,13 @@ fn collect_otp_secret() -> Result<OtpSecret, AkonError> {
321324
let secret = prompt_password("TOTP Secret")?;
322325

323326
if secret.trim().is_empty() {
324-
println!("❌ Secret cannot be empty. Please try again.");
327+
println!(
328+
"{} {}",
329+
"[ERROR]".bright_red().bold(),
330+
"Secret cannot be empty. Please try again."
331+
.bright_red()
332+
.bold()
333+
);
325334
continue;
326335
}
327336

@@ -330,8 +339,14 @@ fn collect_otp_secret() -> Result<OtpSecret, AkonError> {
330339
match otp_secret.validate_base32() {
331340
Ok(_) => return Ok(otp_secret),
332341
Err(_) => {
333-
println!("❌ Invalid Base32 format. Please check your secret and try again.");
334-
println!(" Valid characters: A-Z, 2-7, =, /");
342+
println!(
343+
"{} {}",
344+
"[ERROR]".bright_red().bold(),
345+
"Invalid Base32 format. Please check your secret and try again."
346+
.bright_red()
347+
.bold()
348+
);
349+
println!(" Valid characters: A-Z, 2-7, =, /");
335350
continue;
336351
}
337352
}
@@ -354,7 +369,11 @@ fn collect_pin() -> Result<Pin, AkonError> {
354369
let candidate = pin_str.trim().to_string();
355370

356371
if candidate.is_empty() {
357-
println!("❌ PIN cannot be empty. Please try again.");
372+
println!(
373+
"{} {}",
374+
"[ERROR]".bright_red().bold(),
375+
"PIN cannot be empty. Please try again.".bright_red().bold()
376+
);
358377
continue;
359378
}
360379

@@ -385,7 +404,13 @@ fn prompt_required(prompt: &str, default: &str) -> Result<String, AkonError> {
385404
if !default.is_empty() {
386405
return Ok(default.to_string());
387406
}
388-
println!("❌ This field is required. Please enter a value.");
407+
println!(
408+
"{} {}",
409+
"[ERROR]".bright_red().bold(),
410+
"This field is required. Please enter a value."
411+
.bright_red()
412+
.bold()
413+
);
389414
continue;
390415
}
391416

0 commit comments

Comments
 (0)