Repository navigation
Make the addresses wire-pod uses for robots configurable - #533
Open
Mikeycallin1 wants to merge 1 commit into
Open
Mikeycallin1 wants to merge 1 commit into
Mikeycallin1 wants to merge 1 commit into
Conversation
wire-pod assumes it can discover its own reachable address, and that the
address a robot appears to come from is the robot's. Both hold on a flat LAN
and neither holds behind a reverse proxy, a container bridge or a router, where
every robot arrives at the same gateway address and that address is what gets
stored and later dialled.
Two separate addresses become configurable, kept deliberately distinct:
robot_facing_address inbound - what robots dial to reach wire-pod. Goes
into the certificate SANs and
server_config.json, which must agree or the
robot's pinned-leaf handshake fails.
robot_lan_addresses outbound - per robot, what wire-pod dials to reach that
robot for the SDK app, camera stream and
jdocs.
Behind a proxy the observed peer address is also useless as an identity key, so
a robot is identified by the ESN it reports on the connection check, or by its
own token's requestor_id on refresh.
All of this is off unless proxy_mode is set. A default install writes a
byte-identical apiConfig.json, regenerates no certificate and changes no
on-disk shape - the new fields are omitempty and absent when unset. Identity
resolution is gated too, deliberately: on a direct LAN the peer address is the
better signal, and preferring the reported ESN there would retire the mDNS
browse that repairs a robot's stored address after DHCP moves it.
The first-run wizard gains a checkbox and an address field. Bot Setup gains a
per-robot address table, shown only when proxy_mode is on. An address can also
be captured automatically during BLE adoption.
Tests cover the paths that could damage an existing install: config
byte-identity, write-then-reload round trips, both gates asserted at the level
of their consequences, and certificate/server_config coherence. The repo has no
test CI, so they run only when invoked:
cd chipper && go test ./pkg/vars/... ./pkg/servers/token/... \
./pkg/wirepod/setup/... ./pkg/wirepod/sdkapp/...
Contributor
|
ngl, this is a lot for something that can be resolved by reserving your Vectors IP so it doesn't change. Also don't Vectors broadcast their IP via mDNS just like WirePod does? - it seems it would be easier during Vector discovery to update the IP automatically so this reverse proxy is not needed (I would need to verify this) |
This branch has not been deployed
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.
Fixes the problem in #532, and the one reported in #213.
The problem
wire-pod assumes two things that only hold on a flat LAN:
GetOutboundIP()Behind a reverse proxy, a container bridge or a router, every robot arrives at
the same gateway address. That address gets stored against each robot and later
dialled for the SDK app, camera stream and jdocs — so wire-pod ends up calling
the proxy instead of the robot. The robot reports as unreachable while being
perfectly healthy.
What this adds
Two addresses, kept deliberately distinct because conflating them breaks TLS:
robot_facing_addressserver_config.json, which must agree or the robot's pinned-leaf handshake failsrobot_lan_addressesBehind a proxy the peer address is also useless as an identity key, since
several call sites look a robot up by its stored address. So a robot is
identified by the ESN it reports on the connection check (
?emresn=), or byits own token's
requestor_idon refresh.UI: a checkbox and address field in the first-run wizard; a per-robot address
table in Bot Setup, shown only when
proxy_modeis on. The address can also becaptured automatically during BLE adoption.
Existing installs are unaffected
Everything is off unless
proxy_modeis set:omitempty, so a default install'sapiConfig.jsonstays byte-identicalit stays a deliberate admin action. A coherence check only warns
botSdkInfo.jsonkeeps its exact on-disk shapeaddress is the better signal, and preferring the reported ESN there would
retire the mDNS browse that repairs a robot's stored address after DHCP
moves it
Testing
The repo has no test CI, so these only run when invoked:
They concentrate on what could damage an existing install: config
byte-identity, write-then-reload round trips, certificate/
server_configcoherence, and both gates asserted at the level of their consequences rather
than their return values — for example that a stock install does not rewrite a
robot's stored GUID from an unverifiable token claim.
Happy to drop the tests from the PR if you would rather not carry them.
What is not covered
The two BLE reads in the adoption capture need real hardware, so they are
manually verified only. The decision logic around them is in an untagged file
and is tested.