-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(networking): For Helia and Others. #7
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nishant Arora <[email protected]>
Signed-off-by: Nishant Arora <[email protected]>
Signed-off-by: Nishant Arora <[email protected]>
Signed-off-by: Nishant Arora <[email protected]>
Signed-off-by: Nishant Arora <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review.
@@ -160,7 +172,7 @@ func RunAction(c *cli.Context) error { | |||
// Initialize ipfs client | |||
var ipfsClient *shell.Shell | |||
if c.Int("ipfs-api-port") != 0 { | |||
ipfsClient = shell.NewShell(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", c.Int("ipfs-api-port"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this right here becomes a problem as soon as you're dealing with docker networking. The containers should be allowed to bind to any IP, not the localhost always like kubo prefers.
@@ -176,7 +178,7 @@ func (p *probe) initBrowser() error { | |||
// Initialize browser reference | |||
p.browser = rod.New(). | |||
Context(p.ctx). // stop when outer ctx stops | |||
ControlURL(fmt.Sprintf("ws://localhost:%d", p.cdpPort)) | |||
ControlURL(fmt.Sprintf("ws://%s:%d", p.chromeHost, p.cdpPort)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we're at it, might as well.
@@ -0,0 +1,66 @@ | |||
version: "3.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample of how these values can be used to host an ipfs implementation in a container.
db: | ||
image: postgres:14 | ||
ports: | ||
- "5432:5432" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no custom port needed.
command: bash -c "cd /tiros && go run *.go run" | ||
networks: | ||
tiros_net: | ||
ipv4_address: 172.20.0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional
depends_on: | ||
- db | ||
- helia | ||
- chrome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
important.
Signed-off-by: Nishant Arora <[email protected]>
dnsmasq: | ||
image: 4km3/dnsmasq:2.85-r2 | ||
command: -A /.helia/172.20.0.2 | ||
ports: | ||
- 53:53/udp | ||
cap_add: | ||
- NET_ADMIN | ||
networks: | ||
tiros_net: | ||
ipv4_address: 172.20.0.10 # Static IP here makes it possible to point other containers' dns here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom DNS resolves all requests to helia.
Run:
docker compose -f docker-compose.helia.yml up
Fixes runs for https://github.com/ipfs/helia-http-gateway
The problem:
KI (mac):