Skip to content

feat(cloud): release builds know FTW Cloud by its key - #1609

Merged
frahlg merged 2 commits into
masterfrom
claude/cloud-release-key
Oct 13, 2026
Merged

frahlg merged 2 commits into
masterfrom
claude/cloud-release-key

Conversation

@frahlg

@frahlg frahlg commented Oct 13, 2026

Copy link
Copy Markdown
Member

Release builds can now turn FTW Cloud on. cloudlink.ServiceKeys carries the public service key of cloud.ftw.energy. The endpoint was already wss://cloud.ftw.energy/v1/box. Nothing else changes: FTW Cloud stays off until an owner turns it on, and the box checks every hello_ok and every downlink message against this one key.

The key

BG6EvBxFzSHPVsQOES6PYaKFo5vHQmte9lJ6D5OBIT9JgcBrJAOxAucdqKXxS76pToQ7orI1Ivsno0OtxbMuliQ

  • It is the key the service holds in Secrets Manager as ftw-cloud/service-key. srcfl/ftw-cloud#2 recorded it when the host was set up. docs: add device identity reference #3 checked it when the key moved to Secrets Manager, and Docs: testing guide + test status snapshot #6 checked it again after a reboot.
  • The live run below checks it a fourth time: the deployed service's hello_ok verifies with it.
  • Only the public half is here. I did not read or touch the private key.

Rotation

docs/protocol-cloud.md now has "Rotating the service keys". A release carries the new public half next to the old one; once boxes have updated, the service switches; a later release drops the old half. If the key leaks, a release with only the new key goes out at once. To stand in for the service, an attacker would also need the TLS certificate for cloud.ftw.energy.

Tests

  • New: TestAReleaseBuildTrustsOnlyTheServicesKey. It checks the release endpoint and that the release keys parse to exactly one P-256 key. A box with the release keys then talks to a service that has its own key: the box says hello, hears hello_ok, sends nothing more, and does not report itself connected.
  • go test -race ./cmd/ftw ./internal/cloudlink ./internal/api passes.
  • The uplink changeset no longer says that release builds name no service. A new changeset says what this PR changes.

Live run (13 Oct, 10:38–10:42, a laptop, not the home box)

Two builds of this branch, with the same state directory, so they share one box key:

  1. Wrong key (-X …cloudlink.ServiceKeys=<a fresh key>). FTW Cloud on over loopback at 10:40:33. The box reached cloud.ftw.energy, sent its hello, and refused each answer: cloudlink: the service broke the protocol: hello_ok did not check out, six times in 20 s with backoff. GET /api/cloud said connected: false.
  2. Release (plain go build ./cmd/ftw, no -X). It started at 10:41:09 and logged FTW Cloud uplink connected home=m733cwqi7bdyhwuf2iyn3dj6ui at 10:41:34.754. GET /api/cloud said connected: true.
  3. Off. DELETE /api/cloud/grant at 10:41:51. The service deleted the test home and sent its receipt at 10:41:51.539 (purgedAtMs). The box deleted its cloud.key. Then I stopped Core.

🤖 Generated with Claude Code

cloudlink.ServiceKeys now carries cloud.ftw.energy's public service
key, so a release build can turn FTW Cloud on when an owner asks. The
endpoint was already wss://cloud.ftw.energy/v1/box. Nothing dials until
an owner grants, and the box checks every hello_ok and downlink message
against this key alone.

A test shows that a release build refuses a service that signs with any
other key: the box says hello, hears hello_ok, and sends nothing more.
docs/protocol-cloud.md says how the key rotates. The uplink changeset
no longer says release builds name no service.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T08:45:20.986618Z 081e0d8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 081e0d8803

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,5 @@
---
"ftw": patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Mark the Cloud activation as a minor release

When the Version Packages workflow consumes this changeset, it will publish the first release in which an owner can enable FTW Cloud as a patch. That is a visible new capability, not a fix, so this entry must use minor and receive the required owner approval; otherwise the release version understates the user-visible change.

AGENTS.md reference: AGENTS.md:L164-L168

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit c6ab8ee into master Oct 13, 2026
@frahlg
frahlg deleted the claude/cloud-release-key branch November 11, 2026 09:13
frahlg added a commit that referenced this pull request Nov 28, 2026
ADR 0008 and the Cloud protocol said nothing had shipped. FTW betas link
to cloud.ftw.energy since v0.141.7-beta.1 (#1609), and pairing turns the
readable copy on with Cloud. The ADR keeps its original line, dated, and
gains a note of 28 November 2026; the protocol's first line says which
releases speak it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
frahlg added a commit that referenced this pull request Nov 28, 2026
* docs: say the Cloud copy runs while FTW Cloud is on

README and the architecture page called the readable copy opt-in and off
by default. Pairing or accepting the Cloud terms sends a grant with every
scope in cloud_scopes, and the copy has no switch of its own. The pairing
page now says turning Cloud off is how to stop it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* docs(cloud): add a dated note that FTW Cloud has shipped in betas

ADR 0008 and the Cloud protocol said nothing had shipped. FTW betas link
to cloud.ftw.energy since v0.141.7-beta.1 (#1609), and pairing turns the
readable copy on with Cloud. The ADR keeps its original line, dated, and
gains a note of 28 November 2026; the protocol's first line says which
releases speak it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* docs(contract): say statistics come with the Cloud grant

The comment on cloud_purposes said statistics were a separate consent,
off unless the owner turned them on. Under the current Cloud terms a
grant carries both purposes with no separate statistics switch. Comment
only; the generated constants do not change. Paired copies go into
ftw-webapp and ftw-app.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant