Documentation
¶
Overview ¶
Package catalog holds Levelrail's own curated set of one-click service templates (ADR 015). Every Template's name, slogan, and Compose body here is written fresh for this platform: none of it is copied or lightly-rewritten from any other project's own dataset. Image tags are real, versioned tags for each well-known open-source project; where a specific tag's exact string couldn't be verified against a live registry in this environment, that entry says so in its own comment.
Index ¶
- Constants
- Variables
- func IsVerified(id string) bool
- func ValidateCompose(body []byte) (map[string]bool, error)
- type DomainPrompt
- type EnvPrompt
- type Finding
- type InstallInput
- type Manifest
- type ManifestHealthcheck
- type Protection
- type Requirements
- type RequirementsLevel
- type Template
- type VerifiedRecord
Constants ¶
const ( SeverityInfo = "info" SeverityReview = "review" SeverityElevated = "elevated" )
Finding severities, ordered info < review < elevated.
const ( FindingPrivileged = "privileged" FindingDockerSocket = "docker_socket" FindingHostNetwork = "host_network" FindingHostNamespace = "host_namespace" FindingCapAdd = "cap_add" FindingDevices = "devices" FindingSecurityOpt = "security_opt" FindingHostMount = "host_mount" FindingUnpinnedImage = "unpinned_image" FindingPublishedPorts = "published_ports" FindingGeneratedSecrets = "generated_secrets" FindingRequiredSecrets = "required_secrets" FindingNoHealthcheck = "no_healthcheck" FindingPersistentData = "persistent_data" FindingGPU = "gpu" FindingUnparsed = "unparsed" )
Finding codes, stable identifiers the dashboard maps to translated copy.
const ( ProtectionIngress = "https_ingress" ProtectionMasking = "secret_masking" ProtectionBackups = "volume_backups" ProtectionHealth = "health_gated_deploy" ProtectionRollback = "rollback" ProtectionExposure = "exposure_report" ProtectionFirewall = "firewall" )
Protection codes for what Levelrail adds around a template.
Variables ¶
var Templates = concat(
starterKitsTemplates,
automationTemplates,
monitoringTemplates,
storageTemplates,
analyticsTemplates,
infrastructureTemplates,
securityTemplates,
productivity1Templates,
productivity2Templates,
productivity3Templates,
applicationsTemplates,
devtools1Templates,
devtools2Templates,
dashboardTemplates,
financeTemplates,
media1Templates,
media2Templates,
communicationTemplates,
databasesTemplates,
iotTemplates,
aiml1Templates,
aiml2Templates,
selfhosted1Templates,
selfhosted2Templates,
selfhosted3Templates,
selfhosted4Templates,
aiTemplates,
devtoolsBatchTemplates,
productivityBatchTemplates,
automationBatchTemplates,
catalogBatch2Templates,
catalogBatch3Templates,
catalogBatch4Templates,
catalogBatch5Templates,
catalogBatch6Templates,
catalogRustDeskTemplates,
catalogDevtoolsInfraTemplates,
contribTemplates,
manifestTemplates,
)
Templates is the full catalog, served by GET /api/v1/service-templates and GET /api/v1/service-templates/{id}. contribTemplates (contrib.go) are contributor-submitted YAML entries, merged in last so they're indistinguishable from the hand-written Go ones to every consumer.
Functions ¶
func IsVerified ¶
IsVerified reports whether the template passed the last committed smoke run.
func ValidateCompose ¶ added in v0.2.0
ValidateCompose runs a compose body through the same parse, magic-var and translation steps a real deploy uses, with stand-in secrets, and returns the declared service keys. A later catalog import batch runs this over every candidate file (scripts/validate-templates).
Types ¶
type DomainPrompt ¶ added in v0.2.0
type DomainPrompt struct {
Service string `yaml:"service" json:"service"`
Port int `yaml:"port" json:"port"`
Description string `yaml:"description" json:"description,omitempty"`
}
DomainPrompt is a service the installer offers to put behind a domain.
type EnvPrompt ¶ added in v0.2.0
type EnvPrompt struct {
Key string `yaml:"key" json:"key"`
Label string `yaml:"label" json:"label,omitempty"`
Description string `yaml:"description" json:"description,omitempty"`
Default string `yaml:"default" json:"default,omitempty"`
Generate string `yaml:"generate" json:"generate,omitempty"`
Length int `yaml:"length" json:"length,omitempty"`
Required bool `yaml:"required" json:"required,omitempty"`
Secret bool `yaml:"secret" json:"secret,omitempty"`
}
EnvPrompt is one ${KEY} placeholder the installer asks for.
type Finding ¶
type Finding struct {
Code string `json:"code"`
Severity string `json:"severity"`
Services []string `json:"services,omitempty"`
Detail string `json:"detail,omitempty"`
Message string `json:"message"`
}
Finding is one thing a template asks of the host or the operator.
type InstallInput ¶ added in v0.2.0
InstallInput is what an operator supplies when installing a manifest.
type Manifest ¶ added in v0.2.0
type Manifest struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Icon string `yaml:"icon" json:"icon,omitempty"`
Category string `yaml:"category" json:"category"`
DocumentationURL string `yaml:"documentation_url" json:"documentation_url"`
ComposeFile string `yaml:"compose_file" json:"-"`
RecommendedMemoryBytes int64 `yaml:"recommended_memory_bytes" json:"recommended_memory_bytes,omitempty"`
Env []EnvPrompt `yaml:"env" json:"env,omitempty"`
Domains []DomainPrompt `yaml:"domains" json:"domains,omitempty"`
Healthcheck *ManifestHealthcheck `yaml:"healthcheck" json:"healthcheck,omitempty"`
Compose string `yaml:"-" json:"-"`
}
Manifest is one template directory: template.yaml plus the compose file it names.
func LoadManifest ¶ added in v0.2.0
LoadManifest reads and validates one template directory.
func LoadManifests ¶ added in v0.2.0
LoadManifests reads every <dir>/<id>/template.yaml in fsys, sorted by id, and validates each one. All problems are reported, not just the first.
func (Manifest) Render ¶ added in v0.2.0
func (m Manifest) Render(in InstallInput, allowMissing bool) (string, error)
Render returns the manifest's compose file with every prompt filled in. Values are substituted into parsed YAML scalars, never into raw text, so an operator value cannot change the document's structure. With allowMissing, a required prompt with no value becomes an unresolved magic var, which the deploy path reports as "needs configuration".
type ManifestHealthcheck ¶ added in v0.2.0
type ManifestHealthcheck struct {
Service string `yaml:"service" json:"service"`
Port int `yaml:"port" json:"port"`
Path string `yaml:"path" json:"path"`
}
ManifestHealthcheck is the HTTP check that proves an install actually serves.
type Protection ¶
Protection is one Levelrail safeguard that applies to a template.
type Requirements ¶
type Requirements struct {
Level RequirementsLevel `json:"level"`
Findings []Finding `json:"findings"`
Protections []Protection `json:"protections"`
}
Requirements is the computed "what this needs, what Levelrail adds" card.
func ComputeRequirements ¶
func ComputeRequirements(composeBody string) Requirements
ComputeRequirements derives the requirements card from a template's Compose body alone. A body that fails to parse is reported as review.
type RequirementsLevel ¶
type RequirementsLevel string
RequirementsLevel summarizes how much trust a template asks of the host.
const ( LevelStandard RequirementsLevel = "standard" LevelReview RequirementsLevel = "review" LevelElevated RequirementsLevel = "elevated" )
Requirements levels, ordered standard < review < elevated.
type Template ¶
type Template struct {
ID string
Name string
Slogan string
// Description is optional operator setup notes (ports, firewall, required env, licence), plain text.
Description string
Category string
DocumentationURL string
Compose string
// RecommendedMemoryBytes is a static, pre-deploy RAM advisory (zero
// means none). Informational only, not checked against any node's
// real available memory.
RecommendedMemoryBytes int64
// RequiresGPU marks entries that reserve an NVIDIA GPU through
// deploy.resources.reservations.devices in their Compose body.
RequiresGPU bool
// Manifest is set for entries loaded from manifests/ (env prompts, domains, healthcheck).
Manifest *Manifest
}
Template is one deployable entry in the catalog. Compose is a full compose.yaml body, valid against internal/compose's supported subset (see catalog_test.go, which parses and validates every one).
func TemplateByID ¶ added in v0.2.0
TemplateByID returns the Templates entry with this ID, or false if none matches.
type VerifiedRecord ¶
type VerifiedRecord struct {
VerifiedOn string `json:"verified_on"`
Environment string `json:"environment"`
Templates []string `json:"templates"`
}
VerifiedRecord is the committed result of the last live smoke pass (scripts/catalog-smoke.sh): which templates came up healthy, when, where.
func VerifiedInfo ¶
func VerifiedInfo() VerifiedRecord
VerifiedInfo returns the date and environment of the last smoke pass.
Source Files
¶
- catalog.go
- contrib.go
- files.go
- manifest.go
- manifest_load.go
- requirements.go
- templates_ai.go
- templates_aiml1.go
- templates_aiml2.go
- templates_analytics.go
- templates_applications.go
- templates_automation.go
- templates_automation_batch.go
- templates_catalog_batch2.go
- templates_catalog_batch3.go
- templates_catalog_batch4.go
- templates_catalog_batch5.go
- templates_catalog_batch6.go
- templates_catalog_batch_rustdesk.go
- templates_communication.go
- templates_dashboard.go
- templates_databases.go
- templates_devtools1.go
- templates_devtools2.go
- templates_devtools_batch.go
- templates_devtools_infra_batch.go
- templates_finance.go
- templates_infrastructure.go
- templates_iot.go
- templates_media1.go
- templates_media2.go
- templates_monitoring.go
- templates_productivity1.go
- templates_productivity2.go
- templates_productivity3.go
- templates_productivity_batch.go
- templates_security.go
- templates_selfhosted1.go
- templates_selfhosted2.go
- templates_selfhosted3.go
- templates_selfhosted4.go
- templates_starterkits.go
- templates_storage.go
- verified.go