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

Add extra_hosts #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

johnshaughnessy
Copy link
Contributor

@johnshaughnessy johnshaughnessy commented Jan 29, 2023

For local development, we have been mapping hubs.local to localhost via entries in the hostfile (/etc/hosts). With this docker setup, the services are running in separate containers and thus should not map to localhost for cross-service traffic.

Add extra_hosts so that hubs.local and hubs-proxy.local resolve to the host-gateway and containers can reach one another. It seems that host.docker.internal also only works for me (on linux) if it is included as an extra_host.

I don't know if this is the correct solution. I was inspired by this stackoverflow answer https://stackoverflow.com/a/70725882 , which comes with a warning and recommendation to define a custom network definition that will guarantee a specific gateway address.

Incidentally, @keianhzo 's open PR defines a subnet for the hubs_network: https://github.com/mozilla/hubs-compose/pull/16/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R166-R170

Following the advice linked above, we would add a gateway: to the config (and perhaps an ip_range, if necessary).

@bryanenders
Copy link
Contributor

bryanenders commented Jan 30, 2023

This is a design smell. hubs.local and hubs-proxy.local are external host names. It tells us that our software is attempting to communicate across the WAN instead of the LAN. Let’s figure out why and determine whether or not it should be that way before hacking the hosts file.

It’s also on my todo list to make hubs.local and hubs-proxy.local a piece of configuration in Reticulum. Unfortunately they are hard-coded throughout at present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants