Repository navigation
v0.2.0
Upgrade the CLI, the central server and every host together. v0.1 CLIs, servers and hosts don't work with v0.2. Hosts now connect out to the central server and join an account once with a one-time code; the CLI sends the server only a hash of each sandbox's token. Re-join each host with the host installer, curl -fsSL https://ephemera.run/host | sudo sh -s -- <join code>, after making a code in the dashboard or with ephemera-server join-code create.
Added
- Sandbox names.
ephemera run --name api-tests(andephemera dev --name, andnameon the MCPrun_commandtool) names a sandbox for what it's for; without one the server makes one up, likeamber-dune-42. Names are lowercase letters, digits and hyphens, up to 40 characters, and unique among an account's running sandboxes: a clash gets409.ephemera lslists sandboxes by name, andephemera rm,DELETE /v1/sandboxes/{id}anddestroy_sandboxtake a name or an id. Sandboxes and runs in the API carryname, and--jsonevents carry it too. The signed record format doesn't change. ephemera verify api-testschecks the newest record of the sandbox namedapi-tests;ephemera verifyalone checks the newest record of all, and an id or a path works as before. Records are saved as<name>-<id>.json, so the folder reads by name and repeat runs keep their own. The MCPverify_recordtool takessandbox(a name, an id or a path) and needs nothing for the newest record.- A host installer:
curl -fsSL https://ephemera.run/host | sudo sh -s -- <join code>sets up a host from a release, with no checkout, Go or network of its own. It checks KVM, installs Firecracker 1.15.1 (checked against a pinned SHA-256), the host agent and its guest image, joins the account and starts theephemera-hostservice. It serves on the machine's one private IPv4 address, or--address. Run it again to upgrade;--uninstallremoves it. The host release archive now holdsbuild-image.shand the systemd unit, andinstall-host.shis a release file of its own. ephemera doctorsays why the CLI can't run a sandbox. It checks the login, the central server, the token and each host in turn, and prints a fix for the first that fails. Exit 1 if a check fails.--jsonprints the same checks.GET /v1/hostsreturns each host'surl,online(true while it checks in often enough to get sandboxes),capacity,version,running(how many of the account's sandboxes are on it),joinedand the key'sfingerprint.- The dashboard, signed in with a session, can use
GET /v1/hosts,GET /v1/sandboxesandGET /v1/usage, stop sandboxes and remove hosts, all for the whole account. A session can't make sandboxes.GET /v1/usagewith a session adds up the whole account's day. GET /v1/runslists the account's sandboxes, running and finished, newest first, 100 at a time;?before=<time>pages back. Each has its host, token name, spec, start and end, and why it ended. Postgres only, as files don't keep finished sandboxes.- Postgres. With
EPHEMERA_DATABASE_URL(or--database), the central server keeps tokens, sandboxes and usage in Postgres instead of files, and keeps finished sandboxes as a history. It creates and updates its tables itself. Files stay the default. - Sign in with GitHub. With Postgres and a GitHub OAuth app (
EPHEMERA_GITHUB_CLIENT_ID,EPHEMERA_GITHUB_CLIENT_SECRET,EPHEMERA_PUBLIC_URL,EPHEMERA_DASHBOARD_URL), people sign in at/auth/githuband get an account of their own,gh-<GitHub user id>. With the session,GET,POSTandDELETE /v1/tokenslist, make and revoke that account's tokens, andGET /v1/mesays who is signed in. Sign-in asks only forread:userand doesn't keep GitHub's access token./auth/github?next=/some/pathlands on that path of the dashboard's site after signing in; anything that isn't a plain path lands on the dashboard. - Accounts.
ephemera-server token create --account NAMEputs a token in an account, and a token sees and destroys only its own account's sandboxes. Tokens made without one, including every existing token, share the accountlocal, so nothing changes for them.GET /v1/whoamiand sandboxes include the account.
Changed
ephemera dev --namenow names the sandbox as well as the session, so it must be a valid sandbox name (lowercase letters, digits and hyphens). Without it, the session is still the git branch.ephemera lshas aNAMEcolumn first.- The CLI's default central server is the hosted one,
https://api.ephemera.run, soephemera loginneeds no--serverthere. A self-hosted server still takes--server, and a saved login keeps its server.ephemera doctor's fixes point to the dashboard and the host installer. ephemera loginsigns a machine in through the browser when the server has GitHub sign-in: it shows a code such asK7QM-2XRT, opens the approval page, and saves a device token named after the machine once the person approves. Codes last 10 minutes, a token can be collected once, and the approval page allows 10 wrong codes an account an hour.--with-token, or a piped token, reads an API token as before, and is used whenever the server has no browser sign-in. New endpoints:POST /v1/device/codes,POST /v1/device/token, and with a sessionGET /v1/deviceandPOST /v1/device/approve. Tokens now have akind,deviceorapi.- Hosts serve TLS 1.3 to the CLI, with a certificate made from the key they joined with, and
--urlis nowhttps://. The CLI checks that key against the server's record of it and pins it, like ssh's known_hosts, inknown_hosts.jsonnext to the saved login; a pinned host whose key changes is refused with a message, andephemera trust <host>accepts the new key.ephemera hostslists the account's hosts, their keys and whether each is pinned.EPHEMERA_STRICT_HOSTS=1refuses hosts not pinned yet. Sandboxes now includehost_key, anddoctorchecks each host over the same pinned TLS. - The CLI makes each sandbox's access token and sends the central server only its SHA-256 (
token_hashinPOST /v1/sandboxes). The server passes the hash to the host and never sees the token, so it can't open a sandbox to read the code in it. A create withouttoken_hash, from an older CLI, is refused: upgrade the CLI too. - Hosts join an account once, with a one-time code from
ephemera-server join-code create(orPOST /v1/join-codesfrom the dashboard):ephemera-host join --server URL CODE. A code works once, for 15 minutes. The host then signs in with its own Ed25519 key, by signing a fresh challenge from the server;EPHEMERA_HOST_SECRETis gone. A host runs only its account's sandboxes,GET /v1/hostslists only the account's hosts, andDELETE /v1/hosts/{id}removes one. A host the server has no record of destroys its sandboxes.install.shjoins the host itself, and takes--join-code-filein place of--secret-file; upgrading a one-machine install joins it automatically. - Hosts connect out to the central server and keep that connection open; the server sends creates and destroys down it instead of calling the host. The server no longer needs to reach hosts at all, so a host can sit behind NAT, as long as the CLI can reach its
--urlfor files and commands. A host that loses the connection keeps retrying, waiting 1 s, doubling to 60 s.POST /v1/hostsand the host's create and destroy endpoints are gone, so hosts and servers from v0.1 don't work with this version or each other: upgrade both. - Building from source needs Go 1.25 or later (was 1.24), for the Postgres driver. Go itself supports only 1.26 and 1.27 now.