|
|
|
@ -11,8 +11,11 @@ ipfs config --json Gateway.NoFetch true
|
|
|
|
# DHT client mode with accelerated providing
|
|
|
|
# DHT client mode with accelerated providing
|
|
|
|
ipfs config --json Routing '{ "Type": "dhtclient", "AcceleratedDHTClient": true }'
|
|
|
|
ipfs config --json Routing '{ "Type": "dhtclient", "AcceleratedDHTClient": true }'
|
|
|
|
|
|
|
|
|
|
|
|
# Reprovider config was renamed to Provide in go-ipfs 0.38+
|
|
|
|
# Reprovider config name changed in go-ipfs 0.38+. Try the new key first, then fall back.
|
|
|
|
ipfs config --json Provide '{ "Interval": "22h", "Strategy": "pinned+mfs", "Enabled": true }'
|
|
|
|
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
|
|
|
|
# Keep connection manager within reasonable bounds
|
|
|
|
ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }'
|
|
|
|
ipfs config --json Swarm.ConnMgr '{ "Type": "basic", "LowWater": 50, "HighWater": 200, "GracePeriod": "20s" }'
|
|
|
|
@ -31,16 +34,19 @@ set_json_if_present() {
|
|
|
|
if [ -f "$SWARM_KEY_PATH" ] && [ -s "$SWARM_KEY_PATH" ]; then
|
|
|
|
if [ -f "$SWARM_KEY_PATH" ] && [ -s "$SWARM_KEY_PATH" ]; then
|
|
|
|
ipfs config --json AutoConf.Enabled false
|
|
|
|
ipfs config --json AutoConf.Enabled false
|
|
|
|
ipfs config --json AutoTLS.Enabled false
|
|
|
|
ipfs config --json AutoTLS.Enabled false
|
|
|
|
set_json_if_present Bootstrap "${IPFS_PRIVATE_BOOTSTRAP:-[]}"
|
|
|
|
ipfs config --json Bootstrap "[]"
|
|
|
|
ipfs config --json DNS.Resolvers "{}"
|
|
|
|
ipfs config --json DNS.Resolvers "{}"
|
|
|
|
ipfs config --json Ipns.DelegatedPublishers "[]"
|
|
|
|
ipfs config --json Ipns.DelegatedPublishers "[]"
|
|
|
|
ipfs config --json Swarm.Transports.Network '{ "TCP": true, "Websocket": false }'
|
|
|
|
ipfs config --json Swarm.Transports.Network '{ "TCP": true, "Websocket": false }'
|
|
|
|
set_json_if_present Peering.Peers "${IPFS_PEERING_PEERS:-[]}"
|
|
|
|
ipfs config --json Peering.Peers "[]"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ipfs config --json AutoConf.Enabled true
|
|
|
|
ipfs config --json AutoConf.Enabled true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
set_json_if_present Addresses.Announce "${IPFS_ANNOUNCE_ADDRESSES:-[]}"
|
|
|
|
set_json_if_present Bootstrap "${IPFS_PRIVATE_BOOTSTRAP:-}"
|
|
|
|
|
|
|
|
set_json_if_present Peering.Peers "${IPFS_PEERING_PEERS:-}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_json_if_present Addresses.Announce "${IPFS_ANNOUNCE_ADDRESSES:-}"
|
|
|
|
if [ -z "${IPFS_NOANNOUNCE_ADDRESSES:-}" ]; then
|
|
|
|
if [ -z "${IPFS_NOANNOUNCE_ADDRESSES:-}" ]; then
|
|
|
|
ipfs config --json Addresses.NoAnnounce '["/ip4/127.0.0.1","/ip6/::1"]'
|
|
|
|
ipfs config --json Addresses.NoAnnounce '["/ip4/127.0.0.1","/ip6/::1"]'
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -50,7 +56,6 @@ fi
|
|
|
|
if [ -n "${IPFS_SWARM_ANNOUNCE_PRIVATE:-}" ]; then
|
|
|
|
if [ -n "${IPFS_SWARM_ANNOUNCE_PRIVATE:-}" ]; then
|
|
|
|
set_json_if_present Swarm.AddrFilters "${IPFS_SWARM_ANNOUNCE_PRIVATE}"
|
|
|
|
set_json_if_present Swarm.AddrFilters "${IPFS_SWARM_ANNOUNCE_PRIVATE}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# CORS for RPC API (visible only in docker network)
|
|
|
|
# CORS for RPC API (visible only in docker network)
|
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
|
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
|
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT","POST","GET"]'
|
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT","POST","GET"]'
|
|
|
|
|