Documentation
¶
Overview ¶
Package pstack carries the nine files the binary embeds. Explicit paths, never a glob: the READMEs beside the assets must not ship, and a pattern that matches nothing is a compile error — which is exactly the failure mode `with { type: 'text' }` had at bundle time, moved earlier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AgentScript string
AgentScript is the pstack-agent node reporter, passed as `sh -c` to a stock docker CLI image on every node (no pstack binary on workers). It only reports; every decision is the control plane's.
var CloudInitTemplate string
CloudInitTemplate is the cloud-config user-data template.
var ControlTemplate string
ControlTemplate is the control stack's compose file, rendered by init.
var GrafanaDatasources string
GrafanaDatasources is Grafana's provisioned Loki datasource, which init writes to control/grafana/datasources/loki.yaml with `--logging loki`. Embedded as-is for LokiConfig's reasons: nothing in it varies by host, and it holds no credential.
var LokiConfig string
LokiConfig is Loki's config file, which init writes beside the control compose file with `--logging loki`. Embedded as-is, never rendered: nothing in it varies by host, and it holds no credential.
var OpenAPISpec []byte
OpenAPISpec is the API's own OpenAPI document, served at `/api/openapi.yaml` and, converted, at `/api/openapi.json`.
The SAME file oascmd-gen reads to generate `pstack api`, so the served document and the shipped commands cannot describe different APIs — and a route missing from it fails a test before either exists. Embedding costs ~34KB in a 17MB binary; fetching it from anywhere at runtime would mean a host could serve a spec that does not match the binary answering the requests.
var PackageJSON []byte
PackageJSON is the workspace manifest — the version of record (lockstep with the TS packages).
ShareHTML is the page a share link opens.
var UIHTML string
UIHTML is the basic web UI, served for every non-/api/ path.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
pstack
command
The pstack binary.
|
The pstack binary. |
|
internal
|
|
|
api
Forwarding (docs/migrate-forward-design.md): this host (A) passes deploys and visitors it no longer serves to another pstack (B).
|
Forwarding (docs/migrate-forward-design.md): this host (A) passes deploys and visitors it no longer serves to another pstack (B). |
|
apicli
Package apicli is the `pstack api …` command tree, GENERATED from `packages/pstack/api/openapi.yaml`.
|
Package apicli is the `pstack api …` command tree, GENERATED from `packages/pstack/api/openapi.yaml`. |
|
auth
Package auth is accounts, sessions and personal API tokens, on top of the Store.
|
Package auth is accounts, sessions and personal API tokens, on top of the Store. |
|
autolabel
Package autolabel generates the Traefik labels and network wiring a preview service needs, from one short label — and, on a host that runs Loki, the logging block that ships its output there.
|
Package autolabel generates the Traefik labels and network wiring a preview service needs, from one short label — and, on a host that runs Loki, the logging block that ships its output there. |
|
cli
`pstack api …` — every HTTP route as a command, generated from `packages/pstack/api/openapi.yaml`.
|
`pstack api …` — every HTTP route as a command, generated from `packages/pstack/api/openapi.yaml`. |
|
cloudinit
Package cloudinit is `pstack cloud-init` — fill the cloud-config template and print a ready-to-boot user-data file.
|
Package cloudinit is `pstack cloud-init` — fill the cloud-config template and print a ready-to-boot user-data file. |
|
compose
Package compose is the Docker Compose invocation.
|
Package compose is the Docker Compose invocation. |
|
config
Package config is the portable host configuration document: everything that makes a pstack host *this* host, in a form that can be carried to a new one.
|
Package config is the portable host configuration document: everything that makes a pstack host *this* host, in a form that can be carried to a new one. |
|
events
Package events is the domain event bus.
|
Package events is the domain event bus. |
|
exec
Package exec runs things.
|
Package exec runs things. |
|
hostvars
Package hostvars is host-level variables and secrets — the GitHub-Actions model, scoped to one host.
|
Package hostvars is host-level variables and secrets — the GitHub-Actions model, scoped to one host. |
|
image
Package image is `pstack build-image` — build the control image from the running binary itself.
|
Package image is `pstack build-image` — build the control image from the running binary itself. |
|
initctl
Package initctl is `pstack init` — stand up the CONTROL stack on a host.
|
Package initctl is `pstack init` — stand up the CONTROL stack on a host. |
|
inspect
The CONTROL STACK's own runtime — traefik, pstack, the optional advanced UI — as an operator's page shows it.
|
The CONTROL STACK's own runtime — traefik, pstack, the optional advanced UI — as an operator's page shows it. |
|
jobs
Package jobs is the in-memory job registry.
|
Package jobs is the in-memory job registry. |
|
js
Package js reproduces the JavaScript primitives the contract leans on.
|
Package js reproduces the JavaScript primitives the contract leans on. |
|
jsonx
Package jsonx is JSON.stringify.
|
Package jsonx is JSON.stringify. |
|
log
Package log is the logging seam: the CLI wants progress on stdout, the API wants the same events captured per job and streamed to a browser, so the orchestrator writes to a Sink and each consumer passes its own.
|
Package log is the logging seam: the CLI wants progress on stdout, the API wants the same events captured per job and streamed to a browser, so the orchestrator writes to a Sink and each consumer passes its own. |
|
loki
Package loki is Loki's settings: what an operator may change, the ranges pstack holds them to, and the bytes they become in control/loki/config.yaml and control/loki/s3-credentials.
|
Package loki is Loki's settings: what an operator may change, the ranges pstack holds them to, and the bytes they become in control/loki/config.yaml and control/loki/s3-credentials. |
|
nodestats
The agent's and the prunes' docker commands, as strings, and the reading of a prune's output.
|
The agent's and the prunes' docker commands, as strings, and the reading of a prune's output. |
|
notify
Package notify delivers domain events to the outside world.
|
Package notify delivers domain events to the outside world. |
|
omap
Package omap is the ordered map the whole compose pipeline runs on.
|
Package omap is the ordered map the whole compose pipeline runs on. |
|
readiness
Package readiness answers "did the stack actually come up?".
|
Package readiness answers "did the stack actually come up?". |
|
redact
Package redact is redaction for anything a human is shown.
|
Package redact is redaction for anything a human is shown. |
|
registries
Package registries is private registry credentials for the control plane.
|
Package registries is private registry credentials for the control plane. |
|
registry
Package registry is the deployment registry — what turns pstack from a CLI into a control plane.
|
Package registry is the deployment registry — what turns pstack from a CLI into a control plane. |
|
routing
CUSTOM ROUTES: a stable alias for a stack.
|
CUSTOM ROUTES: a stable alias for a stack. |
|
scaler
Package scaler adds and removes swarm workers through OpenTofu.
|
Package scaler adds and removes swarm workers through OpenTofu. |
|
scheduler
Package scheduler is sleep and wake-on-call: the SleepIndex (hostname → the deployment the catch-all router's request belongs to), the TrafficMeter (Traefik's per-router counters → "last request"), the tick that applies a spec's `sleep:` policy, Recency (when a deployment was last in use, which the api package's pressure sleep ranks by too), and the "spinning up" page.
|
Package scheduler is sleep and wake-on-call: the SleepIndex (hostname → the deployment the catch-all router's request belongs to), the TrafficMeter (Traefik's per-router counters → "last request"), the tick that applies a spec's `sleep:` policy, Recency (when a deployment was last in use, which the api package's pressure sleep ranks by too), and the "spinning up" page. |
|
settings
Package settings is the handful of host knobs an operator may change at RUNTIME, without restarting the control container.
|
Package settings is the handful of host knobs an operator may change at RUNTIME, without restarting the control container. |
|
share
Package share is share links: a signed, expiring, READ-ONLY grant to one deployment.
|
Package share is share links: a signed, expiring, READ-ONLY grant to one deployment. |
|
signals
Package signals answers the two questions something outside pstack asks before it turns a worker machine on or off:
|
Package signals answers the two questions something outside pstack asks before it turns a worker machine on or off: |
|
spec
Package spec parses and validates a `preview.yml` into a resolved Stack.
|
Package spec parses and validates a `preview.yml` into a resolved Stack. |
|
specs
Package specs is the named-spec store — store a spec once, reference it from many deployments.
|
Package specs is the named-spec store — store a spec once, reference it from many deployments. |
|
sso
Package sso is sign-in with the operator's own identity provider.
|
Package sso is sign-in with the operator's own identity provider. |
|
stack
Package stack is lifecycle orchestration.
|
Package stack is lifecycle orchestration. |
|
store
Package store is the persistent state that is not the registry: users, sessions, API tokens, webhook registrations and delivery logs, the terminal audit, host variables, SSO, host settings, Loki's settings, and the custom routes (an alias name -> the deployment it points at).
|
Package store is the persistent state that is not the registry: users, sessions, API tokens, webhook registrations and delivery logs, the terminal audit, host variables, SSO, host settings, Loki's settings, and the custom routes (an alias name -> the deployment it points at). |
|
swarm
Package swarm is Docker Swarm: the compose→swarm conversion, the `docker stack` command lines, the node/join helpers behind the swarm panel, and the line that puts the Loki log plugin on a node.
|
Package swarm is Docker Swarm: the compose→swarm conversion, the `docker stack` command lines, the node/join helpers behind the swarm panel, and the line that puts the Loki log plugin on a node. |
|
terminal
Package terminal is a shell inside a preview container, over a WebSocket.
|
Package terminal is a shell inside a preview container, over a WebSocket. |
|
testfacts
Package testfacts locates packages/conformance/golden/facts — the measured Bun semantics the foundation packages are tested against.
|
Package testfacts locates packages/conformance/golden/facts — the measured Bun semantics the foundation packages are tested against. |
|
upgrade
Package upgrade is `pstack upgrade` — move a host to a new version of pstack.
|
Package upgrade is `pstack upgrade` — move a host to a new version of pstack. |
|
version
Package version answers "which pstack is this" from two sources, in order: the -X flag a release build stamps, else the `version` field of the embedded package.json.
|
Package version answers "which pstack is this" from two sources, in order: the -X flag a release build stamps, else the `version` field of the embedded package.json. |
|
webhooks
Package webhooks is notifier registrations and their delivery log.
|
Package webhooks is notifier registrations and their delivery log. |
|
yamlx
Package yamlx is Bun.YAML.parse.
|
Package yamlx is Bun.YAML.parse. |
|
tools
|
|
|
yamlcat
command
yamlcat parses YAML files with pstack's own parser and prints each one as JSON, one line per file: {"path":…,"json":…} or {"path":…,"error":…}.
|
yamlcat parses YAML files with pstack's own parser and prints each one as JSON, one line per file: {"path":…,"json":…} or {"path":…,"error":…}. |