From c19375e85ecb91c765de4d5efc98b0d8eff45181 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 17:27:17 +0100 Subject: [PATCH 01/17] adding all known Addresses to ipfstryme --- zen/bash_template.sh | 11 +++ zen/cesium_INIT.sh | 115 ------------------------ zen/cesium_IPFS_swarm.sh | 118 ------------------------- zen/gchange_INIT.sh | 17 ++-- zen/gchange_IPFS_swarm.sh | 32 +++---- zen/no_SPAM.sh | 44 --------- zen/tools/add_externIP_to_ipfstryme.sh | 26 +++++- 7 files changed, 50 insertions(+), 313 deletions(-) create mode 100644 zen/bash_template.sh delete mode 100755 zen/cesium_INIT.sh delete mode 100755 zen/cesium_IPFS_swarm.sh delete mode 100755 zen/no_SPAM.sh diff --git a/zen/bash_template.sh b/zen/bash_template.sh new file mode 100644 index 0000000..1cc11be --- /dev/null +++ b/zen/bash_template.sh @@ -0,0 +1,11 @@ +#!/bin/bash +######################################################################## +# Author: Fred (support@qo-op.com) +# Version: 2020.12.25 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); +IPFSNODEID=$(ipfs id -f='\n') diff --git a/zen/cesium_INIT.sh b/zen/cesium_INIT.sh deleted file mode 100755 index e4f5bde..0000000 --- a/zen/cesium_INIT.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -######################################################################## -# Author: Fred (support@qo-op.com) -# Version: 2020.11.30 -# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) -######################################################################## -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -ME="${0##*/}" - -######################################################################## -# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info -######################################################################## -YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); -IPFSNODEID=$(ipfs id -f='\n') -[[ $IPFSNODEID == "" ]] && echo "ERROR missing IPFS Node id !! EXIT" && exit 1 -######################################################################## -[[ ! -f ~/.zen/secret.dunikey ]] && echo "Missing ~/.zen/secret.dunikey. EXIT" && exit 1 -G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) -[[ $G1PUB == "" ]] && echo "ERROR G1PUB empty !! EXIT" && exit 1 -######################################################################## - -# GET NODE disk performance. TODO, publish and use as IPFS repartition -echo "DISK SIZE AVAILABLE & PERFORMANCE TESTING" -[[ -f ~/.ipfs/test.disk ]] && rm -f ~/.ipfs/test.disk -diskperf=$(dd if=/dev/zero of=~/.ipfs/test.disk bs=10M count=1 oflag=dsync 2>&1 | tail -n 1 | sed s/\,\ /\ -/g | cut -d '-' -f 4) -# echo $diskperf - -# IPFS LOCAL REPOSITORY for Node Identity -mkdir -p ~/.zen/ipfs/.$IPFSNODEID/G1SSB - -# find IPFSTRYME public address -echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr -for tryme in $(ipfs id | jq -r .Addresses[]); -do - isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") - [[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr -done -cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr - - -################################ -# ADD Cesium+ informations -CESIUMPLUS="https://g1.data.le-sou.org" - -# PREPARE title -# Made from Gchange+ profile tittle and city OR user@hostname -title=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq -r '._source.title') -[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna ]] && uidna=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_uidna) - -# Put in .$IPFSNODEID INDEX: _g1.uidna & _g1.cesium_name (used by Minetest flavour and others) -[[ $uidna ]] && echo "$uidna" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.uidna -[[ $title ]] && echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.cesium_name - -[[ $uidna ]] && [[ "$title" == "null" ]] && title="Station $uidna" -[[ "$title" == "null" ]] && title="Station $USER@$(cat /etc/hostname)" - -city=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq -r '._source.city') -[[ "$city" != "null" ]] && title="$title in $city" - -# ADD "cesium_geoPoint.lat" AND "cesium_geoPoint.lon" messages in SSB feed -# This way any SSB account is connected to its Cesium+ Geolocalisation. -geopointlat=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq '._source.geoPoint.lat') -geopointlon=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq '._source.geoPoint.lon') - -# REFRESH Cesium+ Avatar image -curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq -r '._source.avatar._content' | base64 -d > "~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.cesium.avatar.png" - -# Get nodename -[[ -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename ]] && nodename=$(cat /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename) -if [[ $nodename == "" ]]; then - nodename=$(cat /etc/hostname) - extension=$(echo $nodename | cut -d '.' -f 2) - if [[ $extension == $nodename ]]; then - nodename=$nodename.home - fi - echo "$nodename" > /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename -fi -######################################################################## -# DUNITER G1 Wallet balance -export LC_ALL=C.UTF-8 #attipix -export LANG=C.UTF-8 #attipix - -# COPY NODE G1SSB ID to IPFS -echo "$G1PUB" > ~/.zen/ipfs/.${IPFSNODEID}/G1SSB/_g1.pubkey - -# IPFS Node PUBLISH Adresses so Pub can become bootstrap for ${g1author} -ipfs id | jq -r .Addresses[] > ~/.zen/ipfs/.${IPFSNODEID}/Addresses - -# IPFS Node PUBLISH AgentVersion & repo.stat -ipfs id | jq -r .AgentVersion > ~/.zen/ipfs/.${IPFSNODEID}/AgentVersion -ipfs repo stat > ~/.zen/ipfs/.${IPFSNODEID}/repo.stat - -echo "$diskperf" > ~/.zen/ipfs/.${IPFSNODEID}/disk.perf -echo $(df ~/.ipfs/ | tail -n 1 | awk '{print $4}') > ~/.zen/ipfs/.${IPFSNODEID}/disk.bytes - - -IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) -NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS) - -### -# GET ALL MY CESIUMPLUS FRIENDS AND SEND THEM my IPFS Address - -cd ~/.zen/astrXbian/zen/jaklis -# GET LIST of issuer(s) who likes me -for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer'); -do - # CHECk if I am liking him either - friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours'); - echo "Sending IPFSTRYME message to $liking_me" - [[ $friend_of_mine != null ]] && ./jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr -done -cd - - -exit 0 diff --git a/zen/cesium_IPFS_swarm.sh b/zen/cesium_IPFS_swarm.sh deleted file mode 100755 index 2a4530e..0000000 --- a/zen/cesium_IPFS_swarm.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -######################################################################## -# Author: Fred (support@qo-op.com) -# Version: 2020.12.03 -# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) -######################################################################## -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -ME="${0##*/}" - -# Connect to IPFS peers with bidirectionnal "like" (Cesium+ friends) - -######################################################################## -# \\/// -# qo-op -############# '$MY_PATH/$ME' -######################################################################## -# ex: ./'$ME' -# GET CESIUM FRIENDS AND FIND THEIR IPFS ID TO "ipfs swarm connect" THEM -########################################################################' - -## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 (use natools to sign messages?) - - -######################################################################## -# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info -######################################################################## -IPFSNODEID=$(ipfs id -f='\n') -[[ $IPFSNODEID == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1 -isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) -[[ ! $isIPFSRunning ]] && echo "ERROR! ipfs daemon is not running. EXIT" && exit 1 -######################################################################## - -# Force Strict #swarm0 !!? -# ipfs bootstrap rm --all -echo "" > ~/.zen/A_allow_ip.txt - -echo "" > ~/.zen/A_liking_me_NO_ipfstryme.txt # contains "friends" with no "ipfstryme" incoming message -liking_me_count=0 -friend_of_mine_count=0 -######################################################################## -# Let's look for Friends and "IPFS swarm connect" with them -######################################################################## -cd ~/.zen/astrXbian/zen/jaklis -rm -f ~/.zen/A_allow_ipfsid.txt ~/.zen/A_allow_ip.txt - -# 1. Get C+ "liking_me" people list -for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer'); -do - # Check if my like is reverse - friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours'); - - [[ $friend_of_mine != null ]] && echo "Connect to my friend $liking_me" && friend_of_mine_count=$((friend_of_mine_count+1)) && ipfsadd=0 \ - && for peer in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); - # 2. Searching "ipfstryme" message from friend_of_mine - do - ip=$(echo "$peer" | awk -F '/' '{print $3}') && [[ $ip == "" ]] && continue || echo "Adding $ip to ~/.zen/A_allow_ip.txt" - # Fill a file with friend of mine ip - echo $ip >> ~/.zen/A_allow_ip.txt - # Get its ipfsnodeid - ipfsnodeid=$(echo "$peer" | awk -F '/' '{print $8}') - echo $ipfsnodeid >> ~/.zen/A_allow_ipfsid.txt - - g1id=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py "$ipfsnodeid") - if [[ "$g1id" == "$friend_of_mine" ]]; then - # 3. ADD liking_me friend_of_mine to my swarm & bootstrap - ipfs swarm connect $peer; - ipfs bootstrap add $peer; - - ipfsadd=$((ipfsadd+1)) - else - echo "ALERT!!! $friend_of_mine spoofing is happening" - fi - done; - - - if [[ $friend_of_mine != null ]]; then - if [[ $ipfsadd == 0 ]]; then - # Friend of mine with no ipfstryme message (did not install astroport?) - echo "No 'ipfstryme' message... from $liking_me" - echo "$liking_me" >> ~/.zen/A_liking_me_NO_ipfstryme.txt - - else - # REMOVING DUPLICATES OLD ipfstryme MESSAGES - nbmessage=0 - for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') - do - nbmessage=$((nbmessage+1)) - [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ./jaklis.py delete -i $messageid - done - fi - - fi - - # Automatic level_1 like from oasis.astroport.com (TODO add other default bootstrap) - # TODO get $g1pub from ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.pubkey ?? - # [[ $friend_of_mine == null && $G1PUB == "2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS" ]] && ./jaklis.py like -p $g1pub -s 1 - echo "__________________________________________" - liking_me_count=$((liking_me_count+1)) - -done - - -echo "#################################################### -I have $friend_of_mine_count friends amoung $liking_me_count liking me people -__________________________________________ -My actual #SWARM0" -ipfs swarm peers -echo "__________________________________________" -echo -## Could send message to friends with 'ipfstryme' message -for line in $(cat ~/.zen/A_liking_me_NO_ipfstryme.txt | uniq); do - echo "Liking each other, but no ipfstryme received..." - echo "cd ~/.zen/astrXbian/zen/jaklis" - echo "./jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" -done - -cd - diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index fe6e23e..037c4a5 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -30,12 +30,6 @@ diskperf=$(dd if=/dev/zero of=~/.ipfs/test.disk bs=10M count=1 oflag=dsync 2>&1 mkdir -p ~/.zen/ipfs/.$IPFSNODEID/G1SSB # find IPFSTRYME public address -echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr -for tryme in $(ipfs id | jq -r .Addresses[]); -do - isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") - [[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr -done ~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr @@ -103,16 +97,15 @@ NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS) ### # GET ALL MY GCHANGE FRIENDS AND SEND THEM my IPFS Address - -cd ~/.zen/astrXbian/zen/jaklis # GET LIST of issuer(s) who likes me -for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer'); +for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do # CHECk if I am liking him either - friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours'); + friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours'); echo "Sending IPFSTRYME message to $liking_me" - [[ $friend_of_mine != null ]] && ./jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr + [[ $friend_of_mine != null ]] && ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr done + echo 'SEND ipfstryme to A_boostrap_nodes.txt listed PUBs' # Add your bootstrap Pub here for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do @@ -122,7 +115,7 @@ if [[ $g1node != "" ]]; then ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr fi done -cd - + # SHOW RESULT cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index cd89698..5a855b0 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -19,10 +19,8 @@ ME="${0##*/}" # ex: ./'$ME' # GET GCHANGE FRIENDS AND FIND THEIR IPFS ID TO "ipfs swarm connect" THEM ########################################################################' - ## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 - ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info ######################################################################## @@ -35,38 +33,36 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr # Force Strict #swarm0 !!? # ipfs bootstrap rm --all echo "" > ~/.zen/A_allow_ip.txt - +echo "" > ~/.zen/A_allow_ipfsid.txt echo "" > ~/.zen/A_liking_me_NO_ipfstryme.txt # contains "friends" with no "ipfstryme" incoming message liking_me_count=0 friend_of_mine_count=0 + ######################################################################## # Let's look for Friends and "IPFS swarm connect" with them ######################################################################## -cd ~/.zen/astrXbian/zen/jaklis -rm -f ~/.zen/A_allow_ipfsid.txt ~/.zen/A_allow_ip.txt - # 1. Get Gchange "liking_me" people list -for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer'); +for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do # Check if my like is reverse - friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours'); + friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours.pseudo'); # contains my XZUID [[ $friend_of_mine != null ]] && echo "Connect to my friend $liking_me" && friend_of_mine_count=$((friend_of_mine_count+1)) && ipfsadd=0 \ - && for peer in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); + && for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); # 2. Searching "ipfstryme" message from friend_of_mine do - ip=$(echo "$peer" | awk -F '/' '{print $3}') && [[ $ip == "" ]] && continue || echo "Adding $ip to ~/.zen/A_allow_ip.txt" + ip=$(echo "$peerline" | awk -F '/' '{print $3}') && [[ $ip == "" ]] && continue || echo "Adding $ip to ~/.zen/A_allow_ip.txt" # Fill a file with friend of mine ip echo $ip >> ~/.zen/A_allow_ip.txt # Get its ipfsnodeid - ipfsnodeid=$(echo "$peer" | awk -F '/' '{print $7}') + ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $7}') echo $ipfsnodeid >> ~/.zen/A_allow_ipfsid.txt g1id=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py "$ipfsnodeid") if [[ "$g1id" == "$friend_of_mine" ]]; then # 3. ADD liking_me friend_of_mine to my swarm & bootstrap - ipfs swarm connect $peer; - ipfs bootstrap add $peer; + ipfs swarm connect $peerline; + ipfs bootstrap add $peerline; ipfsadd=$((ipfsadd+1)) else @@ -84,21 +80,16 @@ do else # REMOVING DUPLICATES OLD ipfstryme MESSAGES nbmessage=0 - for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') + for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') do nbmessage=$((nbmessage+1)) - [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ./jaklis.py delete -i $messageid + [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ~/.zen/astrXbian/zen/jaklis/jaklis.py delete -i $messageid done fi fi - - # Automatic level_1 like from oasis.astroport.com (TODO add other default bootstrap) - # TODO get $g1pub from ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.pubkey ?? - # [[ $friend_of_mine == null && $G1PUB == "2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS" ]] && ./jaklis.py like -p $g1pub -s 1 echo "__________________________________________" liking_me_count=$((liking_me_count+1)) - done @@ -116,4 +107,3 @@ for line in $(cat ~/.zen/A_liking_me_NO_ipfstryme.txt | uniq); do echo "./jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" done -cd - diff --git a/zen/no_SPAM.sh b/zen/no_SPAM.sh deleted file mode 100755 index 2d62c9d..0000000 --- a/zen/no_SPAM.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -######################################################################## -# Author: Fred (support@qo-op.com) -# Version: 2020.03.18 -# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) -######################################################################## -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -######################################################################## -# \\/// -# qo-op -############# -########################## -####################################### -#################################################### -######################################################################## - -######################################################################## -# check /tmp/cmd_received_$SOURCEH and /tmp/cmd_SPAM_$SOURCEH within 1mn - -# Remove older than a minute received COMMAND -find /tmp -cmin +1 -type f -name "cmd_received_*" -exec rm -f '{}' \; 2>/dev/null -# Filter Acknowlegement -if [[ "$CMD" != "ACK" && "$CMD" != "DELIVERED" && "$CMD" != "PENDING" ]]; then - # Still less than a minute with same $SOURCEH - if [[ -f "/tmp/cmd_received_$SOURCEH" ]]; then - # Create SPAM file => Stop answering - if [[ ! -f "/tmp/cmd_SPAM_$SOURCEH" ]]; then - echo $(date) > "/tmp/cmd_SPAM_$SOURCEH" - fi - return 1 - fi - echo "$COMMAND" > "/tmp/cmd_received_$SOURCEH" - # Remove SPAM flag older than one day - find /tmp -ctime +1 -type f -name "cmd_SPAM_*" -exec rm -f '{}' \; 2>/dev/null -else - # THIS IS AN AKNOWLEGEMENT - return 1 -fi -# Remove SPAM flag older than one day -find /tmp -ctime +1 -type f -name "cmd_SPAM_*" -exec rm -f '{}' \; 2>/dev/null -return 0 - - diff --git a/zen/tools/add_externIP_to_ipfstryme.sh b/zen/tools/add_externIP_to_ipfstryme.sh index cb980ba..1cb1349 100755 --- a/zen/tools/add_externIP_to_ipfstryme.sh +++ b/zen/tools/add_externIP_to_ipfstryme.sh @@ -11,12 +11,32 @@ ME="${0##*/}" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); IPFSNODEID=$(ipfs id -f='\n') -EXTERNIP=$(curl -s http://whatismyip.akamai.com/) +#EXTERNIP=$(curl -s http://whatismyip.akamai.com/) ######################################################################## -echo "ADD $EXTERNIP to /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr" +echo "ADDING KNOWN Adresses to /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr" ######################################################################## mkdir -p ~/.zen/ipfs/.${IPFSNODEID} -echo "/ip4/$EXTERNIP/udp/4001/astro/p2p/${IPFSNODEID}" >> /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr +# echo "/ip4/$EXTERNIP/udp/4001/astro/p2p/${IPFSNODEID}" >> /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr +# Doesn't have the right NATed port, so pretty useless... +echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr +for tryme in $(ipfs id | jq -r .Addresses[]); +do + isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") + [[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr && echo "ME = $tryme" +done + +# Now adding "ipfs swarm peers" to ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr +for tryme in $(ipfs swarm peers); +do + echo "___________________________________________" + echo "$tryme" + isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") + [[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr && echo "___________________________________________ADDING" +done +# UNIQ TOUT CA +cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr | uniq > /tmp/tryme.addr +cp -f /tmp/tryme.addr ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr +rm -f /tmp/tryme.addr exit 0 From 6ee6c9a9af7d1372d3c6f961ce768935b862cde2 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 18:10:39 +0100 Subject: [PATCH 02/17] create swarm_map and my_swam files --- zen/gchange_IPFS_swarm.sh | 96 +++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 55 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 5a855b0..0b4c292 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -32,9 +32,8 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr # Force Strict #swarm0 !!? # ipfs bootstrap rm --all -echo "" > ~/.zen/A_allow_ip.txt -echo "" > ~/.zen/A_allow_ipfsid.txt -echo "" > ~/.zen/A_liking_me_NO_ipfstryme.txt # contains "friends" with no "ipfstryme" incoming message +echo "" > ~/.zen/A_my_swarm.txt +echo "" > ~/.zen/A_swram_map.txt liking_me_count=0 friend_of_mine_count=0 @@ -44,66 +43,53 @@ friend_of_mine_count=0 # 1. Get Gchange "liking_me" people list for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do + [[ "$liking_me" == "" ]] && continue + # DE TOUS CEUX QUI M'AIMENT JE VAIS LIRE LES MESSAGES pour collecter les ipfstryme vers ~/.zen/A_swram_map.txt + # SI JE SUIS LEUR AMI EN RETOUR, je conserve leur ID dans ~/.zen/A_my_swarm.txt # Check if my like is reverse - friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours.pseudo'); # contains my XZUID - - [[ $friend_of_mine != null ]] && echo "Connect to my friend $liking_me" && friend_of_mine_count=$((friend_of_mine_count+1)) && ipfsadd=0 \ - && for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); - # 2. Searching "ipfstryme" message from friend_of_mine - do - ip=$(echo "$peerline" | awk -F '/' '{print $3}') && [[ $ip == "" ]] && continue || echo "Adding $ip to ~/.zen/A_allow_ip.txt" - # Fill a file with friend of mine ip - echo $ip >> ~/.zen/A_allow_ip.txt - # Get its ipfsnodeid - ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $7}') - echo $ipfsnodeid >> ~/.zen/A_allow_ipfsid.txt - - g1id=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py "$ipfsnodeid") - if [[ "$g1id" == "$friend_of_mine" ]]; then - # 3. ADD liking_me friend_of_mine to my swarm & bootstrap - ipfs swarm connect $peerline; - ipfs bootstrap add $peerline; - - ipfsadd=$((ipfsadd+1)) - else - echo "ALERT!!! $friend_of_mine spoofing is happening" - fi - done; - - - if [[ $friend_of_mine != null ]]; then - if [[ $ipfsadd == 0 ]]; then - # Friend of mine with no ipfstryme message (did not install astroport) - echo "No 'ipfstryme' message... from $liking_me" - echo "$liking_me" >> ~/.zen/A_liking_me_NO_ipfstryme.txt - - else - # REMOVING DUPLICATES OLD ipfstryme MESSAGES - nbmessage=0 - for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') - do - nbmessage=$((nbmessage+1)) - [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ~/.zen/astrXbian/zen/jaklis/jaklis.py delete -i $messageid - done - fi - - fi - echo "__________________________________________" liking_me_count=$((liking_me_count+1)) + echo ">>>>>> CHECKING my friend n° $liking_me_count" + echo "READING 'ipfstryme' message from $liking_me" + for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); + do + echo "$peerline" + # A_swarm_map.txt + cat ~/.zen/A_swarm_map.txt | grep -v -E "$peerline" > ~/.zen/A_swarm_map.txt + # Fill a file with friend of mine ip + echo $peerline >> ~/.zen/A_swarm_map.txt + # Get its ipfsnodeid + + ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $7}') + whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) + echo "Am I friend whith $whoisg1 ?" + friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID + if [[ "$friend_of_mine" != "" ]]; then + friend_of_mine_count=$((friend_of_mine_count+1)) + echo "YEAH FRIEND !!!" + echo $peerline >> ~/.zen/A_my_swarm.txt + # REMOVING DUPLICATES OLD ipfstryme MESSAGES + nbmessage=0 + for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') + do + nbmessage=$((nbmessage+1)) + [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ~/.zen/astrXbian/zen/jaklis/jaklis.py delete -i $messageid + sleep 0.5 + done + fi + done; + + echo "__________________________________________" + done +cat ~/.zen/A_my_swarm.txt echo "#################################################### I have $friend_of_mine_count friends amoung $liking_me_count liking me people __________________________________________ My actual #SWARM0" ipfs swarm peers -echo "__________________________________________" -echo -## Could send message to friends with 'ipfstryme' message -for line in $(cat ~/.zen/A_liking_me_NO_ipfstryme.txt | uniq); do - echo "Liking each other, but no ipfstryme received..." - echo "cd ~/.zen/astrXbian/zen/jaklis" - echo "./jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" -done + +# HONTO SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" + From 3e69a3d4a8378ca2050a3a543542d6735e59639b Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 18:27:47 +0100 Subject: [PATCH 03/17] extended ipfstryme protocol --- zen/gchange_IPFS_swarm.sh | 13 +-------- zen/ipfs_SWARM_refresh.sh | 59 ++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 0b4c292..9786e5e 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -8,18 +8,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" -# Connect to IPFS peers with bidirectionnal "like" (Gchange or Cesium+ friends) -# configured in jaklis/.env - -######################################################################## -# \\/// -# qo-op -############# '$MY_PATH/$ME' -######################################################################## -# ex: ./'$ME' -# GET GCHANGE FRIENDS AND FIND THEIR IPFS ID TO "ipfs swarm connect" THEM -########################################################################' -## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 +# create swarm_map and my_swam files ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index c7912e6..ab5b481 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -37,48 +37,43 @@ rm -Rf /home/$YOU/.zen/ipfs_swarm/.Qm* rm -Rf /home/$YOU/.zen/ipfs_swarm/* count=1 -for peer in $(ipfs swarm peers); +for peerline in $(ipfs swarm peers && cat ~/.zen/A_swarm_map.txt); do - ipfsnodeid=$(echo "$peer" | awk -F '/' '{print $8}') - ip=$(echo "$peer" | awk -F '/' '{print $3}') + ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $8}') + whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) + + ip=$(echo "$peerline" | awk -F '/' '{print $3}') + isLAN=$(echo $ip | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") + nowdate=$(date) timestamp=$(date -u +%s%N | cut -b1-13) - echo "$nowdate - $ipfsnodeid - $ip" - foundIp=$(cat ~/.zen/A_allow_ip.txt | grep "$ip") - foundIpfs=$(cat ~/.zen/A_allow_ipfsid.txt | grep "$ipfsnodeid") - isLAN=$(echo $ip | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") - - if [[ ! $foundIpfs && ! $isLAN ]] ; then - echo "${ip} of peer ${id} is not in the authorized ip list." - echo "${peer} will be removed from the swarm" - - ipfs swarm disconnect $peer - ipfs bootstrap rm $peer - - echo "# FAIL2BAN # $USER must activate no password sudo (Rpi & Xbian OK)" - if [[ $USER == "pi" || $USER == "xbian" ]]; then - echo "TODO BAN $ip ($ipfsnodeid)" - # sudo fail2ban-client add recidive 2>/dev/null 1>&2 - # sudo fail2ban-client start recidive - # sudo fail2ban-client set recidive banip $ip - # Show banned IP - # sudo fail2ban-client status recidive - fi - else - echo "${peer}" - echo "REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" - $MY_PATH/tools/timeout.sh -t 30 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid - - fi - + echo "### $nowdate ### whoisg1 : $ipfsnodeid - $ip" + echo "${peerline}" + myfriendpeer=$(cat ~/.zen/A_my_swarm.txt | grep $ipfsnodeid ) + if [[ "$myfriendpeer" != "" ]]; then + echo "REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" + $MY_PATH/tools/timeout.sh -t 30 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid + ipfs swarm connect $peerline + ipfs bootstrap add $peerline + else + echo "#YOU CAN ACTIVATE FAIL2BAN # ADD $USER NOPASSWD:ALL in /etc/sudoers" + # sudo fail2ban-client add recidive 2>/dev/null 1>&2 + # sudo fail2ban-client start recidive + # sudo fail2ban-client set recidive banip $ip + # Show banned IP + # sudo fail2ban-client status recidive + echo "FALSE BAN $ip ($ipfsnodeid)" + fi done +######################################################################## +######################################################################## +######################################################################## echo "$IPFSNODEID PUBLISHING /home/$YOU/.zen/ipfs/ to SWARM" [[ ! -d /home/$YOU/.zen/ipfs ]] && echo "ERROR : /home/$YOU/.zen/ipfs/ NOT FOUND" && exit 1 IWALLETS=$(ipfs add -rHq /home/$YOU/.zen/ipfs | tail -n 1) NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS) - # Retrieve my own data in /home/$YOU/.zen/ipfs_swarm/ ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID From 94c33418c35bfe030c1290d16136c00797983bf9 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 18:40:20 +0100 Subject: [PATCH 04/17] whoisg1 --- zen/gchange_IPFS_swarm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 9786e5e..c38d819 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -54,14 +54,14 @@ do friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID if [[ "$friend_of_mine" != "" ]]; then friend_of_mine_count=$((friend_of_mine_count+1)) - echo "YEAH FRIEND !!!" + echo "YEAH FRIEND ° $friend_of_mine_count !!!" echo $peerline >> ~/.zen/A_my_swarm.txt - # REMOVING DUPLICATES OLD ipfstryme MESSAGES + # REMOVING OLD ipfstryme MESSAGES nbmessage=0 - for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') + for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$whoisg1" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') do nbmessage=$((nbmessage+1)) - [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ~/.zen/astrXbian/zen/jaklis/jaklis.py delete -i $messageid + [ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $whoisg1" && ~/.zen/astrXbian/zen/jaklis/jaklis.py delete -i $messageid sleep 0.5 done fi From febfa874f33f2b531357ce28d9f6815a4cc990dd Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 18:43:39 +0100 Subject: [PATCH 05/17] ipfsnodeid extract error --- zen/gchange_IPFS_swarm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index c38d819..ddc574a 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -48,7 +48,7 @@ do echo $peerline >> ~/.zen/A_swarm_map.txt # Get its ipfsnodeid - ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $7}') + ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $8}') whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) echo "Am I friend whith $whoisg1 ?" friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID From 81694f5bc1d47e3914d246752fffcaf2be322834 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 18:50:37 +0100 Subject: [PATCH 06/17] INIT every hour (send ipfstryme message) --- cron_MINUTE.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index e7e6983..c4822a9 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -75,6 +75,8 @@ fi # /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ # ################################################################## +# +[[ "$minute" == "01" ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/gchange_INIT.sh & # REFRESH IPFS SWARM DATA EVERY 12 & 15 minutes [[ $(($minute % 12)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/gchange_IPFS_swarm.sh & [[ $(($minute % 15)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh & From ffd3f73d47510705b32f69fe896c26e7ccd41290 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 19:27:26 +0100 Subject: [PATCH 07/17] optimistic swarm connect --- A_boostrap_nodes.txt | 4 ++-- zen/gchange_INIT.sh | 19 ++++++++++++------- zen/ipfs_BOOTSTRAP_me.sh | 30 ------------------------------ 3 files changed, 14 insertions(+), 39 deletions(-) delete mode 100755 zen/ipfs_BOOTSTRAP_me.sh diff --git a/A_boostrap_nodes.txt b/A_boostrap_nodes.txt index d74b031..3190204 100644 --- a/A_boostrap_nodes.txt +++ b/A_boostrap_nodes.txt @@ -1,3 +1,3 @@ +# CONTAINS G1PUB of bootstrap PUB Station +# oasis.astroport.com 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS - -#csmld diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index 037c4a5..010808d 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -21,15 +21,14 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) ######################################################################## # GET NODE disk performance. TODO, publish and use as IPFS repartition -echo "DISK SIZE AVAILABLE & PERFORMANCE TESTING" [[ -f ~/.ipfs/test.disk ]] && rm -f ~/.ipfs/test.disk diskperf=$(dd if=/dev/zero of=~/.ipfs/test.disk bs=10M count=1 oflag=dsync 2>&1 | tail -n 1 | sed s/\,\ /\ -/g | cut -d '-' -f 4) -# echo $diskperf +echo "DISK PERFORMANCE TESTING : $diskperf" # IPFS LOCAL REPOSITORY for Node Identity mkdir -p ~/.zen/ipfs/.$IPFSNODEID/G1SSB -# find IPFSTRYME public address +# create IPFSTRYME public address file ~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr @@ -97,6 +96,7 @@ NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS) ### # GET ALL MY GCHANGE FRIENDS AND SEND THEM my IPFS Address +######################################################################## # GET LIST of issuer(s) who likes me for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do @@ -113,11 +113,16 @@ if [[ $g1node != "" ]]; then echo "LIKING my BOOTSTRAP node : $g1node" # ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.le-sou.org" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr + + isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ? + if [[ $isG1PUBoot == "$G1PUB" ]]; then + for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer') + do + echo "SENDING 3 STARS to $liking_me" + /home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3 + done + fi fi done - -# SHOW RESULT -cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr - exit 0 diff --git a/zen/ipfs_BOOTSTRAP_me.sh b/zen/ipfs_BOOTSTRAP_me.sh deleted file mode 100755 index cbfa88e..0000000 --- a/zen/ipfs_BOOTSTRAP_me.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -######################################################################## -# Author: Fred (support@qo-op.com) -# Version: 2020.12.22 -# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) -######################################################################## -# Auto maticaly accept incoming frendship sending back 3 stars like -# AstrXbian NODE running it starts acting like a "SSB" PUB -# Best using 24/24 public IP node + 1 TB - -# GET XZUID -[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && echo "ERROR no _xbian.zuid" && exit 1 -XZUID=$(cat ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid) # Should be hostname... but like that can be changed... - -isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ? - -if [[ $isG1PUBoot == "$G1PUB" ]]; then - for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer') - do - echo "SENDING 3 STARS to $liking_me" - /home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3 - echo "Our SWARM will join during ipfs_SWARM_refresh.sh RUN" - done -fi - -~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh - -echo "Share collected indexes as mine" -cp /var/www/astrxbian/FASTRXBIAN ~/.zen/ipfs/xbian/F${XZUID} - From 73ad041078e83cf2ed0eb72e44662e100551f09f Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 19:31:35 +0100 Subject: [PATCH 08/17] SLOW DOWN --- zen/gchange_INIT.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index 010808d..89b2b4b 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -104,6 +104,7 @@ do friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours'); echo "Sending IPFSTRYME message to $liking_me" [[ $friend_of_mine != null ]] && ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr + sleep 3 # SLOW DOWN done echo 'SEND ipfstryme to A_boostrap_nodes.txt listed PUBs' # Add your bootstrap Pub here From 7ec26b96c94e7ff75f5776d068b88834452e09d1 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 19:39:25 +0100 Subject: [PATCH 09/17] empty line continue --- zen/gchange_IPFS_swarm.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index ddc574a..8adf70a 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -32,7 +32,7 @@ friend_of_mine_count=0 # 1. Get Gchange "liking_me" people list for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do - [[ "$liking_me" == "" ]] && continue + [[ "$liking_me" == "" ]] && continue # DE TOUS CEUX QUI M'AIMENT JE VAIS LIRE LES MESSAGES pour collecter les ipfstryme vers ~/.zen/A_swram_map.txt # SI JE SUIS LEUR AMI EN RETOUR, je conserve leur ID dans ~/.zen/A_my_swarm.txt # Check if my like is reverse @@ -42,13 +42,14 @@ do for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); do echo "$peerline" - # A_swarm_map.txt + # KEEP A_swarm_map.txt uniq "$peerline" line cat ~/.zen/A_swarm_map.txt | grep -v -E "$peerline" > ~/.zen/A_swarm_map.txt # Fill a file with friend of mine ip echo $peerline >> ~/.zen/A_swarm_map.txt - # Get its ipfsnodeid - + + # Get its ipfsnodeid ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $8}') + [[ "$ipfsnodeid" == "" ]] && continue whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) echo "Am I friend whith $whoisg1 ?" friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID From fdf3ccc9de517bfd9fc6a8b00b2e3b2dd2d467d9 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 19:52:08 +0100 Subject: [PATCH 10/17] ~/.zen/ipfs_swarm/ SYNC --- zen/gchange_IPFS_swarm.sh | 14 +++++++------- zen/ipfs_SWARM_refresh.sh | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 8adf70a..3b82e93 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -9,6 +9,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" # create swarm_map and my_swam files +echo "" > ~/.zen/A_my_swarm.txt +echo "" > ~/.zen/A_swram_map.txt ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info @@ -21,8 +23,6 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr # Force Strict #swarm0 !!? # ipfs bootstrap rm --all -echo "" > ~/.zen/A_my_swarm.txt -echo "" > ~/.zen/A_swram_map.txt liking_me_count=0 friend_of_mine_count=0 @@ -41,13 +41,13 @@ do echo "READING 'ipfstryme' message from $liking_me" for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content'); do - echo "$peerline" + echo "PEERLINE: $peerline" # KEEP A_swarm_map.txt uniq "$peerline" line - cat ~/.zen/A_swarm_map.txt | grep -v -E "$peerline" > ~/.zen/A_swarm_map.txt - # Fill a file with friend of mine ip echo $peerline >> ~/.zen/A_swarm_map.txt - - # Get its ipfsnodeid + cat ~/.zen/A_swarm_map.txt | uniq > /tmp/A_swarm_map.txt + cp -f /tmp/A_swarm_map.txt ~/.zen/A_swarm_map.txt + + # Get ipfsnodeid ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $8}') [[ "$ipfsnodeid" == "" ]] && continue whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index ab5b481..381705d 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -52,18 +52,19 @@ do echo "${peerline}" myfriendpeer=$(cat ~/.zen/A_my_swarm.txt | grep $ipfsnodeid ) if [[ "$myfriendpeer" != "" ]]; then - echo "REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" - $MY_PATH/tools/timeout.sh -t 30 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid + echo "OK REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" + $MY_PATH/tools/timeout.sh -t 20 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid ipfs swarm connect $peerline ipfs bootstrap add $peerline else - echo "#YOU CAN ACTIVATE FAIL2BAN # ADD $USER NOPASSWD:ALL in /etc/sudoers" + echo "KO ___________________ # YOU CAN ACTIVATE FAIL2BAN" + # PLEASE ADD $USER NOPASSWD:ALL for fail2ban-client in /etc/sudoers # sudo fail2ban-client add recidive 2>/dev/null 1>&2 # sudo fail2ban-client start recidive # sudo fail2ban-client set recidive banip $ip # Show banned IP # sudo fail2ban-client status recidive - echo "FALSE BAN $ip ($ipfsnodeid)" + echo "?? BAN $ip ($ipfsnodeid)" fi done From aad0f3e235d867fd7919234c4ff6f353beaab687 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 19:59:42 +0100 Subject: [PATCH 11/17] better like that --- ISOconfig.sh | 4 ++-- install.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index dce2527..bf65898 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -124,8 +124,8 @@ echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ######################################################################## echo "CREATE + profile" ######################################################################## -~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" set --name "$XZUID" --avatar "/home/xbian/.zen/astrXbian/logo.png" #CESIUM+ -~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" set --name "$XZUID" --avatar "/home/xbian/.zen/astrXbian/logo.png" #GCHANGE+ +~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+ +~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #GCHANGE+ ### REVERT # ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" erase # ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" erase diff --git a/install.sh b/install.sh index 9761ffe..6d00896 100755 --- a/install.sh +++ b/install.sh @@ -49,9 +49,9 @@ sudo fail2ban restart ### Install astrxbian & NGINX config sudo rm -Rf /var/www/astrxbian sudo mkdir -p /var/www/astrxbian -sudo cp -Rf /home/xbian/.zen/astrXbian/www/xbian/* /var/www/astrxbian -sudo chown -R xbian:xbian /var/www/astrxbian -sudo cp -f /home/xbian/.zen/astrXbian/.install/templates/nginx/astrxbian.conf /etc/nginx/conf.d/ +sudo cp -Rf /home/$USER/.zen/astrXbian/www/xbian/* /var/www/astrxbian +sudo chown -R $USER:$USER /var/www/astrxbian +sudo cp -f /home/$USER/.zen/astrXbian/.install/templates/nginx/astrxbian.conf /etc/nginx/conf.d/ # TODO ####################################################################### # echo "Install JUKEBOOX" From 8db669bc467047b82523a00a0b73c213d3cb5035 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 20:11:03 +0100 Subject: [PATCH 12/17] simplify --- ISOconfig.sh | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index bf65898..50fa96e 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -15,34 +15,23 @@ # ~/.zen/ipfs.sync ######################################################################## # CHECK INTERNET CONNECTIVITY & git pull !! +rm -f /tmp/A_booting_log.txt ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || (echo "NO INTERNET CONNEXION" && exit 1) [[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || exit 1 # CHECK IF CONFIG ALREADY DONE !! Remove ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync if [[ -f ~/.zen/ipfs.sync ]]; then - echo "CONFIG ALREADY DONE" + echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt" source ~/.zen/ipfs.sync - # Wait for ipfs to connect to its swarm, then send ipfstryme to $friend_of_mine - sleep 30 - echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr # ERASE - for tryme in $(ipfs id | jq -r .Addresses[]); - do - isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") - [[ ! $isLAN && $tryme != "" ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr && echo "$tryme" - done + # Wait for ipfs to connect to its swarm + sleep 20 + ~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt + sleep 10 + ~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh >> /tmp/A_booting_log.txt + sleep 10 + ~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh >> /tmp/A_booting_log.txt - # NEW BOOT! SEND ipfstryme message to my friends... - cd ~/.zen/astrXbian/zen/jaklis - # GET LIST of issuer(s) who likes me - for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer'); - do - # CHECk if I am liking him either - friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours'); - echo "Sending IPFSTRYME message to $liking_me" - [[ $friend_of_mine != null ]] && ./jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr - done - cd - exit 0 fi @@ -132,7 +121,7 @@ echo "CREATE + profile" ######################################################################## ######################################################################## -echo "BECOME FRIEND with oasis (1st bootstrap)" +echo "BECOME FRIEND with A_boostrap_nodes.txt (1st bootstrap)" ######################################################################## for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do From cc3147bd839d9ce96a7b611763c403cf4842477c Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 20:15:44 +0100 Subject: [PATCH 13/17] A_swram_map.txt error --- zen/gchange_IPFS_swarm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 3b82e93..de67ba7 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -10,7 +10,7 @@ ME="${0##*/}" # create swarm_map and my_swam files echo "" > ~/.zen/A_my_swarm.txt -echo "" > ~/.zen/A_swram_map.txt +echo "" > ~/.zen/A_swarm_map.txt ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info @@ -33,7 +33,7 @@ friend_of_mine_count=0 for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer'); do [[ "$liking_me" == "" ]] && continue - # DE TOUS CEUX QUI M'AIMENT JE VAIS LIRE LES MESSAGES pour collecter les ipfstryme vers ~/.zen/A_swram_map.txt + # DE TOUS CEUX QUI M'AIMENT JE VAIS LIRE LES MESSAGES pour collecter les ipfstryme vers ~/.zen/A_swarm_map.txt # SI JE SUIS LEUR AMI EN RETOUR, je conserve leur ID dans ~/.zen/A_my_swarm.txt # Check if my like is reverse liking_me_count=$((liking_me_count+1)) From e31aa7b1a84b28181a69dcf0698782bffa018f0b Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 20:27:04 +0100 Subject: [PATCH 14/17] =?UTF-8?q?r=C3=A9glage=20swam=20control?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zen/gchange_IPFS_swarm.sh | 4 +++- zen/ipfs_SWARM_refresh.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index de67ba7..ef98dca 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -72,7 +72,9 @@ do done -cat ~/.zen/A_my_swarm.txt +# UNIQ file +cat ~/.zen/A_my_swarm.txt | uniq > /tmp/A_my_swarm.txt +cp -f /tmp/A_my_swarm.txt ~/.zen/A_my_swarm.txt echo "#################################################### I have $friend_of_mine_count friends amoung $liking_me_count liking me people diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 381705d..0cdaf4a 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -40,6 +40,7 @@ count=1 for peerline in $(ipfs swarm peers && cat ~/.zen/A_swarm_map.txt); do ipfsnodeid=$(echo "$peerline" | awk -F '/' '{print $8}') + [[ "$ipfsnodeid" == "" ]] && continue whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) ip=$(echo "$peerline" | awk -F '/' '{print $3}') From b9cd789787fa1c466a32a92bb3ea55878fb3aa66 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 20:30:11 +0100 Subject: [PATCH 15/17] reduce loops --- zen/ipfs_SWARM_refresh.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 0cdaf4a..3984e0b 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -53,10 +53,9 @@ do echo "${peerline}" myfriendpeer=$(cat ~/.zen/A_my_swarm.txt | grep $ipfsnodeid ) if [[ "$myfriendpeer" != "" ]]; then + [[ ! $(ipfs swarm peers | grep $ipfsnodeid) ]] && ipfs swarm connect "$peerline" && ipfs bootstrap add "$peerline" echo "OK REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" $MY_PATH/tools/timeout.sh -t 20 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid - ipfs swarm connect $peerline - ipfs bootstrap add $peerline else echo "KO ___________________ # YOU CAN ACTIVATE FAIL2BAN" # PLEASE ADD $USER NOPASSWD:ALL for fail2ban-client in /etc/sudoers From 51c4bc76621a6d5520a6e1b8d7c1ddba436dc7c0 Mon Sep 17 00:00:00 2001 From: qo-op Date: Fri, 25 Dec 2020 20:32:28 +0100 Subject: [PATCH 16/17] Friends should be in their swarm... Control ~/.zen/ipfs_swarm to verify --- zen/ipfs_SWARM_refresh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 3984e0b..52d230d 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -54,7 +54,7 @@ do myfriendpeer=$(cat ~/.zen/A_my_swarm.txt | grep $ipfsnodeid ) if [[ "$myfriendpeer" != "" ]]; then [[ ! $(ipfs swarm peers | grep $ipfsnodeid) ]] && ipfs swarm connect "$peerline" && ipfs bootstrap add "$peerline" - echo "OK REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" + echo "OK Friend REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" $MY_PATH/tools/timeout.sh -t 20 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid else echo "KO ___________________ # YOU CAN ACTIVATE FAIL2BAN" From 1805bb102d8b4afed977191b35ccfa0200d73684 Mon Sep 17 00:00:00 2001 From: qo-op Date: Sat, 26 Dec 2020 16:41:51 +0100 Subject: [PATCH 17/17] refresh .kodi template --- ISOconfig.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index 50fa96e..cc33752 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -149,10 +149,12 @@ echo 'EXTEND ~/.bashrc' ######################################################################## ~/.zen/astrXbian/.install/update_bashrc.sh -echo "Configure .kodi/addons/plugin.video.vstream/resources/sites/astroport.py" -cp -f ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py \ +echo "COPY .kodi template " +cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ +# cp -f ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py \ ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py +echo "Configure .kodi/addons/plugin.video.vstream/resources/sites/astroport.py" # CREATE xbian IPNSKEY used to publish ~/.zen/ipfs_swarm/xbian (contains all XZUID pastebin files) ipfs key rm xbian IPNSKEY=$(ipfs key gen xbian)