From f6daf7f3228930da80c97e5a4c65e00ea59b5c93 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 28 Sep 2023 14:32:20 +0200 Subject: [PATCH] Reduce IPFSNODEID Swarm Size : /TW/PLAYER/index.html = redirect to /ipns/${ASTRONAUTENS} --- API/UPLANET.sh | 2 + RUNTIME/PLAYER.refresh.sh | 12 +--- RUNTIME/UPLANET.refresh.sh | 7 +- tools/astroscan.sh | 130 ------------------------------------- 4 files changed, 10 insertions(+), 141 deletions(-) delete mode 100755 tools/astroscan.sh diff --git a/API/UPLANET.sh b/API/UPLANET.sh index 0a4096e8d..1b36c3ac5 100755 --- a/API/UPLANET.sh +++ b/API/UPLANET.sh @@ -218,8 +218,10 @@ if [[ ! -f ~/.zen/tmp/${MOATS}/TW/${EMAIL}/index.html ]]; then ipfs key rm ${MOATS} && rm ~/.zen/tmp/${MOATS}.priv echo "" > ~/.zen/tmp/${MOATS}/TW/${EMAIL}/index.html + ## CREATE ASTRONAUTE TW ON CURRENT ASTROPORT ( + ##### (☉_☉ ) ####### ${MY_PATH}/../tools/VISA.new.sh "${EMAIL}" "${NPASS}" "${EMAIL}" "UPlanet" "/ipns/${UMAPNS}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ## Send VISA.new log to EMAIL ) & diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index 69510b49b..6fa59b281 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -275,15 +275,9 @@ for PLAYER in ${PLAYERONE[@]}; do ls -al ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON} 2>/dev/null echo "(☉_☉ ) (☉_☉ ) (☉_☉ )" -######################### PLAYER_feed - #~ IFRIENDHEAD="$(cat ~/.zen/tmp/${IPFSNODEID}/RSS/${PLAYER}/IFRIENDHEAD 2>/dev/null)" - #~ echo "(☉_☉ ) (☉_☉ ) (☉_☉ )" - #~ echo "IFRIENDHEAD :" ${IFRIENDHEAD} - #~ [[ -d ~/.zen/game/players/${PLAYER}/FRIENDS ]] \ - #~ && cat ${MY_PATH}/../www/iframe.html | sed "s~_ME_~/ipns/${ASTRONAUTENS}~g" | sed "s~_IFRIENDHEAD_~${IFRIENDHEAD}~g" > ~/.zen/game/players/${PLAYER}/FRIENDS/index.html - #~ [[ -s ~/.zen/game/players/${PLAYER}/FRIENDS/index.html ]] \ - #~ && FRAME=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/FRIENDS/index.html | tail -n 1) \ - #~ && ipfs name publish --key="${PLAYER}_feed" /ipfs/$FRAME +######################### REPLACE TW with REDIRECT (reduce 12345 cache size) + echo "" \ + > ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html done echo "PLAYER.refresh DONE." diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index b60b13f98..b0994e6b6 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -238,8 +238,11 @@ mkdir ~/.zen/tmp/${MOATS} [[ -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \ && cp ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json - ## GET 100KM GCHANGE ADS - ${MY_PATH}/../tools/gchange_get_100km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange100.json + ## GET 100KM GCHANGE ADS ( https://data.gchange.fr ) + ${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json + + ## CREATE GCHANGE ACCOUNT ??!! + ### SET navigator.html ## MAKE EVOLVE template/umap.html cp ${MY_PATH}/../templates/umap.html ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html diff --git a/tools/astroscan.sh b/tools/astroscan.sh deleted file mode 100755 index 18ab94e5e..000000000 --- a/tools/astroscan.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -. "$MY_PATH/my.sh" -# Controle par Scanner de QRCode -# Scan G1PUB -# Scan QRSec + PASS -# Colecter ou générer les identifiants / mot de passe = "$SALT" "$PEPPER" -# Correspondance profil Gchange+ (CESIUM+) = $PLAYER -# -# Get last connected User -PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) - -echo "Bienvenue $PLAYER" -echo "Relancez start.sh pour changer votre identité" -echo "Pressez ENTRER" -read - -sudo cat /dev/ttyACM0 | while read line; do - lon=${#line} - # /ipns/.... /ipfs - inet=$(echo $line | cut -d "/" -f 2) - hash=$(echo $line | cut -d "/" -f 3) - echo "__SUB:tag_READ.sh: SCAN /dev/ttyACM0 ($lon) :: $line" - - if [[ $inet == 'ipns' ]]; then - xdg-open "$myIPFS/ipns/$hash" & - fi - - if [[ $lon != 43 && $lon != 44 ]]; then - ## QRSEC SCAN ??? - echo "Veuillez saisir PASS pour décoder cet identité" - read PASS - echo "********* DECODAGE SecuredSocketLayer *********" - rm -f ~/.zen/tmp/secret.dunikey 2>/dev/null - openssl enc -aes-256-cbc -d -in "$HOME/.zen/game/players/.current/enc.secret.dunikey" -out "$HOME/.zen/tmp/${PLAYER}.dunikey" -k $pass 2>&1>/dev/null - [ ! -f $HOME/.zen/tmp/${PLAYER}.dunikey ] && echo "ERROR. MAUVAIS PASS. SORTIE" && exit 1 - - PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) - echo "ASTRONAUTE $PLAYER : Ŋ1 exploration" - PLAYERNS=$(ipfs key list -l | grep -w "$PLAYER" | cut -d ' ' -f 1) - echo "MOA : $myIPFS/ipns/$PLAYERNS" - - ## Lancer vlc_webcam - ## Ajouter vlog au TW - - continue - fi - - RESSOURCENS=$(ipfs key list -l | grep -w "$G1PUB" | cut -d ' ' -f 1) - - if [[ $RESSOURCENS ]]; then - echo "SCAN G1REVE. CONFIRMER." - echo "'Identifiant' ..." - read SALT - echo "'Code secret' ..." - read PEPPER - echo "MERCI"; sleep 2 - else - echo "Scan G1Billet VIERGE" - echo "Saisissez son TITRE (en majuscules sans accent)" - read TITLE - fi - - # REGENERATION CLEFS ET COMPARAISON - $MY_PATH/tools/keygen -t duniter -o ~/.zen/tmp/secret.dunikey "$SALT" "$PEPPER" - G1PUB=$(cat ~/.zen/tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) - - # EXISTING RESSOURCE ? - if [[ $RESSOURCENS ]]; then - # YES - echo "EXISTING RESSOURCE CURRENT STATUS $G1PUB" - ls -al ~/.zen/game/world/$G1PUB - - ipfs ls /ipns/$RESSOURCENS - - continue - - fi - - - # CREATE NEW RESSOURCE - $MY_PATH/tools/keygen -t ipfs -o ~/.zen/tmp/astroscan.secret "$SALT" "$PEPPER" - ipfs key import $G1PUB -f pem-pkcs8-cleartext ~/.zen/tmp/astroscan.secret - - if [[ ! -f ~/.zen/game/world/$G1PUB/index.html ]]; then - echo "Nouveau Canal TW Astroport" - mkdir -p ~/.zen/game/world/$G1PUB - - cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/game/world/$G1PUB/index.html - sed -i "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/game/world/$G1PUB/index.html - sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/world/$G1PUB/index.html - sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/world/$G1PUB/index.html - - IPNSK=$(ipfs key list -l | grep -w "${G1PUB}" | cut -d ' ' -f 1) - # La Clef IPNS porte comme nom G1PUB. - sed -i "s~_MOAKEY_~${G1PUB}~g" ~/.zen/game/world/$G1PUB/index.html - sed -i "s~k2k4r8opmmyeuee0xufn6txkxlf3qva4le2jlbw6da7zynhw46egxwp2~${IPNSK}~g" ~/.zen/game/world/$G1PUB/index.html - sed -i "s~ipfs.infura.io~${myTUBE}~g" ~/.zen/game/world/$G1PUB/index.html - - IPUSH=$(ipfs add -Hq ~/.zen/game/world/$G1PUB/index.html | tail -n 1) - ipfs name publish --key=${G1PUB} /ipfs/$IPUSH 2>/dev/null - - else - echo "Canal TW existant" - # REFRESH IPNS - ipfs --timeout 6s cat /ipns/$IPNSK > ~/.zen/game/world/$G1PUB/index.html - fi - - ## CREATE GCHANGE AD - if [[ ! -f ~/.zen/game/world/.gchange.$G1PUB ]] - then - echo "CREATION ANNONCE CROWDFUNDING" - echo $MY_PATH/tools/jaklis/jaklis.py -k ~/.zen/tmp/secret.dunikey -n "$myDATA" setoffer -t "${TITLE} #ASTROMIZ" -d "$myIPFS/ipns/$RESSOURCENS - Gratitude Astronaute $PLAYER" -p $HOME/.zen/Astroport.ONE/images/moa_net.png - # echo $GOFFER > ~/.zen/game/world/.gchange.$G1PUB - fi - - ## OPEN - echo "OUVERTURE TW" - xdg-open "$myIPFS/ipns/$IPNSK" & - - -done - -# Charger le TW # sudo npm install -g tiddlywiki -# TODO USE TW COMMANDS -# https://tiddlywiki.com/static/ListenCommand.html - -# CLEF PLAYER CONNUE -# tiddlywiki $PLAYER --verbose --load ~/.zen/Astroport.ONE/templates/moawiki.html --listen port=8282