From 7bf9ca62014286c02f204eb013a2e2007a3bbe92 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 19 Nov 2025 16:08:03 +0100 Subject: [PATCH] Fix SSH command quoting and remove duplicate user prompts - Fix rebuild and backup commands with proper inner command quoting - Remove duplicate "Press any key to close..." from SSH commands since scripts handle it - Clean up SSH terminal command to avoid redundant prompts - Ensure consistent command execution patterns across all SSH operations - Update version to 0.1.91 --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- dashboard/Cargo.toml | 2 +- dashboard/src/ui/mod.rs | 10 +++++----- shared/Cargo.toml | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b78c1f..fe723ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.90" +version = "0.1.91" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.90" +version = "0.1.91" dependencies = [ "anyhow", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.90" +version = "0.1.91" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 4ded3df..8b50469 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.90" +version = "0.1.91" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index e5c8fec..06e2a59 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.90" +version = "0.1.91" edition = "2021" [dependencies] diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index ecd33e9..09132f1 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -220,7 +220,7 @@ impl TuiApp { let connection_ip = self.get_connection_ip(&hostname); // Create command that shows logo, rebuilds, and waits for user input let logo_and_rebuild = format!( - "echo 'Rebuilding system: {} ({})' && ssh -tt {}@{} \"bash -ic {}\" && echo 'Press any key to close...' && read -n 1 -s", + "echo 'Rebuilding system: {} ({})' && ssh -tt {}@{} \"bash -ic '{}'\"", hostname, connection_ip, self.config.ssh.rebuild_user, @@ -244,7 +244,7 @@ impl TuiApp { let connection_ip = self.get_connection_ip(&hostname); // Create command that shows logo, runs backup, and waits for user input let logo_and_backup = format!( - "echo 'Running backup: {} ({})' && ssh -tt {}@{} \"bash -ic {}\" && echo 'Press any key to close...' && read -n 1 -s", + "echo 'Running backup: {} ({})' && ssh -tt {}@{} \"bash -ic '{}'\"", hostname, connection_ip, self.config.ssh.rebuild_user, @@ -267,7 +267,7 @@ impl TuiApp { if let (Some(service_name), Some(hostname)) = (self.get_selected_service(), self.current_host.clone()) { let connection_ip = self.get_connection_ip(&hostname); let service_start_command = format!( - "echo 'Starting service: {} on {}' && ssh -tt {}@{} \"bash -ic '{} start {}'\" && echo 'Press any key to close...' && read -n 1 -s", + "echo 'Starting service: {} on {}' && ssh -tt {}@{} \"bash -ic '{} start {}'\"", service_name, hostname, self.config.ssh.rebuild_user, @@ -291,7 +291,7 @@ impl TuiApp { if let (Some(service_name), Some(hostname)) = (self.get_selected_service(), self.current_host.clone()) { let connection_ip = self.get_connection_ip(&hostname); let service_stop_command = format!( - "echo 'Stopping service: {} on {}' && ssh -tt {}@{} \"bash -ic '{} stop {}'\" && echo 'Press any key to close...' && read -n 1 -s", + "echo 'Stopping service: {} on {}' && ssh -tt {}@{} \"bash -ic '{} stop {}'\"", service_name, hostname, self.config.ssh.rebuild_user, @@ -393,7 +393,7 @@ impl TuiApp { if let Some(hostname) = self.current_host.clone() { let connection_ip = self.get_connection_ip(&hostname); let ssh_command = format!( - "echo 'Opening SSH terminal to: {}' && ssh -tt {}@{} && echo 'Press any key to close...' && read -n 1 -s", + "echo 'Opening SSH terminal to: {}' && ssh -tt {}@{}", hostname, self.config.ssh.rebuild_user, connection_ip diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 04bf17d..1d36eb1 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.90" +version = "0.1.91" edition = "2021" [dependencies]