diff --git a/Dockerfile b/Dockerfile index b0b223e..ec086a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN apt update # upgrading packages against advice of phusion RUN apt upgrade -y -RUN apt install -y golang git build-essential +RUN apt install -y golang git build-essential rsync RUN go get -u github.com/ipfs/ipfs-update RUN /root/go/bin/ipfs-update install latest diff --git a/ipfsd.run b/ipfsd.run index 9968360..328a9cc 100644 --- a/ipfsd.run +++ b/ipfsd.run @@ -3,6 +3,12 @@ export IPFS="/usr/local/bin/ipfs" export HOME="/home/ipfs" +chown ipfs:ipfs $HOME + cd $HOME +if [[ ! -d $HOME/.ipfs ]]; then + chpst -u ipfs $IPFS init +fi + exec chpst -u ipfs $IPFS daemon diff --git a/sync.run b/sync.run index 6e74dc7..cb5b2d2 100644 --- a/sync.run +++ b/sync.run @@ -17,6 +17,8 @@ # Make a full sync of an Ubuntu mirror. # This currently requires more than 1TB of storage space and takes a long time. +chown ipfs:ipfs /mirror + chpst -u ipfs /bin/bash << '__EOF__' export IPFS=/usr/local/bin/ipfs