Skip to content

Commit

Permalink
Merge pull request #20 from gildlab/develop
Browse files Browse the repository at this point in the history
udp only in docker
  • Loading branch information
thedavidmeister committed Nov 7, 2023
2 parents 89c63ec + c48b769 commit 9d0c1d2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
gl_ipfs:
container_name: gl_ipfs
image: gildlab/ipfs-node:${GILDLAB_IPFS_NODE_CHANNEL}.ipfs
pull_policy: always
restart: always
# dont expose anything in particular use nginx for that
# localhost and ephemeral ports only
Expand All @@ -14,7 +15,9 @@ services:
# - "127.0.0.1::4001"
# - "127.0.0.1::4001/udp"
# expose directly here for now, can use nginx in future
- "4001:4001"
# Disabling tcp due to router issues. 4001/udp is fine.
# https://github.com/ipfs/kubo/issues/3320#issuecomment-1321103079
# - "4001:4001"
- "4001:4001/udp"
# gateway
- "127.0.0.1::8080"
Expand All @@ -27,6 +30,7 @@ services:
gl_pin:
container_name: gl_pin
image: gildlab/ipfs-node:${GILDLAB_IPFS_NODE_CHANNEL}.pin
pull_policy: always
restart: always
depends_on:
gl_ipfs:
Expand All @@ -43,6 +47,7 @@ services:
gl_nginx:
container_name: gl_nginx
image: gildlab/ipfs-node:${GILDLAB_IPFS_NODE_CHANNEL}.nginx
pull_policy: always
restart: always
ports:
- "80:80"
Expand Down
6 changes: 3 additions & 3 deletions ipfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ipfs/kubo:v0.19.1
FROM ipfs/kubo:v0.20.0

ADD ./container-init.d/001-set-allow-origin.sh /container-init.d/001-set-allow-origin.sh
RUN chmod a+x /container-init.d/001-set-allow-origin.sh /container-init.d/001-set-allow-origin.sh
ADD ./container-init.d /container-init.d
RUN chmod a+x /container-init.d/*
6 changes: 6 additions & 0 deletions ipfs/container-init.d/000-cleanup-deprecated-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -euxo pipefail

# moved to Routing.AcceleratedDHTClient in Kubo 0.21
# ipfs config --bool Experimental.AcceleratedDHTClient null
ipfs config profile apply default-networking
9 changes: 9 additions & 0 deletions ipfs/container-init.d/002-set-udp-only.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -euxo pipefail

# https://github.com/ipfs/kubo/issues/3320#issuecomment-1321103079
ipfs config --bool Swarm.Transports.Network.TCP false
# https://github.com/ipfs/kubo/issues/9998
ipfs config --json Swarm.Transports.Network.Websocket false
# https://github.com/ipfs/kubo/blob/master/docs/config.md#addressesswarm
ipfs config --json Addresses.Swarm '["/ip4/0.0.0.0/udp/4001/quic","/ip4/0.0.0.0/udp/4001/quic-v1","/ip4/0.0.0.0/udp/4001/quic-v1/webtransport","/ip6/::/udp/4001/quic","/ip6/::/udp/4001/quic-v1","/ip6/::/udp/4001/quic-v1/webtransport"]'
5 changes: 5 additions & 0 deletions ipfs/container-init.d/004-set-allow-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -euxo pipefail

# This is inside the docker container, nginx wraps it.
ipfs config --json Addresses.API '"/ip4/0.0.0.0/tcp/5001"'
10 changes: 3 additions & 7 deletions pin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
FROM nixos/nix

RUN nix-channel --update

RUN nix-shell -p bash jq curl xe dig --run exit
FROM nixos/nix:2.16.1

# Get latest gildlab cli from main
RUN nix-shell -p rustc cargo pkgconfig openssl --run 'cargo install --git https://github.com/gildlab/gildlab-cli --branch main'
ENV PATH="$PATH:$USER/.cargo/bin"
RUN nix --extra-experimental-features "nix-command flakes" --print-build-logs profile install github:gildlab/gildlab-cli && nix-collect-garbage -d
RUN gildlab-cli --version

ADD . .
RUN chmod a+x /main.sh
Expand Down

0 comments on commit 9d0c1d2

Please sign in to comment.