Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 00:50
· 36 commits to main since this release
v0.2.0
00fd610

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 (and ephemera dev --name, and name on the MCP run_command tool) names a sandbox for what it's for; without one the server makes one up, like amber-dune-42. Names are lowercase letters, digits and hyphens, up to 40 characters, and unique among an account's running sandboxes: a clash gets 409. ephemera ls lists sandboxes by name, and ephemera rm, DELETE /v1/sandboxes/{id} and destroy_sandbox take a name or an id. Sandboxes and runs in the API carry name, and --json events carry it too. The signed record format doesn't change.
  • ephemera verify api-tests checks the newest record of the sandbox named api-tests; ephemera verify alone 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 MCP verify_record tool takes sandbox (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 the ephemera-host service. It serves on the machine's one private IPv4 address, or --address. Run it again to upgrade; --uninstall removes it. The host release archive now holds build-image.sh and the systemd unit, and install-host.sh is a release file of its own.
  • ephemera doctor says 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. --json prints the same checks.
  • GET /v1/hosts returns each host's url, online (true while it checks in often enough to get sandboxes), capacity, version, running (how many of the account's sandboxes are on it), joined and the key's fingerprint.
  • The dashboard, signed in with a session, can use GET /v1/hosts, GET /v1/sandboxes and GET /v1/usage, stop sandboxes and remove hosts, all for the whole account. A session can't make sandboxes. GET /v1/usage with a session adds up the whole account's day.
  • GET /v1/runs lists 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/github and get an account of their own, gh-<GitHub user id>. With the session, GET, POST and DELETE /v1/tokens list, make and revoke that account's tokens, and GET /v1/me says who is signed in. Sign-in asks only for read:user and doesn't keep GitHub's access token. /auth/github?next=/some/path lands 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 NAME puts 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 account local, so nothing changes for them. GET /v1/whoami and sandboxes include the account.

Changed

  • ephemera dev --name now 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 ls has a NAME column first.
  • The CLI's default central server is the hosted one, https://api.ephemera.run, so ephemera login needs no --server there. 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 login signs a machine in through the browser when the server has GitHub sign-in: it shows a code such as K7QM-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 session GET /v1/device and POST /v1/device/approve. Tokens now have a kind, device or api.
  • Hosts serve TLS 1.3 to the CLI, with a certificate made from the key they joined with, and --url is now https://. The CLI checks that key against the server's record of it and pins it, like ssh's known_hosts, in known_hosts.json next to the saved login; a pinned host whose key changes is refused with a message, and ephemera trust <host> accepts the new key. ephemera hosts lists the account's hosts, their keys and whether each is pinned. EPHEMERA_STRICT_HOSTS=1 refuses hosts not pinned yet. Sandboxes now include host_key, and doctor checks 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_hash in POST /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 without token_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 (or POST /v1/join-codes from 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_SECRET is gone. A host runs only its account's sandboxes, GET /v1/hosts lists only the account's hosts, and DELETE /v1/hosts/{id} removes one. A host the server has no record of destroys its sandboxes. install.sh joins the host itself, and takes --join-code-file in 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 --url for files and commands. A host that loses the connection keeps retrying, waiting 1 s, doubling to 60 s. POST /v1/hosts and 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.