Skip to content

berth 0.6: one UI, a CLI over the API, nodes and the tailnet by API key - #60

Merged
helightdev merged 116 commits into
mainfrom
rework
Nov 15, 2026
Merged

helightdev merged 116 commits into
mainfrom
rework

Conversation

@helightdev

Copy link
Copy Markdown
Owner

Everything queued for 0.6.0, collected on rework through #44 to #59.

  • The browser page and berth-remote are gone. The screens are one terminal UI (berth ui) that does everything through the API of a server: one elsewhere, a berth serve on its socket, or the one in the process.
  • The command line is berth THING ACTION [NAME] [FLAGS], and goes through the same API.
  • API 2: new names on the wire (host types, actions, the controller pass-through), ports.connect, resources.connect, the exec action, jobs.stop, job arguments, and error headers for refused streams.
  • A node is a host type. It hosts Incus and Docker through plugin features and offers its provisioners; the incus-host recipe is replaced by it.
  • Hosts join the tailnet with a key made from an API key that berth keeps.
  • Hardening: a request's role no longer depends on what it says of itself, a node's report changes only its own provisioners, portals bound what one caller can make them hold, and profile values are never read as Ansible templates.
  • Upgrading from 0.5 is covered by fixes, a page in the docs and an end-to-end case that opens a 0.5.2 store.

The API breaks against 0.5 without old spellings kept. Not for merging until a release candidate is wanted.

helightdev and others added 30 commits November 14, 2026 23:38
berth serve no longer takes --web, and berth has no web feature. berth-remote is the client for a server elsewhere.
Streams on the portal can now ask for a window on their bytes, which both sides keep to with credit frames, and the server's frames wait for room in a bounded queue. A stream nobody reads no longer grows the other side's memory or holds up the rest of the portal.
The levels reachable, controller and workstation become the types ssh, managed and workstation, in profiles, the API, the screens and the commands (berth host type, --type). The role still records a managed host as level controller; berthd and berth read that, and berth reads the version of a berthd of API 1.
The field that says what a host is installed on (laptop, cloud) is target now. The role keeps its variable devbox_profile, and bootstrap.sh reads a seed of either name.
A seventh import gives every stored profile type and target in place of level and profile, in one change with its marker; the rows may be sealed, so a migration of the database cannot. Profiles read from the store, from files, from --set and from what a host keeps take the new names too, and the kept profile is format 3 so that an older berth asks to be updated instead of misreading it. The API of berth serve takes the new names only.
berthd's tasks.list, tasks.run and tasks.choices become actions.list, actions.run and actions.choices under /v1/actions, and the installation's actions of berth serve move to installation.actions and installation.act under /v1/installation/actions. berth serve passes a host's operations through under /v1/hosts/NAME/controller, as /v1/hosts/NAME/actions is its own list of the host's actions. The role writes /etc/berth/actions.json, which berthd reads before tasks.json. berth needs a berthd of API 2. The commands are berth actions HOST and box actions.
feat(serve)!: remove the browser page
feat(api): port tunnels, change events and API number 2
With no server set and no berth serve of the user running, berth ui runs
the API in its own process and the screens reach it over pipes in memory.
Jobs that still run when the screens close are waited for.
…h-page's

berth-remote's device becomes plain code in berth-page, with no Device
trait. The server and its token are kept as berth's own server and
server_token settings; berth ui takes in berth-remote's settings.json
once. Ctrl+Q leaves a session and quits elsewhere, q quits from the
hosts, and F4 and F5 generate and hash in the set-up, as in berth's
terminal UI. BERTH_REMOTE_FILE is BERTH_FILE.
… user

A host gets the action installer, which builds its unattended ISO,
downloading Ubuntu's when the profile names none, and writes it to a USB
drive with the sudo password given. Like changing settings that are not
open to the network, it is offered only on the socket and in the process.
The set-up of the screens offers the USB installer again.
berth and berth HOST open the same screens as berth ui. apply, seed and
iso go through a server like everything the screens do: the one berth is
set to use, a berth serve of the user here, or one in the process, which
waits for the jobs it runs. A profile file can no longer be opened by its
path; berth profile HOST --set FILE takes it in.
berth is built for Linux, macOS and Windows. Its installation, berth
serve and the commands are in its Linux build alone, behind one cfg;
elsewhere it is the screens, berth connect and berth update. The release
packs berth for five systems, install.sh installs it on Linux and macOS
and install.ps1 on Windows; install-remote.sh is gone.
refactor!: a host has a type, a profile a target, and tasks are actions
…a host has no address

The server in the process asks in the terminal, as berth serve does when
it starts. The help of the USB installer's fields says the build downloads
the ISO, as F4 no longer does.
The terminal UI, server, install, USB and building pages describe the
screens over a server, the one inside berth on Linux, and berth on macOS
and Windows. The screenshots are made again.
feat!: one set of screens over the API, in berth on every system
helightdev and others added 27 commits November 15, 2026 05:43
fix(serve): a request's role does not depend on what it says of itself
A provisioner registered by hand is taken over only when berth finds its server on the node's address. One the node only names, by an alias or the certificate it reports, is left alone and can be made the node's with the new action adopt.
The reader's own replies take room from a small budget, and the reader stops reading while it is full. Calls, their answers and a stream's input take room from a byte budget and are refused with limit past it. Messages, operation names, calls in flight and open streams are capped, and the client ends a stream a server floods.
…self

ansible_vars take devbox_ names alone and features as PLUGIN/FEATURE, checked when a profile is saved and left out with a line when one saved before is applied. The variables and the inventory go to Ansible with every text marked !unsafe, so a value in them is never a template that would run a lookup on the server.
Docker puts the daemon's log options on every container, so refusing them refused most real servers. The helper also takes options to set over the container's, for the server recipe.
The handshake's body may not have arrived when the client reads the refusal, which left only the code and made a test of the message fail now and then. The message is repeated in a header beside the code.
Polish the reworked screens and command line
…gs on every command

The import ran in berth ui alone and removed berth-remote's file even when berth used another server. Now it runs before any command looks for a server, and leaves the file unless berth has its contents. The screens forget the kept token only on sign-out or for one typed in its place; a server that does not answer, or refuses the token, leaves it.
…ntroller is behind

A client refuses a server with an older API for anything but berth version, and the screens say the same on connect. A controller too old to list its actions is said to be old, with the command that updates it, on the host's page, its actions and the overview.
… before anything runs

berth serve takes --web again and says it does nothing, GET / says to use berth login, and a missing tailnet key, secret or ISO is a refusal (412) rather than a bad request.
…p applying without it

berth 0.5 joined a host only with a pasted key or with its switch for keys berth makes, which was off unless set. The tailnet's import marks the other profiles with devbox_tailnet_optional: they join once berth can make the key, and until then an apply goes on without the tailnet.
berth 0.5 cannot read a store once this berth has converted it, so the first open copies a SQLite store beside it with VACUUM INTO, named for the berth and schema it had. A store in PostgreSQL gets a line saying a dump is the way back. The fixture is a store berth 0.5.2 wrote, with made-up hosts and fake keys.
Harden node offers, portal limits and profile variables
The order of the updates, what is converted, berth-remote's settings, the tailnet and going back, with the old spellings generated from the command line's table. Nodes say what taking in a server keeps, and updates no longer says sessions need berthd API 2.
Upgrading from 0.5: keep what an installation has, and say what is older
Comment thread crates/berth-core/src/import.rs Dismissed
Comment thread crates/berth/src/local/mod.rs Dismissed
Comment thread crates/berth/src/local/serve/actions.rs Dismissed
Comment thread crates/berthd/src/endpoints.rs Dismissed
@helightdev
helightdev merged commit 1ce32b8 into main Nov 15, 2026
22 of 23 checks passed
@helightdev
helightdev deleted the rework branch November 15, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants