Documentation
¶
Overview ¶
Package apps declares application deploy slots: which repository may deploy which application, to which target, with which secrets.
An app owns its deployment, not its infrastructure. The infrastructure app (john/arch) declares a slot; the app repository publishes an image and runs a deploy job on release tags. That job requests a Forgejo Actions ID token with audience "yawn-app:<id>"; the deploy hand-off verifies the token against the slot (repository by immutable ID, release tag prefix, exact workflow file), then deploys exactly the requested image digest to the slot's target, health-checks it and rolls back on failure.
Containers, addresses, routes, DNS and monitors stay in the infrastructure app. A slot never grants an app repository any infrastructure credential.
Slots synthesize to .yawn/apps.json (data only, no secrets).
Index ¶
Constants ¶
const SchemaVersion = 1
SchemaVersion of apps.json.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
ID string `json:"id"`
Source Source `json:"source"`
// Image is the registry repository, e.g. "code.yawn.dev/john/corn"; the
// deploy names an exact digest of it, never a tag.
Image string `json:"image"`
Target Target `json:"target"`
// Health is the URL that must answer 2xx/3xx after a deploy.
Health string `json:"health"`
// Secrets are xyOps secret IDs granted only to this app's deploy.
Secrets []string `json:"secrets,omitempty"`
Notes string `json:"notes,omitempty"`
}
App is one deploy slot.
type Apps ¶
type Apps struct {
// contains filtered or unexported fields
}
Apps is the declared set of deploy slots.
func Load ¶
Load parses apps.json, refusing unknown fields and other schema versions, and re-validates every slot exactly as Add does.
type Source ¶
type Source struct {
// Repository is "owner/name", for humans and workflow_ref matching.
Repository string `json:"repository"`
// RepositoryID and OwnerID are Forgejo's immutable numeric IDs.
RepositoryID string `json:"repository_id"`
OwnerID string `json:"owner_id"`
// Workflow is the deploy workflow file, e.g. ".forgejo/workflows/deploy.yml".
Workflow string `json:"workflow"`
// TagPrefix selects release tags, e.g. "v" for refs/tags/v1.2.3.
TagPrefix string `json:"tag_prefix"`
// AllowManual also accepts workflow_dispatch at such a tag (redeploys,
// rollbacks to an earlier release).
AllowManual bool `json:"allow_manual,omitempty"`
}
Source pins who may deploy: one repository, identified by immutable IDs, deploying from release tags with one exact workflow file.
type Target ¶
type Target struct {
Kind TargetKind `json:"kind"`
// Service is the fleet service ID (ComposeLXC).
Service string `json:"service,omitempty"`
// Host names the host for ComposeHost, e.g. "vps".
Host string `json:"host,omitempty"`
// Project is the Compose project name; Compose files and data live
// under /opt/<project> on the target.
Project string `json:"project"`
// ComposeService is the one Compose service a deploy recreates.
ComposeService string `json:"compose_service"`
}
Target is where the app runs.
type TargetKind ¶
type TargetKind string
TargetKind is where an app runs.
const ( // ComposeLXC runs the app with Docker Compose inside a Proxmox container // declared in the same app (identified by the fleet service ID). ComposeLXC TargetKind = "compose-lxc" // ComposeHost runs the app with Docker Compose on a host outside Proxmox // (e.g. the VPS or a workstation), reached through a reviewed, // root-owned helper installed by the operator. ComposeHost TargetKind = "compose-host" )