fix(networking): For Helia and Others.#7
Open
whizzzkid wants to merge 6 commits intoprobe-lab:mainfrom
Open
Conversation
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
whizzzkid
commented
Oct 31, 2023
cmd_run.go
Outdated
| // 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"))) |
Author
There was a problem hiding this comment.
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.
| 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)) |
Author
There was a problem hiding this comment.
while we're at it, might as well.
| @@ -0,0 +1,66 @@ | |||
| version: "3.9" | |||
Author
There was a problem hiding this comment.
sample of how these values can be used to host an ipfs implementation in a container.
| db: | ||
| image: postgres:14 | ||
| ports: | ||
| - "5432:5432" |
| command: bash -c "cd /tiros && go run *.go run" | ||
| networks: | ||
| tiros_net: | ||
| ipv4_address: 172.20.0.5 |
Comment on lines
+45
to
+48
| depends_on: | ||
| - db | ||
| - helia | ||
| - chrome |
Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
whizzzkid
commented
Oct 31, 2023
Comment on lines
+12
to
+21
| 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. |
Author
There was a problem hiding this comment.
custom DNS resolves all requests to helia.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run:
docker compose -f docker-compose.helia.yml upFixes runs for https://github.com/ipfs/helia-http-gateway
The problem:
KI (mac):