IF Commons GitHub

logical/services

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-linux-services-profiles FR-003, 0002-linux-services-profiles FR-004, 0002-linux-services-profiles FR-005, 0002-linux-services-profiles FR-006

The requirements of Archon that a profile makes, over the kinds it has (package, directory, file, service), and the text of each file. Nothing here runs a program or reads a machine.

import { postgresRequirements } from "./services.ts";
const r = postgresRequirements({ machine: "olympia", version: 18, port: 5432, listen: ["localhost"] });
r.kind; // "ok"

Source: commons/linux-services/src/logical/services.ts

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

logical.certbotClifunctionno test imports it
function certbotCli(p: CertificateProfile): string

The cli.ini of certbot: the authority, the account's contact, the DNS plugin and where its credentials are.

logical.certificateRequirementsfunctionno test imports it
function certificateRequirements(p: CertificateProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a machine that obtains and renews a certificate.

logical.issueUnitfunctionno test imports it
function issueUnit(p: CertificateProfile): string

The unit that obtains the certificate once, where it is not yet there.

logical.mailNamefunctionno test imports it
function mailName(p: MailRelayProfile): string

The name the machine says in mail: <machine>.<tag>.<domain>.

logical.mailRelayRequirementsfunctionno test imports it
function mailRelayRequirements(p: MailRelayProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a send-only mail relay.

logical.mainCffunctionno test imports it
function mainCf(p: MailRelayProfile): string

Postfix's main.cf of a null client that relays everything over implicit TLS.

logical.mcpAccessRequirementsfunctionno test imports it
function mcpAccessRequirements(p: McpAccessProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a machine that serves a program as a tool server over ssh: the account's .ssh folder and its authorized_keys, which let in only the keys of the profile and only to that program.

logical.mcpAuthorizedKeysfunctionno test imports it
function mcpAuthorizedKeys(p: McpAccessProfile): Result<string, readonly string[]>

The authorized_keys of the account: a line for each key that forces <program> mcp (with --read-only for a key that may only read), and so no shell, no terminal and no forwarding (restrict).

logical.postgresDropInfunctionno test imports it
function postgresDropIn(p: PostgresProfile): string

The drop-in of PostgreSQL's configuration: the port, the addresses, the logs.

logical.postgresRequirementsfunctionno test imports it
function postgresRequirements(p: PostgresProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a PostgreSQL cluster, the one Ubuntu's package makes.

logical.recipientMapfunctionno test imports it
function recipientMap(p: MailRelayProfile): string

Every address of a local account goes to the mailbox of the fleet.

logical.SECRET_PATHSconstno test imports it
const SECRET_PATHS: { readonly mailSasl: "/etc/postfix/sasl_passwd"; readonly cloudflareCredentials: "/etc/letsencrypt/cloudflare.ini"; }

Where the secrets of the services are put on a machine, by the owner and never in the model.

logical.senderMapfunctionno test imports it
function senderMap(p: MailRelayProfile): string

Every sender becomes <user>+<machine>.<tag>@<domain>, as RFC 5233 subaddresses.

certbotClifunctionno test imports it
function certbotCli(p: CertificateProfile): string

The cli.ini of certbot: the authority, the account's contact, the DNS plugin and where its credentials are.

certificateRequirementsfunction
function certificateRequirements(p: CertificateProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a machine that obtains and renews a certificate.

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

issueUnitfunction
function issueUnit(p: CertificateProfile): string

The unit that obtains the certificate once, where it is not yet there.

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

mailNamefunctionno test imports it
function mailName(p: MailRelayProfile): string

The name the machine says in mail: <machine>.<tag>.<domain>.

mailRelayRequirementsfunction
function mailRelayRequirements(p: MailRelayProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a send-only mail relay.

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

mainCffunction
function mainCf(p: MailRelayProfile): string

Postfix's main.cf of a null client that relays everything over implicit TLS.

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

mcpAccessRequirementsfunction
function mcpAccessRequirements(p: McpAccessProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a machine that serves a program as a tool server over ssh: the account's .ssh folder and its authorized_keys, which let in only the keys of the profile and only to that program.

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

mcpAuthorizedKeysfunction
function mcpAuthorizedKeys(p: McpAccessProfile): Result<string, readonly string[]>

The authorized_keys of the account: a line for each key that forces <program> mcp (with --read-only for a key that may only read), and so no shell, no terminal and no forwarding (restrict).

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

postgresDropInfunction
function postgresDropIn(p: PostgresProfile): string

The drop-in of PostgreSQL's configuration: the port, the addresses, the logs.

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

postgresRequirementsfunction
function postgresRequirements(p: PostgresProfile): Result<readonly Requirement[], readonly string[]>

The requirements of a PostgreSQL cluster, the one Ubuntu's package makes.

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

recipientMapfunction
function recipientMap(p: MailRelayProfile): string

Every address of a local account goes to the mailbox of the fleet.

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

SECRET_PATHSconstno test imports it
const SECRET_PATHS: { readonly mailSasl: "/etc/postfix/sasl_passwd"; readonly cloudflareCredentials: "/etc/letsencrypt/cloudflare.ini"; }

Where the secrets of the services are put on a machine, by the owner and never in the model.

senderMapfunction
function senderMap(p: MailRelayProfile): string

Every sender becomes <user>+<machine>.<tag>@<domain>, as RFC 5233 subaddresses.

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

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