Browse Source

1st bootstrap creates ~/.ipfs/swarm.key.defcon3

master
qo-op 1 week ago
parent
commit
3bd360d736
  1. 15
      zen/ipfs_SWARM_refresh.sh

15
zen/ipfs_SWARM_refresh.sh

@ -143,7 +143,7 @@ do
if [[ $ip && ! $isanybodyelseipmyfriend && ( $DEFCON < 5 ) && ! $isLAN ]]
then
## DEFCON 4
if [[ $DEFCON -eq 4 ]]; then ## DEFCON 4
### SECURITY CHOICE TO MAKE IN /etc/sudoers ###
# $USER ALL=(ALL:ALL) NOPASSWD:ALL
# $USER ALL=(ALL:ALL) NOPASSWD:/usr/bin/fail2ban-client
@ -154,10 +154,19 @@ do
sudo fail2ban-client set recidive banip $ip
# Show ALL banned IP
sudo fail2ban-client status recidive
fi
## DEFCON 3
# ACTIVATE PRIVATE SMARM !! BOOTSRAP OASIS creates and send a key to everyfriend he knows (PUB)
if [[ $DEFCON -eq 3 ]]; then ## DEFCON 3
# ACTIVATE PRIVATE SMARM !! 1ST BOOTSRAP creates and send a key to everyfriend he knows (PUB)
# HOWTO MAKE swarm.key echo -e "/key/swarm/psk/1.0.0/\n/base16/\n `tr -dc 'a-f0–9' < /dev/urandom | head -c64`" > ~/.ipfs/swarm.key
if [[ ! -f ~/.ipfs/swarm.key.defcon3 ]]; then
SWARMKEYnode=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | tail -n 1) ## FIRST BOOTSTRAP EMIT AND SEND swarm.key
nodeid=${SWARMKEYnode##*/}
KEYnode=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $nodeid)
[[ "$KEYnode" == "$G1PUB" ]] && echo -e "/key/swarm/psk/1.0.0/\n/base16/\n `tr -dc 'a-f0–9' < /dev/urandom | head -c64`" > ~/.ipfs/swarm.key.defcon3
fi
fi
## DEFCON 2
# nmap NOT FRIEND

Loading…
Cancel
Save