-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Make dashboard bind to IPv4 & IPv6 when available #5699
Conversation
Will give this a try today and get back to you! |
I think it's safe to review this while we're waiting on feedback from Josh, as it's a fairly small change and I've already verified by other means ( |
Just confirming that @OnlyOneJMJQ got back to me via Slack and confirmed that this change does indeed fix the issue he observed in #5690 |
Just realized that I need to add some doc comments and improve a bit of the error handling so we're not throwing cryptic |
Argh, so this is frustrating... I added better error handling for the case when the user mistypes their desired hostname, but it turns out that the error handling code is unreachable due to how we provision additional ports for the websocket servers. That is, when I purposefully test with a mistyped hostname, it throws The bigger issue is that the I think this means that in order to make this change properly I need to refactor the message bus to reuse the cc @cliffoo as FYI |
Co-authored-by: David Murdoch <[email protected]>
c23883c
to
c1e0c34
Compare
- Removes the need to listen on three ports to run the dashboard - Removes the problematic port allocation strategy for the publish/subscribe server implementations
c1e0c34
to
d455f78
Compare
Closing this for now as the changes here are too big for something that we are not able to reliably reproduce on our end. If we can reproduce this in the future we'll revisit it. |
PR description
Addresses issue #5690.
This change makes it so that the dashboard server and dashboard message bus listens on both IPv4 and IPv6 for a given hostname. In the event that one of the two protocols is not available for a given hostname, it will only listen on the protocol that is available.
Testing instructions
truffle dashboard
in your project of choice.dashboard
network to connect to host127.0.0.1
and ensure thattruffle migrate --reset --network dashboard
succeeds under this configuration.dashboard
network to connect to host::1
and ensure thattruffle migrate --reset --network dashboard
succeeds under this configuration.dashboard
network to connect to hostlocalhost
and ensure thattruffle migrate --reset --network dashboard
succeeds under this configuration.Documentation
doc-change-required
label to this PR if documentation updates are required.Breaking changes and new features
breaking-change
andnew-feature
labels for the appropriate packages.Note to reviewers
There's a bit of unfortunate code duplication here. I would have preferred to put the logic for resolving the IPs of a given local hostname into the
@truffle/dashboard-message-bus-common
package, but the webpack operation in the build for the dashboard frontend choked on the node-specific modules that are used by this logic (theos
andnet
modules). As a result, I decided it was easier to temporarily duplicate this code between theutils
module in the dashboard server, and theutils
module in thedashboard-message-bus
module.That said, we're still not breaking "the rule of three" here, so hopefully this can be approved as-is. However if #5621 happens to be ready to merge before this PR, I can rebase this code on
develop
, move the logic to@dashboard-message-bus-common
, and drop thenet
andos
packages in the dashboard's newly-ejected webpack config.