models

package
v0.39.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package models defines the core data structures for StackKits.

Index

Constants

View Source
const (
	ComputeTierLow      = "low"
	ComputeTierStandard = "standard"
	ComputeTierHigh     = "high"

	RuntimeNative = "native"

	StorageOverlay2    = "overlay2"
	StorageVFS         = "vfs"
	StorageFuseOverlay = "fuse-overlayfs"

	VirtNone   = "none"
	VirtKVM    = "kvm"
	VirtLXC    = "lxc"
	VirtOpenVZ = "openvz"

	DNSFixNone = "none"

	InstallModeBare         = "bare"
	InstallModeBootstrapped = "bootstrapped"
	InstallModeAdvanced     = "advanced"
	InstallModeSimpleLegacy = "simple"
	InstallModeTerramate    = "terramate"
	InstallModeAdvancedTM   = "advanced-terramate"
	InstallModeDefault      = InstallModeBootstrapped

	// PAAS platform types
	PAASDokploy = "dokploy"
	PAASCoolify = "coolify"
	PAASKomodo  = "komodo"
	PAASDockge  = "dockge"
	PAASNone    = "none"

	// Reverse proxy backend — determines which Traefik instance routes platform services.
	// User app rollouts are owned by the selected PaaS; StackKit only records
	// route and manifest handoff metadata for those apps.
	ReverseProxyStandalone = "standalone"
	ReverseProxyStackKit   = "stackkit"
	ReverseProxyDokploy    = "dokploy"
	ReverseProxyCoolify    = "coolify"

	PlatformFallbackDisabled          = "disabled"
	PlatformFallbackStandaloneCompose = "standalone-compose"

	// Domain constants
	DomainKombifyMe = "kombify.me"
	DomainHomelab   = "homelab"
	// DomainHomeLab keeps the historical constant name for compatibility. The
	// canonical local deployment zone is resolved by the scoped device profile
	// installed during Home device enrollment. It never relies on .localhost,
	// mDNS, a hosts file, or router DHCP configuration.
	DomainHomeLab             = "home"
	DomainHomeLocalhost       = "home.localhost"
	DomainStackHome           = "stack.home"
	DomainHomeKombifyLegacy   = "home.kombify"
	DomainHomeLabLegacy       = "home.lab"
	DomainHomeDNS             = "home"
	LocalTechnicalEmailDomain = "example.com"

	OwnerBootstrapModeAuto   = "auto"
	OwnerBootstrapModeCustom = "custom"
	OwnerBootstrapModeNone   = "none"

	OwnerSourceLocal    = "local"
	OwnerSourceCloud    = "cloud"
	OwnerSourceFirstRun = "first-run"

	BreakGlassScopeFullEmergencyAdmin = "full-emergency-admin"

	BootstrapModeFullAuto = "full_auto"
	BootstrapModeGuided   = "guided"
	BootstrapModeMinimal  = "minimal"

	SetupPolicyManual    = "manual"
	SetupPolicyOnDemand  = "on_demand"
	SetupPolicyAutomatic = "automatic"

	RuntimeProfileKombifyManaged          = "kombify-managed"
	RuntimeProfileKombifyManagedHybrid    = "kombify-managed-hybrid"
	RuntimeProfileSelfHostedContainer     = "self-hosted-container"
	RuntimeProfileSelfHostedHAOS          = "self-hosted-ha-os"
	RuntimeProfileBringYourOwnHA          = "bring-your-own-ha"
	RuntimeProfileSelfHostedLightweight   = "self-hosted-lightweight"
	RuntimeProfileSelfHostedCollaboration = "self-hosted-collaboration"
	RuntimeProfileKombifyManagedFiles     = "kombify-managed-files"
	RuntimeProfileKombifyManagedDMS       = "kombify-managed-dms"
	RuntimeProfileBringYourOwnStorage     = "bring-your-own-storage"

	SetupRunStatusRunning   = "running"
	SetupRunStatusWaiting   = "waiting"
	SetupRunStatusCompleted = "completed"
	SetupRunStatusFailed    = "failed"

	BootstrapPhaseDesired        = "desired"
	BootstrapPhasePrepared       = "prepared"
	BootstrapPhaseOwnerActivated = "owner_activated"
	BootstrapPhaseConfigured     = "configured"
	BootstrapPhaseVerified       = "verified"
)
View Source
const (
	// NodeRoleMain is the canonical role for the homelab control node. The
	// main node owns identity, StackKits control state, and the PaaS UI.
	NodeRoleMain = "main"
	// NodeRoleControlPlane is a compatibility alias for NodeRoleMain.
	NodeRoleControlPlane = "control-plane"
	// NodeRoleStandalone is a compatibility alias for a single-node main.
	NodeRoleStandalone = "standalone"
	NodeRoleWorker     = "worker"
	NodeRoleStorage    = "storage"
)
View Source
const (
	PlacementLocalOnly = "local-only"
	PlacementStandard  = "standard"
	PlacementManaged   = "managed-serverless"
	PlacementDefault   = PlacementStandard

	ExposurePrivate   = "private"
	ExposurePublic    = "public"
	CouplingCloudless = "cloudless"
	CouplingCoupled   = "coupled"
)

Placement axis (PLACEMENT-MODE-STANDARD §4 / STACKKITS-SPEC-PIPELINE §10). StackKits-OSS realizes only S1 (local-only, standard+cloudless); managed-serverless/coupled are S2/S3 (TechStack/Control-Plane), not realized here.

Variables

This section is empty.

Functions

func CanonicalNodeRole

func CanonicalNodeRole(role string) string

CanonicalNodeRole maps compatible legacy role names to the BaseKit v1 role vocabulary used for validation and placement decisions.

func DefaultAppHost

func DefaultAppHost(domain, subdomainPrefix, appName string) string

DefaultAppHost returns the route host for a StackSpec app when route.host is omitted. kombify.me app routes use the flat registry service naming shape.

func IsAdvancedLifecycleInstallMode

func IsAdvancedLifecycleInstallMode(mode string) bool

func IsDraftPAAS

func IsDraftPAAS(paas string) bool

IsDraftPAAS reports whether the platform has adapter work but is not part of the production PaaS standard or canonical E2E matrix.

func IsExperimentalPAAS

func IsExperimentalPAAS(paas string) bool

IsExperimentalPAAS reports whether the platform exists only as a constrained nonstandard mode rather than a normal StackKit default.

func IsExplicitTerramateInstallMode

func IsExplicitTerramateInstallMode(mode string) bool

func IsKnownBootstrapMode

func IsKnownBootstrapMode(mode string) bool

func IsKnownBootstrapSelector

func IsKnownBootstrapSelector(mode string) bool

func IsKnownInstallMode

func IsKnownInstallMode(mode string) bool

func IsKnownNodeRole

func IsKnownNodeRole(role string) bool

IsKnownNodeRole reports whether role is part of the supported BaseKit node vocabulary or one of its compatibility aliases.

func IsKnownOwnerBootstrapMode

func IsKnownOwnerBootstrapMode(mode string) bool

func IsKnownOwnerSource

func IsKnownOwnerSource(source string) bool

func IsKnownPlacementMode

func IsKnownPlacementMode(mode string) bool

IsKnownPlacementMode reports whether mode is one of the three axis values.

func IsKnownSetupPolicy

func IsKnownSetupPolicy(policy string) bool

func IsKombifyMeDomain

func IsKombifyMeDomain(domain string) bool

IsKombifyMeDomain returns true for the managed kombify.me shared domain.

func IsLegacyInstallMode

func IsLegacyInstallMode(mode string) bool

func IsLocalDomain

func IsLocalDomain(domain string) bool

IsLocalDomain returns true for local-only or non-routable domains.

func IsLocalhostDomain

func IsLocalhostDomain(domain string) bool

IsLocalhostDomain returns true for the browser-reserved localhost namespace.

func IsMainNodeRole

func IsMainNodeRole(role string) bool

IsMainNodeRole reports whether role identifies the homelab main node.

func IsStandardPAAS

func IsStandardPAAS(paas string) bool

IsStandardPAAS reports whether the platform is part of the production StackKit PaaS standard. Draft adapters may still be supported by lower-level contracts, but they are not standard rollout choices.

func IsSupportedPAAS

func IsSupportedPAAS(paas string) bool

IsSupportedPAAS reports whether StackKit has a platform adapter contract for the value. This includes draft adapters used by focused contract tests.

func LocalDNSDomain

func LocalDNSDomain(localName string) string

LocalDNSDomain returns the domain suffix for Kombify Point local DNS mode.

func NeedsSyntheticAdminEmail

func NeedsSyntheticAdminEmail(email string) bool

NeedsSyntheticAdminEmail reports whether the configured admin identity is only a placeholder and must be converted into a usable email-shaped login.

func NormalizeAdminEmail

func NormalizeAdminEmail(email, domain, subdomainPrefix string) string

NormalizeAdminEmail converts empty or bare admin identities into a usable email-shaped login. Bare usernames are scoped to the deployment host.

func NormalizeInstallMode

func NormalizeInstallMode(mode string) string

NormalizeInstallMode maps public and legacy install-mode values onto the current three-mode contract.

func NormalizePlacementMode

func NormalizePlacementMode(mode string) string

NormalizePlacementMode maps blank to the default; otherwise trims/lowercases.

func NormalizeSetupPolicy

func NormalizeSetupPolicy(policy string) string

func RequiresKombifyPoint

func RequiresKombifyPoint(domain string) bool

RequiresKombifyPoint returns true when local service names need our LAN DNS resolver.

func ResolveAdminEmail

func ResolveAdminEmail(spec *StackSpec) string

ResolveAdminEmail returns the email-shaped account used for bootstrap-only admin credentials in tools that cannot yet rely on PocketID/OIDC. The human Owner is canonical; adminEmail and email remain compatibility fallbacks.

func ResolveAdminEmailForDomain

func ResolveAdminEmailForDomain(spec *StackSpec, domain string) string

ResolveAdminEmailForDomain is the same owner-first resolver but lets callers pass a domain that was already normalized or context-adjusted.

func ResolveReverseProxyForPAAS

func ResolveReverseProxyForPAAS(paas string) string

ResolveReverseProxyForPAAS determines which Traefik instance routes platform services for the given PAAS selection.

func SyntheticAdminEmail

func SyntheticAdminEmail(domain, subdomainPrefix string) string

SyntheticAdminEmail returns the generated admin email for a deployment.

Types

type AlertReceiverSpec

type AlertReceiverSpec struct {
	Name string `yaml:"name" json:"name"`
	Type string `yaml:"type" json:"type"` // "email", "slack", "discord", "telegram", "webhook"
}

AlertReceiverSpec defines an alert destination.

type AlertingSpec

type AlertingSpec struct {
	// Enabled activates alerting.
	Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Receivers lists alert destinations.
	Receivers []AlertReceiverSpec `yaml:"receivers,omitempty" json:"receivers,omitempty"`
}

AlertingSpec configures alerting.

type AppHealthSpec

type AppHealthSpec struct {
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
}

AppHealthSpec describes the app health endpoint contract.

type AppRouteSpec

type AppRouteSpec struct {
	Host string `yaml:"host,omitempty" json:"host,omitempty"`
	Auth string `yaml:"auth,omitempty" json:"auth,omitempty"` // login-gateway (default) or public
}

AppRouteSpec describes how an app is exposed through Traefik.

type AppSetupSpec

type AppSetupSpec struct {
	Policy string          `yaml:"policy,omitempty" json:"policy,omitempty"`
	Drops  []SetupDropSpec `yaml:"drops,omitempty" json:"drops,omitempty"`
}

AppSetupSpec describes first-run setup behavior for a platform-managed app.

type AppSpec

type AppSpec struct {
	Kind    string            `yaml:"kind,omitempty" json:"kind,omitempty"`
	Image   string            `yaml:"image,omitempty" json:"image,omitempty"`
	Port    int               `yaml:"port,omitempty" json:"port,omitempty"`
	Route   AppRouteSpec      `yaml:"route,omitempty" json:"route,omitempty"`
	Health  AppHealthSpec     `yaml:"health,omitempty" json:"health,omitempty"`
	Setup   AppSetupSpec      `yaml:"setup,omitempty" json:"setup,omitempty"`
	Env     map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	Secrets map[string]string `yaml:"secrets,omitempty" json:"secrets,omitempty"`
}

AppSpec describes a user application deployed behind the StackKits platform.

type ApplicationConnectorDef

type ApplicationConnectorDef struct {
	Kind          string   `yaml:"kind,omitempty" json:"kind,omitempty"`
	Name          string   `yaml:"name,omitempty" json:"name,omitempty"`
	Owner         string   `yaml:"owner,omitempty" json:"owner,omitempty"`
	Endpoint      string   `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
	Transport     string   `yaml:"transport,omitempty" json:"transport,omitempty"`
	Auth          string   `yaml:"auth,omitempty" json:"auth,omitempty"`
	NativeProduct bool     `yaml:"nativeProduct,omitempty" json:"nativeProduct,omitempty"`
	Capabilities  []string `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
}

ApplicationConnectorDef captures package-level connector metadata. Product MCP connectors are owned by the product itself (for example Home Assistant's native /api/mcp endpoint); StackKits only wires, protects, and verifies them.

type ApplicationDef

type ApplicationDef struct {
	Role                  ToolRole                                `yaml:"role" json:"role"`
	DefaultTool           string                                  `yaml:"defaultTool,omitempty" json:"defaultTool,omitempty"`
	Alternatives          []string                                `yaml:"alternatives,omitempty" json:"alternatives,omitempty"`
	Description           string                                  `yaml:"description,omitempty" json:"description,omitempty"`
	Package               string                                  `yaml:"package,omitempty" json:"package,omitempty"`
	DefaultRuntimeProfile string                                  `yaml:"defaultRuntimeProfile,omitempty" json:"defaultRuntimeProfile,omitempty"`
	RuntimeProfiles       map[string]ApplicationRuntimeProfileDef `yaml:"runtimeProfiles,omitempty" json:"runtimeProfiles,omitempty"`
	Connectors            map[string]ApplicationConnectorDef      `yaml:"connectors,omitempty" json:"connectors,omitempty"`
	ProductAPIs           map[string]ApplicationProductAPIDef     `yaml:"productApis,omitempty" json:"productApis,omitempty"`
	RIL                   *ApplicationRILDef                      `yaml:"ril,omitempty" json:"ril,omitempty"`
}

ApplicationDef defines an application-layer (L3) service slot in stackkit.yaml. Pre-2026-04 named UseCaseDef under `useCases:` — renamed in migration 000084 to align with the canonical Foundation/Platform/Application layer standard (ADR-0012, ARCHITECTURE_V6 §4).

type ApplicationProductAPIDef

type ApplicationProductAPIDef struct {
	Protocol string `yaml:"protocol,omitempty" json:"protocol,omitempty"`
	BasePath string `yaml:"basePath,omitempty" json:"basePath,omitempty"`
	Auth     string `yaml:"auth,omitempty" json:"auth,omitempty"`
	Purpose  string `yaml:"purpose,omitempty" json:"purpose,omitempty"`
}

type ApplicationRILCapabilityDef

type ApplicationRILCapabilityDef struct {
	Mode             string `yaml:"mode,omitempty" json:"mode,omitempty"`
	Authority        string `yaml:"authority,omitempty" json:"authority,omitempty"`
	Source           string `yaml:"source,omitempty" json:"source,omitempty"`
	RequiresApproval bool   `yaml:"requiresApproval,omitempty" json:"requiresApproval,omitempty"`
	Evidence         string `yaml:"evidence,omitempty" json:"evidence,omitempty"`
}

type ApplicationRILDef

type ApplicationRILDef struct {
	Capabilities map[string]ApplicationRILCapabilityDef `yaml:"capabilities,omitempty" json:"capabilities,omitempty"`
}

type ApplicationRuntimeProfileDef

type ApplicationRuntimeProfileDef struct {
	DisplayName               string   `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	Description               string   `yaml:"description,omitempty" json:"description,omitempty"`
	Realization               string   `yaml:"realization,omitempty" json:"realization,omitempty"` // oss, control-plane, hybrid, external
	PlacementModes            []string `yaml:"placementModes,omitempty" json:"placementModes,omitempty"`
	Contexts                  []string `yaml:"contexts,omitempty" json:"contexts,omitempty"`
	ManagedServerlessEligible bool     `yaml:"managedServerlessEligible,omitempty" json:"managedServerlessEligible,omitempty"`
	RequiresControlPlane      bool     `yaml:"requiresControlPlane,omitempty" json:"requiresControlPlane,omitempty"`
	RequiresLocalBridge       bool     `yaml:"requiresLocalBridge,omitempty" json:"requiresLocalBridge,omitempty"`
	Notes                     []string `yaml:"notes,omitempty" json:"notes,omitempty"`
}

ApplicationRuntimeProfileDef describes one runtime realization for a use case package. Control-plane profiles are publishable eligibility/handoff metadata; StackKits OSS does not realize them locally.

type BackupDestinationSpec

type BackupDestinationSpec struct {
	Name string `yaml:"name" json:"name"`
	Type string `yaml:"type" json:"type"` // "local", "s3", "b2", "sftp"
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
	// S3-specific fields.
	S3Bucket   string `yaml:"s3Bucket,omitempty" json:"s3Bucket,omitempty"`
	S3Endpoint string `yaml:"s3Endpoint,omitempty" json:"s3Endpoint,omitempty"`
	S3Region   string `yaml:"s3Region,omitempty" json:"s3Region,omitempty"`
	// SFTP-specific fields.
	SFTPHost string `yaml:"sftpHost,omitempty" json:"sftpHost,omitempty"`
	SFTPUser string `yaml:"sftpUser,omitempty" json:"sftpUser,omitempty"`
	SFTPPath string `yaml:"sftpPath,omitempty" json:"sftpPath,omitempty"`
}

BackupDestinationSpec defines a backup target.

type BackupEmergencyExportSpec

type BackupEmergencyExportSpec struct {
	Enabled        *bool                     `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Mode           string                    `yaml:"mode,omitempty" json:"mode,omitempty"`
	Format         string                    `yaml:"format,omitempty" json:"format,omitempty"`
	Schedule       string                    `yaml:"schedule,omitempty" json:"schedule,omitempty"`
	IncludeClasses []string                  `yaml:"includeClasses,omitempty" json:"includeClasses,omitempty"`
	LargeMediaMode string                    `yaml:"largeMediaMode,omitempty" json:"largeMediaMode,omitempty"`
	Target         *BackupDestinationSpec    `yaml:"target,omitempty" json:"target,omitempty"`
	Manifest       *BackupExportManifestSpec `yaml:"manifest,omitempty" json:"manifest,omitempty"`
}

BackupEmergencyExportSpec defines the Kopia-independent fallback export.

type BackupExportManifestSpec

type BackupExportManifestSpec struct {
	Enabled               *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	IncludeRestoreRunbook *bool `yaml:"includeRestoreRunbook,omitempty" json:"includeRestoreRunbook,omitempty"`
	IncludeChecksums      *bool `yaml:"includeChecksums,omitempty" json:"includeChecksums,omitempty"`
}

BackupExportManifestSpec controls portable export metadata.

type BackupResilienceSpec

type BackupResilienceSpec struct {
	SingleServer      *SingleServerBackupSafetySpec  `yaml:"singleServer,omitempty" json:"singleServer,omitempty"`
	MultiServer       *MultiServerBackupSafetySpec   `yaml:"multiServer,omitempty" json:"multiServer,omitempty"`
	EmergencyExport   *BackupEmergencyExportSpec     `yaml:"emergencyExport,omitempty" json:"emergencyExport,omitempty"`
	ManagedServerless *ManagedServerlessRecoverySpec `yaml:"managedServerless,omitempty" json:"managedServerless,omitempty"`
}

BackupResilienceSpec defines recovery layers around the primary backup.

type BackupRetentionSpec

type BackupRetentionSpec struct {
	Daily   int `yaml:"daily,omitempty" json:"daily,omitempty"`
	Weekly  int `yaml:"weekly,omitempty" json:"weekly,omitempty"`
	Monthly int `yaml:"monthly,omitempty" json:"monthly,omitempty"`
	Yearly  int `yaml:"yearly,omitempty" json:"yearly,omitempty"`
}

BackupRetentionSpec defines backup retention policy.

type BackupSpec

type BackupSpec struct {
	// Enabled activates backups (default true via CUE).
	Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Engine: "kopia" or transitional "restic-import".
	Engine string `yaml:"engine,omitempty" json:"engine,omitempty"`
	// Backend is a legacy alias for Engine. Only "kopia" and "restic-import"
	// are valid; Restic/Borg/Rclone are no longer active StackKits engines.
	Backend string `yaml:"backend,omitempty" json:"backend,omitempty"`
	// Schedule in cron format (default derived from compute tier).
	Schedule string `yaml:"schedule,omitempty" json:"schedule,omitempty"`
	// DataClasses lists state classes covered by the backup policy.
	DataClasses []string `yaml:"dataClasses,omitempty" json:"dataClasses,omitempty"`
	// Resilience defines recovery layers around the primary Kopia repository.
	Resilience *BackupResilienceSpec `yaml:"resilience,omitempty" json:"resilience,omitempty"`
	// Retention defines how many backups to keep.
	Retention *BackupRetentionSpec `yaml:"retention,omitempty" json:"retention,omitempty"`
	// Destinations lists backup targets.
	Destinations []BackupDestinationSpec `yaml:"destinations,omitempty" json:"destinations,omitempty"`
	// Paths to include in backups.
	Paths []string `yaml:"paths,omitempty" json:"paths,omitempty"`
	// Excludes lists patterns to exclude from backups.
	Excludes []string `yaml:"excludes,omitempty" json:"excludes,omitempty"`
}

BackupSpec maps to CUE #BackupConfig — backup configuration.

type BlockDevice

type BlockDevice struct {
	Name       string  `json:"name"`
	Path       string  `json:"path"`
	SizeGB     float64 `json:"sizeGB"`
	Type       string  `json:"type"` // "disk", "part"
	Mountpoint string  `json:"mountpoint"`
	FSType     string  `json:"fstype"`
	Model      string  `json:"model"`
	Removable  bool    `json:"removable"`
}

BlockDevice represents a detected block device on the host.

type BootstrapSpec

type BootstrapSpec struct {
	Mode                     string `yaml:"mode,omitempty" json:"mode,omitempty"` // legacy/scenario selector: full_auto, guided, minimal, or an explicit install-mode alias
	PlatformPolicy           string `yaml:"platformPolicy,omitempty" json:"platformPolicy,omitempty"`
	ApplicationDefaultPolicy string `yaml:"applicationDefaultPolicy,omitempty" json:"applicationDefaultPolicy,omitempty"`
}

BootstrapSpec configures setup policy defaults for the selected install mode. Mode is kept only as a legacy/scenario bootstrap selector; public install mode remains StackSpec.Mode.

func (BootstrapSpec) EffectiveMode

func (b BootstrapSpec) EffectiveMode() string

type BrandingSpec

type BrandingSpec struct {
	// Color is the primary brand color (hex, e.g. "#4F46E5").
	Color string `yaml:"color,omitempty" json:"color,omitempty"`
	// DashboardTitle is the title shown on the dashboard.
	DashboardTitle string `yaml:"dashboardTitle,omitempty" json:"dashboardTitle,omitempty"`
}

BrandingSpec configures dashboard branding.

type BreakGlassConfig

type BreakGlassConfig struct {
	Enabled        *bool  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Scope          string `yaml:"scope,omitempty" json:"scope,omitempty"`
	PocketIDAdmin  *bool  `yaml:"pocketidAdmin,omitempty" json:"pocketidAdmin,omitempty"`
	TinyAuthStatic *bool  `yaml:"tinyauthStatic,omitempty" json:"tinyauthStatic,omitempty"`
	ServerRecovery *bool  `yaml:"serverRecovery,omitempty" json:"serverRecovery,omitempty"`
}

BreakGlassConfig describes the emergency account and server-recovery scope. Pointer bools let us distinguish omitted defaults from explicit false.

func (BreakGlassConfig) EffectiveEnabled

func (b BreakGlassConfig) EffectiveEnabled() bool

func (BreakGlassConfig) EffectiveScope

func (b BreakGlassConfig) EffectiveScope() string

func (BreakGlassConfig) IsZero

func (b BreakGlassConfig) IsZero() bool

type CloudflareTunnelConfig

type CloudflareTunnelConfig struct {
	// TunnelName is the Cloudflare tunnel name.
	TunnelName string `yaml:"tunnelName,omitempty" json:"tunnelName,omitempty"`
	// ZeroTrust enables Cloudflare Zero Trust access policies.
	ZeroTrust bool `yaml:"zeroTrust,omitempty" json:"zeroTrust,omitempty"`
}

CloudflareTunnelConfig holds Cloudflare Tunnel settings.

type CompatibilityTier

type CompatibilityTier string

CompatibilityTier classifies a VPS by how well it supports Docker/StackKits.

const (
	// TierFull means Docker works perfectly with all features.
	TierFull CompatibilityTier = "full"
	// TierDegraded means Docker works with auto-workarounds (vfs, host network, DNS fix).
	TierDegraded CompatibilityTier = "degraded"
	// TierIncompatible means the kernel blocks unshare — Docker cannot run at all.
	TierIncompatible CompatibilityTier = "incompatible"
)

type ComputeSpec

type ComputeSpec struct {
	Tier string `yaml:"tier" json:"tier"` // "low", "standard", "high"
}

ComputeSpec defines compute tier configuration

type ContainerRuntimeSpec

type ContainerRuntimeSpec struct {
	// Engine: "docker" (default) or "podman".
	Engine string `yaml:"engine,omitempty" json:"engine,omitempty"`
	// Rootless enables rootless container mode.
	Rootless bool `yaml:"rootless,omitempty" json:"rootless,omitempty"`
	// StorageDriver: "overlay2", "btrfs", "zfs", "vfs".
	StorageDriver string `yaml:"storageDriver,omitempty" json:"storageDriver,omitempty"`
	// DataRoot directory for container data (default "/var/lib/docker").
	DataRoot string `yaml:"dataRoot,omitempty" json:"dataRoot,omitempty"`
	// RegistryMirrors lists Docker registry mirrors.
	RegistryMirrors []string `yaml:"registryMirrors,omitempty" json:"registryMirrors,omitempty"`
	// LogDriver default for containers: "json-file", "journald", etc.
	LogDriver string `yaml:"logDriver,omitempty" json:"logDriver,omitempty"`
}

ContainerRuntimeSpec maps to CUE #ContainerRuntime.

type DNSSpec

type DNSSpec struct {
	// Servers lists upstream DNS resolvers (default: ["1.1.1.1", "8.8.8.8"]).
	Servers []string `yaml:"servers,omitempty" json:"servers,omitempty"`
	// LocalResolver enables a local DNS resolver (AdGuard Home, Unbound).
	LocalResolver bool `yaml:"localResolver,omitempty" json:"localResolver,omitempty"`
	// LocalResolverTool selects the local resolver tool ("adguard-home", "unbound").
	LocalResolverTool string `yaml:"localResolverTool,omitempty" json:"localResolverTool,omitempty"`
	// DoH enables DNS-over-HTTPS.
	DoH bool `yaml:"doh,omitempty" json:"doh,omitempty"`
	// DoHUpstream is the DoH upstream URL.
	DoHUpstream string `yaml:"dohUpstream,omitempty" json:"dohUpstream,omitempty"`
}

DNSSpec maps to CUE #DNSConfig — DNS resolver settings.

type DemoDataSpec

type DemoDataSpec struct {
	Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
}

DemoDataSpec controls optional sample content for beta onboarding.

func (DemoDataSpec) EffectiveEnabled

func (d DemoDataSpec) EffectiveEnabled() bool

type DeploymentState

type DeploymentState struct {
	StackKit           string             `yaml:"stackkit" json:"stackkit"`
	Mode               string             `yaml:"mode" json:"mode"`
	Status             DeploymentStatus   `yaml:"status" json:"status"`
	LastApplied        time.Time          `yaml:"lastApplied" json:"lastApplied"`
	TofuState          string             `yaml:"tofuState,omitempty" json:"tofuState,omitempty"`
	Services           []ServiceState     `yaml:"services" json:"services"`
	PlatformSystemApps []PlatformAppState `yaml:"platformSystemApps,omitempty" json:"platformSystemApps,omitempty"`
	PlatformApps       []PlatformAppState `yaml:"platformApps,omitempty" json:"platformApps,omitempty"`
	SetupRuns          []SetupRunState    `yaml:"setupRuns,omitempty" json:"setupRuns,omitempty"`

	// KitVersionID, KitSemver, KitChannel are populated by `stackkit apply`
	// and `stackkit kit upgrade` (kit-update-phase-1, ADR-0018). State files
	// written by older CLI versions leave these empty; the upgrade command
	// fails with a clear "re-apply to populate version metadata" message
	// rather than guessing.
	KitVersionID string `yaml:"kitVersionId,omitempty" json:"kitVersionId,omitempty"`
	KitSemver    string `yaml:"kitSemver,omitempty" json:"kitSemver,omitempty"`
	KitChannel   string `yaml:"kitChannel,omitempty" json:"kitChannel,omitempty"`

	// LastSnapshotDir points at .stackkit/snapshots/<ts>-<old-kit>/ — used
	// by `stackkit kit upgrade rollback` as the default --to-snapshot when
	// the operator does not pass one explicitly.
	LastSnapshotDir string `yaml:"lastSnapshotDir,omitempty" json:"lastSnapshotDir,omitempty"`
}

DeploymentState represents the current deployment state

type DeploymentStatus

type DeploymentStatus string

DeploymentStatus represents deployment status

const (
	StatusPending  DeploymentStatus = "pending"
	StatusPlanning DeploymentStatus = "planning"
	StatusApplying DeploymentStatus = "applying"
	StatusRunning  DeploymentStatus = "running"
	StatusDegraded DeploymentStatus = "degraded"
	StatusError    DeploymentStatus = "error"
	StatusRemoved  DeploymentStatus = "removed"
)

type DockerCapabilities

type DockerCapabilities struct {
	BridgeNetworking bool   `json:"bridgeNetworking"`
	Iptables         bool   `json:"iptables"`
	StorageDriver    string `json:"storageDriver"`

	// Docker runtime functionality — false when the kernel blocks unshare/namespaces
	// (e.g. OpenVZ containers), making Docker unable to run any containers.
	DockerFunctional bool   `json:"dockerFunctional"`
	RuntimeError     string `json:"runtimeError,omitempty"`

	// VPS environment detection
	VirtualizationType string            `json:"virtualizationType,omitempty"` // "kvm", "openvz", "lxc", "none"
	CompatibilityTier  CompatibilityTier `json:"compatibilityTier,omitempty"`  // "full", "degraded", "incompatible"
	UnshareAvailable   bool              `json:"unshareAvailable"`
	CgroupVersion      string            `json:"cgroupVersion,omitempty"` // "v1", "v2"
	MemoryLimits       bool              `json:"memoryLimits"`            // false when nested Docker cannot apply cgroup memory limits

	// DNS and image pre-pull status (troubleshooting engine)
	DNSWorking      bool     `json:"dnsWorking"`
	DNSFix          string   `json:"dnsFix,omitempty"` // "none", "daemon-json", "host-prepull"
	PrePulledImages []string `json:"prePulledImages,omitempty"`
	PrePullFailed   []string `json:"prePullFailed,omitempty"`

	// Disk space (detected during prepare)
	DiskTotalGB float64 `json:"diskTotalGB,omitempty"`
	DiskAvailGB float64 `json:"diskAvailGB,omitempty"`
	DiskMount   string  `json:"diskMount,omitempty"`   // mount point checked (e.g. "/" or "/var/lib/docker")
	LVMDetected bool    `json:"lvmDetected,omitempty"` // root is on LVM
	LVMExtended bool    `json:"lvmExtended,omitempty"` // auto-extended during prepare

	// Hardware profile (detected during prepare)
	CPUCores int     `json:"cpuCores,omitempty"`
	MemoryGB float64 `json:"memoryGB,omitempty"`

	// Resolved NodeContext from legacy host observation (never native v2 authoring).
	ResolvedContext NodeContext `json:"resolvedContext,omitempty"` // "local", "cloud", "pi"

	// Network environment detection (lower-level detail feeding into context resolution)
	NetworkEnv         NetworkEnvironment `json:"networkEnv,omitempty"`         // "home", "vps", "cloud", "unknown"
	PublicIP           string             `json:"publicIP,omitempty"`           // External IP (empty if detection failed)
	PrivateIP          string             `json:"privateIP,omitempty"`          // LAN/internal IP
	IsNAT              bool               `json:"isNAT,omitempty"`              // true if behind NAT (private/local target)
	HasPublicInterface bool               `json:"hasPublicInterface,omitempty"` // true if a network interface has a public IP directly

	// Block devices and storage resolution
	BlockDevices      []BlockDevice      `json:"blockDevices,omitempty"`
	StorageResolution *StorageResolution `json:"storageResolution,omitempty"`
}

DockerCapabilities represents detected Docker runtime capabilities. Written by `stackkit prepare` and read by `stackkit generate`.

type DriftDetectionSpec

type DriftDetectionSpec struct {
	// Enabled activates drift detection.
	Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Schedule in cron format (default "0 */6 * * *").
	Schedule string `yaml:"schedule,omitempty" json:"schedule,omitempty"`
}

DriftDetectionSpec configures Day-2 drift detection (advanced mode).

type Features

type Features struct {
	MultiNode    bool `yaml:"multiNode,omitempty" json:"multiNode,omitempty"`
	VPNOverlay   bool `yaml:"vpnOverlay,omitempty" json:"vpnOverlay,omitempty"`
	PublicAccess bool `yaml:"publicAccess,omitempty" json:"publicAccess,omitempty"`
}

Features defines optional features

type FirewallRuleSpec

type FirewallRuleSpec struct {
	Port     int    `yaml:"port" json:"port"`
	Protocol string `yaml:"protocol,omitempty" json:"protocol,omitempty"` // "tcp", "udp", "both"
	Source   string `yaml:"source,omitempty" json:"source,omitempty"`     // IP/CIDR or "any"
	Action   string `yaml:"action,omitempty" json:"action,omitempty"`     // "allow", "deny"
	Comment  string `yaml:"comment,omitempty" json:"comment,omitempty"`
}

FirewallRuleSpec defines a single firewall rule.

type FirewallSpec

type FirewallSpec struct {
	// Enabled activates the firewall (default true).
	Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Backend: "ufw", "firewalld", "nftables".
	Backend string `yaml:"backend,omitempty" json:"backend,omitempty"`
	// DefaultInbound policy: "allow" or "deny" (default "deny").
	DefaultInbound string `yaml:"defaultInbound,omitempty" json:"defaultInbound,omitempty"`
	// Rules defines additional firewall rules.
	Rules []FirewallRuleSpec `yaml:"rules,omitempty" json:"rules,omitempty"`
	// RateLimit configures brute-force protection (fail2ban-style).
	RateLimit *RateLimitSpec `yaml:"rateLimit,omitempty" json:"rateLimit,omitempty"`
}

FirewallSpec maps to CUE #FirewallPolicy — host firewall settings.

type HeadscaleConfig

type HeadscaleConfig struct {
	ServerURL       string   `yaml:"serverUrl,omitempty" json:"serverUrl,omitempty"`
	Namespace       string   `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	ExitNode        bool     `yaml:"exitNode,omitempty" json:"exitNode,omitempty"`
	AdvertiseRoutes []string `yaml:"advertiseRoutes,omitempty" json:"advertiseRoutes,omitempty"`
}

HeadscaleConfig holds Headscale-specific VPN settings.

type HealthStatus

type HealthStatus string

HealthStatus represents health check status

const (
	HealthStatusHealthy   HealthStatus = "healthy"
	HealthStatusUnhealthy HealthStatus = "unhealthy"
	HealthStatusStarting  HealthStatus = "starting"
	HealthStatusNone      HealthStatus = "none"
	HealthStatusUnknown   HealthStatus = "unknown"
)

type IdentitySpec

type IdentitySpec struct {
	// AuthMode overrides the default TinyAuth auth mode (e.g. "passkeys_plus_legacy").
	AuthMode string `yaml:"authMode,omitempty" json:"authMode,omitempty"`
	// SecondUserEmail is an optional second admin user email.
	SecondUserEmail string `yaml:"secondUserEmail,omitempty" json:"secondUserEmail,omitempty"`
	// OIDCProvider selects the OIDC provider ("pocketid" default, or external).
	OIDCProvider string `yaml:"oidcProvider,omitempty" json:"oidcProvider,omitempty"`
	// LDAPEnabled enables LLDAP for directory services.
	LDAPEnabled *bool `yaml:"ldapEnabled,omitempty" json:"ldapEnabled,omitempty"`
	// LDAPOrganization sets the LDAP organization name.
	LDAPOrganization string `yaml:"ldapOrganization,omitempty" json:"ldapOrganization,omitempty"`
}

IdentitySpec configures the identity/auth stack behavior.

type InstanceRegistration

type InstanceRegistration struct {
	InstanceID  string        `json:"instance_id"`        // Unique instance identifier (device fingerprint + stackkit name)
	EndpointURL string        `json:"endpoint_url"`       // Public URL where stackkit-server is reachable (e.g. https://api.mylab.kombify.me)
	StackKit    string        `json:"stackkit"`           // StackKit name (e.g. "basement-kit")
	Version     string        `json:"version,omitempty"`  // StackKit version
	Services    []ServiceInfo `json:"services"`           // Running services
	Status      string        `json:"status"`             // "running", "degraded", "stopped"
	APIPort     int           `json:"api_port,omitempty"` // Port stackkit-server listens on
	LastSeen    time.Time     `json:"last_seen"`          // Last heartbeat timestamp
}

InstanceRegistration is the payload sent to kombify when a stackkit-server registers itself for Direct Connect (Cloudflare Edge proxies directly to it).

type KitMetadata

type KitMetadata struct {
	Name        string   `yaml:"name" json:"name"`
	Version     string   `yaml:"version" json:"version"`
	DisplayName string   `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Summary     string   `yaml:"summary,omitempty" json:"summary,omitempty"`
	Author      string   `yaml:"author,omitempty" json:"author,omitempty"`
	License     string   `yaml:"license,omitempty" json:"license,omitempty"`
	Homepage    string   `yaml:"homepage,omitempty" json:"homepage,omitempty"`
	Repository  string   `yaml:"repository,omitempty" json:"repository,omitempty"`
	Maturity    string   `yaml:"maturity,omitempty" json:"maturity,omitempty"`
	Status      string   `yaml:"status,omitempty" json:"status,omitempty"`
	Tags        []string `yaml:"tags,omitempty" json:"tags,omitempty"`
}

KitMetadata is the canonical Go representation of the shared metadata envelope in schemas.#KitMetadata.

apiVersion and kind are document identity, not metadata: every kit file declares them at the document root. They lived here until 2026-08-14 and therefore never loaded at all, so every kit's declared schema silently read as the empty string. internal/kitio always had them in the right place.

type LoggingSpec

type LoggingSpec struct {
	// Driver: "json-file", "journald", "loki", "none".
	Driver string `yaml:"driver,omitempty" json:"driver,omitempty"`
	// Level: "debug", "info", "warn", "error".
	Level string `yaml:"level,omitempty" json:"level,omitempty"`
	// MaxSize per log file (e.g. "50m").
	MaxSize string `yaml:"maxSize,omitempty" json:"maxSize,omitempty"`
	// MaxFile count of rotated log files.
	MaxFile int `yaml:"maxFile,omitempty" json:"maxFile,omitempty"`
}

LoggingSpec configures container/host logging.

type ManagedServerlessRecoverySpec

type ManagedServerlessRecoverySpec struct {
	Enabled                    *bool    `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	NoServerDependency         *bool    `yaml:"noServerDependency,omitempty" json:"noServerDependency,omitempty"`
	Authority                  string   `yaml:"authority,omitempty" json:"authority,omitempty"`
	ProtectedClasses           []string `yaml:"protectedClasses,omitempty" json:"protectedClasses,omitempty"`
	ControlPlaneSnapshot       *bool    `yaml:"controlPlaneSnapshot,omitempty" json:"controlPlaneSnapshot,omitempty"`
	ProviderNativeBackups      *bool    `yaml:"providerNativeBackups,omitempty" json:"providerNativeBackups,omitempty"`
	RequireProviderDataHandles *bool    `yaml:"requireProviderDataHandles,omitempty" json:"requireProviderDataHandles,omitempty"`
	RequireRebuildIntent       *bool    `yaml:"requireRebuildIntent,omitempty" json:"requireRebuildIntent,omitempty"`
	PortableManifest           *bool    `yaml:"portableManifest,omitempty" json:"portableManifest,omitempty"`
	PreChangeSnapshot          *bool    `yaml:"preChangeSnapshot,omitempty" json:"preChangeSnapshot,omitempty"`
	Schedule                   string   `yaml:"schedule,omitempty" json:"schedule,omitempty"`
}

ManagedServerlessRecoverySpec captures server-independent managed recovery.

type MetricsSpec

type MetricsSpec struct {
	// Enabled activates metrics collection.
	Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Backend: "prometheus", "victoriametrics", "none".
	Backend string `yaml:"backend,omitempty" json:"backend,omitempty"`
	// ScrapeInterval (e.g. "15s").
	ScrapeInterval string `yaml:"scrapeInterval,omitempty" json:"scrapeInterval,omitempty"`
	// Retention period (e.g. "15d", "30d").
	Retention string `yaml:"retention,omitempty" json:"retention,omitempty"`
}

MetricsSpec configures metrics collection.

type ModeSpec

type ModeSpec struct {
	Name        string `yaml:"name" json:"name"`
	Description string `yaml:"description" json:"description"`
	Engine      string `yaml:"engine" json:"engine"` // "opentofu" or "terramate"
	Default     bool   `yaml:"default,omitempty" json:"default,omitempty"`
}

ModeSpec defines a single deployment mode

type Modes

type Modes struct {
	Bare         ModeSpec `yaml:"bare,omitempty" json:"bare,omitempty"`
	Bootstrapped ModeSpec `yaml:"bootstrapped,omitempty" json:"bootstrapped,omitempty"`
	Simple       ModeSpec `yaml:"simple,omitempty" json:"simple,omitempty"`
	Advanced     ModeSpec `yaml:"advanced,omitempty" json:"advanced,omitempty"`
}

Modes defines deployment modes.

The public install-mode contract is bare / bootstrapped / advanced. Simple remains as a legacy stackkit.yaml key so older kit definitions keep loading.

type MultiServerBackupMediaSpec

type MultiServerBackupMediaSpec struct {
	DocumentsMode           string `yaml:"documentsMode,omitempty" json:"documentsMode,omitempty"`
	PhotosMode              string `yaml:"photosMode,omitempty" json:"photosMode,omitempty"`
	LargeMediaMode          string `yaml:"largeMediaMode,omitempty" json:"largeMediaMode,omitempty"`
	ExcludeGeneratedCaches  *bool  `yaml:"excludeGeneratedCaches,omitempty" json:"excludeGeneratedCaches,omitempty"`
	RequireExternalMediaMap *bool  `yaml:"requireExternalMediaMap,omitempty" json:"requireExternalMediaMap,omitempty"`
}

MultiServerBackupMediaSpec captures clustered backup media policy.

type MultiServerBackupPerformanceSpec

type MultiServerBackupPerformanceSpec struct {
	Profile                    string `yaml:"profile,omitempty" json:"profile,omitempty"`
	AvoidPrimaryOnlySnapshots  *bool  `yaml:"avoidPrimaryOnlySnapshots,omitempty" json:"avoidPrimaryOnlySnapshots,omitempty"`
	StaggerNodeSnapshots       *bool  `yaml:"staggerNodeSnapshots,omitempty" json:"staggerNodeSnapshots,omitempty"`
	MaxConcurrentNodeSnapshots int    `yaml:"maxConcurrentNodeSnapshots,omitempty" json:"maxConcurrentNodeSnapshots,omitempty"`
	PreferRepoServerFanIn      *bool  `yaml:"preferRepoServerFanIn,omitempty" json:"preferRepoServerFanIn,omitempty"`
}

MultiServerBackupPerformanceSpec captures backup workload-shaping policy.

type MultiServerBackupSafetySpec

type MultiServerBackupSafetySpec struct {
	Enabled                      *bool                             `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Topology                     string                            `yaml:"topology,omitempty" json:"topology,omitempty"`
	MinServers                   int                               `yaml:"minServers,omitempty" json:"minServers,omitempty"`
	MinManagers                  int                               `yaml:"minManagers,omitempty" json:"minManagers,omitempty"`
	QuorumSize                   int                               `yaml:"quorumSize,omitempty" json:"quorumSize,omitempty"`
	ToleratedManagerFailures     int                               `yaml:"toleratedManagerFailures,omitempty" json:"toleratedManagerFailures,omitempty"`
	CapacityHeadroomNodes        int                               `yaml:"capacityHeadroomNodes,omitempty" json:"capacityHeadroomNodes,omitempty"`
	ReleaseReadyHA               *bool                             `yaml:"releaseReadyHA,omitempty" json:"releaseReadyHA,omitempty"`
	CoordinationMode             string                            `yaml:"coordinationMode,omitempty" json:"coordinationMode,omitempty"`
	RequireOffsiteRepo           *bool                             `yaml:"requireOffsiteRepo,omitempty" json:"requireOffsiteRepo,omitempty"`
	RequireEmergencyExport       *bool                             `yaml:"requireEmergencyExport,omitempty" json:"requireEmergencyExport,omitempty"`
	RequireRestoreDrill          *bool                             `yaml:"requireRestoreDrill,omitempty" json:"requireRestoreDrill,omitempty"`
	RequireSharedVolumeInventory *bool                             `yaml:"requireSharedVolumeInventory,omitempty" json:"requireSharedVolumeInventory,omitempty"`
	RequirePlacementSpread       *bool                             `yaml:"requirePlacementSpread,omitempty" json:"requirePlacementSpread,omitempty"`
	RequireManagedServerlessPlan *bool                             `yaml:"requireManagedServerlessPlan,omitempty" json:"requireManagedServerlessPlan,omitempty"`
	Media                        *MultiServerBackupMediaSpec       `yaml:"media,omitempty" json:"media,omitempty"`
	Performance                  *MultiServerBackupPerformanceSpec `yaml:"performance,omitempty" json:"performance,omitempty"`
}

MultiServerBackupSafetySpec captures HA/fleet backup release-readiness.

type NetworkEnvironment

type NetworkEnvironment string

NetworkEnvironment classifies where the server is running. This is a lower-level detection detail used internally by context resolution.

const (
	// NetEnvHome means the target is on a private/local network behind NAT.
	NetEnvHome NetworkEnvironment = "home"
	// NetEnvVPS means the server is a VPS/dedicated server with a public IP.
	NetEnvVPS NetworkEnvironment = "vps"
	// NetEnvCloud means the server was provisioned via kombify Cloud (SaaS).
	NetEnvCloud NetworkEnvironment = "cloud"
	// NetEnvUnknown means the environment could not be determined.
	NetEnvUnknown NetworkEnvironment = "unknown"
)

type NetworkSpec

type NetworkSpec struct {
	Mode    string `yaml:"mode" json:"mode"` // "local", "public", "hybrid"
	Subnet  string `yaml:"subnet,omitempty" json:"subnet,omitempty"`
	Gateway string `yaml:"gateway,omitempty" json:"gateway,omitempty"`
	// MTU for the Docker network (default 1500).
	MTU int `yaml:"mtu,omitempty" json:"mtu,omitempty"`
	// IPv6 enables IPv6 on the Docker network.
	IPv6 bool `yaml:"ipv6,omitempty" json:"ipv6,omitempty"`
}

NetworkSpec defines network configuration

type NodeContext

type NodeContext string

NodeContext classifies the deployment environment. Matches CUE #NodeContext: "local" | "cloud" | "pi". Legacy v1/v0.6 observation and migration input; native v2 authoring does not accept a --context flag.

const (
	// ContextLocal means a local/private target (behind NAT, no public IP).
	ContextLocal NodeContext = "local"
	// ContextCloud means a VPS, dedicated server, or kombify Cloud instance (public IP).
	ContextCloud NodeContext = "cloud"
	// ContextPi means a low-resource ARM64 device (Raspberry Pi, etc.).
	ContextPi NodeContext = "pi"
)

type NodeOSSpec

type NodeOSSpec struct {
	// Family: "debian" or "rhel".
	Family string `yaml:"family,omitempty" json:"family,omitempty"`
	// Distro: "ubuntu", "debian", "rocky", "alma".
	Distro string `yaml:"distro,omitempty" json:"distro,omitempty"`
	// Version of the distro (e.g. "24.04").
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

NodeOSSpec defines the OS configuration for a node.

type NodeSpec

type NodeSpec struct {
	Name     string   `yaml:"name" json:"name"`
	Role     string   `yaml:"role" json:"role"` // "main", "worker", "storage"; aliases: "control-plane", "standalone"
	IP       string   `yaml:"ip" json:"ip"`
	Host     string   `yaml:"host,omitempty" json:"host,omitempty"` // hostname or FQDN
	Services []string `yaml:"services,omitempty" json:"services,omitempty"`
	// Per-node compute resources (from CUE #ComputeResources).
	CPUCores  int `yaml:"cpuCores,omitempty" json:"cpuCores,omitempty"`
	RAMGB     int `yaml:"ramGB,omitempty" json:"ramGB,omitempty"`
	StorageGB int `yaml:"storageGB,omitempty" json:"storageGB,omitempty"`
	// OS configuration for the node.
	OS *NodeOSSpec `yaml:"os,omitempty" json:"os,omitempty"`
}

NodeSpec defines a deployment node

type ObservabilitySpec

type ObservabilitySpec struct {
	// Logging configuration.
	Logging *LoggingSpec `yaml:"logging,omitempty" json:"logging,omitempty"`
	// Metrics configuration.
	Metrics *MetricsSpec `yaml:"metrics,omitempty" json:"metrics,omitempty"`
	// Alerting configuration.
	Alerting *AlertingSpec `yaml:"alerting,omitempty" json:"alerting,omitempty"`
}

ObservabilitySpec maps to CUE #LoggingConfig + #MetricsConfig + #AlertingConfig.

type OwnerAdminBootstrapEnvelope

type OwnerAdminBootstrapEnvelope struct {
	Owner                   OwnerConfig      `yaml:"owner,omitempty" json:"owner,omitempty"`
	AdminEmail              string           `yaml:"adminEmail,omitempty" json:"adminEmail,omitempty"`
	AdminUsername           string           `yaml:"adminUsername,omitempty" json:"adminUsername,omitempty"`
	AdminCredentialRef      string           `yaml:"adminCredentialRef,omitempty" json:"adminCredentialRef,omitempty"`
	RecoveryMaterialRef     string           `yaml:"recoveryMaterialRef,omitempty" json:"recoveryMaterialRef,omitempty"`
	RecoveryPassphraseHash  string           `yaml:"recoveryPassphraseHash,omitempty" json:"recoveryPassphraseHash,omitempty"`
	RecoveryPassphrasePlain string           `yaml:"-" json:"recoveryPassphrasePlain,omitempty"`
	BreakGlass              BreakGlassConfig `yaml:"breakGlass,omitempty" json:"breakGlass,omitempty"`
}

OwnerAdminBootstrapEnvelope is the private runtime handoff delivered by kombify Administration to a freshly booted VM. It must never be exported as a public/default StackSpec because it can contain one-time secret material.

type OwnerConfig

type OwnerConfig struct {
	// BootstrapMode selects how owner identity is prepared: "auto", "custom",
	// or "none". Empty preserves legacy specs; a non-empty Source with no
	// BootstrapMode resolves to custom(local) or auto(cloud).
	BootstrapMode string `yaml:"bootstrapMode,omitempty" json:"bootstrapMode,omitempty"`

	// Source selects the provisioning path: "local" for custom self-hosted
	// bootstrap or "cloud" for orchestrator-managed auto bootstrap.
	Source string `yaml:"source,omitempty" json:"source,omitempty"`

	// Email is the owner's address. Required only for custom bootstrap.
	Email string `yaml:"email,omitempty" json:"email,omitempty"`

	// Username is the PocketID login handle. Required only for custom bootstrap.
	Username string `yaml:"username,omitempty" json:"username,omitempty"`

	// DisplayName is rendered in PocketID's UI; defaults to Username when empty.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`

	// RecoveryPassphraseHash is the argon2id-PHC hash of the recovery
	// passphrase used to encrypt the break-glass bundle. Required when Source
	// is non-empty; the plaintext is re-prompted at apply-time.
	RecoveryPassphraseHash string `yaml:"recoveryPassphraseHash,omitempty" json:"recoveryPassphraseHash,omitempty"`

	// RecoveryMaterialRef points at orchestrator-owned recovery material. It is
	// a reference only; plaintext recovery passphrases do not belong in specs.
	RecoveryMaterialRef string `yaml:"recoveryMaterialRef,omitempty" json:"recoveryMaterialRef,omitempty"`

	// CloudOIDCIssuer is the URL of the external OIDC issuer for auto/cloud
	// owner bootstrap.
	CloudOIDCIssuer string `yaml:"cloudOidcIssuer,omitempty" json:"cloudOidcIssuer,omitempty"`

	// CloudOIDCClientID is the registered client ID at the cloud OIDC issuer.
	CloudOIDCClientID string `yaml:"cloudOidcClientId,omitempty" json:"cloudOidcClientId,omitempty"`

	// CloudOIDCClientSecretRef is a secret-store reference (e.g. doppler:// or
	// secret://) pointing at the OIDC client secret. The literal secret is
	// never persisted in the spec.
	CloudOIDCClientSecretRef string `yaml:"cloudOidcClientSecretRef,omitempty" json:"cloudOidcClientSecretRef,omitempty"`

	// CloudOIDCForeignSubject is the cloud user's stable subject ID at the
	// external IdP. PocketID uses it to federate the local owner record.
	CloudOIDCForeignSubject string `yaml:"cloudOidcForeignSubject,omitempty" json:"cloudOidcForeignSubject,omitempty"`
}

OwnerConfig holds the owner-provisioning fields that `stackkit init` captures and TechStack may pass through stack-spec handoff. `bootstrapMode` is the current lane selector:

  • auto: owner identity is resolved by kombify Cloud/TechStack. StackKits must not require or invent owner.email/owner.username in the public spec.
  • custom: explicit self-hosted/local Owner. Email and username are required.
  • none: no Owner bootstrap for OSS/BYOS or legacy/manual setups.

Persisted to stack-spec.yaml under the `owner:` key with omitempty so older specs round-trip without picking up an empty owner block.

func (OwnerConfig) EffectiveBootstrapMode

func (o OwnerConfig) EffectiveBootstrapMode() string

EffectiveBootstrapMode normalizes legacy owner specs to the new lane model.

func (OwnerConfig) IsZero

func (o OwnerConfig) IsZero() bool

IsZero lets YAML encoders omit an empty owner block while still preserving an explicit bootstrapMode: none block.

type PangolinTunnelConfig

type PangolinTunnelConfig struct {
	// ServerDomain is the Pangolin server domain.
	ServerDomain string `yaml:"serverDomain,omitempty" json:"serverDomain,omitempty"`
}

PangolinTunnelConfig holds Pangolin settings.

type PlacementSpec

type PlacementSpec struct {
	Mode     string `yaml:"mode,omitempty" json:"mode,omitempty"`
	Exposure string `yaml:"exposure,omitempty" json:"exposure,omitempty"`
	Coupling string `yaml:"coupling,omitempty" json:"coupling,omitempty"`
}

PlacementSpec is the user's placement intent (mirrors CUE #PlacementIntent).

type PlatformAppState

type PlatformAppState struct {
	Name           string          `yaml:"name" json:"name"`
	Role           string          `yaml:"role,omitempty" json:"role,omitempty"`
	Platform       string          `yaml:"platform" json:"platform"`
	Management     string          `yaml:"management,omitempty" json:"management,omitempty"`
	ExternalID     string          `yaml:"externalId" json:"externalId"`
	DeploymentID   string          `yaml:"deploymentId,omitempty" json:"deploymentId,omitempty"`
	ObservedStatus string          `yaml:"observedStatus,omitempty" json:"observedStatus,omitempty"`
	ObservedAt     time.Time       `yaml:"observedAt,omitempty" json:"observedAt,omitempty"`
	ComposePath    string          `yaml:"composePath,omitempty" json:"composePath,omitempty"`
	SetupPolicy    string          `yaml:"setupPolicy,omitempty" json:"setupPolicy,omitempty"`
	SetupDrops     []SetupDropSpec `yaml:"setupDrops,omitempty" json:"setupDrops,omitempty"`
	LastDeployed   time.Time       `yaml:"lastDeployed,omitempty" json:"lastDeployed,omitempty"`
	FailureStage   string          `yaml:"failureStage,omitempty" json:"failureStage,omitempty"`
	FailureMessage string          `yaml:"failureMessage,omitempty" json:"failureMessage,omitempty"`
	Retryable      bool            `yaml:"retryable,omitempty" json:"retryable,omitempty"`
}

PlatformAppState records the external platform identity for a StackKit L3 app.

type PlatformDef

type PlatformDef struct {
	Role         ToolRole `yaml:"role" json:"role"`
	DefaultTool  string   `yaml:"defaultTool,omitempty" json:"defaultTool,omitempty"`
	Alternatives []string `yaml:"alternatives,omitempty" json:"alternatives,omitempty"`
}

PlatformDef defines a platform service in stackkit.yaml (v5).

type PlatformFallbackSpec

type PlatformFallbackSpec struct {
	Enabled bool   `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Mode    string `yaml:"mode,omitempty" json:"mode,omitempty"` // disabled or standalone-compose
}

PlatformFallbackSpec controls the explicit bare-metal fallback path for StackKit-owned platform apps. The zero value is the strict PaaS path.

type RateLimitSpec

type RateLimitSpec struct {
	Enabled    bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	MaxRetries int  `yaml:"maxRetries,omitempty" json:"maxRetries,omitempty"`
	FindTime   int  `yaml:"findTime,omitempty" json:"findTime,omitempty"` // seconds
	BanTime    int  `yaml:"banTime,omitempty" json:"banTime,omitempty"`   // seconds
}

RateLimitSpec configures brute-force / rate limiting on the firewall.

type Requirements

type Requirements struct {
	Minimum     ResourceSpec `yaml:"minimum" json:"minimum"`
	Recommended ResourceSpec `yaml:"recommended" json:"recommended"`
}

Requirements defines system requirements

type ResourceSpec

type ResourceSpec struct {
	CPU  int `yaml:"cpu" json:"cpu"`
	RAM  int `yaml:"memory" json:"ram"` // in GB (yaml: "memory" to match stackkit.yaml)
	Disk int `yaml:"disk" json:"disk"`  // in GB
}

ResourceSpec defines resource specifications

type SSHSpec

type SSHSpec struct {
	KeyPath string `yaml:"keyPath,omitempty" json:"keyPath,omitempty"`
	User    string `yaml:"user,omitempty" json:"user,omitempty"`
	Port    int    `yaml:"port,omitempty" json:"port,omitempty"`
	// PermitRootLogin controls sshd PermitRootLogin ("no", "prohibit-password", etc.).
	PermitRootLogin string `yaml:"permitRootLogin,omitempty" json:"permitRootLogin,omitempty"`
	// PasswordAuth enables/disables password authentication in sshd.
	PasswordAuth *bool `yaml:"passwordAuth,omitempty" json:"passwordAuth,omitempty"`
	// MaxAuthTries limits authentication attempts per connection.
	MaxAuthTries int `yaml:"maxAuthTries,omitempty" json:"maxAuthTries,omitempty"`
}

SSHSpec defines SSH configuration

type ServiceInfo

type ServiceInfo struct {
	Name   string `json:"name"`
	URL    string `json:"url,omitempty"`
	Status string `json:"status"` // "running", "stopped", "error"
}

ServiceInfo is a lightweight service descriptor for registry registration.

type ServiceState

type ServiceState struct {
	Name      string        `yaml:"name" json:"name"`
	Status    ServiceStatus `yaml:"status" json:"status"`
	Container string        `yaml:"container,omitempty" json:"container,omitempty"`
	URL       string        `yaml:"url,omitempty" json:"url,omitempty"`
	Health    HealthStatus  `yaml:"health" json:"health"`
}

ServiceState represents the state of a service

type ServiceStatus

type ServiceStatus string

ServiceStatus represents service status

const (
	ServiceStatusRunning  ServiceStatus = "running"
	ServiceStatusStopped  ServiceStatus = "stopped"
	ServiceStatusStarting ServiceStatus = "starting"
	ServiceStatusError    ServiceStatus = "error"
	ServiceStatusUnknown  ServiceStatus = "unknown"
)

type SetupDropSpec

type SetupDropSpec struct {
	Name          string            `yaml:"name" json:"name"`
	Version       string            `yaml:"version,omitempty" json:"version,omitempty"`
	Runner        string            `yaml:"runner,omitempty" json:"runner,omitempty"`
	Description   string            `yaml:"description,omitempty" json:"description,omitempty"`
	RollbackNotes []string          `yaml:"rollbackNotes,omitempty" json:"rollbackNotes,omitempty"`
	Command       []string          `yaml:"command,omitempty" json:"command,omitempty"`
	Env           map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	Secrets       map[string]string `yaml:"secrets,omitempty" json:"secrets,omitempty"`
}

SetupDropSpec describes a setup unit that can run separately from deploy.

type SetupPolicyResolver

type SetupPolicyResolver struct {
	// contains filtered or unexported fields
}

func NewSetupPolicyResolver

func NewSetupPolicyResolver(spec *StackSpec) SetupPolicyResolver

func (SetupPolicyResolver) ApplicationDefaultPolicy

func (r SetupPolicyResolver) ApplicationDefaultPolicy() string

func (SetupPolicyResolver) EffectiveApplicationPolicy

func (r SetupPolicyResolver) EffectiveApplicationPolicy(useCase, tool string, aliases ...string) string

func (SetupPolicyResolver) EffectivePlatformServicePolicy

func (r SetupPolicyResolver) EffectivePlatformServicePolicy(tool string, aliases ...string) string

func (SetupPolicyResolver) InstallMode

func (r SetupPolicyResolver) InstallMode() string

func (SetupPolicyResolver) PlatformPolicy

func (r SetupPolicyResolver) PlatformPolicy() string

type SetupRunLogEntry

type SetupRunLogEntry struct {
	Timestamp time.Time `yaml:"timestamp,omitempty" json:"timestamp,omitempty"`
	Phase     string    `yaml:"phase,omitempty" json:"phase,omitempty"`
	Level     string    `yaml:"level,omitempty" json:"level,omitempty"`
	Message   string    `yaml:"message,omitempty" json:"message,omitempty"`
}

SetupRunLogEntry records a bounded, user-facing setup phase event.

type SetupRunState

type SetupRunState struct {
	RunID         string             `yaml:"runId,omitempty" json:"runId,omitempty"`
	ServiceKey    string             `yaml:"serviceKey,omitempty" json:"serviceKey,omitempty"`
	AppName       string             `yaml:"appName" json:"appName"`
	DropName      string             `yaml:"dropName" json:"dropName"`
	Policy        string             `yaml:"policy,omitempty" json:"policy,omitempty"`
	Status        string             `yaml:"status" json:"status"`
	Phase         string             `yaml:"phase,omitempty" json:"phase,omitempty"`
	Attempts      int                `yaml:"attempts,omitempty" json:"attempts,omitempty"`
	Message       string             `yaml:"message,omitempty" json:"message,omitempty"`
	Error         string             `yaml:"error,omitempty" json:"error,omitempty"`
	FailureClass  string             `yaml:"failureClass,omitempty" json:"failureClass,omitempty"`
	Evidence      map[string]string  `yaml:"evidence,omitempty" json:"evidence,omitempty"`
	Logs          []SetupRunLogEntry `yaml:"logs,omitempty" json:"logs,omitempty"`
	RollbackNotes []string           `yaml:"rollbackNotes,omitempty" json:"rollbackNotes,omitempty"`
	LastRequested time.Time          `yaml:"lastRequested,omitempty" json:"lastRequested,omitempty"`
	LastStarted   time.Time          `yaml:"lastStarted,omitempty" json:"lastStarted,omitempty"`
	LastFinished  time.Time          `yaml:"lastFinished,omitempty" json:"lastFinished,omitempty"`
}

SetupRunState records an explicit setup-drop execution. Manual setup drops remain absent from this list until a user requests a run.

type SingleServerBackupSafetySpec

type SingleServerBackupSafetySpec struct {
	Enabled                  *bool  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	MinimumRecoveryCopies    int    `yaml:"minimumRecoveryCopies,omitempty" json:"minimumRecoveryCopies,omitempty"`
	RequireLocalRepo         *bool  `yaml:"requireLocalRepo,omitempty" json:"requireLocalRepo,omitempty"`
	RequireEmergencyExport   *bool  `yaml:"requireEmergencyExport,omitempty" json:"requireEmergencyExport,omitempty"`
	RequireRestoreDrill      *bool  `yaml:"requireRestoreDrill,omitempty" json:"requireRestoreDrill,omitempty"`
	RequireOffHostCopy       *bool  `yaml:"requireOffHostCopy,omitempty" json:"requireOffHostCopy,omitempty"`
	RecommendOffsite         *bool  `yaml:"recommendOffsite,omitempty" json:"recommendOffsite,omitempty"`
	RecommendImmutableCopy   *bool  `yaml:"recommendImmutableCopy,omitempty" json:"recommendImmutableCopy,omitempty"`
	KopiaIndependentFallback string `yaml:"kopiaIndependentFallback,omitempty" json:"kopiaIndependentFallback,omitempty"`
}

SingleServerBackupSafetySpec captures safer one-node defaults.

type StackKit

type StackKit struct {
	APIVersion   string                    `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`
	Kind         string                    `yaml:"kind,omitempty" json:"kind,omitempty"`
	Metadata     StackKitMetadata          `yaml:"metadata" json:"metadata"`
	SupportedOS  []string                  `yaml:"supportedOS" json:"supportedOS"`
	Requirements Requirements              `yaml:"requirements" json:"requirements"`
	Modes        Modes                     `yaml:"modes" json:"modes"`
	Application  map[string]ApplicationDef `yaml:"application,omitempty" json:"application,omitempty"`
	Platform     map[string]PlatformDef    `yaml:"platform,omitempty" json:"platform,omitempty"`
	Features     Features                  `yaml:"features,omitempty" json:"features,omitempty"`
}

StackKit represents a complete stackkit.yaml file

type StackKitMetadata

type StackKitMetadata = KitMetadata

StackKitMetadata is retained as a source-compatible alias. KitMetadata is the only concrete Go metadata schema.

type StackSpec

type StackSpec struct {
	Name             string               `yaml:"name" json:"name"`
	StackKit         string               `yaml:"stackkit" json:"stackkit"`
	Mode             string               `yaml:"mode,omitempty" json:"mode,omitempty"`
	Runtime          string               `yaml:"runtime,omitempty" json:"runtime,omitempty"` // "docker" or "native"
	Context          string               `yaml:"context,omitempty" json:"context,omitempty"`
	Placement        PlacementSpec        `yaml:"placementMode,omitempty" json:"placementMode,omitempty"`
	Domain           string               `yaml:"domain,omitempty" json:"domain,omitempty"`
	SubdomainPrefix  string               `yaml:"subdomainPrefix,omitempty" json:"subdomainPrefix,omitempty"`
	Email            string               `yaml:"email,omitempty" json:"email,omitempty"`
	AdminEmail       string               `yaml:"adminEmail,omitempty" json:"adminEmail,omitempty"`
	Network          NetworkSpec          `yaml:"network,omitempty" json:"network,omitempty"`
	Compute          ComputeSpec          `yaml:"compute,omitempty" json:"compute,omitempty"`
	Storage          StorageSpec          `yaml:"storage,omitempty" json:"storage,omitempty"`
	SSH              SSHSpec              `yaml:"ssh,omitempty" json:"ssh,omitempty"`
	Nodes            []NodeSpec           `yaml:"nodes,omitempty" json:"nodes,omitempty"`
	TLS              TLSSpec              `yaml:"tls,omitempty" json:"tls,omitempty"`
	PAAS             string               `yaml:"paas,omitempty" json:"paas,omitempty"` // explicit platform adapter override; omitted resolves to Coolify
	Addons           []string             `yaml:"addons,omitempty" json:"addons,omitempty"`
	Application      map[string]any       `yaml:"application,omitempty" json:"application,omitempty"`
	Services         map[string]any       `yaml:"services,omitempty" json:"services,omitempty"`
	Apps             map[string]AppSpec   `yaml:"apps,omitempty" json:"apps,omitempty"`
	PlatformFallback PlatformFallbackSpec `yaml:"platformFallback,omitempty" json:"platformFallback,omitempty"`
	Environment      map[string]string    `yaml:"environment,omitempty" json:"environment,omitempty"`
	Metadata         map[string]string    `yaml:"metadata,omitempty" json:"metadata,omitempty"`
	Identity         *IdentitySpec        `yaml:"identity,omitempty" json:"identity,omitempty"`

	// Owner is set by `stackkit init` or orchestration handoff when owner
	// bootstrap is requested. Empty means owner provisioning is disabled. The
	// explicit bootstrapMode separates SaaS auto-owner, self-hosted custom
	// owner, and OSS/BYOS no-owner specs without inventing a fake human owner.
	Owner OwnerConfig `yaml:"owner,omitempty" json:"owner,omitempty"`

	// BreakGlass declares the emergency-admin contract. It is enabled by
	// default even when omitted; the explicit block exists so Admin/private
	// specs can prove that break-glass is a separate full-emergency path rather
	// than a second daily admin account.
	BreakGlass BreakGlassConfig `yaml:"breakGlass,omitempty" json:"breakGlass,omitempty"`

	// Bootstrap configures setup policy defaults. Install mode selects the
	// automation surface; bootstrapped defaults to automatic platform setup and
	// on-demand application setup.
	Bootstrap BootstrapSpec `yaml:"bootstrap,omitempty" json:"bootstrap,omitempty"`

	// DemoData controls optional seed content for app verification. It is off
	// by default so L3 applications are not preconfigured unless requested.
	DemoData DemoDataSpec `yaml:"demoData,omitempty" json:"demoData,omitempty"`

	// Extended spec sections — derived from basement-kit CUE schemas.
	// These capture the full Zielbild that StackKits need to generate configs.
	System          *SystemSpec           `yaml:"system,omitempty" json:"system,omitempty"`
	DNS             *DNSSpec              `yaml:"dns,omitempty" json:"dns,omitempty"`
	VPN             *VPNSpec              `yaml:"vpn,omitempty" json:"vpn,omitempty"`
	Firewall        *FirewallSpec         `yaml:"firewall,omitempty" json:"firewall,omitempty"`
	Backup          *BackupSpec           `yaml:"backup,omitempty" json:"backup,omitempty"`
	Observability   *ObservabilitySpec    `yaml:"observability,omitempty" json:"observability,omitempty"`
	ContainerConfig *ContainerRuntimeSpec `yaml:"container,omitempty" json:"container,omitempty"`
	Branding        *BrandingSpec         `yaml:"branding,omitempty" json:"branding,omitempty"`
	Tunnel          *TunnelSpec           `yaml:"tunnel,omitempty" json:"tunnel,omitempty"`
	DriftDetection  *DriftDetectionSpec   `yaml:"driftDetection,omitempty" json:"driftDetection,omitempty"`
}

StackSpec represents the user's deployment specification (stack-spec.yaml)

func (*StackSpec) EffectiveInstallMode

func (s *StackSpec) EffectiveInstallMode() string

func (*StackSpec) EffectivePlacementMode

func (s *StackSpec) EffectivePlacementMode() string

EffectivePlacementMode resolves the effective mode: spec value → default.

func (*StackSpec) HasCustomPublicDomain

func (s *StackSpec) HasCustomPublicDomain() bool

HasCustomPublicDomain returns true when the stack uses a routable, non-kombify domain.

func (*StackSpec) IsMultiNode

func (s *StackSpec) IsMultiNode() bool

IsMultiNode reports whether the spec describes one homelab spread across multiple registered nodes.

func (*StackSpec) ResolvePAAS

func (s *StackSpec) ResolvePAAS() string

ResolvePAAS determines the PAAS platform from explicit setting or compute tier.

func (*StackSpec) ResolvePAASForContext

func (s *StackSpec) ResolvePAASForContext(ctx NodeContext) string

ResolvePAASForContext is the canonical auto-selection policy for normal StackKit platform adapters. Explicit user config wins; otherwise fresh StackKit rollouts default to Coolify. Komodo is the production alternative; Dokploy remains draft adapter work outside canonical E2E dispatch.

func (*StackSpec) ResolveReverseProxy

func (s *StackSpec) ResolveReverseProxy() string

ResolveReverseProxy determines which Traefik instance routes platform services based on the PaaS selection. Day-1 installs use StackKit's own Traefik so a fresh node never depends on a PaaS-created Docker network that does not exist yet.

func (*StackSpec) UsesAdvancedIAC

func (s *StackSpec) UsesAdvancedIAC() bool

type StorageResolution

type StorageResolution struct {
	Strategy string `json:"strategy"` // "none", "external-device", "tier-downgrade", "force"
	Device   string `json:"device,omitempty"`
	Mount    string `json:"mount,omitempty"`
}

StorageResolution records the strategy chosen to resolve insufficient storage.

type StorageSpec

type StorageSpec struct {
	ExternalDevice string `yaml:"externalDevice,omitempty" json:"externalDevice,omitempty"`
	MountPoint     string `yaml:"mountPoint,omitempty" json:"mountPoint,omitempty"`
	// DataDir is the root directory for service data (default "/opt/data").
	DataDir string `yaml:"dataDir,omitempty" json:"dataDir,omitempty"`
	// BackupDir is the directory for local backups (default "/opt/backups").
	BackupDir string `yaml:"backupDir,omitempty" json:"backupDir,omitempty"`
	// MediaPath is the path for media storage (Jellyfin, Immich, etc.).
	MediaPath string `yaml:"mediaPath,omitempty" json:"mediaPath,omitempty"`
}

StorageSpec defines external storage configuration

type SystemInfo

type SystemInfo struct {
	Hostname      string `json:"hostname"`
	OS            string `json:"os"`
	OSVersion     string `json:"osVersion"`
	Arch          string `json:"arch"`
	CPUCores      int    `json:"cpuCores"`
	MemoryMB      int    `json:"memoryMB"`
	DiskGB        int    `json:"diskGB"`
	DockerVersion string `json:"dockerVersion,omitempty"`
	TofuVersion   string `json:"tofuVersion,omitempty"`
}

SystemInfo represents system information from a node

type SystemSpec

type SystemSpec struct {
	// Timezone in IANA format (e.g. "Europe/Berlin"). Default: "UTC".
	Timezone string `yaml:"timezone,omitempty" json:"timezone,omitempty"`
	// Locale for the system (e.g. "en_US.UTF-8").
	Locale string `yaml:"locale,omitempty" json:"locale,omitempty"`
	// Swap policy: "disabled", "auto", "manual".
	Swap string `yaml:"swap,omitempty" json:"swap,omitempty"`
	// SwapSizeMB when Swap is "manual".
	SwapSizeMB int `yaml:"swapSizeMB,omitempty" json:"swapSizeMB,omitempty"`
	// UnattendedUpgrades: "disabled", "security" (default), "all".
	UnattendedUpgrades string `yaml:"unattendedUpgrades,omitempty" json:"unattendedUpgrades,omitempty"`
}

SystemSpec maps to CUE #SystemConfig — host-level system settings.

type TLSSpec

type TLSSpec struct {
	Provider  string `yaml:"provider,omitempty" json:"provider,omitempty"`   // DNS provider for DNS-01 challenge (e.g. "cloudflare")
	Challenge string `yaml:"challenge,omitempty" json:"challenge,omitempty"` // "tls" (default) or "dns"
}

TLSSpec defines TLS/HTTPS certificate configuration

type ToolRole

type ToolRole string

ToolRole represents the role of a tool within a StackKit (v5).

const (
	RoleDefault     ToolRole = "default"
	RoleAlternative ToolRole = "alternative"
	RoleOptional    ToolRole = "optional"
	RoleAddon       ToolRole = "addon"
)

type TunnelSpec

type TunnelSpec struct {
	// Enabled activates the tunnel.
	Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Provider: "cloudflare" or "pangolin".
	Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
	// Cloudflare-specific configuration.
	Cloudflare *CloudflareTunnelConfig `yaml:"cloudflare,omitempty" json:"cloudflare,omitempty"`
	// Pangolin-specific configuration.
	Pangolin *PangolinTunnelConfig `yaml:"pangolin,omitempty" json:"pangolin,omitempty"`
}

TunnelSpec maps to CUE tunnel addon — CGNAT/DS-Lite bypass configuration.

type VPNSpec

type VPNSpec struct {
	// Enabled activates the VPN overlay.
	Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	// Type selects the VPN provider: "headscale", "tailscale", "wireguard", "netbird", "none".
	Type string `yaml:"type,omitempty" json:"type,omitempty"`
	// Subnet for the VPN network.
	Subnet string `yaml:"subnet,omitempty" json:"subnet,omitempty"`
	// Port for the VPN service.
	Port int `yaml:"port,omitempty" json:"port,omitempty"`
	// Headscale-specific configuration.
	Headscale *HeadscaleConfig `yaml:"headscale,omitempty" json:"headscale,omitempty"`
}

VPNSpec maps to CUE #VPNConfig — VPN/overlay network settings.

type ValidationError

type ValidationError struct {
	Path    string `json:"path"`
	Message string `json:"message"`
	Code    string `json:"code,omitempty"`
}

ValidationError represents a validation error or warning

type ValidationResult

type ValidationResult struct {
	Valid    bool              `json:"valid"`
	Errors   []ValidationError `json:"errors,omitempty"`
	Warnings []ValidationError `json:"warnings,omitempty"`
}

ValidationResult represents the result of a validation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL