Skip to content

0.51.0 (draft) - #25

Open
fransallen wants to merge 168 commits into
mainfrom
dev
Open

fransallen wants to merge 168 commits into
mainfrom
dev

Conversation

@fransallen

Copy link
Copy Markdown
Contributor

Draft to run CI on dev before the 0.51.0 release. Not for merging yet.

Includes Cloudflare Tunnel, Compose sync, admin sign-in rules, the disk pressure fix, image CVE fixes, the database restart notice, the Postgres restore fix after failover, self-managing agent roles, the own-server refresh, the release verifier bootstrap and the Cloud refresh address fix.

release.json's agentAccess covered only the agent's roles, so a release
that changed the admission policy didn't tell admins to run each
cluster's connect command. Clusters that can't refresh their install
(Pyo Cloud, self-update off, read only) only get a new policy that way.

The hash now covers the policy's rules too, built with stand-in images
so it stays the same whatever images an installation runs.
A cluster whose admission policy is older than the agent's refuses
client traffic policies that remove visitor headers. The refused write
stopped the rest of a service's routes: its WAF policies, stale route
removal and the WAF settings. Deploys of services behind Cloudflare
with an HTTPS domain failed, and so did settings that rewrite the
shared policies.

When such a write is refused, the agent writes the policy without its
headers, as the older policy accepts, carries on, logs it once and
reports it with each heartbeat until the cluster's install changes.
Answers the spec's 13 open questions as accepted on 2026-11-22: the
origin key on the control plane, 15 year origin certificates with no
renewal loop, ports kept public in tunnel mode, an optional apex-only
default domain, no record put back by default when a domain goes, and
the cf-visitor redirect at the gateway.

Adds what came up since: the migration moves to 0040, the connect.sh
preflight already shipped in 0.5.5, a cluster on an older install is
refused tunnel mode until its connect command runs, and tunnel routes
carry no 403 gate so a domain answers both ways while it switches.
Adds a build status section to pick the work up from.
Each zone now carries its Cloudflare account and whether it can use
Cloudflare Tunnel: the token may edit DNS there, make tunnels in its
account (a probe tunnel made and deleted once per account, leftovers
cleaned up) and read its Origin CA certificates. Tunnel permissions are
optional. A zone with neither stays DNS only, and only half of them is
reported as a problem.

Adds the tunnel API client (tunnels, routes, tokens, Origin CA
certificates) behind its own trait, with a fake account for tests, and
the pure parts the tunnel loop builds on: the routes, their hash and the
certificate's names. Not compiled yet.
The user asked for both paths only while a domain switches. A domain's
tunnel is now switching or on: while switching, direct visitors and
the tunnel both work and the plain http route stays. Once the record
points at the tunnel, direct connections get 403 and the http route
goes. Switch back passes through switching again.
Buying a sandbox server at Hetzner moves to the dashboard for now.
Removing one still asks about its price first.
Connecting Hetzner and making servers there is done in the dashboard
for now. The API and MCP tools keep these ops.
The new project lands in the store at once, so the form read it as
taking its own name and slug and showed both errors in red until the
project page opened. The form now leaves out the project it just made
and takes no second submit.
A snapshot that came in before the database page opened listed the
new database and the name field read it as taken. The form now leaves
out the database it made, and Create stays off while the page moves.
Once the cluster was made, the name field above its progress showed
"A cluster with this name exists" for the cluster itself.
Hetzner removed GET /datacenters on 2026-10-01 and now answers 410
"API functionality was removed". Pyo read it to learn where each
server type can be made, so the server type and price list failed and
no Hetzner server (cluster or sandbox) could be made.

Read availability and deprecation from each server type's `locations`
instead, as Hetzner's changelog says. A location where a type is being
phased out is left out with its price, like a type phased out
everywhere before. The fake Hetzner in tests now answers in the
current shape and 410 on /datacenters. Examples name cx23, since cx22
is no longer sold.
An error Hetzner gave no code for read "Hetzner answered 410: API
functionality was removed". A 410 now says Hetzner removed a part of
its API that Pyo calls, and every other error says the status and
quotes Hetzner's message.
# Conflicts:
#	crates/pyo-cli/src/main.rs
#	crates/pyo-cli/src/sandbox.rs
Clusters gain traffic, tunnel and the tunnel capability. Domains gain
tunnel, and their records gain via, previous and the switching states.
The store sends setClusterTraffic, setDomainTunnel, removeClusterTunnel
and rotateTunnelToken.
The Public traffic panel becomes Traffic, a radio group of three
choices. Cloudflare Tunnel takes a default domain, an account when the
zones span more than one, and the public TCP and UDP ports switch, and
asks before it switches. The panel shows the tunnel's health and Rotate,
and Danger zone removes a tunnel the cluster no longer uses.
Adds the tunnel's commands (TunnelSet, TunnelRemove), the heartbeat's
TunnelReport, the reply's TunnelWanted and publicPorts, the agent's
tunnel capability and a domain's tunnel state (switching or on).

system.rs gets cloudflared by digest, its Deployment, Secret and
disruption budget, the origin Service in front of the gateway's HTTPS
and the Service that keeps public TCP and UDP ports in tunnel mode. The
admission policy pins both Services, lets the agent write them by name
and takes client policies labelled tunnel with Cloudflare's own visitor
headers kept. firewall.rs adds the gated authorization for switched
tunnel routes.
The agent keeps the tunnel token in pyo-system/pyo-tunnel, runs two
cloudflared connectors with it, reports them with each heartbeat and
removes them when the tunnel goes. The connectors' pod addresses are the
only ones tunnel listeners trust for the visitor's address, and the
policies follow when pods move.

Tunnel domains get routes of their own: while switching both paths
answer, and once switched direct connections get 403 and the plain
HTTP route goes. A cf-visitor rule sends visitors Cloudflare took over
plain HTTP to HTTPS. In tunnel mode public TCP and UDP ports go out
through a Service of their own.

An install older than the agent refuses these objects: what runs is
kept, the deploy's other routes go on, and it's reported until the
install changes.
Migration 0040 adds the cluster's traffic choice (public, tailscale or
tunnel, with public_traffic generated from it), cluster_tunnels with row
security, and the tunnel side of dns_records.

The tunnel loop runs every 30 seconds on the leader: it makes the
tunnel (or makes it again when it's gone), keeps its routes and Origin
CA certificate in step with the cluster's tunnel domains, moves records
to the tunnel only once the agent has the routes, puts kept records back
on switch back, sends the agent its token, reads Cloudflare's view every
2 minutes, alerts after 5 minutes down and takes a tunnel apart in order.

New ops setClusterTraffic, setDomainTunnel, removeClusterTunnel and
rotateTunnelToken, and GET /clusters/{id}/tunnel. Tunnel mode is refused
until the cluster's install can run it. removeCloudflare is refused
while a tunnel exists. The tunnel token is sealed while queued and
wiped once answered. MCP's add_domain takes tunnel.
A small root program for the first server of a cluster connected to a
Pyo it does not run itself. A systemd timer runs it. It asks the
control plane which version is live, takes only a release the release
workflow signed at exactly that version's tag, never goes below what
the server has, waits until the signature is a day old, then replaces
itself with that release's verifier and hands over to it.

This is the bootstrap only: nothing is applied to the cluster. It
writes its status to a file and to the pyo-system/pyo-verifier
ConfigMap, and shares the connect command's lock.

It runs curl and k3s kubectl instead of linking clients, and its trust
root is the one compiled into pyo-sigstore.
Replace the lock with the Tailscale logo on tailnet domains and the
Cloudflare logo on domains through the tunnel or a proxied record.
Drop the Tailscale pill and the calm Via Tunnel line. The line stays
when there is something to do or something wrong.
The role that reads the customer's policy also reads the ConfigMap
pyo-system/pyo-verifier by name, and the admission policy refuses the
agent any write to it. AgentScope carries the status and Policy the
updates hold switch. Both are only ever shown.

This changes a rule in a role every install has, so the pinned roles
hash moves to 0dcaac0328ee92f9.
A missing ConfigMap means no verifier. An install that refuses the
read is said once in the log, not at every heartbeat.
On a Pyo without the self-update role the connect and refresh commands
carry --auto-update. The choice is not stored. A Pyo with the
self-update role adds no flag.
GET /install/version answers with the version and the install hash of
a cluster without the self-update role. No key, cached for a minute.

A cluster's settings get autoUpdate from the verifier's status when it
checked within 48 hours. The status comes through the agent, so it only
changes what is shown. An outdated install still says Update needed
with its command.
A checkbox next to the connect and refresh commands swaps the flag in
the command shown. The cluster's settings show how automatic updates
stand.
On a cluster that takes web traffic through Cloudflare Tunnel the name
sits under the team's own default domain, so "Free domain" was wrong.
Clusters on public ports keep "Free domain".

The wizard's suggestion line now also goes away once the tunnel domain
is in the list.
On a cluster that takes web traffic through Cloudflare Tunnel the name
Pyo makes sits under the team's own default domain, not nip.io. The
CLI, MCP and API text now says "tunnel domain" there and keeps "free
domain" for nip.io names. Only copy changes: no flags, fields or tool
names are renamed.
connect.sh takes --auto-update and --no-auto-update and keeps the
choice in /etc/pyo/auto-update for runs without either. With it on, once
the agent runs, it downloads the verifier for this server's processor
from the GitHub release of its own stamped version, checks it against
the pinned SHA-256 and runs pyo-verify install. A copy without pins,
a failed download, a checksum mismatch or a failed install only say so
in one line. --no-auto-update and --uninstall remove the verifier.

connect.sh now takes /run/pyo-connect.lock on every server, so it and
the verifier's runs never overlap. The verifier it starts never gets the
lock's file.

release-manifest.ts writes release.json's verifier field from the
built files and stamps their sums on connect.sh's pyo:verify-pin lines.
Pyo shows a cluster as on hold only for updates: "hold" (trimmed, any
case). The verifier read more words as hold and others as go, so it
could hold or go where Pyo showed otherwise. Now hold stops, empty or
auto goes on, and any other value stops with the error as before.
The release now carries pyo-verify-linux-x86_64 (pyo.Dockerfile's verify
target, from the Rust binaries job) and pyo-verify-linux-aarch64 (built
on an Arm runner), each checked to be static and to say the tag's
version. release.json gets their sums, which are checked against the
files and connect.sh's pins before signing and against the draft's
assets before publishing.

Tags like vX.Y.Z-rc.N run the same build and publish a pre-release,
never latest, without rebuilding pyo.dev. The upgrader checks a copy of
their release.json with the version's numbers alone.
Covers the pyo-verify assets, release.json's verifier field, the
pyo:verify-pin lines in connect.sh, how to cut a release candidate to
test the verifier, and the release order for Pyo Cloud.
serde_json::json in tunnel.rs is used by its tests only, and the test
helper changed_roles takes a slice.
The test module's auto_update_flag(args) shadowed join.rs's
auto_update_flag(self_update, keep) after both branches met in dev, so
the module didn't compile. The helper is now auto_update_arg.
On Pyo Cloud the agent's Secret names agent.pyo.dev, which takes only
the agents' own requests. A refresh read that address and fetched
/install/agent.yaml, the gateway's CRDs and set up the verifier from
it, so it was turned away.

A Pyo whose agents reach it at another address (PYO_AGENT_ENDPOINT)
now adds --install-url with its public API address to the refresh and
connect commands. connect.sh fetches every install file from it, gives
it to pyo-verify install, and keeps it in /etc/pyo/install-url for
later runs without the flag. A connect without it drops a kept one,
and the server Pyo runs on never reads or writes it. Without the flag
or a kept address, as before: the agent's address serves both.

A refresh turned away by Pyo now also says to copy the command again.
Self-hosted commands are unchanged.
0040 dropped clusters.public_traffic and re-added it as a generated
column. v0.5.5 still writes it (setClusterPublicTraffic and
install::web_ports_busy), so those writes failed while its pods ran
next to the new migrations, and after a rollback.

Keep it a plain column and sync it with traffic through a trigger. The
widened dns_records status check gets a contract line, since every
status v0.5.5 writes still fits. The generated column moves to a later
release, noted under Pending contracts in RELEASING.md.
pyo-sandbox enables rustls's ring provider next to everyone else's
aws-lc-rs, so a workspace build can't pick a default, and kube's client
panics while building its config. The new cleanup test built one
without installing a provider first.

Install aws-lc-rs in the cleanup test's fake, in pyo_api::run (the
self-hosted binary and hosted builds both start there) and in the CLI.
pyo-api's sqlx now uses aws-lc-rs too, so the shipped API, agent and
database controller build with one provider.
url 2.5.8 overflows the stack in Url::origin() on nested blob: URLs.
form_urlencoded moves to 1.2.3 with it.
@fransallen
fransallen marked this pull request as ready for review November 23, 2026 09:10
A release candidate's version (X.Y.Z-rc.N) isn't one the updates
compare, so on one what_stops_an_update and only_older_agents_are_behind
failed, and with them cargo test in the release workflow. The first
now names the Pyo version it reasons about. The second says an rc build
moves no agent. What a release build does is unchanged.

(cherry picked from commit 6458b75)
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.

1 participant