IF Commons GitHub

governance/profiles

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-linux-services-profiles FR-001, 0002-linux-services-profiles FR-007

The profiles of the services a machine of a small fleet runs, and the rules their fields obey. A profile is data: it carries no secret and runs nothing.

import { PORTS, NAME } from "./profiles.ts";
NAME.test("prime"); // true
PORTS.min; // 1024

Source: commons/linux-services/src/governance/profiles.ts

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

governance.DOMAINconstno test imports it
const DOMAIN: RegExp

A DNS name: labels of letters, digits and dashes, at least two of them.

governance.MAILBOXconstno test imports it
const MAILBOX: RegExp

A mailbox: local part and domain, no display name.

governance.MARKERconstno test imports it
const MARKER: "managed by archon"

The marker a DNS record of a profile carries in its comment, so that a plan removes only what a profile made.

governance.NAMEconstno test imports it
const NAME: RegExp

A name of a machine, a cluster or a mailbox tag: lowercase letters, digits and dashes, starting with a letter.

governance.PORTSconstno test imports it
const PORTS: { readonly min: 1024; readonly max: 65535; }

The ports a service of a machine listens on, without the privileged ones.

governance.CertificateProfiletypeno test imports it
type CertificateProfile = { readonly machine: string; /** The names the certificate is for, the first is its name on… (485 characters)
type CertificateProfile = {
  readonly machine: string;
  /** The names the certificate is for, the first is its name on the disk. */
  readonly names: readonly string[];
  /** The address of the account's mail, where the authority writes. */
  readonly contact: string;
  /** The ACME directory: Let's Encrypt's production unless the profile says another. */
  readonly directory: string;
  /** The DNS plugin of certbot that answers the challenge. */
  readonly dns: "cloudflare";
};

A certificate by DNS-01 from an ACME authority.

governance.DnsProfiletypeno test imports it
type DnsProfile = {
  readonly zone: string;
  readonly records: readonly DnsRecord[];
};

The records a profile wants in a zone, and the names it claims (a name it lists is its own whatever its records say).

governance.DnsRecordtypeno test imports it
type DnsRecord = {
  readonly type: "A" | "AAAA" | "CNAME" | "TXT" | "MX";
  readonly name: string;
  readonly content: string;
  readonly ttl: number;
  readonly proxied: boolean;
};

A record of a DNS zone.

governance.MailRelayProfiletypeno test imports it
type MailRelayProfile = { readonly machine: string; /** The name the machine says in the mail it sends, `<machine>.<… (505 characters)
type MailRelayProfile = {
  readonly machine: string;
  /** The name the machine says in the mail it sends, `<machine>.<tag>.<domain>`: given as its parts. */
  readonly tag: string;
  readonly domain: string;
  /** Where mail for local accounts (root, ops, cron) goes. */
  readonly mailbox: string;
  /** The relay, `host:port` over implicit TLS. */
  readonly relay: string;
  /** The user name of SASL; the secret is a file on the machine, and only its path is here. */
  readonly saslUser: string;
};

A send-only mail relay: Postfix as a null client that sends everything through the relay of the fleet's mail provider.

governance.McpAccessProfiletypeno test imports it
type McpAccessProfile = {
  readonly machine: string;
  /** The account the keys log in as. */
  readonly user: string;
  /** The program the forced command runs. */
  readonly program: string;
  readonly keys: readonly { readonly name: string; readonly publicKey: string; readonly role: "read-only" | "full"; readonly from?: readonly string[] }[];
};

The program a machine serves as a tool server over ssh (MCP), and the keys that may call it: each key runs only <program> mcp, with --read-only where it may only read.

governance.PostgresProfiletypeno test imports it
type PostgresProfile = {
  /** The subject (machine) it is for. */
  readonly machine: string;
  /** The major version: the archive's own (18 on Ubuntu 26.04). */
  readonly version: number;
  readonly port: number;
  /** The addresses it listens on: `localhost` or addresses of the machine. */
  readonly listen: readonly string[];
};

A PostgreSQL cluster, the one Ubuntu's package makes (<version>/main).

DOMAINconstno test imports it
const DOMAIN: RegExp

A DNS name: labels of letters, digits and dashes, at least two of them.

MAILBOXconstno test imports it
const MAILBOX: RegExp

A mailbox: local part and domain, no display name.

MARKERconstno test imports it
const MARKER: "managed by archon"

The marker a DNS record of a profile carries in its comment, so that a plan removes only what a profile made.

NAMEconstno test imports it
const NAME: RegExp

A name of a machine, a cluster or a mailbox tag: lowercase letters, digits and dashes, starting with a letter.

PORTSconstno test imports it
const PORTS: { readonly min: 1024; readonly max: 65535; }

The ports a service of a machine listens on, without the privileged ones.

CertificateProfiletypeno test imports it
type CertificateProfile = { readonly machine: string; /** The names the certificate is for, the first is its name on… (485 characters)
type CertificateProfile = {
  readonly machine: string;
  /** The names the certificate is for, the first is its name on the disk. */
  readonly names: readonly string[];
  /** The address of the account's mail, where the authority writes. */
  readonly contact: string;
  /** The ACME directory: Let's Encrypt's production unless the profile says another. */
  readonly directory: string;
  /** The DNS plugin of certbot that answers the challenge. */
  readonly dns: "cloudflare";
};

A certificate by DNS-01 from an ACME authority.

DnsProfiletypeno test imports it
type DnsProfile = {
  readonly zone: string;
  readonly records: readonly DnsRecord[];
};

The records a profile wants in a zone, and the names it claims (a name it lists is its own whatever its records say).

DnsRecordtypeno test imports it
type DnsRecord = {
  readonly type: "A" | "AAAA" | "CNAME" | "TXT" | "MX";
  readonly name: string;
  readonly content: string;
  readonly ttl: number;
  readonly proxied: boolean;
};

A record of a DNS zone.

MailRelayProfiletypeno test imports it
type MailRelayProfile = { readonly machine: string; /** The name the machine says in the mail it sends, `<machine>.<… (505 characters)
type MailRelayProfile = {
  readonly machine: string;
  /** The name the machine says in the mail it sends, `<machine>.<tag>.<domain>`: given as its parts. */
  readonly tag: string;
  readonly domain: string;
  /** Where mail for local accounts (root, ops, cron) goes. */
  readonly mailbox: string;
  /** The relay, `host:port` over implicit TLS. */
  readonly relay: string;
  /** The user name of SASL; the secret is a file on the machine, and only its path is here. */
  readonly saslUser: string;
};

A send-only mail relay: Postfix as a null client that sends everything through the relay of the fleet's mail provider.

McpAccessProfiletypeno test imports it
type McpAccessProfile = {
  readonly machine: string;
  /** The account the keys log in as. */
  readonly user: string;
  /** The program the forced command runs. */
  readonly program: string;
  readonly keys: readonly { readonly name: string; readonly publicKey: string; readonly role: "read-only" | "full"; readonly from?: readonly string[] }[];
};

The program a machine serves as a tool server over ssh (MCP), and the keys that may call it: each key runs only <program> mcp, with --read-only where it may only read.

PostgresProfiletypeno test imports it
type PostgresProfile = {
  /** The subject (machine) it is for. */
  readonly machine: string;
  /** The major version: the archive's own (18 on Ubuntu 26.04). */
  readonly version: number;
  readonly port: number;
  /** The addresses it listens on: `localhost` or addresses of the machine. */
  readonly listen: readonly string[];
};

A PostgreSQL cluster, the one Ubuntu's package makes (<version>/main).

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