Fix BZZZ deployment system and deploy to ironwood

## Major Fixes:
1. **Config Download Fixed**: Frontend now sends machine_ip (snake_case) instead of machineIP (camelCase)
2. **Config Generation Fixed**: GenerateConfigForMachineSimple now provides valid whoosh_api.base_url
3. **Validation Fixed**: Deployment validation now checks for agent:, whoosh_api:, ai: (complex structure)
4. **Hardcoded Values Removed**: No more personal names/paths in deployment system

## Deployment Results:
-  Config validation passes: "Configuration loaded and validated successfully"
-  Remote deployment works: BZZZ starts in normal mode on deployed machines
-  ironwood (192.168.1.113) successfully deployed with systemd service
-  P2P networking operational with peer discovery

## Technical Details:
- Updated api/setup_manager.go: Fixed config generation and validation logic
- Updated main.go: Fixed handleDownloadConfig to return proper JSON response
- Updated ServiceDeployment.tsx: Fixed field name for API compatibility
- Added version tracking 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 21:49:05 +10:00
parent be761cfe20
commit da1b42dc33
14 changed files with 923 additions and 285 deletions

View File

@@ -45,12 +45,11 @@ type OpenAIConfig struct {
// Config represents the complete configuration for a Bzzz agent
type Config struct {
WHOOSHAPI WHOOSHAPIConfig `yaml:"hive_api"`
WHOOSHAPI WHOOSHAPIConfig `yaml:"whoosh_api"`
Agent AgentConfig `yaml:"agent"`
GitHub GitHubConfig `yaml:"github"`
P2P P2PConfig `yaml:"p2p"`
Logging LoggingConfig `yaml:"logging"`
HCFS HCFSConfig `yaml:"hcfs"`
Slurp SlurpConfig `yaml:"slurp"`
V2 V2Config `yaml:"v2"` // BZZZ v2 protocol settings
UCXL UCXLConfig `yaml:"ucxl"` // UCXL protocol settings
@@ -226,31 +225,6 @@ type UCXLP2PConfig struct {
DiscoveryTimeout time.Duration `yaml:"discovery_timeout" json:"discovery_timeout"`
}
// HCFSConfig holds HCFS integration configuration
type HCFSConfig struct {
// API settings
APIURL string `yaml:"api_url" json:"api_url"`
APITimeout time.Duration `yaml:"api_timeout" json:"api_timeout"`
// Workspace settings
MountPath string `yaml:"mount_path" json:"mount_path"`
WorkspaceTimeout time.Duration `yaml:"workspace_timeout" json:"workspace_timeout"`
// FUSE settings
FUSEEnabled bool `yaml:"fuse_enabled" json:"fuse_enabled"`
FUSEMountPoint string `yaml:"fuse_mount_point" json:"fuse_mount_point"`
// Cleanup settings
IdleCleanupInterval time.Duration `yaml:"idle_cleanup_interval" json:"idle_cleanup_interval"`
MaxIdleTime time.Duration `yaml:"max_idle_time" json:"max_idle_time"`
// Storage settings
StoreArtifacts bool `yaml:"store_artifacts" json:"store_artifacts"`
CompressArtifacts bool `yaml:"compress_artifacts" json:"compress_artifacts"`
// Enable/disable HCFS integration
Enabled bool `yaml:"enabled" json:"enabled"`
}
// LoadConfig loads configuration from file, environment variables, and defaults
func LoadConfig(configPath string) (*Config, error) {
@@ -281,7 +255,7 @@ func LoadConfig(configPath string) (*Config, error) {
func getDefaultConfig() *Config {
return &Config{
WHOOSHAPI: WHOOSHAPIConfig{
BaseURL: "https://hive.home.deepblack.cloud",
BaseURL: "https://whoosh.home.deepblack.cloud",
Timeout: 30 * time.Second,
RetryCount: 3,
},
@@ -317,19 +291,6 @@ func getDefaultConfig() *Config {
Output: "stdout",
Structured: false,
},
HCFS: HCFSConfig{
APIURL: "http://localhost:8000",
APITimeout: 30 * time.Second,
MountPath: "/tmp/hcfs-workspaces",
WorkspaceTimeout: 2 * time.Hour,
FUSEEnabled: false,
FUSEMountPoint: "/mnt/hcfs",
IdleCleanupInterval: 15 * time.Minute,
MaxIdleTime: 1 * time.Hour,
StoreArtifacts: true,
CompressArtifacts: false,
Enabled: true,
},
Slurp: GetDefaultSlurpConfig(),
UCXL: UCXLConfig{
Enabled: false, // Disabled by default
@@ -456,10 +417,10 @@ func loadFromFile(config *Config, filePath string) error {
// loadFromEnv loads configuration from environment variables
func loadFromEnv(config *Config) error {
// WHOOSH API configuration
if url := os.Getenv("BZZZ_HIVE_API_URL"); url != "" {
if url := os.Getenv("BZZZ_WHOOSH_API_URL"); url != "" {
config.WHOOSHAPI.BaseURL = url
}
if apiKey := os.Getenv("BZZZ_HIVE_API_KEY"); apiKey != "" {
if apiKey := os.Getenv("BZZZ_WHOOSH_API_KEY"); apiKey != "" {
config.WHOOSHAPI.APIKey = apiKey
}
@@ -533,7 +494,7 @@ func loadFromEnv(config *Config) error {
func validateConfig(config *Config) error {
// Validate required fields
if config.WHOOSHAPI.BaseURL == "" {
return fmt.Errorf("hive_api.base_url is required")
return fmt.Errorf("whoosh_api.base_url is required")
}
// Note: Agent.ID can be empty - it will be auto-generated from node ID in main.go