Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: init script sed in non existent file #1246

Merged
merged 2 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
8 changes: 5 additions & 3 deletions init-and-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

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"
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

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