Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ jobs:
GATEWAY_ZIP="$S/gateway" WORKER_ZIP="$S/worker" MCP_PROXY_DIR="$S/mcp" CODERHELM_DASHBOARD_DIR="$S/dash" node dist/lib/native/build.js v0.0.0-ci "$RUNNER_TEMP/native"
pip install --quiet cfn-lint==1.58.0
cfn-lint ../infra/cfn/*.yaml
cfn-lint -i W3005 -i W2531 -- "$RUNNER_TEMP/native/coderhelm.json" "$RUNNER_TEMP/native"/stacks/*.json
cfn-lint -i W3005 -i W2531 -- "$RUNNER_TEMP/native/coderhelm.json" "$RUNNER_TEMP/native/access.json" "$RUNNER_TEMP/native"/stacks/*.json
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ jobs:
export CODERHELM_COMMIT CODERHELM_RELEASED_AT
CODERHELM_DASHBOARD_DIR="$RUNNER_TEMP/dash" node dist/lib/native/build.js "$TAG" "$RUNNER_TEMP/native"
pip install --quiet cfn-lint==1.58.0
cfn-lint -i W3005 -i W2531 -- "$RUNNER_TEMP/native/coderhelm.json" "$RUNNER_TEMP/native"/stacks/*.json
cfn-lint -i W3005 -i W2531 -- "$RUNNER_TEMP/native/coderhelm.json" "$RUNNER_TEMP/native/access.json" "$RUNNER_TEMP/native"/stacks/*.json
cp "$RUNNER_TEMP/native/coderhelm.json" ../dist/coderhelm.json
tar -czf ../dist/coderhelm-native.tar.gz -C "$RUNNER_TEMP/native" stacks assets
tar -czf ../dist/coderhelm-native.tar.gz -C "$RUNNER_TEMP/native" access.json stacks assets
- name: Checksums
run: |
(cd dist && sha256sum gateway.zip worker.zip mcp-proxy.zip dashboard.tar.gz source.tar.gz coderhelm-selfhost.tgz install.sh coderhelm.json coderhelm-native.tar.gz models.json coderhelm-log-reader.yaml coderhelm-log-reader-update.yaml > SHA256SUMS)
Expand Down
2 changes: 1 addition & 1 deletion docs/self-host/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ It can't choose the code: only a published release's template. It does choose th

**What waits for a person.** The updater reads every change, with its before and after values, in the parent's change set and each part's. It never executes by itself a change set (or a part's) that would replace or remove a table, bucket, key, user pool or secret, or that changes who may do what: an IAM role or policy added or changed, a function permission or URL, a resource policy (a bucket's, queue's, topic's, secret's, key's or table's), or a principal other than an AWS service anywhere in a property. It waits, and Settings, System lists exactly those changes. It applies once an install admin confirms that list there: the confirmation names this prepared update and exactly those changes, so a confirmation of an older list, or of another update, is refused. The gateway passes it on only from an install admin (`PLATFORM_ADMIN_EMAILS`, who is also a team admin), and the history records who confirmed what.

**What CoderHelm never applies.** A change set that changes the deploy role or either boundary: the boundary forbids the role to change those (that is what keeps it from giving itself more), and nothing else in the install may. Settings, System says so and links to the change set; someone with administrator rights in the account executes it in the CloudFormation console. Letting CoderHelm apply these would need a role that can rewrite the deploy role's boundary, which is a role that can give itself anything: so there is none.
**What CoderHelm never applies.** A change set that changes the deploy role or either boundary: the boundary forbids the role to change those (that is what keeps it from giving itself more), and nothing else in the install may. Executing such a change set in the CloudFormation console doesn't get around it either: the stack's service role is the deploy role, so AWS runs it as that role whoever presses Execute (and its rollback fails the same way). So no update changes them: the parent template carries them exactly as installs have them, every update keeps the install's own copies, and the updater checks every IAM call a prepared update needs against the deploy role before it runs. Newer documents for them ship in each release's signed `access.json`, which someone with administrator rights applies with their own permissions as the stack `coderhelm-<name>-access` (Settings, System, Permissions; [Updates](./updates.md#permissions)). Its writer function and role are named `CoderHelmAccess-<name>`, outside the install's names, so no CoderHelm role can invoke, pass or change them, and no CoderHelm role may create, change or delete that stack (`TheAccessStackStays`). Letting CoderHelm apply these would need a role that can rewrite the deploy role's boundary, which is a role that can give itself anything: so there is none.

- Only CloudFormation can assume it, only for this account (`aws:SourceAccount`) and only for this stack and its parts (`aws:SourceArn`).
- It carries the boundary (its own copy, kept with it).
Expand Down
27 changes: 25 additions & 2 deletions docs/self-host/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ The **Version** section of **Settings, then System** shows one state at a time,
| **vX would replace or remove data** | The prepared update would replace or remove data, and waits for you ([Update now](#update-now)). | **Replace the data and apply**, once you've read what it lists. |
| **vX is ready to apply** | Prepared and waiting: the maintenance window held it because it changes what CoderHelm's own roles may do, or auto-update was turned off before it ran. | **Apply update**. |
| **vX is ready to apply** | The prepared update waits for an admin, for example because automatic updates were turned off before it ran. | **Apply vX**. |
| **vX needs an AWS admin** | The update changes the deploy role or a permissions boundary, which CoderHelm can't apply for itself ([why](#what-an-update-does)). | **Open it in the AWS console**: someone with administrator rights reviews it and chooses **Execute**. |
| **vX needs an AWS admin** | Only on a stack from before the deploy role existed (up to v0.8.26 with **AutoUpdate** off): its first update adds the role ([below](#the-first-update-onto-a-release-with-the-deploy-role-on-every-install)). | **Open it in the AWS console**: someone with administrator rights reviews it and chooses **Execute**. |
| **Couldn't start: it needs permissions CoderHelm's update role doesn't have** | The check before it runs found a call the deploy role would be refused ([Permissions](#permissions)). Nothing ran. | Apply the permission change under **Permissions**, then **Update** again. |
| **Applying vX…** / **Updating to vX…** | The update runs (10 to 20 minutes), with who started it and when. When someone executed it in the AWS console, it says so. Coderhelm keeps running your current version until it finishes. | Nothing. The page follows it. |
| **The update to vX couldn't start** / **didn't finish** / **stopped partway** | The last try didn't work ([When an update fails](#when-an-update-fails)). | **Try again**, after fixing what **Install health** lists. After **stopped partway**, **Roll back** is offered too. |
| **vX is available, but can't install yet** | An install check that stops updates fails. | **See what to fix** opens **Install health**. |
Expand All @@ -127,6 +128,27 @@ Under the status, **Check for updates** sits next to when GitHub last answered (

There is only ever one update waiting. A newer prepared update replaces an older one that hasn't run, and the history lists the older one as **Replaced**. An update that AWS is still preparing or already applying is never replaced.

## Permissions

Some releases can do more once your install's permission limit (its boundary) or its deploy role allows a little more, for example reading Airflow, ECS and ECR in your own account. No update can change those: the deploy role that runs updates may never change itself or a boundary. So the update installs without them, the features that need them say so where you use them, and **Settings, then System, then Version** shows a separate, optional item: **Permissions**, with what it adds in plain words (for example "adds read access to Airflow, ECR and ECS").

**Open in the AWS console** opens one link: a stack named `coderhelm-<name>-access`, from that release's signed `access.json`, with your install's values filled in. Someone with administrator rights in the AWS account checks the box and chooses **Create stack**. It runs with that person's own permissions (the stack has no service role), writes a new version of `coderhelm-<name>-boundary-stack` and `coderhelm-<name>-deploy-boundary-stack` and the deploy role's policy, only where they differ, and finishes in about a minute. The item then reads **Applied**. Deleting that stack later changes nothing. If the stack exists from an earlier change, delete it first (the item links to it); no CoderHelm role can create, change or delete a stack of that name.

Updates never wait for this item, and it never waits for an update.

### An install launched from v0.8.54-beta.20261108

v0.8.54-beta.20261108 was the one release whose template carried a newer boundary. An install launched from it (not updated to it) has that boundary, and its updater is the one from before held updates. So the next release, which carries the earlier boundary, shows **vX needs an AWS admin** there once. Don't execute that change set: it runs as the deploy role and can't change the boundary. If someone already did and the stack reads `UPDATE_ROLLBACK_FAILED`, recover it once in the CloudFormation console:

1. Open the stack `coderhelm-<name>`, then **Stack actions**, then **Continue update rollback**.
2. Under **Resources to skip**, select **Boundary** and **DeployBoundary**. Neither was changed: the update was refused before it changed them. Choose **Continue update rollback**.

The install is then back on v0.8.54-beta.20261108, working as before, and it stays on it: its updater can't keep its own boundary in a newer release, and the deploy role can't change it. Moving such an install on takes one step by an AWS admin, which CoderHelm doesn't automate yet. No other install is affected: every install launched from any other release updates as usual.

## A rollback that stopped

If AWS stops while it puts the previous release back (the stack reads `UPDATE_ROLLBACK_FAILED`), no update can run until the rollback finishes. CoderHelm finishes it by itself: for each resource AWS couldn't put back, it checks that the resource is already exactly as the previous release has it (a policy's document, as IAM has it now), and continues the rollback skipping only those. **Settings, then System** shows it, and the update's history entry ends as rolled back. If a resource isn't as the previous release has it, CoderHelm skips nothing, emails admins once and shows what differs.

## Install health

**Install health**, its own section under **Version**, is the install's own checks: its address, GitHub, email, Claude and its queues. It says **All N checks pass**, or lists each check that fails or needs a look with its fix. A failing check marked **Stops updates** holds an update until it passes (the update's own health check would stop it otherwise); a failing integration such as Slack doesn't. **Re-run checks** runs them again; **See every check** opens **Settings, then Setup**. The same list is `GET /api/system/preflight`; see [Check your install](./check-your-install.md).
Expand Down Expand Up @@ -165,7 +187,8 @@ On an install made with Launch Stack, an update is a stack update of `coderhelm-
4. **Applies it, through the deploy role.** **Settings, then System** shows the change set's summary while it runs: how many resources are added, changed and removed, which ones are replaced, which parts it touches, and a link to it in the CloudFormation console if you want to look.
- **You pressed Update:** it applies as soon as it is prepared. The card says next to the button that one press includes any change to what CoderHelm's own roles may do; those always stay inside the install's permissions boundary, and the deploy role can't change itself or the boundary. When it would replace or remove data, it stops: the card lists what it replaces or removes, in words, and **Replace the data and apply** applies exactly those changes (if they changed since the page showed them, it asks again). The raw CloudFormation list is under **Technical details**.
- **The maintenance window started it (auto-update on):** it applies by itself, except when it would replace or remove data or change permissions: then it waits, admins get an email, and you confirm it on the page the same way. If auto-update was turned off before it ran, it waits for you to press **Apply**.
- **It changes the deploy role or a permissions boundary:** the deploy role can't change those (that is what keeps it from giving itself more), so CoderHelm can't apply it for you. The page says so and links to the change set: someone with administrator rights in the AWS account reviews it and chooses **Execute**. Releases do this rarely, and their notes say so.
- **The deploy role and the permissions boundaries never change in an update.** The deploy role can't change itself or a boundary (that is what keeps it from giving itself more), and executing the change set in the AWS console doesn't get around it: the stack's service role is the deploy role, so AWS runs it as that role whoever presses **Execute**. So every update keeps your install's own deploy role and boundaries exactly as they are, and the rest of the release installs. A release that needs newer ones lists them under [Permissions](#permissions), as a separate step.
- **Before it runs**, the updater checks every IAM call the change set needs against the deploy role's own policy and boundary, as IAM has them now. If one would be refused, the update stops before anything changes and says which call and which rule refused it.
5. **Follows it.** The updater reads the change set and the stack every 5 minutes until the update ends, and again each time **Settings, then System** asks, so the page never shows an older state than CloudFormation's. An update executed outside the app (in the AWS console or the AWS CLI) is followed the same way, and the history records it as applied in the AWS console. Before it calls the update a success, it checks that the stack reports the new release. When the stack update starts, the install's own copy step checks every file of the release against the sha256 that `coderhelm.json` lists before any part changes. If a part fails, CloudFormation rolls the whole stack back to the previous release by itself.
6. **Reports.** The history in **Settings, then System** shows the version, when, who (or "auto") and the result: succeeded, failed, or rolled back. A try that didn't succeed says in plain words what happened, where your install is now and what to do next; CloudFormation's own text (for the first resource that failed) is under **Technical details**. Admins get an email when it failed or rolled back; a finished update is only in the history.

Expand Down
Loading
Loading