From 0725e2c3f53bb184cccdda337af5bb76825a4491 Mon Sep 17 00:00:00 2001 From: JGAntunes Date: Mon, 5 Mar 2018 03:19:17 +0000 Subject: [PATCH 1/2] fix: init script sed in non existent file --- init-and-daemon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init-and-daemon.sh b/init-and-daemon.sh index 0085bce4a5..df2fa48f17 100755 --- a/init-and-daemon.sh +++ b/init-and-daemon.sh @@ -9,10 +9,10 @@ else exit 1 fi -sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config - # Initialize the repo but ignore if error if it already exists # This can be the case when we restart a container without stopping/removing it node src/cli/bin.js init || true +sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config + node src/cli/bin.js daemon From 02895b15280adadf0ce93941398196335739f1d3 Mon Sep 17 00:00:00 2001 From: JGAntunes Date: Wed, 14 Mar 2018 01:31:34 +0000 Subject: [PATCH 2/2] chore: make IPFS api host on daemon script configurable --- Dockerfile | 1 + init-and-daemon.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e0db17242..a688f82b9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ENV IPFS_WRTC_LINUX_WINDOWS=1 ENV IPFS_BOOTSTRAP=1 ENV IPFS_MONITORING=1 ENV IPFS_PATH=/root/.jsipfs +ENV IPFS_API_HOST=0.0.0.0 ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3' diff --git a/init-and-daemon.sh b/init-and-daemon.sh index df2fa48f17..f406b5aa11 100755 --- a/init-and-daemon.sh +++ b/init-and-daemon.sh @@ -2,7 +2,7 @@ set -e -if [ -n $IPFS_PATH ]; then +if [ -n "$IPFS_PATH" ]; then echo "Using $IPFS_PATH as IPFS repository" else echo "You need to set IPFS_PATH environment variable to use this script" @@ -13,6 +13,8 @@ fi # This can be the case when we restart a container without stopping/removing it node src/cli/bin.js init || true -sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config +if [ -n "$IPFS_API_HOST" ]; then + sed -i.bak "s/127.0.0.1/$IPFS_API_HOST/g" $IPFS_PATH/config +fi node src/cli/bin.js daemon