Skip to content

Commit 88a1294

Browse files
committed
Fix IPFS conf: use the recommended method to update IPFS configuration
1 parent bb3d24d commit 88a1294

File tree

4 files changed

+76
-42
lines changed

4 files changed

+76
-42
lines changed

deployment/samples/docker-compose/docker-compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,12 @@ services:
112112
- "127.0.0.1:5001:5001"
113113
volumes:
114114
- "pyaleph-ipfs:/data/ipfs"
115-
- "./kubo.json:/etc/kubo.json:ro"
115+
- "./001-update-ipfs-config.sh:/container-init.d/001-update-ipfs-config.sh:ro"
116116
environment:
117117
- IPFS_PROFILE=server
118118
networks:
119119
- pyaleph
120-
command: ["daemon", "--enable-pubsub-experiment", "--enable-gc", "--migrate",
121-
"--config-file", "/etc/kubo.json"]
120+
command: ["daemon", "--enable-pubsub-experiment", "--enable-gc", "--migrate"]
122121

123122

124123
networks:

deployment/samples/docker-compose/kubo.json

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/sh
2+
3+
# Kubo doc => https://github.com/ipfs/kubo/blob/master/docs/config.md
4+
5+
CONFIG_FILE="/data/ipfs/config"
6+
7+
if [ -f $CONFIG_FILE ]; then
8+
cp "$CONFIG_FILE" "$CONFIG_FILE.backup"
9+
fi
10+
11+
echo "Updating IPFS config file..."
12+
13+
# Enable the V1+V2 service
14+
ipfs config AutoNAT.ServiceMode 'enabled'
15+
16+
# Only announce recursively pinned CIDs
17+
ipfs config Reprovider.Strategy 'pinned'
18+
19+
# ONLY use the Amino DHT (no HTTP routers).
20+
ipfs config Routing.Type "dhtserver"
21+
22+
# Improve latency and read/write for large dataset
23+
ipfs config Routing.AcceleratedDHTClient --json 'true'
24+
25+
# Aleph + Public Bootstrap peers
26+
ipfs config Bootstrap --json '[
27+
"/ip4/51.159.57.71/tcp/4001/p2p/12D3KooWSdcuGvLfXgc6BPgDEqWYQirGpBWUmyXRwK5RmyM1T7Di",
28+
"/ip4/46.255.204.209/tcp/4001/p2p/12D3KooWHWNCn8t9NKQPBPZU61Fq6BoVw9XV37YsWTuMLwZXrEtj",
29+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
30+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
31+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
32+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
33+
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
34+
"/dnsaddr/va1.bootstrap.libp2p.io/p2p/12D3KooWKnDdG3iXw9eTFijk3EWSunZcFi54Zka4wmtqtt6rPxc8",
35+
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
36+
"/ip4/104.131.131.82/udp/4001/quic-v1/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
37+
]'
38+
39+
# soft upper limit to trigger GC
40+
ipfs config Datastore.StorageMax '10GB'
41+
42+
# time duration specifying how frequently to run a garbage collection
43+
ipfs config Datastore.GCPeriod '12h'
44+
45+
# Enable hole punching for NAT traversal when port forwarding is not possible
46+
ipfs config Swarm.EnableHolePunching --json 'true'
47+
48+
# Disable providing /p2p-circuit v2 relay service to other peers on the network.
49+
ipfs config Swarm.RelayService.Enabled --json 'false'
50+
51+
# Disable advertising networks (**Add your server provider network if you receive a netscan alert**)
52+
ipfs config Swarm.AddrFilters --json '[
53+
"/ip4/10.0.0.0/ipcidr/8",
54+
"/ip4/100.64.0.0/ipcidr/10",
55+
"/ip4/169.254.0.0/ipcidr/16",
56+
"/ip4/172.16.0.0/ipcidr/12",
57+
"/ip4/192.0.0.0/ipcidr/24",
58+
"/ip4/192.0.2.0/ipcidr/24",
59+
"/ip4/192.168.0.0/ipcidr/16",
60+
"/ip4/198.18.0.0/ipcidr/15",
61+
"/ip4/198.51.100.0/ipcidr/24",
62+
"/ip4/203.0.113.0/ipcidr/24",
63+
"/ip4/240.0.0.0/ipcidr/4",
64+
"/ip6/100::/ipcidr/64",
65+
"/ip6/2001:2::/ipcidr/48",
66+
"/ip6/2001:db8::/ipcidr/32",
67+
"/ip6/fc00::/ipcidr/7",
68+
"/ip6/fe80::/ipcidr/10",
69+
"/ip4/86.84.0.0/ipcidr/16"
70+
]'
71+
72+
echo "IPFS config updated!"

docs/guides/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ To check that the generation of the keys succeeded, check the content of your ke
116116
3. Run the node with Docker Compose
117117
===================================
118118

119-
Download the Kubo config file and Docker Compose file that defines how to run PyAleph and IPFS together.
119+
Download the Kubo config file script and Docker Compose file that defines how to run PyAleph and IPFS together.
120120

121121
.. parsed-literal::
122-
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/|pyaleph_version|/deployment/samples/docker-compose/kubo.json"
122+
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/|pyaleph_version|/deployment/scripts/001-update-ipfs-config.sh"
123123
wget "https://raw.githubusercontent.com/aleph-im/pyaleph/|pyaleph_version|/deployment/samples/docker-compose/docker-compose.yml"
124124
125125
At this stage, you will need your configuration file and your keys.

0 commit comments

Comments
 (0)