Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent running server on exposed network address #276

Closed
agostbiro opened this issue Jun 21, 2023 · 3 comments
Closed

Prevent running server on exposed network address #276

agostbiro opened this issue Jun 21, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@agostbiro
Copy link
Contributor

When I run the workspace as part of an integration test I get this popup on the latest MacOS:

Screenshot 2023-06-21 at 11 39 45

This indicates that the server tries to listen on an exposed network address. Ideally, the server would only run on localhost by default and then this popup wouldn't show.

A quick look at the source shows that the default address is indeed localhost:

pub const DEFAULT_RPC_URL: &str = "http://localhost";

so there must be something weird going on to get this popup.

Happy to dig in and provide a PR if you think it's important.

@agostbiro agostbiro changed the title Prevent running server on network address Prevent running server on exposed network address Jun 21, 2023
@frol
Copy link
Collaborator

frol commented Jun 26, 2023

@agostbiro Good catch. Yeah, it is indeed annoying and it is better to solve it. I believe it is not RPC that is not running on localhost, but the P2P part of neard. Workspaces-rs sandbox launches neard server and neard uses two TCP ports: (1) RPC, (2) p2p network. Workspaces-rs patches the config to specify the proper RPC IP:address:

https://github.com/near/workspaces-rs/blob/c31a955df8a55a6c82cedaaf820ed9236ee1fee5/workspaces/src/network/server.rs#L100

My guess is that it does not patch the network addr (I see that it seems to patch the port)

Please, address it.

@frol frol added the enhancement New feature or request label Jun 26, 2023
@frol frol added the good first issue Good for newcomers label Jun 26, 2023
agostbiro added a commit to agostbiro/workspaces-rs that referenced this issue Jun 27, 2023
@agostbiro
Copy link
Contributor Author

Thanks @frol , that was helpful! It turns out that there were two separate causes for the popups, so it was a bit involved to track them down, but the fix is in now: #277

@frol
Copy link
Collaborator

frol commented Jun 30, 2023

Resolved in #277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants