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

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 <noreply@anthropic.com>
@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
17 checks passed
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