mirror of
https://github.com/fluencelabs/node-distro
synced 2025-07-30 21:42:05 +00:00
32 lines
990 B
Plaintext
32 lines
990 B
Plaintext
#!/usr/bin/with-contenv bash
|
|
|
|
# IPFS_PATH is set to /config/ipfs in Dockerfile
|
|
# ipfs config
|
|
if [ ! -d "/config/ipfs" ]; then
|
|
ipfs init
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
|
|
ipfs config --json Addresses.API '"/ip4/0.0.0.0/tcp/5001"'
|
|
ipfs config --json Addresses.Gateway '"/ip4/0.0.0.0/tcp/8080"'
|
|
|
|
# remove default bootstraps
|
|
ipfs bootstrap rm --all
|
|
|
|
# enable Private Network feature by copying swarm.key to $IPFS_HOME
|
|
# https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#private-networks
|
|
cp /defaults/ipfs_preshared_swarm.key /config/ipfs/swarm.key
|
|
|
|
# to check that Private Network is enabled, look for a line
|
|
# 'Swarm is limited to private network of peers with the swarm key'
|
|
# in IPFS logs @ /config/log/ipfs
|
|
fi
|
|
|
|
# make our folders
|
|
mkdir -p \
|
|
/config/log/ipfs \
|
|
/run
|
|
|
|
# permissions
|
|
chown -R abc:abc /config
|
|
chown -R abc:abc /.fluence
|