Page MenuHomePhabricator

[keyserver] Listen on all addresses in dev mode
ClosedPublic

Authored by ashoat on Dec 21 2022, 7:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 12, 9:13 PM
Unknown Object (File)
Fri, Jun 7, 5:23 AM
Unknown Object (File)
Fri, Jun 7, 5:22 AM
Unknown Object (File)
Thu, Jun 6, 11:07 PM
Unknown Object (File)
May 24 2024, 5:08 PM
Unknown Object (File)
May 24 2024, 5:08 PM
Unknown Object (File)
May 24 2024, 2:20 PM
Unknown Object (File)
May 24 2024, 2:20 PM
Subscribers

Details

Summary

When we were using Apache as a proxy, we only needed the keyserver to listen on localhost. That's because Apache was the only thing connected to Node, and Apache would always connect on localhost.

Now that clients are connecting directly to Node, we need to tell Node to listen on other addresses. Without this change, it's not possible to connect an external device to a keyserver running on a dev machine.

The reason we didn't catch this in D5846 was because the test plan was insufficient. In the future, we need to be even stricter with test plans.

Test Plan

Make sure a physical iOS device is able to connect to the keyserver running on my laptop using port 3000

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat retitled this revision from [keyserver] Listen to all ports in dev mode to [keyserver] Listen on all addresses in dev mode.Dec 21 2022, 7:39 AM
keyserver/src/keyserver.js
167 ↗(On Diff #19953)

looks like undefined will default to "0.0.0.0" for the socket addr, which will bind to all interfaces.

Seems like our desired logic would just be:

server.listen(parseInt(process.env.PORT, 10) || 3000);

Unless there's a compelling reason to limit the interfaces for docker.

keyserver/src/keyserver.js
167 ↗(On Diff #19953)
keyserver/src/keyserver.js
167 ↗(On Diff #19953)

I don't see why we would get rid of process.env.COMM_LISTEN_ADDR.

Unless there's a compelling reason to limit the interfaces for docker.

I think it's generally a good idea for security?

jon added inline comments.
keyserver/src/keyserver.js
167 ↗(On Diff #19953)

I think it's generally a good idea for security?

Probably, but only certain ports are exposed. I guess I don't feel strongly enough.

This revision is now accepted and ready to land.Dec 21 2022, 1:55 PM