diff --git a/ipfs/init/001-config.sh b/ipfs/init/001-config.sh index 5954fb6..5161306 100644 --- a/ipfs/init/001-config.sh +++ b/ipfs/init/001-config.sh @@ -11,8 +11,11 @@ ipfs config --json Gateway.NoFetch true # DHT client mode with accelerated providing ipfs config --json Routing '{ "Type": "dhtclient", "AcceleratedDHTClient": true }' -# Reprovider config was renamed to Provide in go-ipfs 0.38+ -ipfs config --json Provide '{ "Interval": "22h", "Strategy": "pinned+mfs", "Enabled": true }' +# Reprovider config name changed in go-ipfs 0.38+. Try the new key first, then fall back. +PROVIDER_CFG='{ "Interval": "22h", "Strategy": "pinned+mfs", "Enabled": true }' +if ! ipfs config --json Provide "$PROVIDER_CFG" 2>/dev/null; then + ipfs config --json Reprovider "$PROVIDER_CFG" +fi # Keep connection manager within reasonable bounds ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }'