get further. need more test

This commit is contained in:
fred 2021-09-06 02:19:30 +02:00
parent 1bf1651699
commit 36f0fbaea2
1 changed files with 25 additions and 31 deletions

View File

@ -32,7 +32,7 @@ fi
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script EXIT" && exit 1
echo -e "Astroport IPFS Layer installation..."
echo -e "IPFS + Astroport Light installation..."
[[ $(which pip3) ]] && sudo pip3 install duniterpy || (echo "python3 pip3 is missing on your device. EXIT" && exit 1)
[[ ! $(which curl) ]] && sudo apt-get install curl -y
@ -82,11 +82,6 @@ fi
|| ipfs init -p server
## Special Xbian init.d config
if [[ "$USER" == "xbian" ]]; then
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
sudo chmod 755 /etc/init.d/ipfs
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
else
## DEBIAN SYSTEMCTL
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
cat > /tmp/ipfs.service <<EOF
@ -113,7 +108,6 @@ EOF
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
sudo systemctl daemon-reload
sudo systemctl enable ipfs
fi
###########################################
@ -136,49 +130,41 @@ ipfs config --json Swarm.ConnMgr.HighWater 0
## Install gateway on 8181 port
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
# ipfs bootstrap rm --all
## get code from https://tube.copylaradio.com/ipfs/
###########################################
# BOOTSTRAP NODES ARE ADDED LATER
###########################################
## Declare directory transfered in IPFS
IPFS_sync_directory="$HOME/astroport"
mkdir -p $IPFS_sync_directory
########################################################################
# INSTALL KEYS
# GET IPFS KEYS & CONVERSIONS
########################################################################
IPFSNODEID=$(ipfs config Identity.PeerID)
## TODO convert to secret.dunikey
########################################################################
echo "INIT ~/.zen/ipfs/.${IPFSNODEID} INDEX"
echo "CREATION IDENTITE BALISE IPFS ~/.zen/ipfs/.${IPFSNODEID} /G1SSB"
########################################################################
rm -Rf ~/.zen/ipfs
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
########################################################################
# Give $XZUID to your (gchange friends)
########################################################################
echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID"
XZUID="$(hostname)-$RANDOM$RANDOM"
echo "SETTING _xbian.zuid PROFILE NAME = $XZUID"
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid
########################################################################
########################################################################
echo "Getting tryme.addr & .mycode from OASIS
-- Change oasis address to fork Astroport Code Universe --"
-- Change oasis address to fork your Astroport Code Universe --"
########################################################################
ipfs bootstrap rm --all
OASIS=12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
# aries=12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
for bootnode in $(curl https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/tryme.addr)
for bootnode in $(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/tryme.addr)
do
## ADD $bootnode TO BOOTSTRAP
ipfs bootstrap add $bootnode
done
codesign=$(curl https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/.mycode)
codesign=$(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/.mycode)
########################################################################
echo "RESTARTING ipfs"
########################################################################
@ -189,16 +175,23 @@ sleep 10
echo ".... ACTUAL SWARM PEERS ..."
ipfs swarm peers
echo "Station IPFS OK
astrXbian $codesign INSTALL OK
echo "IPFS OK
====================
Station Astroport INSTALL
Activation ~/.zen/astrXbian/zen/cron_VRFY.sh
Récupération CODE /ipfs/$codesign
"
## GETTING SAME SOURCE CODE AS OASIS
mkdir -p /home/$USER/.zen/astrXbian/
ipfs get --output=/home/$USER/.zen/astrXbian/ /ipfs/$codesign
## Make scripts executable
find /home/$USER/.zen/astrXbian/ -name "*.sh" -exec chmod u+x '{}' \;
find /home/$USER/.zen/astrXbian/ -name "*.py" -exec chmod u+x '{}' \;
########################################################################
# SUDO permissions
echo "# Setting $USER SUDO permissions ON fail2ban mount umount apt-get apt systemctl"
########################################################################
## USED FOR fail2ban-client (DEFCON)
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
@ -211,14 +204,15 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo
## USED FOR "systemctl restart ipfs"
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
## INSTALL TiddlyWiki
## TODO G1SSB CONFIG
echo "## INSTALL TiddlyWiki /ipns/${IPFSNODEID}/.${IPFSNODEID}/index.html"
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
echo "OK.
echo "Tout semble OK?!
NE PAS OUBLIER!!
Ajoutez le compagnon IFPS à votre navigateur.
Documentation : https://docs.ipfs.io/install/ipfs-companion/
Traduction FR : https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/
"