v0.1.27 release: Complete implementation
Features: - Error logging system with ETHOS #1 compliance - Command factory pattern with UUID generation - Hardware binding with machine fingerprint validation - Ed25519 cryptographic signing for updates - Deduplication and idempotency for commands - Circuit breakers and retry logic - Frontend error logging integration Bug Fixes: - Version display using compile-time injection - Migration 017 CONCURRENTLY issue resolved - Docker build context fixes - Rate limiting implementation verified Documentation: - README updated to reflect actual implementation - v0.1.27 inventory analysis added
This commit is contained in:
@@ -7,24 +7,37 @@ import (
|
||||
|
||||
// Version coordination for Server Authority model
|
||||
// The server is the single source of truth for all version information
|
||||
//
|
||||
// Version Sources:
|
||||
// - Agent versions: Compiled into agent via ldflags during build (see agent/internal/version)
|
||||
// - Server versions: Compiled into server via ldflags during build (injected below)
|
||||
// - Database: agents table stores agent_version at registration
|
||||
|
||||
// CurrentVersions holds the authoritative version information
|
||||
// Build-time injected version information (SERVER AUTHORITY)
|
||||
// Injected by build script during server compilation
|
||||
var (
|
||||
AgentVersion = "dev" // Server's agent version (format: 0.1.27)
|
||||
ConfigVersion = "dev" // Config schema version (format: 3)
|
||||
MinAgentVersion = "dev" // Minimum supported agent version
|
||||
)
|
||||
|
||||
// CurrentVersions holds the authoritative version information for API responses
|
||||
type CurrentVersions struct {
|
||||
AgentVersion string `json:"agent_version"` // e.g., "0.1.23.6"
|
||||
ConfigVersion string `json:"config_version"` // e.g., "6"
|
||||
AgentVersion string `json:"agent_version"` // e.g., "0.1.27"
|
||||
ConfigVersion string `json:"config_version"` // e.g., "3"
|
||||
MinAgentVersion string `json:"min_agent_version"` // e.g., "0.1.22"
|
||||
BuildTime time.Time `json:"build_time"`
|
||||
}
|
||||
|
||||
// GetCurrentVersions returns the current version information
|
||||
// In production, this would come from a version file, database, or environment
|
||||
// Version is compiled into the server binary at build time via ldflags
|
||||
func GetCurrentVersions() CurrentVersions {
|
||||
// TODO: For production, load this from version file or database
|
||||
// For now, use environment variables with defaults
|
||||
// Build-time injection allows version updates without code changes
|
||||
// See Dockerfile for injection via: -ldflags "-X .../version.AgentVersion=0.1.27"
|
||||
return CurrentVersions{
|
||||
AgentVersion: "0.1.23", // Should match current branch
|
||||
ConfigVersion: "3", // Should map from agent version (0.1.23 -> "3")
|
||||
MinAgentVersion: "0.1.22",
|
||||
AgentVersion: AgentVersion,
|
||||
ConfigVersion: ConfigVersion,
|
||||
MinAgentVersion: MinAgentVersion,
|
||||
BuildTime: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user