Cloud accounts
The forge keeps the provider tokens (a cloud vendor's API token) its repositories use, sealed. Four doors show them, all a forge admin's alone; anyone else finds no such page, screen, tool or route. No door ever returns a secret: a token is typed once, checked, sealed, and never drawn, kept in a note or sent back.
- Page: Settings → Cloud accounts,
/settings/cloud. Each account with what it is used for, when it was verified and last used, and today's vendor calls. Attach, verify, allow writes, rename, rotate, audit and remove are forms on the page. - Terminal: the "Cloud accounts" screen (
src/tui/screens/cloud.ts), opened from the palette.aattaches (token typed masked),vre-verifies,rrotates,nrenames,xremoves. The checks are the page's (src/actions/cloud.ts). - MCP:
cloud_accountstakes no arguments and returns the accounts with each token's use, verification, write permission and today's calls. It counts as a write, so arotoken never lists them. - HTTP:
GET /api/v1/cloud/accountsreturns the same body ascloud_accounts(both build it withcloudOverview).
curl -H "authorization: Bearer $FORGE_TOKEN" "$FORGE_URL/api/v1/cloud/accounts"
Answers: 401 with no signed-in user, 403 for a read-only token (every vendor call is audited, so listing is a write-scoped act), 404 for anyone who is not a forge admin.
Not done: the route only lists. Attaching, rotating and removing stay on the page and in the terminal, where the token can be typed masked.
Places and prices in US dollars (#16203)
GET /api/v1/places lists where a forge can run: provider + datacenter + machine size, each with vCPU, memory, disk, included traffic, city and country, costCents (machine + the 10 GiB volume + a public address, US dollars a month), the vendor's own price and the rate that converted it, readAt, orderable and, when not, why. Filters: plan, provider, country. defaults names each plan's default place and says why; the rule is: the cheapest place in the United States that can be ordered now and meets the plan's minimum, among providers with an account that allows writes; PUT /api/v1/places/pin (admin) pins one instead.
- Prices come from the provider's API (Hetzner
/pricing,/server_types,/datacenters; DigitalOcean/sizes,/regions) and are kept as the provider answered, so the dollars are derived at read time. A failed read keeps the last good one. Typed in by hand, and said so: DigitalOcean's block storage price (its API has none) and its regions' countries. - Every amount a person sees is dollars. A vendor billing in euro is converted at the European Central Bank's daily reference rate (
src/cloud/rates.ts, no key), kept with its date; if the fetch fails the last good rate stands and the answer carriesrate.ageDays. All conversion istoUsdinsrc/cloud/prices.ts; money that guards spending roundsup. - A refresh runs when a forge administrator reads the catalog with a write-scoped token and a read is over six hours old; a read-only token gets the kept catalog and starts no vendor call, since every vendor call is audited. One refresh runs at a time, every concurrent read waits on it, and a provider is tried again no sooner than five minutes after its last try, whether or not it answered. A vendor's answer is read to at most 2 MB. No timer yet.
PUT /api/v1/places/pintakes{plan, place}(an empty place clears the pin) and answers the validated plan and place; a place id over 200 characters is a422. A member is refused (403by the admin gate), and a pin is announced ascloud.place_pinned, which an admin's web session hears live.- Each item carries
priceNote, the curious path's sentence, such as€5.99 at 1.08 on 24 Nov; empty when nothing was converted.
In the terminal: the palette's Places (src/tui/screens/places.ts) shows the rule, each plan's default and why, and every place by price in dollars. Anyone signed in reads it; a forge admin who is a person also presses p to pin a plan (plan, then place id; empty clears) through pinPlace, the same act as the API. Opening it as an admin refreshes a stale catalog first.
Not done: deploying by place id, the buyer's "Choose where it runs" disclosure and the owner's margin page; they build on this catalog.
The warm pool (#16362)
A prepared machine already booted and waiting, unclaimed and with no name, answers a purchase in seconds. It costs money while it waits, so none is kept by default: each place (provider:datacenter:size) of an account has a configured most, 0 until a forge admin sets it (about 3 once customers come).
wantedWarm(src/cloud/warm_pool.ts) says how many to hold now: 0 when the setting is 0; otherwise one, raised to cover two hours of purchases at the last day's rate, never past the setting and never past what the account's ceiling leaves room for. Falling demand lowers it; nothing is torn down to save money by this rule alone.- A warm machine is a pinned row in state
warm, so the ceiling counts every one (rowCents) and the account's cost already includes them; Settings → Cloud and the terminal screen show each place's held count, setting and cost beside the ceiling. - Set it with the MCP
cloud_accountverbset_warm(place,count0 to 10, admin scope); it is recorded ascloud.warm_target.
Not done: making and refilling the machines themselves, and a form on the page and a key in the terminal to set the count; this lands the policy, the setting, the counting and the display.