diff --git a/Scripts/ipfs-server.sh b/Scripts/ipfs-server.sh index faed9151..df610f15 100755 --- a/Scripts/ipfs-server.sh +++ b/Scripts/ipfs-server.sh @@ -6,14 +6,17 @@ # Source: github.com/fleschutz/PowerShell # License: CC0 +HOSTNAME="`hostname`" ipfs init --profile server ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001 ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8765 -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://pi:5001", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://$HOSTNAME:5001", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' echo "NOTE: Make sure port 4001 for IPv4/v6 is open by your router!" -ipfs daemon --enable-pubsub-experiment & +while true; do + ipfs daemon +done exit 0