Choseninterfaceno test imports itinterface ChosenWhich model applies, and why.
| Member | Type | What it is |
|---|---|---|
mode | Mode | |
why | string |
The server model of arcactl (commons data 0047-arcactl-init FR-004, FR-005): how it runs where no person is there, in a pipeline, a deploy step, a container or a scheduled job. Everything is given by the environment and the arguments; nothing is asked and no file of a home directory is written; a secret is given as a variable or as a file named by <NAME>_FILE (the convention of Docker and Kubernetes secrets), never both. Which model applies is decided by what is said (an option, ARCA_MODE), then by what the environment shows (CI, no terminal), and only then does a person at a terminal get the workstation.
Choseninterfaceno test imports itinterface ChosenWhich model applies, and why.
| Member | Type | What it is |
|---|---|---|
mode | Mode | |
why | string |
mayAskconstconst mayAsk: (mode: Mode) => booleanWhether the command may ask a person a question: only in the workstation mode.
mayWriteHomeconstconst mayWriteHome: (mode: Mode) => booleanWhat a mode may do: a server writes no file of a home directory and asks no question.
Modetypeno test imports ittype Mode = "workstation" | "server";The two ways arcactl runs.
modeOffunctionfunction modeOf(argv: readonly string[], env: Readonly<Record<string, string | undefined>>, tty: boolean): ChosenChooses the model.
| Parameter | What it is |
|---|---|
argv | the arguments |
env | the environment |
tty | whether input and output are a terminal |
Returns: the mode and why
Readtypeno test imports ittype Read = (path: string) => string;Reads a file; a test gives its own.
secretOffunctionfunction secretOf(env: Readonly<Record<string, string | undefined>>, name: string, read?: Read): Result<string | undefined, string>A secret given by the environment: the variable NAME, or the file named by NAME_FILE.
| Parameter | What it is |
|---|---|
env | the environment |
name | the variable's name |
read | how a file is read |
Returns: the secret (a file's last line ending is not part of it), none where neither is given, or why it cannot be had
ServerSettingsinterfaceno test imports itinterface ServerSettingsWhat a server run is given by its environment.
| Member | Type | What it is |
|---|---|---|
url | string | undefined | |
sealKey | string | undefined | |
unlockSecret | string | undefined | |
approve | string | undefined | The hash of a proposal that a person approved. |
log | "json" | "text" |
serverSettingsfunctionfunction serverSettings(env: Readonly<Record<string, string | undefined>>, read?: Read | undefined): Result<ServerSettings, readonly string[]>The secrets and settings of a server run, or every reason they cannot be had.