From abd27bf0a2e683f829acde0d80b565278c165842 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Mon, 23 Feb 2026 14:13:14 -0500 Subject: [PATCH] refactor(go): Update Go commands and TUI controller Update api-server and gen-keys main files Update TUI controller commands, helpers, and settings --- cmd/api-server/main.go | 10 +++++----- cmd/gen-keys/main.go | 2 +- cmd/tui/internal/controller/commands.go | 6 +++--- cmd/tui/internal/controller/helpers.go | 2 +- cmd/tui/internal/controller/settings.go | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index d4dd44d..4062c15 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -74,7 +74,7 @@ func runSecurityAudit(configFile string) { if mode&0077 != 0 { issues = append(issues, fmt.Sprintf("Config file %s is world/group readable (permissions: %04o)", configFile, mode)) } else { - fmt.Printf("✓ Config file permissions: %04o (secure)\n", mode) + fmt.Printf("Config file permissions: %04o (secure)\n", mode) } } else { warnings = append(warnings, fmt.Sprintf("Could not check config file: %v", err)) @@ -91,14 +91,14 @@ func runSecurityAudit(configFile string) { if len(exposedVars) > 0 { warnings = append(warnings, fmt.Sprintf("Sensitive environment variables exposed: %v (will be cleared on startup)", exposedVars)) } else { - fmt.Println("✓ No sensitive environment variables exposed") + fmt.Println("No sensitive environment variables exposed") } // Check 3: Running as root if os.Getuid() == 0 { issues = append(issues, "Running as root (UID 0) - should run as non-root user") } else { - fmt.Printf("✓ Running as non-root user (UID: %d)\n", os.Getuid()) + fmt.Printf("Running as non-root user (UID: %d)\n", os.Getuid()) } // Check 4: API key file permissions @@ -109,7 +109,7 @@ func runSecurityAudit(configFile string) { if mode&0077 != 0 { issues = append(issues, fmt.Sprintf("API key file %s is world/group readable (permissions: %04o)", apiKeyFile, mode)) } else { - fmt.Printf("✓ API key file permissions: %04o (secure)\n", mode) + fmt.Printf("API key file permissions: %04o (secure)\n", mode) } } } @@ -117,7 +117,7 @@ func runSecurityAudit(configFile string) { // Report results fmt.Println() if len(issues) == 0 && len(warnings) == 0 { - fmt.Println("✓ All security checks passed") + fmt.Println("All security checks passed") } else { if len(issues) > 0 { fmt.Printf("✗ Found %d security issue(s):\n", len(issues)) diff --git a/cmd/gen-keys/main.go b/cmd/gen-keys/main.go index 056b119..0d4ba12 100644 --- a/cmd/gen-keys/main.go +++ b/cmd/gen-keys/main.go @@ -43,7 +43,7 @@ func main() { } // Print summary - fmt.Printf("✓ Generated Ed25519 signing keys\n") + fmt.Printf("Generated Ed25519 signing keys\n") fmt.Printf(" Key ID: %s\n", *keyID) fmt.Printf(" Private key: %s (permissions: 0600)\n", privKeyPath) fmt.Printf(" Public key: %s\n", pubKeyPath) diff --git a/cmd/tui/internal/controller/commands.go b/cmd/tui/internal/controller/commands.go index 9eda176..9593dc1 100644 --- a/cmd/tui/internal/controller/commands.go +++ b/cmd/tui/internal/controller/commands.go @@ -264,7 +264,7 @@ func (c *Controller) queueJob(jobName string, args string) tea.Cmd { c.logger.Info("job queued", "job_name", jobName, "task_id", task.ID[:8], "priority", priority) resultChan <- model.StatusMsg{ - Text: fmt.Sprintf("✓ Queued: %s (ID: %s, P:%d)", jobName, task.ID[:8], priority), + Text: fmt.Sprintf("Queued: %s (ID: %s, P:%d)", jobName, task.ID[:8], priority), Level: "success", } }() @@ -287,7 +287,7 @@ func (c *Controller) deleteJob(jobName string) tea.Cmd { if _, err := c.server.Exec(cmd); err != nil { return model.StatusMsg{Text: fmt.Sprintf("Failed to archive %s: %v", jobName, err), Level: "error"} } - return model.StatusMsg{Text: fmt.Sprintf("✓ Archived: %s", jobName), Level: "success"} + return model.StatusMsg{Text: fmt.Sprintf("Archived: %s", jobName), Level: "success"} } } @@ -309,7 +309,7 @@ func (c *Controller) cancelTask(taskID string) tea.Cmd { return model.StatusMsg{Text: fmt.Sprintf("Cancel failed: %v", err), Level: "error"} } c.logger.Info("task cancelled", "task_id", taskID[:8]) - return model.StatusMsg{Text: fmt.Sprintf("✓ Cancelled: %s", taskID[:8]), Level: "success"} + return model.StatusMsg{Text: fmt.Sprintf("Cancelled: %s", taskID[:8]), Level: "success"} } } diff --git a/cmd/tui/internal/controller/helpers.go b/cmd/tui/internal/controller/helpers.go index deb2145..86f9029 100644 --- a/cmd/tui/internal/controller/helpers.go +++ b/cmd/tui/internal/controller/helpers.go @@ -53,7 +53,7 @@ func formatStatus(m model.State) string { stats = append(stats, fmt.Sprintf("▶ %d", count)) } if count := m.JobStats[model.StatusFinished]; count > 0 { - stats = append(stats, fmt.Sprintf("✓ %d", count)) + stats = append(stats, fmt.Sprintf("%d", count)) } if count := m.JobStats[model.StatusFailed]; count > 0 { stats = append(stats, fmt.Sprintf("✗ %d", count)) diff --git a/cmd/tui/internal/controller/settings.go b/cmd/tui/internal/controller/settings.go index 2794c5c..af0cc21 100644 --- a/cmd/tui/internal/controller/settings.go +++ b/cmd/tui/internal/controller/settings.go @@ -111,7 +111,7 @@ func getSettingsIndicator(m model.State, index int) string { func getAPIKeyStatus(m model.State) string { if m.APIKey != "" { - return "✓ API Key is set\n" + maskAPIKey(m.APIKey) + return "API Key is set\n" + maskAPIKey(m.APIKey) } return "⚠ No API Key configured" }