From e5effa743b7888319c6cd689701915f1950c2642 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 31 Dec 2017 18:00:04 +0000 Subject: [PATCH] ipfs command permissions --- src/freedombone-app-ipfs | 7 +++++-- src/freedombone-image-mesh | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index ebd65dc7..84ab8b0e 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -451,11 +451,14 @@ function mesh_install_ipfs_go { echo '[Unit]' > $IPFS_USER_DAEMON echo 'Description=IPFS go daemon' >> $IPFS_USER_DAEMON + echo 'After=syslog.target' >> $IPFS_USER_DAEMON + echo 'After=network.target' >> $IPFS_USER_DAEMON echo '' >> $IPFS_USER_DAEMON echo '[Service]' >> $IPFS_USER_DAEMON + echo 'Type=simple' >> $IPFS_USER_DAEMON echo "ExecStart=$IPFS_PATH/ipfs daemon" >> $IPFS_USER_DAEMON echo 'Restart=on-failure' >> $IPFS_USER_DAEMON - echo 'RestartSec=10' >> $IPFS_USER_DAEMON + echo 'RestartSec=60' >> $IPFS_USER_DAEMON echo '' >> $IPFS_USER_DAEMON echo '[Install]' >> $IPFS_USER_DAEMON echo 'WantedBy=default.target' >> $IPFS_USER_DAEMON @@ -539,7 +542,7 @@ function install_ipfs_go { fi # initialise - chmod +x $IPFS_PATH/ipfs + chmod 755 $IPFS_PATH/ipfs su -c "$IPFS_PATH/ipfs init -b 2048" - $MY_USERNAME if [ ! -d /home/$MY_USERNAME/.ipfs ]; then echo "IPFS could not be initialised for user $MY_USERNAME" diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index 9ba5ffea..a91722e5 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -985,6 +985,7 @@ function setup_ipfs { IPFS_COMMAND=$IPFS_PATH/ipfs IPFS_PUBLIC=/home/$MY_USERNAME/.ipfs-public + chmod 755 $IPFS_COMMAND su -c "systemctl --user enable ipfs" - $MY_USERNAME if [ -f $CURRENT_BLOG_INDEX ]; then @@ -1033,7 +1034,7 @@ function setup_ipfs { shred -zu /home/$MY_USERNAME/.ipfs-public fi - chmod +x $IPFS_COMMAND + chmod 755 $IPFS_COMMAND su -c "$IPFS_COMMAND init -b $IPFS_KEY_LENGTH" - $MY_USERNAME if [ ! -d /home/$MY_USERNAME/.ipfs ]; then echo "IPFS could not be initialised for user $MY_USERNAME" >> $INSTALL_LOG