IF Commons GitHub

boot

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-boot-command FR-002, 0002-boot-command FR-003, 0002-boot-command FR-004, 0002-boot-command FR-005

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"); // true

Source: commons/archon-boot/src/boot.ts

2 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

variableconst
const variable: (program: string, suffix: "BOOT_ASSETS" | "BOOT_STATE" | "SECRETS") => string

The name of a variable the plugin reads: the program's name in capitals, then the suffix.

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

defaultStateFilefunction
function defaultStateFile(program: string, env: (n: string) => string | undefined): string

The 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).

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

assetsDirfunctionno test imports it
function assetsDir(program: string, given: string, stateFile: string, env: (n: string) => string | undefined): string

The folder of the pinned boot files: given, or the program's variable, or a folder next to the state file.

Preparedtypeno test imports it
type Prepared = { readonly files: readonly string[] };

What prepare wrote.

preparefunctionno test imports it
function 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 it
function 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 it
function disarmAsset(stateFile: string, asset: string): Promise<void>

Disarms an asset.

statusOffunctionno test imports it
function 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.

Titles, headings, exports, tables, columns and requirements. Esc closes.