beta stage rewrite

This commit is contained in:
qo-op 2020-12-15 13:27:32 +01:00
parent 4ce1b63cd9
commit f10bb56444
6 changed files with 21 additions and 36 deletions

View File

@ -20,6 +20,15 @@ if [[ -f ~/.zen/ipfs.sync ]]; then
echo "CONFIG ALREADY DONE"
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
# NEW BOOT! SEND ipfstryme message to my friends...
cd ~/.zen/astrXbian/zen/jaklis
# GET LIST of issuer(s) who likes me

View File

@ -21,6 +21,8 @@ Films: FASTRXBIAN
Raccordez votre compte Nextcloud.
-- Astroport Technology demonstration for Xbian.org --
Sur Xbian.org, installer AstXbian avec la commande:
```
rm -f /tmp/install.sh && wget https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh -O /tmp/install.sh && chmod 755 /tmp/install.sh && bash /tmp/install.sh
```

View File

@ -15,9 +15,7 @@ source $HOME/.profile
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
#### INIT STATION PARAMETERS
[[ -f $MY_PATH/../secret.astroport.key ]] && source $MY_PATH/../secret.astroport.key # DEPRECATED now using ~/.bashrc
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
source /home/$YOU/.profile
[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs id -f='<id>\n')
########################################################################
@ -37,8 +35,6 @@ source /home/$YOU/.profile
########################################################################
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
export isMinetestRunning=$(ps auxf --sort=+utime | grep -w minetest | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
export isG1smsRunning=$(ps auxf --sort=+utime | grep -w gammu | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
# ? isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
@ -56,20 +52,6 @@ weeknumber=$(date +%V)
echo $timebar
#
# _________
# / ____< /________ ___ _____
# / / __ / / ___/ __ `__ \/ ___/
#/ /_/ // (__ ) / / / / (__ )
#\____//_/____/_/ /_/ /_/____/
#
# $MY_PATH/g1sms/sms_ASTROPORT.sh
# TIME NTP SYNC: TODO: Problem being root (stickybit INSTALL?)
# G1Tx. G1sms. G1Dab Zen economy needs precise time sync (RpiZero !!)
# Tx rates is limited by Station time synchronisation.
# sudo ntpdate ntp.pool.org
# ____ _______ __ __
# / __ \/ ____/ | / / ____ ___ ____ ____/ /__
# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \
@ -77,8 +59,8 @@ echo $timebar
# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/
#
#
# ACTIVATE 5 MN "git pull" update
if [[ $(($minute % 5)) == 0 ]]; then
# ACTIVATE 15 MN "git pull" update
if [[ $(($minute % 15)) == 0 ]]; then
#######################################
sleep $((1 + RANDOM % 12))
git pull

View File

@ -50,7 +50,7 @@ title=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq -r '._source.title')
# 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.gchange_name
[[ $title ]] && echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.cesium_name
[[ $uidna ]] && [[ "$title" == "null" ]] && title="Station $uidna"
[[ "$title" == "null" ]] && title="Station $USER@$(cat /etc/hostname)"
@ -58,14 +58,13 @@ title=$(curl -s ${CESIUMPLUS}/user/profile/${G1PUB} | jq -r '._source.title')
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 > "/tmp/_gchange.avatar.png"
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)

View File

@ -16,10 +16,10 @@ ME="${0##*/}"
############# '$MY_PATH/$ME'
########################################################################
# ex: ./'$ME'
# GET GCHANGE FRIENDS AND FIND THEIR IPFS ID TO "ipfs swarm connect" THEM
# 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
## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 (use natools to sign messages?)
########################################################################
@ -67,16 +67,14 @@ do
ipfsadd=$((ipfsadd+1))
else
echo "$friend_of_mine spoofing is happening"
echo "ALERT!!! $friend_of_mine spoofing is happening"
fi
done;
#g1id=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py "$ipfsnodeid")
#echo "G1 ID : $g1id"
if [[ $friend_of_mine != null ]]; then
if [[ $ipfsadd == 0 ]]; then
# Friend of mine with no ipfstryme message (did not install astroport)
# 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

View File

@ -66,7 +66,7 @@ do
else
echo "${peer}"
echo "REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/"
$MY_PATH/tools/timeout.sh -t 20 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
$MY_PATH/tools/timeout.sh -t 30 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
fi
@ -77,12 +77,7 @@ echo "$IPFSNODEID PUBLISHING /home/$YOU/.zen/ipfs/ to SWARM"
IWALLETS=$(ipfs add -rHq /home/$YOU/.zen/ipfs | tail -n 1)
NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
# Put my own data in /home/$YOU/.zen/ipfs_swarm/
# Retrieve my own data in /home/$YOU/.zen/ipfs_swarm/
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
# NB: could start sync IPNS from "swarm peers" and check ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.pubkey
# if it is a gchange friend of mine... Then decide to bannish or keep.
# But IPNS sync with bad node could lead to a filesystem concistency corruption...
# Should be sync in a temp separate folder... So keeping IP control for now.
exit 0