diff --git a/.install/ipfs.service b/.install/ipfs.service new file mode 100644 index 0000000..20602e5 --- /dev/null +++ b/.install/ipfs.service @@ -0,0 +1,11 @@ +[Unit] +Description=IPFS daemon +After=network.target + +[Service] +User=_USER +ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/.install/ipfs.sh b/.install/ipfs.sh index f756105..0dff6b2 100755 --- a/.install/ipfs.sh +++ b/.install/ipfs.sh @@ -1,8 +1,12 @@ # Install IPFS ipfs() { - echo -e "${c_yellow}Onboarding IPFS...$c_" - [[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop + echo -e "${c_yellow}Onboarding IPFS...$c_" + BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + + is_ipfs_update_installed=$(which ipfs-update) + if [[ ! $is_ipfs_update_installed ]]; then + if [[ $ARM == "yes" ]]; then wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update" else @@ -18,15 +22,20 @@ ipfs() { echo "INSTALL latest ipfs" sudo ipfs-update install latest || err+="Install IPFS" + fi + + if [[ ! -f /etc/systemd/system/ipfs.service ]]; then + echo "CREATE SYSTEMD ipfs SERVICE" + sudo cp -f $BASE_DIR/ipfs.service /etc/systemd/system/ + sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service - echo "CREATE SYSTEMD ipfs SERVICE" - [[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service - sudo cp -f $MY_PATH/templates/1/ipfs.service /etc/systemd/system/ - sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service - - # sudo systemctl daemon-reload || err+="Restart IPFS" - # DO NOT START YET... Must get IPFS swarm.key from a G1SSB Pub !! + sudo systemctl daemon-reload || err+="Reload systemd" sudo systemctl enable ipfs || err+="Enable IPFS daemon" + # DO NOT START YET... Must get IPFS swarm.key from a G1SSB Pub !! + fi + + sudo systemctl stop ipfs + echo "ipfs OK. Daemon stop... continue..." } $@ diff --git a/.install/scuttlebutt.sh b/.install/scuttlebutt.sh index f139108..7ea9f09 100755 --- a/.install/scuttlebutt.sh +++ b/.install/scuttlebutt.sh @@ -1,16 +1,11 @@ #!/bin/bash scuttlebutt() { - echo -e "${c_yellow}Onboarding SCUTTLEBUTT...$c_" where_is_ssb_installed=$(which ssb-server) - - # Install npm_modules in ~/.zen/fatlayer_install - mkdir -p ~/.zen/fatlayer_install BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [[ ! $where_is_ssb_installed ]]; then - cd ~/.zen/fatlayer_install # Install dependencies sudo apt-get install -y socat python3-dev libtool python3-setuptools autoconf automake @@ -20,6 +15,7 @@ scuttlebutt() { nvm install --lts # Install sbot-server + [[ ! -d ~/.ssb_astroport ]] && mkdir -p ~/.ssb_astroport && cd ~/.ssb_astroport npm install sodium-native ssb-backlinks ssb-ws ssb-links ssb-query npm install -g ssb-server fi @@ -29,11 +25,11 @@ scuttlebutt() { [[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1 # BACKUP OLD SSB - [[ -d ~/.ssb ]] && mv ~/.ssb ~/.ssb.$USER # BACKUP OLD SSB + [[ ! -d ~/.ssb.$USER && -d ~/.ssb ]] && mv ~/.ssb ~/.ssb.$USER # BACKUP OLD SSB - # MAKE A LINK ~/.ssb.astroport to ~/.ssb - mkdir ~/.ssb.astroport - ln -s ~/.ssb.astroport ~/.ssb + # MAKE A LINK ~/.ssb_astroport to ~/.ssb + [[ ! -d ~/.ssb_astroport ]] && mkdir ~/.ssb_astroport + [[ ! -L ~/.ssb ]] && ln -s ~/.ssb_astroport ~/.ssb # Create config (TODO: adapt if public Pub or Local Node) nodename=$(cat /etc/hostname) @@ -84,18 +80,20 @@ EOF # Store current user as sudo will change it currentUser=$USER - # Copy SYSTEMD service to correct location - sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service - # Copy repplace __USER__ place holder to current user - sudo sed -i "s|__USER__|${currentUser}|g" /tmp/ssb.service - sudo sed -i "s|__SSBSERVER__|${ssbSERVER}|g" /tmp/ssb.service + if [[ ! -f /etc/systemd/system/ssb.service ]]; then + # Copy SYSTEMD service to correct location + sudo cp "$BASE_DIR/ssb.service" /tmp/ssb.service + # Copy repplace __USER__ place holder to current user + sudo sed -i "s|__USER__|${currentUser}|g" /tmp/ssb.service + sudo sed -i "s|__SSBSERVER__|${ssbSERVER}|g" /tmp/ssb.service - sudo mv /tmp/ssb.service /etc/systemd/system/ssb.service + sudo mv /tmp/ssb.service /etc/systemd/system/ssb.service - # Reload, Enable and start SSB Service - sudo systemctl daemon-reload - sudo systemctl enable ssb.service - sudo systemctl start ssb.service + # Reload, Enable and start SSB Service + sudo systemctl daemon-reload + sudo systemctl enable ssb.service + sudo systemctl start ssb.service + fi } diff --git a/doc/images/MIZ-One-LOVE-creation.jpg b/doc/images/MIZ-One-LOVE-creation.jpg new file mode 100644 index 0000000..5b1fa53 Binary files /dev/null and b/doc/images/MIZ-One-LOVE-creation.jpg differ diff --git a/doc/images/astroport3.png b/doc/images/astroport3.png new file mode 100644 index 0000000..2bb41ae Binary files /dev/null and b/doc/images/astroport3.png differ diff --git a/doc/images/astroport4.jpg b/doc/images/astroport4.jpg new file mode 100644 index 0000000..d98583f Binary files /dev/null and b/doc/images/astroport4.jpg differ diff --git a/doc/message_fred.mp3 b/doc/message_fred.mp3 new file mode 100644 index 0000000..ee9cde3 Binary files /dev/null and b/doc/message_fred.mp3 differ