diff --git a/00-META/glossary.md b/00-META/glossary.md index 6d7039e4..6294ab80 100644 --- a/00-META/glossary.md +++ b/00-META/glossary.md @@ -1137,7 +1137,7 @@ becomes a message). **Decided by** ADR 0227, 0231, 0240, 0252, 0283, 0564, 0668. **Purpose.** To make every node and module reachable by name where it should be, and unreachable where it should not. **Recorded by** the controller. **Upstream of** Provisioning and Health and repair. -**Decided by** ADR 0007, 0117, 0138, 0223, 0226, 0247, 0634. +**Decided by** ADR 0007, 0117, 0138, 0223, 0226, 0247, 0634, 0687. **Uses:** node, machine, assignment and endpoint. - **private network** — the mesh's own encrypted network between its nodes, on which every node has an @@ -1155,6 +1155,11 @@ it should not. **Recorded by** the controller. **Upstream of** Provisioning and lists only the mesh's resolvers (ADR 0223), or, where it holds one, its own resolver, which asks them. **uplink** — a node's connection to the outside network, the node seat `node-uplink` (ADR 0117). **hostname** — a node's own name, the node seat `node-hostname`. All three seats are of this domain. +- **sign-in page** — the page a network shows before it lets traffic out, until a person signs in (ADR 0687). The + node seat `node-uplink` says it with its events `sign-in-asked` and `sign-in-ended`, and the holder of + `node-display-session` opens it in the person's browser. In this sense "portal" and "login page" are not used + either (see [Homonyms](#homonyms)). + *Not:* ~~captive portal~~ - **split DNS** — resolving names by domain on one machine: a VPN's domains through the VPN's servers over its link, every other name through the mesh's resolvers. The provision `split-dns`, provided by the holder of the node seat `node-resolver`, the machine's **own resolver**, which exists only where @@ -1525,6 +1530,10 @@ renaming one sense, the old sense moves to a *Not:* line and becomes mechanical. | push | the controller giving nodes their declarations, until release 6 | **send** (verb `push`) | Core | | | a git push | **git push** | The record | | | a phone notification | **push notification** | Operator and conversation | +| portal | the page a network shows before it lets traffic out | **sign-in page** | Connectivity | +| | a web page that gathers one service for a person, such as the bookkeeping portal (design 62) | the page's own name | Module | +| login page | the page a network shows before it lets traffic out | **sign-in page** | Connectivity | +| | an application's own form for a person's credentials | **login page** of that application | Identity and access | | release | a person letting a held delivery go on | **release** | Delivery | | | one milestone built, checked and delivered as one (playbook 07; releases 1 to 6 of ADR 0429) | **release** of a milestone | The record | | | taking a consumer off a licence | **unbind** (verb `release`, to rename) | Identity and access | diff --git a/03-DESIGN/01-to-be/08-connectivity.md b/03-DESIGN/01-to-be/08-connectivity.md index f986b488..9250aedb 100644 --- a/03-DESIGN/01-to-be/08-connectivity.md +++ b/03-DESIGN/01-to-be/08-connectivity.md @@ -22,8 +22,11 @@ code: - mesh-host internal/apply (the service that reflects a rule set; a whole file handed to its new owner) - mesh-controller cmd/mesh-controller/nodes.go (a token issued for a machine's tunnel key, ADR 0169) - mesh-host cmd/mesh-host/join_tunnel.go (a machine joins through the tunnel, ADR 0169) -updated: 2026-10-14 + - mesh-networking mesh-connectivity-contracts (the seats node-uplink and node-resolver, ADR 0687) + - mesh-catalog modules/networkmanager, modules/systemd-resolved, modules/i3 (a network's sign-in page, ADR 0687) +updated: 2026-11-24 decisions: + - "ADR 0687" - "ADR 0241" - "ADR 0117" - "ADR 0340" @@ -341,55 +344,16 @@ nothing needs a name before the link, and a fallback nothing needs is a path not ### Names, and what a container can see -*2026-08-31, from a container that could not resolve a name every machine could.* - -Internal names are `.internal` — the suffix is the one IANA reserved in 2024, so a name that -leaks into a public resolver fails rather than reaching a stranger's machine. They are computed -centrally, because a name set needs every node at once, and written to each machine's hosts file. - -**A file rather than a resolver**, and the reasoning holds: it works on every Linux, needs no -package, and has no failure mode of its own. The stated trigger for a daemon was *names that are -not one-per-node* — service names, wildcards. - -**But a container does not inherit the machine's names.** It gets its own hosts file holding only -its own hostname. So every name the mesh wrote was invisible to the majority of things that need -one — and *on the machine it always worked*, which is exactly what made it easy to miss. It was -found by a database client on one node failing to resolve another node, on a mesh where both names -were correct and present on both machines. - -**So the mesh gives its names to the containers it declares**, written into each container's own -hosts file by the runtime. That extends the file decision rather than overturning it. Given by the -mesh and not chosen by a module: a module that listed the machines would go stale the day one -joins, and a module that did not would be one whose containers cannot reach anything by name. - -**Superseded for containers by ADR 0148 -(2026-09-30).** Everything above still describes the machine's own roster file, which is how it works -and how it will keep working. It no longer describes containers. - -Copying the roster into each container made the roster part of each container's identity, so one name -moving replaced every container in the mesh — a module assigned on one machine restarted the store, the -registry, the edge and mail on another -([issue 151](../../04-ISSUES/151-a-new-name-recreates-every-container-in-the-mesh/00-report.md)). And it -did not stop the staleness it was meant to: a copy taken at creation is stale the moment the roster -moves, twice found as a container holding an address that had not existed for days -([issues 109](../../04-ISSUES/109-a-container-keeps-the-address-it-was-made-with/00-report.md) -and [135](../../04-ISSUES/135-a-containers-mesh-names-are-not-compared/00-report.md)). - -**A container resolves the mesh's names through its machine's resolver, at the moment it asks, and -nothing is copied.** The resolver is a machine-level process rather than a container, so nothing -circular is being asked for. It was gated on a container being able to reach the resolver from any of -the runtime's networks -([issue 110](../../04-ISSUES/110-a-container-on-the-runtimes-own-network-cannot-reach-the-resolver/00-report.md)), -and landed the day that did, 2026-09-30: the controller writes no mesh name into a container and the node-engine's digest carries only what the module declared for itself. - -The paragraph below states the old boundary, and 0148 deliberately gives it up: a container somebody -started by hand resolves the same names as everything else, because the resolver answers the machine, -not a list of containers. - -**The boundary, which is deliberate and worth stating:** *declared* containers. A container -somebody starts by hand is not the mesh's to configure, and reaching into every container on a -machine — declared or not — is what a nameserver in `resolv.conf` would be for. +Internal names are `.internal`: the suffix IANA reserved in 2024, so a name that leaks into a public resolver +fails rather than reaching a stranger's machine. They are computed centrally, because a name set needs every node at +once. +**A container resolves the mesh's names through its machine's resolver, at the moment it asks, and nothing is +copied** (ADR 0148). The controller writes no mesh name into a container and the node-engine's digest carries only +what the module declared for itself, so a container somebody started by hand resolves the same names as everything +else: the resolver answers the machine, not a list of containers. Copying the roster into each container, as the +mesh did until 2026-09-30, made one moved name replace every container in the mesh and still went stale (issues 151, +109 and 135); it ended the day a container could reach the resolver from any of the runtime's networks (issue 110). ### The mesh's resolvers *2026-10-03, revised 2026-10-05.* **The mesh's names live in one module, held on two machines: the @@ -472,83 +436,13 @@ the `node-hostname` seat's holder and changed through its tools; the controller *Checked by the holder's configuration carrying one forwarding rule per declared zone, and by a push leaving the `hosts` file's operator region byte for byte.* -*What follows describes the per-node resolver this replaces — how it was built and why the roles were -split. The split stands; the serving role's scope is what moved.* - -### The resolver, built - -*2026-08-31.* **A service is reached at `..internal`** — the first label is the -service, the rest is the node — so what resolves is *anything under a node's name*, going to that -node. What routes it once it arrives is a proxy's, and stays separate. - -*2026-09-30.* **So the node in a route's internal name is the one whose proxy answers it** -(ADR 0151). -Composed from the node the module ran on, the name sent a client to a machine with nothing listening -whenever the proxy ran elsewhere -([issue 139](../../04-ISSUES/139-an-internal-route-name-resolves-to-the-consumers-node/00-report.md)); -composed from the serving node, the rule above holds without exception. The public name stays the -module's node's, which is where the operator put it. - -**The mesh writes the data and runs no daemon.** One wildcard per machine, from the same set that -writes the `hosts` file. A resolver is third-party software and runs *on* the mesh rather than being -*of* it: the mesh has no business shipping one, choosing which one, or knowing its configuration -language. Swapping dnsmasq for unbound changes that module and nothing in the controller. - -**Two roles, two claims, because they are different things.** systemd-resolved cannot answer a -wildcard at all — it routes the mesh's suffix to something that can. Treating serving and asking -as one role produces a module that cannot work. - -| | claims | | -|---|---|---| -| serving | `the-dns-port` | answers the wildcards | -| asking | `the-resolver-configuration` | decides what the machine asks | - -So *which* resolver is not a mesh-wide decision. One machine can use what systemd already owns and -another can run dnsmasq, and two of either on one machine is refused rather than fought over. - -**Two things a resolver must not do**, both found by a machine rather than by reasoning: - -- **Take an address something else holds.** systemd-resolved holds `127.0.0.53` *and* `127.0.0.54`. -- **Read `resolv.conf` for its upstreams.** Whatever points a machine at the mesh writes the - resolver's own address there, so it becomes its own upstream and every query it cannot answer - loops until its receive queue fills. It needs no upstream: only the mesh's suffix is routed to - it. - -*Checked on two machines, through the path an application takes — nsswitch, files, then DNS — -because the module deciding what the machine asks is half of what is being tested and only that -path goes through it.* - -**That is now the second reason to want a resolver**, and it is a different one from the trigger -above: - -| | | -|---|---| -| names that are not one-per-node | a service named under a machine — `postgres.novox.internal` | -| containers the mesh did not declare | anything a person or another tool starts on a node | - -### Which resolver is not a question the mesh answers - -*Written 2026-08-31, after treating it as open when it had been decided two days earlier.* - -**A resolver takes over `/etc/resolv.conf`, which is a singular resource, so it is a claim** — -ADR 0009 lists it in the table beside the seat -and pid 1. Choosing between resolved, dnsmasq and unbound is **assigning a module**, per machine, -and two of them cannot both be assigned there: - -> `resolved-config and dnsmasq both claim "/etc/resolv.conf", and only one thing may hold it per node` - -So there is nothing global to settle and nothing for the mesh to guess. One machine can use what -systemd already owns and another can run dnsmasq, and neither has to know about the other. - -**What the mesh contributes is the part only it can know**: which machines exist and where. That -is `mesh-resolver`, which writes one file and holds no claim, because writing a file takes nothing -over. A daemon module requires that data and claims the resolver — so swapping the daemon changes -that module and nothing else. - -**This was recorded on 2026-08-29 and reopened as an unanswered question on the 31st.** Which is -the argument for the table in ADR 0009 being a table: the pattern is only obvious once seen, and -the cost of not seeing it is inventing a mechanism that already exists. - +**Two things a resolver must not do**, both found by a machine rather than by reasoning: take an address something +else holds (systemd-resolved holds `127.0.0.53` and `127.0.0.54`), and read `/etc/resolv.conf` for its upstreams, +since whatever points a machine at the mesh writes the resolver's own address there and every question it cannot +answer then loops until its receive queue fills. *Which* resolver program a machine runs is not a mesh-wide +question: a resolver takes over a singular resource, so it is a claim, and choosing one is assigning its module +(ADR 0009). The per-node resolver and its two seats, `the-dns-port` and `the-resolver-configuration`, that this +section once described are retired (ADR 0194, ADR 0220, ADR 0223). ### The mesh resolves only its own names; a public name resolves publicly **The mesh's resolver holds each node's internal domain and nothing else** — `.internal` and @@ -563,36 +457,13 @@ mesh, a routed service is reached, and certified by the internal authority, unde and on a machine by asking its resolver for a public name the mesh serves: the answer is the public address.* -*What follows is how the mesh got here, kept because the reasoning it rejects is the expensive half to -rediscover.* - -*2026-09-09, found by an internal certificate authority that could not issue.* The mesh writes every -`.internal` name into every declared container and treats the public names a proxy serves as a -separate matter — *what routes it once it arrives is a proxy's, and stays separate*, above. That -holds for a client dialling by internal name. It does not hold for anything **inside** the mesh that -must reach a public name, and the first such thing to appear was the internal issuer of §5. - -**An issuer validates by connecting to the name it is certifying.** Asked for a certificate for a -routed public name, the internal authority accepted the order, offered a challenge, and then could -not connect: nothing in the mesh resolved that name, so the challenge had no target. A name the mesh -can reach from the outside but cannot resolve from the inside is a name it cannot certify with an -authority of its own. - -**So a granted route is published into internal resolution as well** — the routed name to the node -that serves it, mesh-wide, by the same mechanism that writes the node names — and as itself: a routed -name has no mesh form, and the suffixed alias the roster once added beside it resolved to a refusal -([issue 157](../../04-ISSUES/157-a-routed-names-internal-alias-is-served-by-nothing/00-report.md)). It is *given by the -mesh, not chosen by a module*, for the same reason the node names are: a module listing the routes -would go stale the day one changes. The mesh propagates the names it was told to serve and still -knows nothing about what they mean -(ADR 0066). - -*2026-10-03, withdrawn.* Publishing public names with private answers turned every resolver that also -serves a LAN into an outage for that LAN's non-members — a phone was handed the control-node's tunnel -address for the mail server — while every check, run from a member, passed. Its reason had gone: routes -have internal names since ADR 0151, and the proxy certifies public names from a public authority and -internal names from the internal one. Superseded by the rule at the head of this section -(ADR 0191). +*How it got here, kept because the reasoning it rejects is the expensive half to rediscover.* On 2026-09-09 an +internal issuer could not certify a routed public name, because nothing inside the mesh resolved it and an issuer +validates by connecting to the name; so every granted route was published into internal resolution with a private +answer. On 2026-10-03 that was withdrawn (ADR 0191): every resolver that also serves a LAN became an outage for the +LAN's other machines (a phone was handed the control-node's tunnel address for the mail server) while every check, +run from a member, passed; and its reason had gone, since routes have internal names (ADR 0151) and the proxy +certifies public names from a public authority and internal names from the internal one. ## 3 — Exposure @@ -1121,6 +992,46 @@ against today's behaviour, where both are always composed; an unrouted endpoint named; an assignment naming an endpoint the module does not declare refused where it is said; and a silent assignment rendering byte-identically to today. +## 7 — A network's sign-in page + +*2026-11-24, ADR 0687.* A network that lets traffic out only after a person signs in answers every plain http +request with its **sign-in page**. The network manager finds such a network itself; on the desktop the mesh composes +nothing showed the page, so the network looked broken. Now it opens by itself, the same for every network (none is +named anywhere, ADR 0687 §6); signing in stays the person's. + +```mermaid +flowchart LR + nm[the network manager's rating] -->|changes| up[node-uplink's holder] + up -->|uplink-names: its check's host| res[node-resolver] + res -->|the guard, every round| link[the link carrying the default route] + up -->|sign-in-asked, sign-in-ended| fam[(node-uplink.events, 7 days)] + fam --> ds[node-display-session's holder] + ds -->|open| browser[the person's browser] + ds -->|send| note[node-notifier] +``` + +- **The uplink says it** (ADR 0687 §1, §3): the node seat `node-uplink` gains the events `sign-in-asked` and + `sign-in-ended`, in the family `node-uplink.events`, published by its holder from the network manager's own rating + as it changes, never on a timer. Both are optional for a holder. +- **The check resolves through the network it tests** (ADR 0687 §2): the node seat `node-resolver` gains the verb + `uplink-names`; its guard answers those names over whichever link carries the default route, so on a machine with + its own resolver a working network is rated fully connected again and a network with a sign-in page is rated as one + (issue 960). +- **The session opens it** (ADR 0687 §4, §5): the node seat `node-display-session` gains the verb `open`, an http + or https address in the person's default browser; its holder hears `sign-in-asked` for its own machine, opens the + page and tells the person why through `node-notifier`, and tells them again when the network is open. A session + that starts while the machine is still behind the page opens it then (issue 935, design 42). + +**Acceptance tests** (ADR 0687, *How it is checked*): + +1. *Live, on the laptop, on a working network:* the network manager rates it fully connected and the wifi link's + default route carries no 20000 penalty (`/node-resolver.routes` shows the check's host on that link). +2. *Live, on the laptop, at the next join of a network with a sign-in page:* the uplink holder's journal shows the + rating PORTAL, the page opens within seconds with a notification saying why, and after signing in a second one + says the network is open. If the journal shows LIMITED instead, ADR 0687's assumption does not hold: the record + is amended, tracked by issue 960. +3. *Unit and integration:* the milestone part's tests pass within each module's budget. + ## The five through the network layers *2026-10-09. A reading aid: it decides nothing and states no rule. Each claim names the section or the @@ -1243,16 +1154,16 @@ The list is worth having in one place, because it is most of the argument: - **The RFC1918 inference**, and the lab substitution that existed to satisfy it. - **`scope:`**, and the class of manifest key that means nothing. -## Open +## Milestones -- **One resolver (ADR 0194).** *Correction of fact, - 2026-10-05:* no node holds `node-dns-resolver` any more, and - ADR 0220 deletes the seat. What stood here before: *"Not built: every node still runs - `node-dns-resolver`. The migration's four steps are in the record, in order."* Nor did it - stay true that *"the workstation moves to the one resolver only once"* zones and the `hosts` file's - holder (ADR 0199) - exist: every node, the workstation included, asks the one resolver, and every node holds - `node-hosts-file`. +| milestone | what it builds | part | state | +|---|---|---|---| +| sign-in-page | a network's sign-in page opens by itself (ADR 0687), closing issues 960 and 935 | [08-milestones/sign-in-page.md](08-milestones/sign-in-page.md) | designed | + +The sections above were built before designs were cut into milestone parts; their remaining lines move into a part +of their own at their next amendment (playbook 02, *The shape of a design*). + +## Open - ~~**What happens when the hub is down.**~~ **Resolved** by ADR 0006, together with `06`'s @@ -1296,15 +1207,4 @@ it. found configuration is kept only until the take is proven — the found unit down, the mesh's interface up and handshaking with a peer. Then it is removed from where the found unit reads it (its original stays kept), the hold ends, and the predecessor's tunnel cannot be raised again by -anything but a person restoring it by hand. Undeclaring the private network does not bring it back. -## The bus is NATS - -*2026-09-23, ADR 0106. Architecture to be written -before code; this section names the shape only.* - -Every link the mesh has rides NATS subjects; durability is JetStream's; a module's account is a -NATS account with permissions derived from `emits`/`consumes`, declared as configuration the node-engine -writes and the server reloads. The sdk's contract is unchanged. The adopted AMQP broker stays as -the predecessor's compatibility broker until its last client is gone. Built in the lab beside the -migration; cut over in one switch-over after the core; the person's client is designed on it. diff --git a/03-DESIGN/01-to-be/08-milestones/sign-in-page.md b/03-DESIGN/01-to-be/08-milestones/sign-in-page.md new file mode 100644 index 00000000..700d14ae --- /dev/null +++ b/03-DESIGN/01-to-be/08-milestones/sign-in-page.md @@ -0,0 +1,219 @@ +--- +layer: to-be +design: 08 +milestone: sign-in-page +updated: 2026-11-24 +code: [mesh-networking mesh-connectivity-contracts, mesh-contracts, mesh-catalog modules/networkmanager, mesh-catalog modules/systemd-networkd, mesh-catalog modules/systemd-resolved, mesh-catalog modules/i3, mesh-catalog retired-words] +decisions: + - "ADR 0687" + - "ADR 0117" + - "ADR 0247" + - "ADR 0208" + - "ADR 0636" + - "ADR 0613" + - "ADR 0303" +--- + +# Design 08, milestone sign-in-page — a network's sign-in page opens by itself on the person's desktop + +**What it builds.** When the network a machine's default route leaves through asks for a sign-in, the holder of the +node seat `node-uplink` says so as an event; the holder of the node seat `node-display-session` on that machine +opens the network's sign-in page in the person's default browser and tells them why through `node-notifier`; and on a +machine with its own resolver, the network manager's own check resolves through the network it tests, so its rating +means what it says (ADR 0687). The purpose and the whole shape are the main file's, +[§7](../08-connectivity.md#7--a-networks-sign-in-page); the session's side is placed in design 42's phase 2. This part +holds every line the milestone builds, cited as "design 08 sign-in-page §n". It closes issue 960 (§5 to §10, on the +machines where the resolver runs) and issue 935 (§3, §16). + +**Where.** Three repositories, one delivery group with one check: mesh-networking (the contracts module +`mesh-connectivity-contracts`: §1, §2), mesh-contracts (§3) and mesh-catalog (`systemd-resolved` §5 to §9, +`networkmanager` §10 to §14, `systemd-networkd` §15, `i3` §16 to §21, the copy of the retired words §22). **Ordering +edges**, which the delivery plan derives: the three seat definitions before any holder that serves or publishes what +they add, and before any module whose `invokes` or `consumes` names it (the manifest validator refuses a name no +definition holds, design 26); `systemd-resolved` serving `uplink-names` before `networkmanager` calling it (a served +verb); `networkmanager` publishing before `i3` hears (an event; `i3` loses nothing if it comes first, §19). + +**What exists today, and its fate.** `node-uplink`'s definition gives the read verbs `resolvers` and `links` and no +events; `networkmanager`'s `uplink-tools` answers those two and watches nothing: both stay and are written into the +definition as they answer today. `node-resolver` has `routes`, `route` and `unroute`, served by `systemd-resolved`: +they stay. `node-display-session` has `reload`, `workspaces` and `windows`, served by `i3`, whose own tool `i3_exec` +runs any command line in the session: all stay, and `open` is the narrow verb beside `i3_exec` that issue 935 asks for. + +## The seats' definitions + +1. **`node-uplink` is defined whole, with two events in the family `node-uplink.events`** (ADR 0687 §1; ADR 0613 + §1, §3: a seat whose contract changes is defined whole in that change; ADR 0636 §5). In `mesh-connectivity-contracts` + the definition holds the verbs `resolvers` and `links` with their inputs and answers as `networkmanager` answers them + today, the events `sign-in-asked` and `sign-in-ended`, and the family `{name: node-uplink.events, max-age-days: 7}`: + the shared events stream filtered to the seat's subjects, which keeps them 7 days. Each event's subject is + `.` after `mesh.seat.node-uplink.event.`, the `` the publishing node, granted to that node's + account alone. Why the node is in the subject: a hearer filters its own machine's events by subject, and the start + read of §19 takes the last message of each subject. The bodies, each a JSON Schema with every field required: + - `sign-in-asked`: `node` (the node's name), `link` (the interface name of the link the default route leaves + through), `network` (the network's name as the network manager knows it, its connection's name), `address` (an + http or https address, the one to open), `at` (when, RFC 3339 in UTC to the second). + - `sign-in-ended`: `node`, `link`, `network`, `at`, and `why`, one of `signed-in`, `left`, `no-longer-asked`; + `link` and `network` are empty only for a `no-longer-asked` said with no connection active (§12). + + **Both are optional for a holder**: the definition marks neither as required and the manifest validator asks no + holder to publish them; a holder whose network manager cannot tell a sign-in page announces neither and says so in + its README (§15). The conformance fixtures hold one value per event, with documentation names only (§23). Checked + by the indexer's generator test over the definition and the holder's whole-module test matching a published event, + subject and body, against a fixture (design 26). +2. **`node-resolver` is defined whole, with the verb `uplink-names`** (ADR 0687 §2, changing ADR 0247 §10; ADR 0613 + §1, §3; ADR 0636 §5). In `mesh-connectivity-contracts` the definition holds `routes`, `route` and `unroute` as + `systemd-resolved` answers them today, and `uplink-names`, required of every holder as the seat's other verbs are + (ADR 0247 §15): + - input `{names}`: a list of 0 to 8 host names, each a name of 1 to 253 bytes in letters, digits, hyphens and + dots, taken lower-cased. The list replaces what was given before; an empty list takes every name away. + - answer `{names, link, set_at}`: the names now given, the link they are answered over now (empty when no link + carries a default route), and when the list was set. + - refused, naming the name and the reason: a name that is not a host name (a wildcard, a trailing dot, a label over + 63 bytes), the root, the mesh's own domain or a name under it (ADR 0247 §12's rule for `route`, for the same + reason), more than 8 names. + + `routes`'s answer gains `uplink_names` `{names, link}`, so the names and the link they are on are read through the + seat. Why 8: the network manager has one check address; 8 leaves room and keeps the guard's round small. +3. **`node-display-session` is defined whole, with the verb `open`** (ADR 0687 §4, changing ADR 0208 §3; ADR 0613 §1, + §3; ADR 0636 §5). In `mesh-contracts` the definition holds `reload`, `workspaces` and `windows` as `i3` answers them + today, and `open`, required of every holder so that any holder of the display session serves it the same way (ADR + 0687 §4: i3 or sway): + - input `{address}`: the address to open. + - answer `{address, program, command}`: the address opened, the desktop entry that opened it (as + `browser.desktop`), and the first word of that entry's command. + - refused, naming the reason: a scheme other than `http` or `https` (named), no scheme (a file path), no host, an + address over 2048 bytes, a character outside the address characters of RFC 3986 (unreserved, reserved and `%`), + no graphical session running, no default program for the scheme. +4. **No layout of the three seats stays in mesh-sdk** (ADR 0613 §3, §5). A type mesh-sdk still holds for one of + these seats moves into the seat's contract in this milestone, with every importer, and mesh-sdk keeps no copy; the + prepare step names each one it finds, or that it found none. + +## The resolver answers the check's names (`systemd-resolved`) + +5. **`systemd-resolved` serves `uplink-names` on the mesh** (ADR 0687 §2). Its claim of `node-resolver` serves + `uplink-names` beside its three verbs, through the node's tool runner as the operator account, a write escalating + with `sudo -n` as `route` does. It is not served on the machine's socket: its caller is on the bus, and a host name + of the network manager's check is no VPN's data (ADR 0247 §31 to §34 hold for those). +6. **The names are kept in one file the guard reads** (ADR 0687 §2). The verb writes + `/var/lib/node-resolver/uplink-names`, root's, mode 0644, one name per line, whole (written beside and renamed + over), empty for an empty list. The module declares the directory `/var/lib/node-resolver` (root, 0755) as its + resource, so the node-engine removes it, the file with it, when the module leaves; nothing else deletes it. Why a + file on the machine: the guard, as root, reads only the machine and resolved, as it does today; the file holds + across a restart of resolved, of the guard and of the machine, and the caller states the names again at each of its + own starts (§10). +7. **The guard gives the names to the link that carries the default route, every round** (ADR 0687 §2, changing + ADR 0247 §16). In each round of its pass over links (every 5 s, the round issue 1981's fallback runs in), the guard + reads the file and finds the link carrying the default route: the kernel's IPv4 default route with the lowest + metric, or the IPv6 one when there is no IPv4 default, never the private network's interface and never a link + `route` routed. It sets that link's domains, through resolved, to the domains the link has plus one routing-only + domain `~` per name, keeping every search domain and routing domain it has; and it takes the names off any + other link it gave them to. A round in which they are in place changes nothing. It never sets a link's servers, its + default route for names, its addresses or its routes (ADR 0117 §13, §14; ADR 0247 §13): the link stays one with + servers of its own that the guard counts its own, so issue 1981's fallback holds for it as before. It writes a + journal line when the link it gives the names to changes and when the names change, never every round. +8. **Its tests** (ADR 0687, *How it is checked*, clause 2), unit, within the module's budget: the names given are + answered over the link that carries the default route, and over the new one after that route moves to another + link, the old one losing them; the link keeps its search domains; a link that has only those names is still given + its default route back while the mesh's resolvers are silent (issue 1981's AC1 still passes); each refusal of §2; + `routes` answers `uplink_names`. +9. **Its README** says the verb, the file, the guard's new duty and that `uplink-names` sets only how resolved answers + names over a link, never the link. + +## The uplink says it (`networkmanager`) + +10. **`uplink-tools` gives the resolver its check's host name** (ADR 0687 §2). At its start it reads the network + manager's check address (`ConnectivityCheckUri`, over D-Bus) and asks `mesh-module-assigner.assignments` with its + own node and `seats`; where `node-resolver` is held on its node, it calls `/node-resolver.uplink-names` with + the address's host name, or with an empty list when the address is empty. It calls again when the address changes + (§11's signal). A failed call is written to its journal with the reason and not repeated on a timer; the names of + the last call stand in the resolver's file (§6). Where no holder of `node-resolver` runs it calls nothing: the + machine's resolver file lists the mesh's resolvers, through which the check already resolves. Its manifest + `invokes` `seat:mesh-module-assigner.assignments` and `seat:node-resolver.uplink-names`. +11. **`uplink-tools` watches the network manager's rating as it changes** (ADR 0687 §3). It hears the network + manager's `PropertiesChanged` signal on the system bus for `Connectivity`, `PrimaryConnection`, + `ConnectivityCheckEnabled`, `ConnectivityCheckAvailable` and `ConnectivityCheckUri`, an event the network manager + sends; nothing runs on a timer, and the check itself stays the network manager's. It writes every rating change it + hears to its journal: the old rating, the new one, the connection's name. It runs for as long as the tool runner + runs its bundle, as `i3`'s watcher does. +12. **When it publishes** (ADR 0687 §3). It keeps in memory whether a sign-in is asked, and for which connection: + - the rating becomes PORTAL while the check is on and a connection is active, and no sign-in is asked: one + `sign-in-asked` for that connection, `address` the check address; while it stays PORTAL nothing more; + - a sign-in is asked and the rating becomes FULL: `sign-in-ended` with `signed-in`; + - a sign-in is asked and the active connection goes or is replaced: `sign-in-ended` with `left`, for the old + connection; then, when the rating is PORTAL for the new one, `sign-in-asked` for it; + - a sign-in is asked and the rating becomes anything else (NONE, LIMITED, UNKNOWN, the check being switched off + included): `sign-in-ended` with `no-longer-asked`. Why the switch-off ends it: a kept `sign-in-asked` must never + stand for a page that is no longer asked (§19 reads the latest one); + - **at its own start**: with the check on, `sign-in-asked` when the rating is PORTAL, otherwise `sign-in-ended` + with `no-longer-asked`, for the active connection or with an empty `link` and `network` when none is active; + - with the check off (not enabled, or not available) it publishes nothing, at its start and after. + + `link` is the interface of the active connection's first device, `network` its connection's name, `at` the + machine's clock. A check address that is not http or https publishes nothing and is written to its journal. +13. **Its README** says that it announces the two events from the network manager's own rating, that with the network + manager's check switched off it announces neither, and that it calls `uplink-names` where a holder of + `node-resolver` runs on its machine and nowhere else (ADR 0687 §2, §3). Its review reads it. +14. **Its tests** (ADR 0687, *How it is checked*, clauses 2 and 3), unit, with a stand-in of the network manager's + D-Bus signals: each line of §12, one `sign-in-asked` per entry into PORTAL carrying the check address; nothing + with the check off; no timer; `uplink-names` called at its start and on a changed address, and not called where + no holder of `node-resolver` runs. +15. **`systemd-networkd`'s README says it announces neither event** (ADR 0687 §1): systemd-networkd cannot tell a + sign-in page. Its review reads it. + +## The session opens it (`i3`) + +16. **`i3` serves `open`** (ADR 0687 §4). Its claim of `node-display-session` serves `open` beside its three verbs, + as the tool `node-display-session.open`. It checks the address by §3's refusals first; then it asks + `xdg-mime query default x-scheme-handler/` in the session's environment (the words its `desktop` package + reads) for the person's default program, refusing when there is none; then it starts `xdg-open` with the address, + single-quoted, as i3's child through i3's IPC `exec`, so the browser runs as the person in their session, as + `i3_exec` starts a program. It answers §3's `{address, program, command}`, the command read from the entry's + `Exec` line in the XDG data directories. With no graphical session it refuses, as its other tools answer. Its + manifest declares the package `xdg-utils` present (ADR 0303 §2). Why §3 refuses so much: any caller can hand + `open` an address, and the only address characters it passes to i3's command line are ones a shell does not read. +17. **`i3` opens the sign-in page when it hears `sign-in-asked` for its own machine** (ADR 0687 §5). Its manifest + `consumes` `node-uplink.sign-in-asked` and `node-uplink.sign-in-ended`, filtered to its own node's subjects, and + `invokes` `seat:node-notifier.send`, which it calls on its own node. On `sign-in-asked` with `at` after the + machine's last boot (the kernel's boot time) and a graphical session running, it opens the address through its + own `open` and sends `{summary: "This network asks you to sign in", body: ": its sign-in page is open in + .", app_name: "mesh", category: "network"}`. When `open` refuses, it sends the same summary with urgency + `critical` and the body ": the page did not open (); open
in a browser.": failure is + loud. One published before the boot, or heard with no session running, it acknowledges and acts on in no other + way; §19 opens the page when a session starts. It remembers the stream sequence of the last `sign-in-asked` it + acted on and never acts on one twice. +18. **`i3` says when the network is open** (ADR 0687 §5). On `sign-in-ended` with `signed-in`, published after the + machine's last boot, with a session running, it sends `{summary: "The network is open", body: ": signed + in.", app_name: "mesh", category: "network"}`; with `left` or `no-longer-asked` it says nothing. +19. **`i3` reads the latest kept sign-in event when the person's session starts** (ADR 0687 §5). It hears logind's + `SessionNew` signal on the system bus; for a session of the operator account of type `x11`, it waits for that + session's i3 IPC socket to answer, woken by the kernel's file events on the folder i3 makes it in, for at most 60 + s, and past that writes to its journal that the start read was skipped. Then it reads the family: an ordered + consumer on the shared events stream, filtered to `sign-in-asked.` and `sign-in-ended.` of its own + node, delivering the last message of each subject; the later of the two by stream sequence is the latest. When + that is a `sign-in-asked` with `at` after the machine's last boot, it opens the page and tells the person as §17 + does; otherwise nothing. It asks no verb. Its account is granted that read with its `consumes` (the grants part); + where the grants part does not derive it yet, that is built in this milestone. +20. **Its README** says the verb `open` and its refusals, the sign-in reaction of §17 and §18, the start read and the + package. +21. **Its tests** (ADR 0687, *How it is checked*, clauses 4 and 5), unit, with i3's IPC, logind and the opener + stood in: `open` refuses every scheme but http and https, a file path and each other refusal of §3, and answers + the program; a `sign-in-asked` for its own machine opens the address once and sends one notification, one for + another machine does nothing; `sign-in-ended` with `signed-in` sends one, with `left` or `no-longer-asked` + nothing; a session that starts while the latest kept event for its machine is a `sign-in-asked` published since + the boot opens the page, and one whose latest is from before the boot, or is a `sign-in-ended`, opens nothing. + One integration test starts `i3-tools` whole against a real bus holding `node-uplink`'s definition, with the + session stood in, and proves §17 and §19 on published events (how-work-is-done: a change to how a module runs + carries one). + +## Words and checks + +22. **The catalog's copy of the retired words gains "captive portal"** (ADR 0687, *Consequences*: the glossary's + word **sign-in page**). mesh-catalog's `retired-words` lists it, so hq's words test agrees with the copy, and no + tool or seat verb description in the change uses it. +23. **Nothing names a network** (ADR 0687 §6). Code, configuration and tests name no network, sign-in page or + employer: the tests use documentation names only (`example.net`, a network named `guest-example`). The milestone's + code review searches the change's code, configuration and tests for a wifi name or a host outside the + documentation domains, and finds none. +24. **The live cases** are the main file's acceptance tests 1 and 2. Issue 960 is resolved once the first holds; + issue 935 once the second does; if the second shows the rating LIMITED instead of PORTAL, ADR 0687 is amended, + tracked by issue 960. diff --git a/03-DESIGN/01-to-be/42-the-machines-modules-in-order.md b/03-DESIGN/01-to-be/42-the-machines-modules-in-order.md index 9aece7a6..78244c51 100644 --- a/03-DESIGN/01-to-be/42-the-machines-modules-in-order.md +++ b/03-DESIGN/01-to-be/42-the-machines-modules-in-order.md @@ -2,8 +2,9 @@ layer: to-be status: in-progress code: [mesh-catalog, mesh-controller, mesh-host] -updated: 2026-11-12 +updated: 2026-11-24 decisions: + - "ADR 0687" - "ADR 0369" - "ADR 0303" - "ADR 0215" @@ -241,6 +242,7 @@ flowchart LR | milestone | what it builds | part | state | |---|---|---|---| | zfs-owns-zfs | the zfs module's ownership of ZFS (ADR 0679), with its three node-engine prerequisites and their readers, under issue 1979 | [42-milestones/zfs-owns-zfs.md](42-milestones/zfs-owns-zfs.md) | designed | +| sign-in-page (design 08's) | `i3`'s side of a network's sign-in page: the verb `open` and the page opened when the uplink asks (ADR 0687) | [08-milestones/sign-in-page.md](08-milestones/sign-in-page.md) §16 to §21 | designed | The modules of the tables above were built before designs were cut into milestone parts; their remaining lines move into a part of their own at their next amendment (playbook 02, *The shape of a design*). @@ -311,6 +313,14 @@ The node-engine is delivered first, so the machines report the two capabilities. next, because it parses `data`, `if-capability` and `renders`. The catalog comes last. Left open: the draw at the wall (a metered plug or a UPS), a GPU-load block from a generic module, and the headsets. +**Added 2026-11-24** (ADR 0687 §4, §5, changing ADR 0208 §3). `node-display-session` gains the verb `open`: one +http or https address in the person's default browser, in their session, as the person, answering which program +opened it and refusing every other scheme and a file path; `i3` serves it, beside its own `i3_exec`. `i3` also hears +the uplink's `sign-in-asked` for its own machine, opens the network's sign-in page and tells the person why through +`node-notifier`, says again when the network is open, and at the start of the person's session opens a page still +asked since the machine's boot. Every line it builds is in design 08's milestone part +[sign-in-page](08-milestones/sign-in-page.md), §16 to §21; the shape is design 08's §7. + ## Phase 3 — one machine model The laptop's hardware module (vendor daemon, GPU mode, charge limit, logind, brightness and vendor keys) diff --git a/03-DESIGN/01-to-be/50-split-dns-on-a-machine-with-a-vpn-client.md b/03-DESIGN/01-to-be/50-split-dns-on-a-machine-with-a-vpn-client.md index cdbd0f38..a8c54d42 100644 --- a/03-DESIGN/01-to-be/50-split-dns-on-a-machine-with-a-vpn-client.md +++ b/03-DESIGN/01-to-be/50-split-dns-on-a-machine-with-a-vpn-client.md @@ -7,8 +7,9 @@ code: - mesh-catalog modules/systemd-resolved (the resolver, its guard and its verbs) - mesh-catalog modules/forticlient (the VPN client's adapter) - mesh-host internal/compose/resolution, internal/network (the names check of the file, milestone resolver-wait) -updated: 2026-11-12 +updated: 2026-11-24 decisions: + - "ADR 0687" - "ADR 0247" - "ADR 0223" - "ADR 0241" @@ -48,7 +49,7 @@ another. A *routing domain* is a domain whose names a resolver sends to one link | part | where | does | |---|---|---| -| the seat `node-resolver` | the controller's set | a node seat, its verbs `routes`, `route`, `unroute`, required of every holder | +| the seat `node-resolver` | the controller's set | a node seat, its verbs `routes`, `route`, `unroute` and, from ADR 0687 §2, `uplink-names`, required of every holder | | the stepping back | the controller's composition | where a module holds `node-resolver` and renders `/etc/resolv.conf`, the uplink holder's rendering of it is left out | | `systemd-resolved` | the catalog | holds the seat, provides `split-dns` at the machine's reach, writes the file and resolved's drop-in, runs the guard | | the guard | `systemd-resolved`'s process, as root | keeps the file the module's, keeps an outside write, serves the verbs on the machine's socket | @@ -97,6 +98,12 @@ The routes are resolved's own per-link state, which resolved forgets when the li no table beside it. A link with servers of its own is never a default route for names: the guard says so to resolved every 5 s, whoever gave the link its servers. Its routing domains stay its own. +**`uplink-names`** (ADR 0687 §2, changing ADR 0247 §10 and §16) gives the link that carries the default route a few +host names to answer through its own servers, beside its own domains: the network manager's connectivity check's +host, so the check resolves through the network it tests. It names no link and no servers, is served on the mesh +only, and the guard applies the names every round to whichever link carries the default route then. Its lines are +design 08's milestone part [sign-in-page](08-milestones/sign-in-page.md), §2 and §5 to §9. + ## 4. An outside write ``` @@ -156,6 +163,7 @@ resolver's hold, and is therefore raised. A VPN that tells resolved its link's D | B — the resolver | mesh-catalog `systemd-resolved` | the module, its guard and verbs | its tests pass; assigned to every machine that runs the VPN client's module, each one's file names its own address, `routes` answers | | C — the adapter | mesh-catalog `forticlient` | `split-dns` required; the adapter | its tests pass; on the laptop, connected, a company name and a mesh name both resolve and no rewrite stays raised | | resolver-wait | mesh-catalog `systemd-resolved`, `mesh-host` | design 50 §2's options (ADR 0678), under issue 1748; its part is [`50-milestones/resolver-wait.md`](50-milestones/resolver-wait.md) | its tests pass; *How it is checked*'s live row holds | +| sign-in-page (design 08's) | mesh-networking, mesh-catalog `systemd-resolved` | `uplink-names` and the guard's new duty (ADR 0687 §2), under issue 960; its part is [`08-milestones/sign-in-page.md`](08-milestones/sign-in-page.md) | its tests pass; design 08's acceptance test 1 holds | ## As built