Enhance deployment system with retry functionality and improved UX

Major Improvements:
- Added retry deployment buttons in machine list for failed deployments
- Added retry button in SSH console modal footer for enhanced UX
- Enhanced deployment process with comprehensive cleanup of existing services
- Improved binary installation with password-based sudo authentication
- Updated configuration generation to include all required sections (agent, ai, network, security)
- Fixed deployment verification and error handling

Security Enhancements:
- Enhanced verifiedStopExistingServices with thorough cleanup process
- Improved binary copying with proper sudo authentication
- Added comprehensive configuration validation

UX Improvements:
- Users can retry deployments without re-running machine discovery
- Retry buttons available from both machine list and console modal
- Real-time deployment progress with detailed console output
- Clear error states with actionable retry options

Technical Changes:
- Modified ServiceDeployment.tsx with retry button components
- Enhanced api/setup_manager.go with improved deployment functions
- Updated main.go with command line argument support (--config, --setup)
- Added comprehensive zero-trust security validation system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-31 10:23:27 +10:00
parent df4d98bf30
commit be761cfe20
234 changed files with 7508 additions and 38528 deletions

39
main.go
View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
@@ -101,12 +102,34 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
// Parse command line arguments
var configPath string
var setupMode bool
flag.StringVar(&configPath, "config", "", "Path to configuration file")
flag.BoolVar(&setupMode, "setup", false, "Start in setup mode")
flag.Parse()
fmt.Println("🚀 Starting Bzzz v1.0.2 + HMMM P2P Task Coordination System...")
// Determine config file path
configPath := os.Getenv("BZZZ_CONFIG_PATH")
// Determine config file path with priority order:
// 1. Command line argument
// 2. Environment variable
// 3. Default location
if configPath == "" {
configPath = ".bzzz/config.yaml"
configPath = os.Getenv("BZZZ_CONFIG_PATH")
if configPath == "" {
configPath = ".bzzz/config.yaml"
}
}
fmt.Printf("📂 Using configuration file: %s\n", configPath)
// Force setup mode if requested via command line
if setupMode {
fmt.Println("🔧 Setup mode requested via command line...")
startSetupMode(configPath)
return
}
// Check if setup is required
@@ -116,10 +139,14 @@ func main() {
return
}
// Load configuration
// Load configuration with security validation
fmt.Println("🔍 Loading configuration with zero-trust validation...")
cfg, err := config.LoadConfig(configPath)
if err != nil {
log.Fatalf("Failed to load configuration: %v", err)
fmt.Printf("❌ Configuration validation failed: %v\n", err)
fmt.Println("🔧 Starting setup mode due to security validation failure...")
startSetupMode(configPath)
return
}
// Validate configuration
@@ -128,6 +155,8 @@ func main() {
startSetupMode(configPath)
return
}
fmt.Println("✅ Configuration loaded and validated successfully")
// Initialize P2P node
node, err := p2p.NewNode(ctx)