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.

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.

The project a forge is filed in (#16340)

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 (a provider with no such place in the United States falls back to its cheapest place anywhere); PUT /api/v1/places/pin (admin) pins one instead.

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.

Where it runs, on New forge

A site admin who has attached a cloud account that allows writes sees "Where it runs" on /forges/new and on the terminal's New forge screen (src/spawn/clouds_offered.ts). Anyone else sees no such choice, and a cloud named in a request from a non-admin is refused.

A forge on a cloud keeps its plan out of it: the place is chosen under Where it runs, not under Plan.

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).

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.

The hourly watch (#16329)

The ceiling counts only what the forge's own rows say it made. The cloud-watch duty (src/maintain/duties/cloud_watch.ts, src/cloud/watch.ts) looks at the provider itself once an hour for each DigitalOcean or Hetzner account that allows writes: read-only GETs of droplets or servers and volumes, recorded like the other cloud calls (maintain:cloud-watch).

Not done: adopting an orphan into a pinned row (retire it in the provider's console, or acknowledge it), and a read of the provider's actual bill.

The watch keeps when the standing problems began, so a standing orphan is one notification and one /health card, not one an hour. A forge-named thing made in the last two hours, or named for a live pinned row, is a deploy in flight and not an orphan. A create stays refused until the next hourly reading even after an orphan is retired in the provider's console; the refusal says so.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs