variableconstconst variable: (program: string, suffix: "BOOT_ASSETS" | "BOOT_STATE" | "SECRETS") => stringThe name of a variable the plugin reads: the program's name in capitals, then the suffix.
The install of a blank machine: what the fleet declares for an asset becomes the autoinstall of its first boot and the playbook it converges itself with, both written as generated files for the owner to commit and sign; the boot server serves them to a machine that network boots, after the owner armed the asset. The state of the server (the arming tokens) is kept in a file in the person's own configuration folder, never in a repository.
import { defaultStateFile } from "./boot.ts";
defaultStateFile("archon", () => undefined).endsWith("state.json"); // truevariableconstconst variable: (program: string, suffix: "BOOT_ASSETS" | "BOOT_STATE" | "SECRETS") => stringThe name of a variable the plugin reads: the program's name in capitals, then the suffix.
defaultStateFilefunctionfunction defaultStateFile(program: string, env: (n: string) => string | undefined): stringThe file the boot server keeps its state in: the program's variable, or a file in the person's own configuration folder (outside any repository, because it holds the tokens of an arming).
assetsDirfunctionno test imports itfunction assetsDir(program: string, given: string, stateFile: string, env: (n: string) => string | undefined): stringThe folder of the pinned boot files: given, or the program's variable, or a folder next to the state file.
Preparedtypeno test imports ittype Prepared = { readonly files: readonly string[] };What prepare wrote.
preparefunctionno test imports itfunction prepare(asset: string, s: BootSubject): Promise<Result<Prepared, string>>Renders the install and the playbook of an asset into the fleet's folder.
armAssetfunctionno test imports itfunction armAsset(stateFile: string, asset: string, o: { readonly confirmDestroy: boolean; readonly mac?: string | undefined; readonly now?: string | undefined; }): Promise<string>Arms an asset for one install and gives its token.
disarmAssetfunctionno test imports itfunction disarmAsset(stateFile: string, asset: string): Promise<void>Disarms an asset.
statusOffunctionno test imports itfunction statusOf(stateFile: string, dir: string, profile: BootProfile): Promise<{ readonly armed: readonly string[]; readonly installed: readonly string[]; readonly last: readonly string[]; readonly missing: readonly string[]; }>What status shows.