Repository navigation
cyberpunkunicorn-os: internet relay, device side - #12
Merged
Merged
Conversation
The board joins its private Supabase Realtime channel device:<id> with a
15-minute token from frequency-web's realtime-token route (scanner key),
over a small TLS WebSocket + Phoenix client of our own, and runs
broadcast rpc lines through the same code as USB, limited to the
owner's allowed_cmds (never cli.run or remote.relay). Replies go back as
"reply", events as "evt", presence tracks {online, version}.
remote::runLine() now holds one lock around every handler, so lines from
USB, BLE and the relay never run two at once. Off by default (NVS
remote/relay): Remote app "Internet remote", `remote relay on|off`,
rpc remote.relay. Never beside Bluetooth; a check-in POST asks it to
step aside when RAM is short. system.status reports relay state.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AycPrTRVXqSDZhb2NNfyG6
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.
Stacked on #10. Retarget it to
mainafter #10 merges. This is Phase 4b of the plan: the website controls the board from any network.What changes
apps/remote/relay.{h,cpp}: acu_relaytask.POST /api/v1/devices/realtime-token, using the scanner key fromfrequency.provision.realtime_urlover our own small TLS WebSocket client. No new library deps.realtime:device:<id>as a private channel with presence, sends a heartbeat every 25 s, and re-mints the token about 2 min before expiry with anaccess_tokenpush.rpclines run throughremote::runLine(), the same code as USB. Replies go back asreplyand events asevt, both{line}. Presence tracks{online, version}.rpclines, and only commands in the token'sallowed_cmds.cli.runandremote.relayare always refused (not_allowed).remote::runLine()is split out ofhandleLine()and holds one lock around every handler. Lines from USB, BLE and the relay never run two at once.remote/relay): Remote app → Internet remote,remote relay on|off, orrpc remote.relay {on}.system.statusgainsrelay:{enabled, state, error?}, and the Remote status screen shows it.Verified
DEVICE_RELAY_ENABLEDandSUPABASE_JWT_SECRET(RUNBOOKS "Internet relay"), plus the owner'sPATCH /api/v1/me/devices/{id} {"relayEnabled":true}.remote relay on, andremoteshould showonline. Then broadcastrpc {"id":1,"cmd":"system.status"}ondevice:<id>and expect areply.cli.runshould answernot_allowed.Generated by Claude Code