Skip to content

Commit 6829d8b

Browse files
feat: remove openssl dep and use rustls for emails
1 parent 2423e00 commit 6829d8b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ priority = "optional"
2020
anyhow = "1.0.95"
2121
clap = { version = "4.5.27", features = ["derive"] }
2222
nix = "0.26.0"
23-
lettre = { version = "0.10", features = ["smtp-transport", "tokio1", "tokio1-native-tls"] }
23+
lettre = { version = "0.10", default-features = false, features = ["smtp-transport", "builder", "rustls-tls"] }
2424
log = "0.4"
2525
chrono = "0.4"
2626
hostname = "0.3"

src/main.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,22 @@ enum Commands {
145145
fn main() -> Result<()> {
146146
let cli = Cli::parse();
147147

148-
// Check root privileges first for commands that need them
148+
// Set up logging first, before privilege check
149+
logging::setup_logging()?;
150+
151+
// Only check root privileges for commands that need them
149152
match &cli.command {
150-
Commands::AddNetwork { .. } |
151-
Commands::Install { .. } |
152-
Commands::Uninstall { .. } |
153-
Commands::SetEnv { .. } => {
153+
Commands::AddNetwork { .. } | // Needs root to modify network configs
154+
Commands::Install { .. } | // Needs root to install system service
155+
Commands::Uninstall { .. } | // Needs root to remove system service
156+
Commands::SetEnv { .. } => { // Needs root to set system-wide env vars
154157
check_root_privileges()
155158
.with_context(|| format!("{} Permission denied",
156159
logging::error_code(ErrorCode::PermissionDenied)))?;
157160
}
158-
_ => {}
161+
_ => {} // Other commands like SendLoginTicket don't need root
159162
}
160163

161-
// Set up logging after privilege check
162-
logging::setup_logging()?;
163-
164164
info!("Robot Network Manager executing: {}",
165165
match &cli.command {
166166
Commands::AddNetwork { .. } => "add-network",

0 commit comments

Comments
 (0)