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

View File

@@ -1,5 +1,5 @@
# BZZZ Build System with Embedded Web UI
.PHONY: build build-ui build-go clean dev setup install deps test
# BZZZ Build System with Embedded Web UI - Dual Binary Support
.PHONY: build build-agent build-hap build-ui build-go clean dev setup install deps test
# Configuration
UI_DIR = install/config-ui
@@ -7,7 +7,7 @@ BUILD_DIR = build
DIST_DIR = $(UI_DIR)/dist
EMBED_DIR = pkg/web
# Default target
# Default target - build both binaries
all: build
# Install dependencies
@@ -26,8 +26,8 @@ dev:
cd $(UI_DIR) && npm run dev &
go run main.go
# Build the complete application
build: build-ui embed-ui build-go
# Build the complete application - both binaries
build: build-ui embed-ui build-agent build-hap
# Build the React web UI
build-ui:
@@ -44,12 +44,23 @@ embed-ui: build-ui
@cp -r $(UI_DIR)/out/* $(EMBED_DIR)/ 2>/dev/null || cp -r $(UI_DIR)/.next/static $(EMBED_DIR)/ 2>/dev/null || true
@echo "✅ Web UI embedded successfully"
# Build the Go binary with embedded UI
build-go:
@echo "🔨 Building Go binary with embedded web UI..."
# Build the autonomous agent binary
build-agent: build-ui embed-ui
@echo "🔨 Building BZZZ Agent binary with embedded web UI..."
@mkdir -p $(BUILD_DIR)
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(BUILD_DIR)/bzzz .
@echo "✅ BZZZ binary built successfully: $(BUILD_DIR)/bzzz"
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(BUILD_DIR)/bzzz-agent ./cmd/agent
@echo "✅ BZZZ Agent binary built successfully: $(BUILD_DIR)/bzzz-agent"
# Build the HAP binary
build-hap: build-ui embed-ui
@echo "🔨 Building BZZZ HAP binary with embedded web UI..."
@mkdir -p $(BUILD_DIR)
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(BUILD_DIR)/bzzz-hap ./cmd/hap
@echo "✅ BZZZ HAP binary built successfully: $(BUILD_DIR)/bzzz-hap"
# Legacy build target for backward compatibility
build-go: build-agent
@echo "⚠️ build-go is deprecated, use build-agent or build-hap"
# Setup development environment
setup: deps
@@ -58,12 +69,15 @@ setup: deps
@mkdir -p $(EMBED_DIR)
@echo "✅ Development environment ready"
# Install BZZZ system-wide
# Install BZZZ binaries system-wide
install: build
@echo "📥 Installing BZZZ..."
sudo cp $(BUILD_DIR)/bzzz /usr/local/bin/
sudo chmod +x /usr/local/bin/bzzz
@echo "✅ BZZZ installed to /usr/local/bin/bzzz"
@echo "📥 Installing BZZZ binaries..."
sudo cp $(BUILD_DIR)/bzzz-agent /usr/local/bin/
sudo cp $(BUILD_DIR)/bzzz-hap /usr/local/bin/
sudo chmod +x /usr/local/bin/bzzz-agent
sudo chmod +x /usr/local/bin/bzzz-hap
@echo "✅ BZZZ Agent installed to /usr/local/bin/bzzz-agent"
@echo "✅ BZZZ HAP installed to /usr/local/bin/bzzz-hap"
# Run tests
test:
@@ -82,11 +96,20 @@ clean:
@echo "✅ Clean complete"
# Quick build for development (skip UI rebuild if not changed)
quick-build:
@echo "⚡ Quick build (Go only)..."
quick-build-agent:
@echo "⚡ Quick agent build (Go only)..."
@mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/bzzz .
@echo "✅ Quick build complete"
go build -o $(BUILD_DIR)/bzzz-agent ./cmd/agent
@echo "✅ Quick agent build complete"
quick-build-hap:
@echo "⚡ Quick HAP build (Go only)..."
@mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/bzzz-hap ./cmd/hap
@echo "✅ Quick HAP build complete"
# Quick build both binaries
quick-build: quick-build-agent quick-build-hap
# Docker build
docker-build:
@@ -96,20 +119,27 @@ docker-build:
# Help
help:
@echo "BZZZ Build System"
@echo "BZZZ Dual-Binary Build System"
@echo ""
@echo "Available targets:"
@echo " all - Build complete application (default)"
@echo " build - Build complete application with embedded UI"
@echo " build-ui - Build React web UI only"
@echo " build-go - Build Go binary only"
@echo " embed-ui - Embed web UI into Go source"
@echo " dev - Start development mode"
@echo " setup - Setup development environment"
@echo " deps - Install dependencies"
@echo " install - Install BZZZ system-wide"
@echo " test - Run tests"
@echo " clean - Clean build artifacts"
@echo " quick-build - Quick Go-only build"
@echo " docker-build- Build Docker image"
@echo " help - Show this help"
@echo " all - Build both binaries with embedded UI (default)"
@echo " build - Build both binaries with embedded UI"
@echo " build-agent - Build autonomous agent binary only"
@echo " build-hap - Build human agent portal binary only"
@echo " build-ui - Build React web UI only"
@echo " embed-ui - Embed web UI into Go source"
@echo " dev - Start development mode"
@echo " setup - Setup development environment"
@echo " deps - Install dependencies"
@echo " install - Install both binaries system-wide"
@echo " test - Run tests"
@echo " clean - Clean build artifacts"
@echo " quick-build - Quick build both binaries (Go only)"
@echo " quick-build-agent- Quick build agent binary only"
@echo " quick-build-hap - Quick build HAP binary only"
@echo " docker-build - Build Docker image"
@echo " help - Show this help"
@echo ""
@echo "Binaries:"
@echo " bzzz-agent - Autonomous AI agent for task execution"
@echo " bzzz-hap - Human Agent Portal for interactive coordination"