51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
//go:build !commercial
|
|
|
|
// Package edition - Community Edition implementation.
|
|
// This file is built when NO build tags are specified (default).
|
|
//
|
|
// Community Edition features:
|
|
// - No external telemetry (privacy-first)
|
|
// - Local logging only
|
|
// - Self-hosted, no central management
|
|
// - AGPL/compliant open source
|
|
package edition
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
func init() {
|
|
Current = &communityEdition{name: "community"}
|
|
SetCommercialConfig = func(cfg *CommercialConfig) {
|
|
// No-op in community edition
|
|
log.Printf("WARNING: CommercialConfig ignored in Community Edition")
|
|
}
|
|
StartReplication = func(ctx context.Context, dataDir string) {
|
|
// No-op: replication not available in Community Edition
|
|
}
|
|
}
|
|
|
|
// communityEdition is the Community Edition implementation.
|
|
type communityEdition struct {
|
|
name string
|
|
}
|
|
|
|
func (e *communityEdition) Name() string { return e.name }
|
|
|
|
func (e *communityEdition) IsTelemetryEnabled() bool { return false }
|
|
|
|
func (e *communityEdition) AlertOperator(ctx context.Context, alertType, message string, details map[string]any) {
|
|
// Community: Log locally only. No external calls.
|
|
if details != nil {
|
|
log.Printf("OPERATOR ALERT [%s]: %s - %+v", alertType, message, details)
|
|
} else {
|
|
log.Printf("OPERATOR ALERT [%s]: %s", alertType, message)
|
|
}
|
|
}
|
|
|
|
// StartTelemetry is a no-op in Community Edition.
|
|
func StartTelemetry(ctx context.Context) {
|
|
log.Printf("Community edition: telemetry disabled (privacy-first)")
|
|
}
|