Browse Source

-n "https://data.gchange.fr" problem

pull/32/head
qo-op 7 months ago
parent
commit
047bcbf3ad
  1. 8
      zen/gchange_INIT.sh
  2. 14
      zen/gchange_IPFS_swarm.sh
  3. 6
      zen/ipfs_SWARM_refresh.sh
  4. 4
      zen/ssh_forward2onelove.sh

8
zen/gchange_INIT.sh

@ -108,23 +108,23 @@ IamBOOTSTRAP=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # AM I
################## CHECKING WHO GAVE ME STARS
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars | jq -r '.likes[].issuer' && cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#");
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' && cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#");
do
##### BOOTSTRAP AUTO LIKE BACK (NOT liking Myself)
if [[ "$IamBOOTSTRAP" == "$G1PUB" ]]; then
echo "I AM A BOOTSTRAP AUTO LIKING $liking_me FRIEND"
if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/tryme.addr && "$liking_me" != "$G1PUB" ]]; then
echo "SENDING 1 STAR AUTO LIKE to $liking_me"
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey unstars -p $liking_me
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $liking_me
sleep $((1 + RANDOM % 2)) # SLOW DOWN
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars -p $liking_me -n 1
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me -n 1
sleep $((1 + RANDOM % 2)) # SLOW DOWN
fi
fi
##### CHECKING IF WE LIKE EACH OTHER (AVOID LIKING MYSELF)
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars -p $liking_me > /tmp/Gstars.json
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me > /tmp/Gstars.json
[[ ! -f /tmp/Gstars.json ]] && rm -Rf ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me && echo "$liking_me is a DEAD FRIEND !!!" && continue

14
zen/gchange_IPFS_swarm.sh

@ -31,7 +31,7 @@ echo $(date)
# Let's look for Friends and "IPFS swarm connect" with them
########################################################################
# 1. Get Gchange "liking_me" people list
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars | jq -r '.likes[].issuer');
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer');
do
[[ "$liking_me" == "" || "$liking_me" == "$G1PUB" ]] && continue
# DE TOUS CEUX QUI M'AIMENT JE VAIS LIRE LES MESSAGES pour collecter leurs ipfstryme vers ~/.zen/A_swarm_map.txt
@ -39,7 +39,7 @@ do
# Check if my like is reverse
liking_me_count=$((liking_me_count+1))
echo ">>>>>> CHECKING liking_me n° $liking_me_count : READING 'ipfstryme' message from $liking_me"
for peerline in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey read -n300 -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 -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content');
do
echo "======================================================"
# GET $ipfsnodeid FROM $peerline
@ -52,14 +52,14 @@ do
# KEEPING LAST ipfstryme MESSAGES only
nbmessage=0
for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey read -n300 -j | jq -r --arg friendKEY "$whoisg1" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id')
for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -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 $nbmessage OLD 'ipfstryme' messages from $whoisg1" && ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey delete -i $messageid
[ $nbmessage -gt 1 ] && echo "Delete $nbmessage OLD 'ipfstryme' messages from $whoisg1" && ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" delete -i $messageid
sleep 0.5
done
[[ $nbmessage == 0 ]] && echo "NO ipfstryme MESSAGE from $whoisg1" && echo "$ipfsnodeid" >> ~/.zen/A_dead_swarm.txt && continue
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d $whoisg1 -t 'Astroport' -m 'Aucun message de ta part https://copylaradio.com'"
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $whoisg1 -t 'Astroport' -m 'Aucun message de ta part https://copylaradio.com'"
# REFRESH A_swarm_map.txt
echo $peerline >> ~/.zen/A_swarm_map.txt
@ -68,7 +68,7 @@ do
# FRIEND ADDRESS DISCOVERY
echo "Am I friend with my FRIEND friend $whoisg1 ?"
friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey stars -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID
friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID
if [[ "$friend_of_mine" != "null" ]]; then
if [[ ! $(grep "$ipfsnodeid" ~/.zen/A_my_swarm.txt) ]]
then
@ -83,7 +83,7 @@ do
echo "NOT FULL FRIEND $ipfsnodeid / $whoisg1"
[[ "$liking_me" != "" ]] && rm -Rf ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me
# SEND ME A MESSAGE TO DECIDE WHAT TO DO ?
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d $whoisg1 -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'"
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $whoisg1 -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'"
fi
done;

6
zen/ipfs_SWARM_refresh.sh

@ -76,13 +76,13 @@ do
grep -vEi $ip ~/.zen/A_my_swarm.txt
echo $ipfsnodeid >> ~/.zen/A_dead_swarm.txt
echo "SEND MESSAGE ABOUT UNREACHABLE FRIEND $whoisg1 ($XID) ($XZUID)"
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d $G1PUB -t "ALERT" -m "Impossible de se synchroniser avec $whoisg1 ($XID) ($XZUID)"
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $G1PUB -t "ALERT" -m "Impossible de se synchroniser avec $whoisg1 ($XID) ($XZUID)"
# KEEPING LAST 10 ALERT MESSAGES
nbmessage=0
for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey read -n300 -j | jq -r --arg friendKEY "$G1PUB" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ALERT")' | jq -r '.id')
for messageid in $(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$G1PUB" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ALERT")' | jq -r '.id')
do
nbmessage=$((nbmessage+1))
[ $nbmessage -gt 10 ] && echo "Delete $nbmessage OLD 'ALERT' messages from $G1PUB" && ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey delete -i $messageid && sleep 0.5
[ $nbmessage -gt 10 ] && echo "Delete $nbmessage OLD 'ALERT' messages from $G1PUB" && ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" delete -i $messageid && sleep 0.5
done
continue
fi

4
zen/ssh_forward2onelove.sh

@ -32,7 +32,7 @@ then
## SEND MESSAGE
echo "ipfs p2p close -p /x/$G1PUB-ssh" > /tmp/ssh.forward
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS -t "SSH-STOP" -f /tmp/ssh.forward
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS -t "SSH-STOP" -f /tmp/ssh.forward
echo "STOP"
fi
if [[ "$ARG" == "" || "$ARG" == "open" ]]; then
@ -44,7 +44,7 @@ then
PORT=$(cat /tmp/ssh.forward.port)
echo "ipfs p2p forward /x/$G1PUB-ssh /ip4/127.0.0.1/tcp/$PORT /p2p/$IPFSNODEID
ssh $USER@localhost -p $PORT" > /tmp/ssh.forward
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey send -d Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS -t "SSH-OPEN" -f /tmp/ssh.forward
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS -t "SSH-OPEN" -f /tmp/ssh.forward
echo "Demande de dépannage envoyé à fred@ONELOVE (Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS)"
fi
fi

Loading…
Cancel
Save