Repository navigation
Conversation
The box still dials the Frankfurt relay unless app_link.command_endpoint names wss://cloud.ftw.energy. That door speaks the same Noise frames on its own outbound socket. The data uplink cannot carry them: its downlink is a closed set and it closes on a relay frame. A cloud handshake that does not complete falls back to the relay, and the exchange socket and dead-man rows follow the door that accepted the box. Default behavior is unchanged. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
6 tasks done
Member
Author
|
Please pause this. Fredrik decided on 15 October 2026 that commands move to FTW Cloud by a tunnel inside the existing 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
Remote commands still leave the house through an outbound socket to the Frankfurt relay (
wss://relay.ftw.energy). FTW Cloud already has a separate data uplink (wss://cloud.ftw.energy/v1/box, from the work in #1595). A parallel change is teachingftwclouddthe relay's frame format so the same Noise sessions can be forwarded there.This is the home-box half.
app_link.command_endpointchooses the command door:wss://relay.ftw.energy: today's behavior, no second dialwss://cloud.ftw.energy: the box dials that origin and appends/r/{epoch}/{handle}/boxand/exchangeas it does for the relay. If the WebSocket handshake does not complete, that attempt falls back to the relay. The next attempt tries the cloud again.Any other origin is refused at config load. A settings save that moves the door asks for a restart, because the uplink is dialed at startup.
Noise still ends at the phone. The box still only dials out. The cloud, like the relay, forwards opaque bytes and holds no key the box accepts for a change of state.
Scope and safety
The data uplink cannot carry these frames, so the sockets are not multiplexed:
cloudwire.Downlinkischallenge,hello_ok,watch,resyncandpurgedgo/internal/cloudlinkmay import onlygo/protocol, so command handling cannot live thereThe exchange socket and the dead-man HTTPS origin follow the door that accepted the box socket, so a phone and a watch meet in the same room and a farewell is posted to the door that is actually holding the connection.
Open PRs also touch
go/cmd/ftw/main.go(#1628, #1364) andgo/internal/config/config.go(#1051, #1003) for unrelated work. This change is additive in those files.Default stays the relay. Nothing here publishes a release.
Verification
Passed locally:
go test ./internal/appuplink/ ./internal/config/ -count=1go test ./cmd/ftw/ -count=1 -run 'CommandDoor|AppLink'Covered: omitted endpoint stays the relay with no fallback; the cloud door falls back when the handshake is refused and is preferred when it accepts; the exchange socket stays on the door that accepted the box; a path (including
/v1/box) is refused; changing the door requires a restart.No UI change. Not run against a live
ftwclouddcommand door; that half is the parallel port.Checklist