ui

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 72 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(currentVersion string) error

Start starts the HTTP server on listenAddr.

Types

type AnalyzedCaller added in v1.23.0

type AnalyzedCaller struct {
	File string `json:"file"`
	Line int    `json:"line"`
}

AnalyzedCaller is the application frame a query originated from — the line a fixer opens to add eager loading, an index, or a cache.

type ConflictingDomain added in v1.8.0

type ConflictingDomain struct {
	Domain  string `json:"domain"`
	OwnedBy string `json:"owned_by"`
}

ConflictingDomain describes a domain declared in .lerd.yaml that wasn't registered for the site because another site on this machine already owns it. Surfaced to the UI so the domain modal can render a warning icon next to the entry with the owning site name.

type DNSStatus

type DNSStatus struct {
	OK      bool   `json:"ok"`
	Status  string `json:"status"` // ok | degraded | down
	VPN     bool   `json:"vpn"`    // a VPN tunnel is up; degraded is then expected
	Enabled bool   `json:"enabled"`
	TLD     string `json:"tld"`
}

type NPlusOneFinding added in v1.23.0

type NPlusOneFinding struct {
	Fingerprint string         `json:"fingerprint"`
	Count       int            `json:"count"`
	TotalTimeMS float64        `json:"total_time_ms"`
	SampleSQL   string         `json:"sample_sql"`
	Caller      AnalyzedCaller `json:"caller"`
}

NPlusOneFinding is one query shape that repeated past the threshold inside a single request — the classic N+1. Fingerprint is the literal-collapsed SQL shared by every repeat; SampleSQL is one concrete instance.

type NginxConfigReadResponse added in v1.23.0

type NginxConfigReadResponse struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Exists  bool   `json:"exists"`
}

NginxConfigReadResponse mirrors SiteNginxReadResponse for the global http-level override. Exists distinguishes a real saved override from the seeded template the handler hands back when the file is missing.

type NginxConfigResetResponse added in v1.23.0

type NginxConfigResetResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

NginxConfigResetResponse mirrors SiteNginxResetResponse for the reset flow.

type NginxConfigRestoreRequest added in v1.23.0

type NginxConfigRestoreRequest struct {
	Name string `json:"name"`
}

NginxConfigRestoreRequest names the backup to roll back to.

type NginxConfigRestoreResponse added in v1.23.0

type NginxConfigRestoreResponse struct {
	OK       bool   `json:"ok"`
	Error    string `json:"error,omitempty"`
	Restored string `json:"restored,omitempty"`
	Content  string `json:"content,omitempty"`
}

NginxConfigRestoreResponse mirrors SiteNginxRestoreResponse.

type NginxConfigWriteRequest added in v1.23.0

type NginxConfigWriteRequest struct {
	Content string `json:"content"`
	Backup  bool   `json:"backup"`
}

NginxConfigWriteRequest is the JSON body for POST /api/nginx/config.

type NginxConfigWriteResponse added in v1.23.0

type NginxConfigWriteResponse struct {
	OK               bool   `json:"ok"`
	Error            string `json:"error,omitempty"`
	BackupName       string `json:"backup_name,omitempty"`
	ValidationOutput string `json:"validation_output,omitempty"`
	Content          string `json:"content,omitempty"`
	Exists           bool   `json:"exists,omitempty"`
}

NginxConfigWriteResponse mirrors SiteNginxWriteResponse so the editor can reuse the same dirty/backup/validation rendering.

type OptimizeReport added in v1.28.1

type OptimizeReport struct {
	Site         string              `json:"site"`
	MedianMillis float64             `json:"median_millis"`
	Samples      int                 `json:"samples"`
	Routes       []RouteOptimization `json:"routes"`
}

OptimizeReport is the joined per-site view: the response-time baseline and every slow route with the query findings behind it.

type PHPStatus

type PHPStatus struct {
	Version       string   `json:"version"`
	Running       bool     `json:"running"`
	XdebugEnabled bool     `json:"xdebug_enabled"`
	XdebugMode    string   `json:"xdebug_mode,omitempty"`
	Ports         []string `json:"ports,omitempty"`
}

type PhpIniReadResponse added in v1.23.0

type PhpIniReadResponse struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Exists  bool   `json:"exists"`
}

PhpIniReadResponse mirrors SiteNginxReadResponse. Exists distinguishes a real saved override from the seeded template the handler hands back when the file is missing.

type PhpIniResetResponse added in v1.23.0

type PhpIniResetResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

type PhpIniRestoreRequest added in v1.23.0

type PhpIniRestoreRequest struct {
	Name string `json:"name"`
}

type PhpIniRestoreResponse added in v1.23.0

type PhpIniRestoreResponse struct {
	OK       bool   `json:"ok"`
	Error    string `json:"error,omitempty"`
	Restored string `json:"restored,omitempty"`
	Content  string `json:"content,omitempty"`
}

type PhpIniWriteRequest added in v1.23.0

type PhpIniWriteRequest struct {
	Content string `json:"content"`
	Backup  bool   `json:"backup"`
}

PhpIniWriteRequest is the JSON body for POST /api/php-versions/{v}/config.

type PhpIniWriteResponse added in v1.23.0

type PhpIniWriteResponse struct {
	OK         bool   `json:"ok"`
	Error      string `json:"error,omitempty"`
	BackupName string `json:"backup_name,omitempty"`
	Content    string `json:"content,omitempty"`
	Exists     bool   `json:"exists,omitempty"`
}

PhpIniWriteResponse mirrors SiteNginxWriteResponse (minus ValidationOutput, which has no clean php pre-flight equivalent).

type PortConflict added in v1.19.1

type PortConflict struct {
	Port  string `json:"port"`
	Label string `json:"label,omitempty"`
}

PortConflict reports a host port lerd wants to bind that is already taken by another process. Surfaced for inactive services so the user sees the blocker before clicking Start.

type PresetResponse added in v1.9.0

type PresetResponse struct {
	Name           string                 `json:"name"`
	Description    string                 `json:"description"`
	Image          string                 `json:"image,omitempty"`
	Dashboard      string                 `json:"dashboard,omitempty"`
	DependsOn      []string               `json:"depends_on,omitempty"`
	MissingDeps    []string               `json:"missing_deps,omitempty"`
	Installed      bool                   `json:"installed"`
	Versions       []config.PresetVersion `json:"versions,omitempty"`
	DefaultVersion string                 `json:"default_version,omitempty"`
	InstalledTags  []string               `json:"installed_tags,omitempty"`
}

PresetResponse describes a bundled service preset for the web UI.

type QueryAnalysis added in v1.23.0

type QueryAnalysis struct {
	Requests []RequestAnalysis `json:"requests"`
	Summary  struct {
		RequestsAnalyzed int `json:"requests_analyzed"`
		NPlusOneFindings int `json:"n_plus_one_findings"`
		SlowFindings     int `json:"slow_findings"`
	} `json:"summary"`
}

QueryAnalysis is the full report: only requests with at least one finding are listed, so an agent gets an actionable work-list rather than a dump.

type RequestAnalysis added in v1.23.0

type RequestAnalysis struct {
	Site        string            `json:"site,omitempty"`
	Request     string            `json:"request,omitempty"`
	Worker      string            `json:"worker,omitempty"`
	RID         string            `json:"rid,omitempty"`
	QueryCount  int               `json:"query_count"`
	TotalTimeMS float64           `json:"total_time_ms"`
	NPlusOne    []NPlusOneFinding `json:"n_plus_one,omitempty"`
	Slow        []SlowFinding     `json:"slow,omitempty"`
}

RequestAnalysis groups findings for one request (or worker invocation).

type RouteOptimization added in v1.28.1

type RouteOptimization struct {
	reqstats.RouteStat
	Evidence []RequestAnalysis  `json:"evidence,omitempty"`
	Profile  *spxreport.Profile `json:"profile,omitempty"`
}

RouteOptimization pairs one flagged slow route with the captured N+1 and slow-query evidence recorded against that same route, so a caller gets the symptom and its likely cause in one payload instead of correlating the timing snapshot and the query ring by hand.

type ServiceActionResponse added in v0.1.23

type ServiceActionResponse struct {
	ServiceResponse
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
	Logs  string `json:"logs,omitempty"`
}

ServiceActionResponse wraps the service state plus any error details.

type ServiceCheck

type ServiceCheck struct {
	Running bool `json:"running"`
}

type ServicePortMapping added in v1.27.1

type ServicePortMapping struct {
	Container int `json:"container"`
	Default   int `json:"default"`
	Published int `json:"published,omitempty"`
}

ServicePortMapping describes one published port of a service: its container-internal port, its preset-default host port, and the current host override (0 = on the default). The ports modal renders and edits these.

type ServiceResponse

type ServiceResponse struct {
	Name              string            `json:"name"`
	Status            string            `json:"status"`
	Version           string            `json:"version,omitempty"`
	EnvVars           map[string]string `json:"env_vars"`
	Dashboard         string            `json:"dashboard,omitempty"`
	DashboardExternal bool              `json:"dashboard_external,omitempty"`
	ConnectionURL     string            `json:"connection_url,omitempty"`
	// Port is the host (published) port the service is exposed on: the
	// published-port override when set, else the preset/version default. 0 when
	// the service publishes no host port (e.g. a worker). The UI shows it in the
	// status pill so a moved port reads at a glance.
	Port int `json:"port,omitempty"`
	// PublishedPort is the user's published-port override (0 when unset, i.e.
	// using the default). DefaultPort is the preset/version default host port.
	// ExtraPorts are the extra published mappings. The ports modal reads these
	// to show the current state and a reset-to-default affordance.
	PublishedPort int      `json:"published_port,omitempty"`
	DefaultPort   int      `json:"default_port,omitempty"`
	ExtraPorts    []string `json:"extra_ports,omitempty"`
	// SecondaryPorts are the service's published mappings past the primary (a
	// multi-port service like mailpit or rustfs), each with its container-internal
	// port, preset-default host port, and current override. The ports modal renders
	// one editable host-port field per entry so every published port is movable.
	SecondaryPorts []ServicePortMapping `json:"secondary_ports,omitempty"`
	Custom         bool                 `json:"custom,omitempty"`
	IsDefault      bool                 `json:"is_default,omitempty"`
	// PresetOwned is true when lerd ships this service as a bundled preset
	// (default-stack or optional like gotenberg). The ports modal keys the
	// extra-ports affordance off this, not is_default, so every service we
	// provide can publish extra ports while genuinely custom services can't.
	PresetOwned bool `json:"preset_owned,omitempty"`
	// Tunable is true when the service exposes a user-editable runtime config
	// override (see config.ServiceTuningMount), so the UI can show a Tuning tab.
	Tunable            bool     `json:"tunable,omitempty"`
	SiteCount          int      `json:"site_count"`
	SiteDomains        []string `json:"site_domains,omitempty"`
	Pinned             bool     `json:"pinned"`
	Paused             bool     `json:"paused,omitempty"`
	DependsOn          []string `json:"depends_on,omitempty"`
	QueueSite          string   `json:"queue_site,omitempty"`
	StripeListenerSite string   `json:"stripe_listener_site,omitempty"`
	ScheduleWorkerSite string   `json:"schedule_worker_site,omitempty"`
	ReverbSite         string   `json:"reverb_site,omitempty"`
	HorizonSite        string   `json:"horizon_site,omitempty"`
	WorkerSite         string   `json:"worker_site,omitempty"`
	WorkerName         string   `json:"worker_name,omitempty"`
	WorkerLabel        string   `json:"worker_label,omitempty"`
	// Set when this worker entry is for a per-worktree unit
	// (lerd-<wname>-<site>-<wt>); empty for parent-site workers.
	WorkerWorktree       string `json:"worker_worktree,omitempty"`
	WorkerWorktreeDomain string `json:"worker_worktree_domain,omitempty"`
	UpdateStrategy       string `json:"update_strategy,omitempty"`
	UpdateAvailable      bool   `json:"update_available,omitempty"`
	LatestVersion        string `json:"latest_version,omitempty"`
	UpgradeVersion       string `json:"upgrade_version,omitempty"`
	PreviousVersion      string `json:"previous_version,omitempty"`
	// MigrationSupported and CanRollback intentionally drop omitempty so the
	// false case still appears in the JSON. The UI uses === to distinguish
	// "field missing" (no avail check ran) from "explicitly false".
	MigrationSupported bool           `json:"migration_supported"`
	CanRollback        bool           `json:"can_rollback"`
	PortConflicts      []PortConflict `json:"port_conflicts,omitempty"`
	// ClientShims are the client tools this service exposes as host shims
	// (mysqldump, pg_dump…), each with whether the host already has the tool and
	// the user's current decision. The service card renders a toggle per tool.
	ClientShims []shims.Info `json:"client_shims,omitempty"`
}

ServiceResponse is the response for GET /api/services.

type ServiceTuningReadResponse added in v1.23.0

type ServiceTuningReadResponse struct {
	Supported bool   `json:"supported"`
	Target    string `json:"target"`
	Content   string `json:"content"`
	Exists    bool   `json:"exists"`
}

ServiceTuningReadResponse is the JSON returned by GET /api/services/{name}/config. Exists distinguishes a real saved override from the seeded template the handler hands back when the file is missing — the frontend uses this to hide the "back up the current file first" checkbox on first save since there's nothing on disk yet to protect.

type ServiceTuningResetResponse added in v1.23.0

type ServiceTuningResetResponse struct {
	OK             bool   `json:"ok"`
	Error          string `json:"error,omitempty"`
	RolledBack     bool   `json:"rolled_back,omitempty"`
	AutoBackupName string `json:"auto_backup_name,omitempty"`
	Content        string `json:"content,omitempty"`
	Exists         bool   `json:"exists,omitempty"`
}

ServiceTuningResetResponse is the JSON returned by POST /api/services/{name}/config/reset. AutoBackupName surfaces the implicit recovery snapshot Reset always stages of the pre-reset content (separate from the user-opted-in backup flag on Save); the modal can show "your previous config is kept as <name>, restore it any time" so users don't fear the action.

type ServiceTuningRestoreRequest added in v1.23.0

type ServiceTuningRestoreRequest struct {
	Name string `json:"name"`
}

ServiceTuningRestoreRequest carries the exact backup name the frontend previewed in the diff modal. Empty means "newest" for tooling that has no preview UI.

type ServiceTuningRestoreResponse added in v1.23.0

type ServiceTuningRestoreResponse struct {
	OK         bool   `json:"ok"`
	Error      string `json:"error,omitempty"`
	Restored   string `json:"restored,omitempty"`
	Content    string `json:"content,omitempty"`
	RolledBack bool   `json:"rolled_back,omitempty"`
}

ServiceTuningRestoreResponse is the JSON response for POST /api/services/{name}/config/restore. RolledBack is true when the restored bytes themselves crashed the service and the handler auto-reverted to the pre-restore content; the modal uses this to distinguish "restore succeeded" from "restore reverted, service is back on its prior config".

type ServiceTuningWriteRequest added in v1.23.0

type ServiceTuningWriteRequest struct {
	Content string `json:"content"`
	Backup  bool   `json:"backup"`
}

ServiceTuningWriteRequest is the JSON body for POST /api/services/{name}/config.

type ServiceTuningWriteResponse added in v1.23.0

type ServiceTuningWriteResponse struct {
	OK         bool   `json:"ok"`
	Error      string `json:"error,omitempty"`
	BackupName string `json:"backup_name,omitempty"`
	Content    string `json:"content,omitempty"`
	Exists     bool   `json:"exists,omitempty"`
	// RolledBack is true when the restart failed and the handler
	// successfully restored the previous bytes; the editor uses this
	// to refresh `original` back to the rolled-back state instead of
	// staying perpetually-dirty against bytes that never landed.
	RolledBack bool `json:"rolled_back,omitempty"`
}

ServiceTuningWriteResponse mirrors SiteNginxWriteResponse so the frontend can share refresh logic between the two editors. Content + Exists round-trip the canonical post-write state (whether or not the restart succeeded) so the client can refresh its baseline even on the auto-rollback path.

type SettingsResponse added in v0.3.0

type SettingsResponse struct {
	AutostartOnLogin          bool     `json:"autostart_on_login"`
	WorkerExecMode            string   `json:"worker_exec_mode"`
	WorkerModeApplies         bool     `json:"worker_mode_applies"` // true on macOS only
	IdleSuspendEnabled        bool     `json:"idle_suspend_enabled"`
	IdleSuspendTimeoutMinutes int      `json:"idle_suspend_timeout_minutes"`
	DNSEnabled                bool     `json:"dns_enabled"`
	DNSUpstream               []string `json:"dns_upstream"`          // pinned upstreams, empty = auto-detect
	DNSUpstreamDetected       []string `json:"dns_upstream_detected"` // what auto-detection currently sees
}

SettingsResponse is the response for GET /api/settings.

type SiteActionResponse added in v0.1.29

type SiteActionResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

SiteActionResponse is returned by POST /api/sites/{domain}/secure|unsecure.

type SiteEnvBackup added in v1.23.0

type SiteEnvBackup = cfgedit.Backup

SiteEnvBackup is one row in the GET /api/sites/{domain}/env/backups list. It aliases cfgedit.Backup so the env editor shares the edit service's shape.

type SiteEnvProposeEntry added in v1.28.1

type SiteEnvProposeEntry struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	Required bool   `json:"required"`
}

SiteEnvProposeEntry is one missing example key with the value that would be written for it (verbatim from .env.example) and whether the app requires it, so the UI can list every candidate key with its value for the user to pick.

type SiteEnvProposeResponse added in v1.28.1

type SiteEnvProposeResponse struct {
	File       string                `json:"file"`
	Current    string                `json:"current"`
	Merged     string                `json:"merged"`
	Added      []string              `json:"added"`
	AddedLines []int                 `json:"addedLines"`
	Required   []string              `json:"required"`
	Optional   []string              `json:"optional"`
	Entries    []SiteEnvProposeEntry `json:"entries"`
}

SiteEnvProposeResponse previews inserting the .env.example keys a site's env file is missing. Current and Merged feed a diff editor; Added lists the keys the merge inserts, Required/Optional the doctor's classification so the UI can offer to also pull in the optional (has-a-code-default) keys. Every slice is non-nil so the client can render without null guards.

type SiteEnvRestoreRequest added in v1.23.0

type SiteEnvRestoreRequest struct {
	Name string `json:"name"`
}

SiteEnvRestoreRequest carries the previewed backup name so the restore applies the exact bytes the user saw, not whatever is newest at accept time.

type SiteEnvRestoreResponse added in v1.23.0

type SiteEnvRestoreResponse struct {
	OK       bool   `json:"ok"`
	Error    string `json:"error,omitempty"`
	Restored string `json:"restored,omitempty"`
	Content  string `json:"content,omitempty"`
}

SiteEnvRestoreResponse is the JSON body returned by POST /env/restore.

type SiteEnvWriteRequest added in v1.23.0

type SiteEnvWriteRequest struct {
	Content string `json:"content"`
	Backup  bool   `json:"backup"`
}

SiteEnvWriteRequest is the JSON body for PUT /api/sites/{domain}/env.

type SiteEnvWriteResponse added in v1.23.0

type SiteEnvWriteResponse struct {
	OK         bool   `json:"ok"`
	Error      string `json:"error,omitempty"`
	BackupPath string `json:"backup_path,omitempty"`
}

SiteEnvWriteResponse is the JSON response for PUT /api/sites/{domain}/env.

type SiteNginxBackup added in v1.23.0

type SiteNginxBackup = cfgedit.Backup

SiteNginxBackup is the backup metadata the frontend's restore dropdown consumes. It aliases cfgedit.Backup so the site, global-nginx, and php.ini editors all surface the same shape from the shared edit service.

type SiteNginxReadResponse added in v1.23.0

type SiteNginxReadResponse struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Exists  bool   `json:"exists"`
}

SiteNginxReadResponse is the JSON returned by GET /api/sites/{domain}/nginx. Exists distinguishes a real saved override from the seeded template the handler hands back when the file is missing; the frontend uses this to hide the "back up the current file first" checkbox on first save since there's nothing on disk yet to protect.

type SiteNginxResetResponse added in v1.23.0

type SiteNginxResetResponse struct {
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

SiteNginxResetResponse is the JSON returned by POST /api/sites/{d}/nginx/reset.

type SiteNginxRestoreRequest added in v1.23.0

type SiteNginxRestoreRequest struct {
	Name string `json:"name"`
}

SiteNginxRestoreRequest is the JSON body for POST /api/sites/{d}/nginx/restore. The frontend always loads a specific backup and previews its diff before the user accepts, so we require the caller to name the backup it rendered; otherwise a concurrent save creating a NEWER backup between modal-open and accept would silently swap the live file with bytes the user never saw and consume the wrong file. Empty name means "newest" for tooling that doesn't have a preview UI.

type SiteNginxRestoreResponse added in v1.23.0

type SiteNginxRestoreResponse struct {
	OK       bool   `json:"ok"`
	Error    string `json:"error,omitempty"`
	Restored string `json:"restored,omitempty"`
	Content  string `json:"content,omitempty"`
}

SiteNginxRestoreResponse is the JSON response for POST /api/sites/{domain}/nginx/restore.

type SiteNginxWriteRequest added in v1.23.0

type SiteNginxWriteRequest struct {
	Content string `json:"content"`
	Backup  bool   `json:"backup"`
}

SiteNginxWriteRequest is the JSON body for POST /api/sites/{domain}/nginx.

type SiteNginxWriteResponse added in v1.23.0

type SiteNginxWriteResponse struct {
	OK               bool   `json:"ok"`
	Error            string `json:"error,omitempty"`
	BackupName       string `json:"backup_name,omitempty"`
	ValidationOutput string `json:"validation_output,omitempty"`
	Content          string `json:"content,omitempty"`
	Exists           bool   `json:"exists,omitempty"`
}

SiteNginxWriteResponse is the JSON response for POST /api/sites/{domain}/nginx. ValidationOutput carries the captured `nginx -t` stdout+stderr when the pre-flight validation step ran (whether it passed or failed) so the modal can show the user exactly which directive / line nginx complained about. Content/Exists round-trip the canonical post-write state so the client can refresh its `original` baseline even on the reload-failure path (file already landed on disk, just the runtime reload step failed).

type SiteReorderRequest added in v1.24.0

type SiteReorderRequest struct {
	Order []string `json:"order"` // site names in the desired display order
}

handleSiteLink links a directory as a site via POST /api/sites/link. It streams command output as SSE events and sends a final "done" event. SiteReorderRequest is the JSON body for POST /api/sites/reorder.

type SiteResponse

type SiteResponse struct {
	Name               string              `json:"name"`
	AppName            string              `json:"app_name,omitempty"`
	Domain             string              `json:"domain"`
	Domains            []string            `json:"domains"`
	ConflictingDomains []ConflictingDomain `json:"conflicting_domains,omitempty"`
	Path               string              `json:"path"`
	PHPVersion         string              `json:"php_version"`
	// PHPMin/PHPMax are the framework's supported PHP range. The dashboard
	// disables out-of-range versions in the picker. Empty when there is no
	// framework or its version was guessed (clamped), so nothing is disabled.
	PHPMin             string         `json:"php_min,omitempty"`
	PHPMax             string         `json:"php_max,omitempty"`
	UsesPHP            bool           `json:"uses_php"`
	NodeVersion        string         `json:"node_version"`
	JSRuntime          string         `json:"js_runtime,omitempty"`
	TLS                bool           `json:"tls"`
	Framework          string         `json:"framework"`
	FPMRunning         bool           `json:"fpm_running"`
	IsLaravel          bool           `json:"is_laravel"`
	FrameworkLabel     string         `json:"framework_label"`
	QueueRunning       bool           `json:"queue_running"`
	QueueFailing       bool           `json:"queue_failing,omitempty"`
	StripeRunning      bool           `json:"stripe_running"`
	StripeSecretSet    bool           `json:"stripe_secret_set"`
	StripeWebhookPath  string         `json:"stripe_webhook_path,omitempty"`
	ScheduleRunning    bool           `json:"schedule_running"`
	ScheduleFailing    bool           `json:"schedule_failing,omitempty"`
	ReverbRunning      bool           `json:"reverb_running"`
	ReverbFailing      bool           `json:"reverb_failing,omitempty"`
	HasReverb          bool           `json:"has_reverb"`
	HasHorizon         bool           `json:"has_horizon"`
	HorizonRunning     bool           `json:"horizon_running"`
	HorizonFailing     bool           `json:"horizon_failing,omitempty"`
	HorizonReload      bool           `json:"horizon_reload,omitempty"`       // horizon runs via horizon:listen (auto-reload)
	HorizonReloadReady bool           `json:"horizon_reload_ready,omitempty"` // chokidar present, so auto-reload can be enabled without installing it
	OctaneReload       bool           `json:"octane_reload,omitempty"`        // FrankenPHP worker serves via octane:start --watch (auto-reload)
	OctaneReloadReady  bool           `json:"octane_reload_ready,omitempty"`  // FrankenPHP worker mode + chokidar present, so auto-reload can be enabled
	HasQueueWorker     bool           `json:"has_queue_worker"`
	HasScheduleWorker  bool           `json:"has_schedule_worker"`
	FrameworkWorkers   []WorkerStatus `json:"framework_workers,omitempty"`
	HasAppLogs         bool           `json:"has_app_logs"`
	LatestLogTime      string         `json:"latest_log_time,omitempty"`
	HasFavicon         bool           `json:"has_favicon"`
	HasEnv             bool           `json:"has_env"`
	Paused             bool           `json:"paused"`
	// Pinned excludes the site from idle-suspend (kept always-warm).
	Pinned bool `json:"pinned,omitempty"`
	// LastActive is the unix-seconds time the site last saw a request, from the
	// idle-suspend activity feed. Zero (omitted) means no activity recorded yet
	// this lerd-ui session.
	LastActive int64 `json:"last_active,omitempty"`
	// IdleSuspended is true when the idle engine has gracefully stopped this
	// site's workers (a subset of Idle: only sites that had workers to stop).
	IdleSuspended bool `json:"idle_suspended,omitempty"`
	// Idle is true when the site has gone past the idle timeout (and isn't
	// paused), whether or not it had any workers to suspend. Drives the
	// dashboard sleep (Zz) indicator, which marks every idle site.
	Idle bool `json:"idle,omitempty"`
	// IdleSuspendedWorkers names the workers the engine stopped while idle, so
	// the dashboard can still show their (dimmed) dots — a sleeping site keeps
	// its worker dots rather than losing them when the units stop.
	IdleSuspendedWorkers []string           `json:"idle_suspended_workers,omitempty"`
	Branch               string             `json:"branch"`
	Worktrees            []WorktreeResponse `json:"worktrees"`
	// Services lists the service names this site uses, sourced from the
	// project's .lerd.yaml. Used by the dashboard to render service badges
	// on the site detail panel.
	Services         []string `json:"services,omitempty"`
	LANPort          int      `json:"lan_port,omitempty"`
	LANShareURL      string   `json:"lan_share_url,omitempty"`
	CustomContainer  bool     `json:"custom_container,omitempty"`
	ContainerPort    int      `json:"container_port,omitempty"`
	ContainerImage   string   `json:"container_image,omitempty"`
	Runtime          string   `json:"runtime,omitempty"`
	RuntimeWorker    bool     `json:"runtime_worker,omitempty"`
	HostProxy        bool     `json:"host_proxy,omitempty"`
	HostPort         int      `json:"host_port,omitempty"`
	HostHasDevServer bool     `json:"host_has_dev_server,omitempty"`
	// Grouping — Group is the group key (main site's name); GroupSubdomain is the
	// label a secondary occupies; GroupMainDomain is the group main's base domain.
	// MultiTenant flags a main whose project declares env_overrides (wildcard
	// tenant subdomains) so the UI can warn that a secondary carves out a label.
	Group           string `json:"group,omitempty"`
	GroupSubdomain  string `json:"group_subdomain,omitempty"`
	GroupMainDomain string `json:"group_main_domain,omitempty"`
	GroupSharedDB   bool   `json:"group_shared_db,omitempty"`
	MultiTenant     bool   `json:"multi_tenant,omitempty"`
}

SiteResponse is the response for GET /api/sites.

type SlowFinding added in v1.23.0

type SlowFinding struct {
	SQL    string         `json:"sql"`
	TimeMS float64        `json:"time_ms"`
	Caller AnalyzedCaller `json:"caller"`
}

SlowFinding is a single query at or over the slow threshold.

type StatusResponse

type StatusResponse struct {
	DNS               DNSStatus    `json:"dns"`
	Nginx             ServiceCheck `json:"nginx"`
	PHPFPMs           []PHPStatus  `json:"php_fpms"`
	PHPDefault        string       `json:"php_default"`
	NodeDefault       string       `json:"node_default"`
	NodeManagedByLerd bool         `json:"node_managed_by_lerd"`
	// BunAvailable is true when a bun binary is installed on the host;
	// BunVersion carries its version for an at-a-glance reference.
	// UsingSystemBun is true when lerd isn't managing Node and there's no system
	// Node, so bun is what actually runs JS host workers (Vite, installs).
	BunAvailable   bool   `json:"bun_available"`
	BunVersion     string `json:"bun_version"`
	UsingSystemBun bool   `json:"using_system_bun"`
	WatcherRunning bool   `json:"watcher_running"`
	// FrankenPHPVersions are the PHP versions dunglas/frankenphp publishes an
	// image for, so the UI can limit a FrankenPHP site's version dropdown to
	// the ones it can actually run (intersected client-side with installed).
	FrankenPHPVersions []string `json:"frankenphp_php_versions"`
	// Home is the user's home directory, so the UI can shorten displayed paths
	// under it to a leading ~ without shipping the absolute path in the label.
	Home string `json:"home"`
}

StatusResponse is the response for GET /api/status.

type VersionResponse

type VersionResponse struct {
	Current   string `json:"current"`
	Latest    string `json:"latest"`
	HasUpdate bool   `json:"has_update"`
	Changelog string `json:"changelog,omitempty"`
}

VersionResponse is the response for GET /api/version.

type WorkerStatus added in v1.0.0

type WorkerStatus struct {
	Name    string `json:"name"`
	Label   string `json:"label"`
	Running bool   `json:"running"`
	Failing bool   `json:"failing,omitempty"`
}

WorkerStatus represents a single framework worker and its running state.

type WorktreeResponse added in v0.6.0

type WorktreeResponse struct {
	Branch              string         `json:"branch"`
	Domain              string         `json:"domain"`
	Path                string         `json:"path"`
	PHPVersion          string         `json:"php_version,omitempty"`
	PHPMin              string         `json:"php_min,omitempty"`
	PHPMax              string         `json:"php_max,omitempty"`
	NodeVersion         string         `json:"node_version,omitempty"`
	PHPVersionOverride  bool           `json:"php_version_override,omitempty"`
	NodeVersionOverride bool           `json:"node_version_override,omitempty"`
	FrameworkVersion    string         `json:"framework_version,omitempty"`
	FrameworkLabel      string         `json:"framework_label,omitempty"`
	DBIsolated          bool           `json:"db_isolated,omitempty"`
	DBDatabase          string         `json:"db_database,omitempty"`
	LANPort             int            `json:"lan_port,omitempty"`
	LANShareURL         string         `json:"lan_share_url,omitempty"`
	FrameworkWorkers    []WorkerStatus `json:"framework_workers,omitempty"`
	// Idle-suspend state for the worktree, which idles on its own timer.
	LastActive           int64    `json:"last_active,omitempty"`
	Idle                 bool     `json:"idle,omitempty"`
	IdleSuspendedWorkers []string `json:"idle_suspended_workers,omitempty"`
}

WorktreeResponse is embedded in SiteResponse for each git worktree. PHP/NodeVersion are the effective values; *Override flags signal whether the worktree's .lerd.yaml set them explicitly or it's inherited.

Jump to

Keyboard shortcuts

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