Skip to content

Implement the rest of ADR 0021: one machine for the control plane and applications #377

Open

Description

@samuelmbabhazi

Scope

The rest of accepted ADR 0021, so that one machine runs the control plane and applications. Done so far: the agent's loopback connect address (#353); capacity and isolation are #352 (#373, #374).

Remaining parts, one pull request each:

  1. The control plane's route in the agent. The installer writes the control plane's DNS name and loopback address into the agent's configuration. The agent applies the route through Caddy's admin API at start, before and independently of enrollment, with a fixed id outside the sk-route- prefix, checks it at every reconcile interval and puts it back when missing or different. UpsertRoute and RemoveRoute cannot touch it, and the agent refuses a route for that name.
  2. No application on the control plane's name. The control plane refuses a domain equal to the host of API_PUBLIC_URL.
  3. Operator commands. node main.js organization create and node main.js server join-token, server-only, audited with the system as actor (ADR 0020). The token goes to the agent's token file without being printed.
  4. The Compose profile without Caddy. HTTP published on 127.0.0.1 only, a fixed subnet, TRUST_PROXY set to its gateway, PostgreSQL and the API in shipkeep-controlplane.slice with oom_score_adj -900.
  5. The installer's single-machine form. The question (default yes), the first organization, the join token, the agent and its Caddy installed and enrolled over loopback, the agent settings of feat(agent): reservation facts and the workloads slice (ADR 0021, part of #352) #373, the three slices (MemoryMax, MemoryLow, CPU weight), the checks (cgroup v2 with memory_recursiveprot, Docker's systemd driver, at least 2 CPUs and 3 GiB).
  6. Docs. docs/INSTALL.md, docs/THREAT_MODEL.md, docs/ARCHITECTURE.md.

Acceptance criteria

Those of the ADR: no forged client address, the control plane's route survives Caddy restarts and config loss, loopback enrollment keeps the checks, capacity, and a real machine. The last one needs the test VM (#200).

Activity

  1. added
    priority:P1
    on Nov 20, 2026
  2. samuelmbabhazi commented on Nov 20, 2026

    @samuelmbabhazi
    CollaboratorAuthor

    Status: code complete, merged in #378, #379, #380, #381 and #382.

    Checked end to end on a fresh Ubuntu 24.04 container:

    • install through a terminal, with the password never shown;
    • the agent enrolled over loopback;
    • a deployment through the egress proxy;
    • a forged X-Forwarded-For that is not trusted;
    • applications that cannot reach port 3000;
    • the control plane route coming back after Caddy lost its config;
    • a reboot.

    What remains is the acceptance on a real VM with a public name and certificate (#200).

  3. added
    v0.1-stable
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P1security-reviewtasktrack:agenttrack:control-planev0.1-stable

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions