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

@@ -7,13 +7,13 @@ import (
"encoding/json"
"fmt"
"log"
"strings"
"sync"
"time"
"chorus.services/bzzz/pkg/config"
"chorus.services/bzzz/pkg/crypto"
"chorus.services/bzzz/pkg/storage"
"chorus.services/bzzz/pkg/ucxl"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
)

View File

@@ -8,8 +8,10 @@ import (
"sync"
"time"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
"github.com/multiformats/go-multihash"
)
// ReplicationManager manages DHT data replication and provider records
@@ -215,8 +217,15 @@ func (rm *ReplicationManager) FindProviders(ctx context.Context, key string, lim
// Query DHT for providers
keyHash := sha256.Sum256([]byte(key))
// Create a proper CID from the hash
mh, err := multihash.EncodeName(keyHash[:], "sha2-256")
if err != nil {
return nil, fmt.Errorf("failed to encode multihash: %w", err)
}
contentID := cid.NewCidV1(cid.Raw, mh)
// Use DHT to find providers
providerCh := rm.dht.FindProvidersAsync(ctx, keyHash[:], limit)
providerCh := rm.dht.FindProvidersAsync(ctx, contentID, limit)
var providers []ProviderInfo
for providerInfo := range providerCh {
@@ -310,8 +319,18 @@ func (rm *ReplicationManager) provideContent(key string) error {
keyHash := sha256.Sum256([]byte(key))
// Create a proper CID from the hash
mh, err := multihash.EncodeName(keyHash[:], "sha2-256")
if err != nil {
rm.metrics.mu.Lock()
rm.metrics.FailedReplications++
rm.metrics.mu.Unlock()
return fmt.Errorf("failed to encode multihash: %w", err)
}
contentID := cid.NewCidV1(cid.Raw, mh)
// Provide the content to the DHT
if err := rm.dht.Provide(ctx, keyHash[:], true); err != nil {
if err := rm.dht.Provide(ctx, contentID, true); err != nil {
rm.metrics.mu.Lock()
rm.metrics.FailedReplications++
rm.metrics.mu.Unlock()