diff --git a/ISOconfig.sh b/ISOconfig.sh index 90b453e..3262ca3 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -9,7 +9,7 @@ IPFSNODEID=$(ipfs id -f='\n') isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) [[ ! ${IPFSNODEID} ]] && echo "IPFS MUST BE INSTALLED" && exit 1 ######################################################################## -# Create secret key files +# Create STATION IPFS/G1 IDENTITY & secret key files # ~/.zen/secret.june # ~/.zen/secret.dunikey # ~/.zen/secret.ipfs & /tmp/config.ipfs @@ -25,14 +25,14 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1) ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || (echo "VERIFIER CONNEXION INTERNET" && exit 1) -# GIT PULL astrXbian code -mkdir -p ~/.zen/astrXbian && cd ~/.zen/astrXbian && git pull || exit 1 +# MAJ astrXbian code +[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || ( echo "astrXbian ERROR" && exit 1 ) # CHECK IF CONFIG ALREADY DONE !! # ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync if [[ -f ~/.zen/ipfs.sync ]]; then echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt" - source ~/.zen/ipfs.sync + source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN" # Wait for IPFS to connect SWARM sleep 20 ~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt @@ -120,7 +120,7 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB # Give $XZUID to your (gchange friends) ######################################################################## echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID" -echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player ######################################################################## echo "CREATING GCHANGE+ PROFILE" @@ -223,7 +223,7 @@ echo 'Installing Astroport cron_MINUTE' ######################################################################## #echo "CHANGE hostname" -#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) #echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey" ######################################################################## #sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname diff --git a/README.md b/README.md index 891e7f4..b295778 100644 --- a/README.md +++ b/README.md @@ -229,10 +229,10 @@ En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procé ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # Obtenir la liste de tous ses amis (gchange+) -cat ~/.zen/ipfs_swarm/.12D*/G1SSB/_g1.gchange_title +cat ~/.zen/ipfs_swarm/.12D*/.player # Scan des stations IPFS de son swarm -for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo $ipfsnodeid; echo "$(ipfs --timeout=2s cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs --timeout=1s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid)"; ipfs --timeout=1s ls /ipns/$ipfsnodeid/; done +for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo $ipfsnodeid; echo "$(ipfs --timeout=2s cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs --timeout=1s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)"; ipfs --timeout=1s ls /ipns/$ipfsnodeid/; done # Obtenir le nom des fichiers contenus dans PIN IPFS for ID in $( ls ~/.zen/PIN/ | cut -d '/' -f 6); do ipfs ls $ID; done @@ -254,8 +254,8 @@ do ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 ); code=$(cat $CODE); IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode) - zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid); - # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) + zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player); + # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) # g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) echo "---> $zuid / $g1name : $IPNSCODE" @@ -265,7 +265,7 @@ do done; # Get your ipfs swarm peers station names (XZUID) -for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid; done +for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player; done ``` diff --git a/ajouter_video.sh b/ajouter_video.sh index 631bfc3..65c900d 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -54,7 +54,7 @@ haut=$((height-200)) ######################################################################## IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)" -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) ######################################################################## ## CADRE EXCEPTION COPIE PRIVE diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index c501e20..689210a 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -36,20 +36,33 @@ fi ## CONTROL IPFS IS RUNNING OR RESTART YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) if [[ ! ${YOU} ]]; then + + # Refresh Peering.Peers + ipfs config --json Peering.Peers '[]' + # DHT PUBSUB mode + ipfs config Pubsub.Router gossipsub + # MAXSTORAGE = 1/2 available + availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}') + diskSize="$((availableDiskSize / 2))" + ipfs config Datastore.StorageMax $diskSize + ## Activate Rapid "ipfs p2p" + ipfs config --json Experimental.Libp2pStreamMounting true + ipfs config --json Experimental.P2pHttpProxy true # control water levels for swarm ipfs config --json Swarm.ConnMgr.LowWater 50 ipfs config --json Swarm.ConnMgr.HighWater 100 + [ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs echo "ERROR! ipfs daemon was not running. RELAUNCHING." exit 1 fi ######################################################################## -# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE +# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE : TODO DEBUG KODI PLUGIN !!! [[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ]] && [[ -f ~/.zen/astroport.py ]] && cp -f ~/.zen/astroport.py ~/.kodi/addons/plugin.video.vstream/resources/sites/ [[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ]] && cp ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ~/.kodi/addons/plugin.video.vstream/resources/art/ 2>/dev/null ######################################################################## -### NO IP GATEWAY : EXIT +### NO IP GATEWAY : EXIT (COULD BE Astroport.ONE Ambassy Alone !!) ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "LAN OK" || exit 1 ######################################################################## @@ -116,7 +129,7 @@ if [[ $(($runtime % 4)) == 0 ]]; then [[ $g1pub ]] && latency=$(ipfs ping --timeout=1s -n 1 /p2p/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null | grep "Average" | cut -d ':' -f 2); [[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt ## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt - # for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid; cat $line; done + # for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player; cat $line; done done fi ######################################################################## @@ -162,7 +175,7 @@ if [[ $(($runtime % 15)) == 0 ]]; then ## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE ## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd - - # CLEAN AND REMOVE BAD DIRECTORIES + # CLEAN AND REMOVE BAD DIRECTORIES should be in .$IPFSNODEID to avoid Station collision. ## BYPASS index.html DELETION [[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html @@ -183,18 +196,6 @@ if [[ $(($runtime % 15)) == 0 ]]; then fi -if [[ $(($minute % 30)) == 0 ]]; then - ########## NextCloud.SMS GUILDE STATION ############## - if [[ -e /home/${YOU}/.zen/SMS/ ]];then -# DONE at 20h01 in taurus crontab -# [[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France - /home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh - fi - ########## BUNKERBOX STATION ############## - # [[ $(cat /home/${YOU}/.zen/bunkerbox/qo-op 2>/dev/null) != "" && $(cat /home/${YOU}/.zen/bunkerbox/choice 2>/dev/null) == "qo-op" ]] && /home/${YOU}/workspace/bunkerbox/crowdbunker.sh & - -fi - # __ __ _____ ____ # __/ // /_/ ___/ ______ __________ ___ / __ \ # /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / / @@ -222,8 +223,8 @@ if [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]]; then $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt fi # SYNC IPFS FRIENDS SWARM -if [[ $(($runtime % 25)) == 0 ]]; then - kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING p4n.swarmscraper.sh" +if [[ $(($runtime % 26)) == 0 ]]; then + kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh" killall chromium $MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt fi @@ -237,6 +238,8 @@ fi # /___/\___/_/ /_/ /_/ /_/ |_\____/ # # REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle + ### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive + ################################################ if [[ $(($runtime % 7)) == 0 ]]; then #### Refresh & publish MEDIAKEYs @@ -259,6 +262,7 @@ fi # # ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh" # Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS +## TEST AUTOMATIC NEW FILE IMPORT. xbian only. if [[ "$USER" == "xbian" ]]; then [[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport # VERIFY LAUNCH inotifywait ?! diff --git a/install.sh b/install.sh index 39903e7..513f6c2 100755 --- a/install.sh +++ b/install.sh @@ -10,8 +10,12 @@ ME="${0##*/}" [ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 + +######################################################################## +[[ ! $(which ipfs) ]] && echo "=== Vous devez avoir installé IPFS https://ipfs.io" && echo "Adaptez ce code à votre système ~/.zen/astrXbian/.install/ipfs_alone.sh" && exit 1 + # MAIN # SI AUCUNE CLEF DE STATION... -if [[ ! -f ~/.zen/secret.june ]]; +if [[ ! -f ~/.zen/secret.dunikey ]]; then # Check requirements @@ -46,7 +50,7 @@ done sudo apt-get install kodi -y;\ ${MY_PATH}/.install/kodi_uqload_downloader.sh -echo "## INSTALLATION OpenCV = 'IA Amicale' " +echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' " sudo apt-get install python3-opencv -y ## Correct PDF restrictions for imagemagick @@ -56,22 +60,6 @@ if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml fi -if [[ ! $(which apache2) ]]; then - echo "########################################################################" - echo "## INSTALL PASSERELLE HTTP(S) #######################################"; echo ; - for i in mariadb-server nginx python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm; do - if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then - echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - sudo apt install -y $i - fi - done -else - echo ">>> WARNING <<< Apache détecté - Vous devrez réaliser la configuration de votre passerelle par vous même..." -fi - -## GIVE ACCESS TO www-data group -sudo usermod -aG www-data $USER - echo "###########################" echo "## INSTALL PYTHON CRYPTO LAYER " echo "###########################" @@ -79,7 +67,7 @@ echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo python3 -m pip install -U pip python3 -m pip install -U setuptools wheel python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy -python3 -m pip install -U nicotine-plus +python3 -m pip install -U nicotine-plus silkaj if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI echo "Ambassade? Souhaitez vous ajouter imprimante 'brother_ql'? Saisissez OUI, sinon laissez vide et tapez sur ENTRER" @@ -99,19 +87,18 @@ sudo ln -f -s /usr/bin/python3 /usr/bin/python ######################################################################## -echo "=== Clonage git CODE astrXbian depuis https://git.p2p.legal" +echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" mkdir -p ~/.zen cd ~/.zen git clone https://git.p2p.legal/axiom-team/astrXbian.git +git clone https://git.p2p.legal/qo-op/Astroport.ONE.git +# TODO INSTALL FROM IPFS / IPNS ######################################################################## echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ ######################################################################## -[[ ! $(which ipfs) ]] && echo "=== Installation de IPFS https://ipfs.io"; ~/.zen/astrXbian/.install/ipfs_alone.sh - -######################################################################## echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+" cd ~/.zen/astrXbian/zen/jaklis ./setup.sh @@ -151,18 +138,10 @@ fi mkdir -p ~/astroport/film mkdir -p ~/astroport/serie mkdir -p ~/astroport/anime -echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt -## PREPARE www EXCHANGE ZONE ~/astroport/www -wwwuser=$(ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1) || wwuser="www-data" -sudo chown -R $USER:$wwwuser ~/astroport/www -sudo chmod -R g+rw ~/astroport/www +echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt + ####################################################################### -## CREATE symlinks for ~/.zen/www/swarm & me ## OLD PHP METHOD ## TO REMOVE... -sudo chown -R $USER:www-data ~/.zen/astrXbian/www/boris -sudo chmod -R g+rw ~/.zen/astrXbian/www/boris -ln -s /home/$USER/.zen/ipfs_swarm ~/.zen/astrXbian/www/boris/swarm -ln -s /home/$USER/.zen/ipfs ~/.zen/astrXbian/www/boris/me echo "## INSTALL open_with_linux.py ## ## https://darktrojan.github.io/openwith/webextension.html" @@ -196,7 +175,7 @@ fi # MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ## else -echo "Installation déjà faite !! +echo "Installation existante !! ======================== Astroport/KODI (Gchange) ======================== diff --git a/ipfs4astroport.sh b/ipfs4astroport.sh index 430c39f..215d8cb 100755 --- a/ipfs4astroport.sh +++ b/ipfs4astroport.sh @@ -176,9 +176,9 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB # Give $XZUID to your (gchange friends) ######################################################################## XZUID="$(hostname)-$RANDOM$RANDOM" -echo "SETTING _xbian.zuid PROFILE NAME = $XZUID" -echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid -echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/_xbian.zuid' +echo "SETTING .player PROFILE NAME = $XZUID" +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player +echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player' ######################################################################## ######################################################################## diff --git a/www/boris/conf.php b/www/boris/conf.php index 7059942..47dc34b 100644 --- a/www/boris/conf.php +++ b/www/boris/conf.php @@ -4,7 +4,7 @@ if (!ini_get('display_errors')) { ini_set('display_errors', '1'); } -define('STATION_NAME', exec('cat ../../../ipfs/.12D*/_xbian.zuid')); +define('STATION_NAME', exec('cat ../../../ipfs/.12D*/.player')); define('HOST', 'astroport'); define('THEME', 'astroport'); define('SITENAME', 'Astroport "' . STATION_NAME . '"'); @@ -42,7 +42,7 @@ define('YOUTUBE_THUMB', 'https://i.ytimg.com/vi/%s/mqdefault.jpg'); define ('MEDIAQR','https://'.$_SERVER['SERVER_NAME'].'/ipns/%s/QR.png'); -// TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/_xbian.zuid" +// TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/.player" $stations = [ 'virgo', 'onelove', diff --git a/www/boris/get_xzuid.sh b/www/boris/get_xzuid.sh index 02bc224..fa2be8d 100755 --- a/www/boris/get_xzuid.sh +++ b/www/boris/get_xzuid.sh @@ -2,5 +2,5 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 -cat /home/$YOU/.zen/ipfs/.12D*/_xbian.zuid +cat /home/$YOU/.zen/ipfs/.12D*/.player diff --git a/zen/bash_template.sh b/zen/bash_template.sh index a54db28..b239f48 100755 --- a/zen/bash_template.sh +++ b/zen/bash_template.sh @@ -10,7 +10,7 @@ ME="${0##*/}" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player); [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index b7ffe07..2747034 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -26,7 +26,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! -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 -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) || hostname -s > ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) || hostname -s > ~/.zen/ipfs/.$IPFSNODEID/.player ######################################################################## # CREATNG IPFS LOCAL REPOSITORY for Node G1 Identity : G1SSB @@ -106,7 +106,7 @@ Customisation TiddlyWiki" [[ ! $(cat ~/.zen/ipfs/.${IPFSNODEID}/index.html | grep ${IPFSNODEID}) ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html # cp -f ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html -zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" +zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)" wiki="/home/$YOU/.zen/ipfs/.$IPFSNODEID/index.html" updated="$(date +"%m-%d-%Y_%H:%M")" @@ -214,7 +214,7 @@ do ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) echo ${ipfsnodeid} > ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/ipfsnodeid ## TIMEOUT... uncomment in DEFCON3 only -# zuid=$(ipfs --timeout=10s cat /ipns/${ipfsnodeid}/.${ipfsnodeid}/_xbian.zuid) +# zuid=$(ipfs --timeout=10s cat /ipns/${ipfsnodeid}/.${ipfsnodeid}/.player) # [[ ${zuid} ]] && touch ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/${zuid} ## NOT USEFULL TRYING diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 7c6a93f..5c5783e 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -40,7 +40,7 @@ for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d do ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend) echo "### $g1friend ipfs reading XID" - XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) + XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) if [[ $XID ]]; then echo "### REFRESH ipfs_swarm $ipfsnodeid ($XID)" ipfs --timeout=360s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid diff --git a/zen/ipfs_FRIENDS_refresh.sh b/zen/ipfs_FRIENDS_refresh.sh index a485930..1a0ffa0 100755 --- a/zen/ipfs_FRIENDS_refresh.sh +++ b/zen/ipfs_FRIENDS_refresh.sh @@ -43,7 +43,7 @@ do #echo "REFRESHING Friend /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" #ipfs --timeout=90s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid - #[[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid || echo "NO ZUID" + #[[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player || echo "NO ZUID" echo "This is the list of your friend $g1id friends liking you" ls -d ~/.zen/ipfs_swarm/.$ipfsnodeid/FRIENDS/*/ 2>/dev/null | rev | cut -d '/' -f 2 | rev diff --git a/zen/ipfs_P2P_forward.sh b/zen/ipfs_P2P_forward.sh index 184c456..0165c3c 100755 --- a/zen/ipfs_P2P_forward.sh +++ b/zen/ipfs_P2P_forward.sh @@ -53,7 +53,7 @@ if [[ "$IPFSNODEID" == "12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN" ]] fi # Every Station publish SSH port "/x/ssh-$zuid" -zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" +zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)" if [[ $zuid ]] then if [[ ! $(cat ~/.ssh/authorized_keys | grep "fred@ONELOVE") ]] diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index b109434..302a857 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -67,7 +67,7 @@ do # ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend) ## $ipfsnodeid already Treated ? [[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue - [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) || XID='' + [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) || XID='' [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title ]] && GZUID=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) || GZUID='' # [[ "$XID" == "" ]] && ipfs swarm disconnect /ipfs/$ipfsnodeid ## NOT COMPLIANT FRIEND STATION # [[ $(cat /tmp/treated.ipfs.swarm | grep "$ipfsnodeid") ]] && continue ## TODO ACTIVATE IN DEFCON 4 @@ -255,7 +255,7 @@ then ## DEFCON 3 echo "BLOB-Brain Friend RENEW /ipns/$ipfsnodeid TO ~/.zen/ipfs_swarm/" rm - Rf /home/$YOU/.zen/ipfs_swarm/$ipfsnodeid ipfs --timeout=60s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid - [[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && zuid=$(cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid) || continue + [[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && zuid=$(cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player) || continue stars=$(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1id/stars.level); G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $g1pub) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) @@ -279,7 +279,7 @@ fi echo "******************************************************************" echo "### REFRESH Film Serie Anime Youtube ${PREFIX}ASTRXBIAN ###" [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/ -AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); +AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player); for PREFIX in F S A Y do @@ -304,7 +304,7 @@ chmod 644 /home/$YOU/.zen/{ipfs_swarm}/.*/astroport/kodi/vstream/*ASTRXBIAN ######################################################################## # REFRESH tiddlywiki WALL OF FRIENDS /ipns/${IPFSNODEID}/.${IPFSNODEID}/FRIENDS/index.html ######################################################################## -zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" +zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)" updated="$(date +"%Y-%m-%d_%H:%M")" echo "******************************************************************" @@ -328,7 +328,7 @@ for wiki in $(ls ~/.zen/ipfs_swarm/.12D*/index.html | grep -Ev "${IPFSNODEID}" 2 whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) echo "
  • - \"$(catdev/null)\" /> + \"$(catdev/null)\" />

    diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index acf70c5..181d39f 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -29,7 +29,7 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); [[ ! $YOU ]] && echo "IPFS NOT RUNNING. EXIT" && exit 1 ######################################################################## -XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) # echo "## FRIENDS IPFS PINGing" # for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done diff --git a/zen/manage_stargates.sh b/zen/manage_stargates.sh index 7dca797..987e681 100755 --- a/zen/manage_stargates.sh +++ b/zen/manage_stargates.sh @@ -10,7 +10,7 @@ ME="${0##*/}" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 IPFSNODEID=$(ipfs id -f='\n') -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player); [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) ######################################################################## diff --git a/zen/swarm_testing.sh b/zen/swarm_testing.sh index 1519c00..0cf5274 100755 --- a/zen/swarm_testing.sh +++ b/zen/swarm_testing.sh @@ -12,7 +12,7 @@ do TEST=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me | jq -r '.yours.level') if [ ! $TEST == 'null' ]; then echo "$station is my friend" - ipfs --timeout=6s cat /ipns/$station/.$station/_xbian.zuid + ipfs --timeout=6s cat /ipns/$station/.$station/.player [ ! $? == 0 ] && echo "UNAVAILABLE FRIEND $liking_me" sleep 1 fi diff --git a/zen/tools/ping_my_friends_on_ipfs.sh b/zen/tools/ping_my_friends_on_ipfs.sh index e6e683c..5d78ad7 100755 --- a/zen/tools/ping_my_friends_on_ipfs.sh +++ b/zen/tools/ping_my_friends_on_ipfs.sh @@ -13,11 +13,11 @@ for ipfsid in $(cat ~/.zen/ipfs_swarm/.*/.ipfsnodeid); do echo "TESTING $ipfsid" ipfs -timeout=7s ping -n5 /p2p/$ipfsid 2>/dev/null | tail -n 1 if [ $? -eq 0 ]; then - zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/_xbian.zuid 2>/dev/null) || zuidonline="TIMEOUT" - [[ -f ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) || zuidoffline="UNKOWN" + zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/.player 2>/dev/null) || zuidonline="TIMEOUT" + [[ -f ~/.zen/ipfs_swarm/.$ipfsid/.player ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) || zuidoffline="UNKOWN" echo "Station $zuidonline [$zuidoffline] : OK" else - echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) : DEAD" + echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) : DEAD" fi echo "" fi diff --git a/zen/wordpress_channel.sh b/zen/wordpress_channel.sh index a0a31aa..0b678e0 100755 --- a/zen/wordpress_channel.sh +++ b/zen/wordpress_channel.sh @@ -12,7 +12,7 @@ ME="${0##*/}" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 IPFSNODEID=$(ipfs id -f='\n') -[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player); [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) channel="$1" && [[ "$channel" == "" ]] && channel="wordpress" @@ -44,7 +44,7 @@ do echo "$ipfnodesource wants to publish $mediakey" ## GET ipns link + title + xzuid title=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/.title | sed "s/_/ /g") - xzuid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/_xbian.zuid) + xzuid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/.player) tags=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/video.json | jq -c .tags | sed 's/[][]//g' | sed "s/\"//g" ) mynodename=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/G1SSB/_nodename)