Documentation
¶
Index ¶
- Variables
- func DetectFavicon(sitePath, publicDir, framework string, fw *config.Framework, hasFw bool) string
- func FrameworkLabel(name, path string) string
- func InvalidateUnitCache()
- func PersistVersionChanges(sites []EnrichedSite) error
- type ConflictingDomain
- type EnrichFlag
- type EnrichedSite
- type WorkerInfo
- type WorktreeInfo
Constants ¶
This section is empty.
Variables ¶
var KnownServices = []string{"mysql", "redis", "postgres", "meilisearch", "rustfs", "mailpit"}
KnownServices lists the built-in service names used for auto-detection.
Functions ¶
func DetectFavicon ¶
DetectFavicon returns the absolute path of the first favicon file found in the site's public directory, or empty string if none found. When fw/hasFw are not available, pass nil/false and the function will look them up from the framework name.
func FrameworkLabel ¶
FrameworkLabel returns the display label for a framework name. Exported for use by callers that need the label without full enrichment.
func InvalidateUnitCache ¶ added in v1.12.0
func InvalidateUnitCache()
InvalidateUnitCache forces the next UnitStatus lookup to re-run systemctl. Call this after any mutation that changes lerd-* unit state (start, stop, enable, disable, etc.) so cached "active" values do not go stale.
func PersistVersionChanges ¶
func PersistVersionChanges(sites []EnrichedSite) error
PersistVersionChanges writes back any detected version changes to the site registry.
Types ¶
type ConflictingDomain ¶
ConflictingDomain describes a domain declared in .lerd.yaml that is owned by a different site on this machine.
type EnrichFlag ¶
type EnrichFlag uint32
EnrichFlag controls which enrichment steps run during site loading.
const ( EnrichFramework EnrichFlag = 1 << iota // framework label + version EnrichVersions // live PHP/Node detection from disk EnrichWorkers // worker status via podman EnrichFPM // FPM container running check EnrichGit // worktrees + main branch EnrichServices // .env + .lerd.yaml service detection EnrichDomainConflicts // conflicting domain check EnrichLogs // app log file detection EnrichFavicon // favicon detection EnrichStripe // stripe secret check EnrichCLI = EnrichFramework | EnrichGit EnrichMCP = EnrichFramework | EnrichWorkers EnrichUI = EnrichFramework | EnrichVersions | EnrichWorkers | EnrichFPM | EnrichGit | EnrichServices | EnrichDomainConflicts | EnrichLogs | EnrichFavicon | EnrichStripe )
type EnrichedSite ¶
type EnrichedSite struct {
// Base fields from config.Site
Name string
Domains []string
Path string
PHPVersion string
NodeVersion string
Secured bool
Paused bool
PausedWorkers []string
PublicDir string
AppURL string
// Framework
FrameworkName string
FrameworkLabel string
FrameworkVersion string
// Runtime status
FPMRunning bool
// Well-known workers
HasQueueWorker bool
QueueRunning bool
QueueFailing bool
HasScheduleWorker bool
ScheduleRunning bool
ScheduleFailing bool
HasReverb bool
ReverbRunning bool
ReverbFailing bool
HasHorizon bool
HorizonRunning bool
HorizonFailing bool
StripeSecretSet bool
StripeRunning bool
// Custom framework workers
FrameworkWorkers []WorkerInfo
// Git
Branch string
Worktrees []WorktreeInfo
// Domain conflicts
ConflictingDomains []ConflictingDomain
// Services
Services []string
// App metadata
HasAppLogs bool
LatestLogTime string
HasFavicon bool
// Version change tracking (for write-back by caller)
PHPVersionChanged bool
NodeVersionChanged bool
OriginalPHPVersion string
OriginalNodeVersion string
}
EnrichedSite is the superset of site information needed by all surfaces.
func Enrich ¶
func Enrich(s config.Site, flags EnrichFlag) EnrichedSite
Enrich populates an EnrichedSite from a config.Site according to the given flags.
func LoadAll ¶
func LoadAll(flags EnrichFlag) ([]EnrichedSite, error)
LoadAll loads all non-ignored sites and enriches them according to flags.
func (*EnrichedSite) PrimaryDomain ¶
func (e *EnrichedSite) PrimaryDomain() string
PrimaryDomain returns the first domain or empty string.
type WorkerInfo ¶
WorkerInfo describes a framework worker and its runtime state.
type WorktreeInfo ¶
WorktreeInfo describes a git worktree associated with a site.