From 0046e8506d82f43621d5b00167ce7e91ce8e9ff5 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 17 Nov 2022 17:16:01 +0100 Subject: [PATCH] CRYPTIP MODE astroport.localhost --- 12345.sh | 4 ++-- 20h12.process.sh | 2 +- ASTROBOT/G1Voeu.sh | 2 +- ASTROBOT/PLAYER.refresh.sh | 4 ++-- ASTROBOT/VOEUX.create.sh | 2 +- ASTROBOT/VOEUX.refresh.sh | 2 +- ajouter_media.sh | 2 +- start.sh | 2 +- tools/Connect_PLAYER_To_Gchange.sh | 2 +- tools/VISA.new.sh | 10 +++++----- tools/VOEUX.print.sh | 2 +- tools/ipfs_config.sh | 4 ++-- tools/new_file_in_astroport.sh | 2 +- tools/vlc_webcam.sh | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/12345.sh b/12345.sh index afadf2a0..1e9aaab5 100755 --- a/12345.sh +++ b/12345.sh @@ -17,7 +17,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" PORT=12345 @@ -392,7 +392,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh # # CRYPTO DECODING CRYPTIP -> myIP rm -f ~/.zen/tmp/myIP.2 - echo "$CRYPTIP" > ~/.zen/tmp/myIP.$G1PUB.enc.2 + echo -n "$CRYPTIP" > ~/.zen/tmp/myIP.$G1PUB.enc.2 $MY_PATH/tools/natools.py decrypt -f pubsec -k ~/.zen/tmp/coucou/${MOATS}.secret.key -i ~/.zen/tmp/myIP.$G1PUB.enc.2 -o ~/.zen/tmp/myIP.2 > /dev/null 2>&1 OLDIP=$(cat ~/.zen/tmp/myIP.2 > /dev/null 2>&1) diff --git a/20h12.process.sh b/20h12.process.sh index 21e8f91e..20042b43 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -12,8 +12,8 @@ espeak "Ding" > /dev/null 2>&1 myIP=$(hostname -I | awk '{print $1}' | head -n 1) -[[ ! $myIP ]] && myIP="127.0.1.1" isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" ## CLEANING ~/.zen/tmp rm -Rf ~/.zen/tmp diff --git a/ASTROBOT/G1Voeu.sh b/ASTROBOT/G1Voeu.sh index eb339019..4b5fbd86 100755 --- a/ASTROBOT/G1Voeu.sh +++ b/ASTROBOT/G1Voeu.sh @@ -65,7 +65,7 @@ echo # CRYPTO BUG. TODO use natools to protect and share key with Ŋ1 only ;) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" echo " Passerelle : $myIP" diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 9d291bcf..fa733485 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -52,7 +52,7 @@ for PLAYER in $(ls -t ~/.zen/game/players/); do myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" echo "Getting latest online TW..." YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); @@ -87,7 +87,7 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|( # # CRYPTO DECODING CRYPTIP -> myIP rm -f ~/.zen/tmp/myIP.2 - echo "$CRYPTIP" > ~/.zen/tmp/myIP.$G1PUB.enc.2 + echo -n "$CRYPTIP" > ~/.zen/tmp/myIP.$G1PUB.enc.2 $MY_PATH/../tools/natools.py decrypt -f pubsec -k ~/.zen/game/players/$PLAYER/secret.dunikey -i ~/.zen/tmp/myIP.$G1PUB.enc.2 -o ~/.zen/tmp/myIP.2 > /dev/null 2>&1 OLDIP=$(cat ~/.zen/tmp/myIP.2 > /dev/null 2>&1) diff --git a/ASTROBOT/VOEUX.create.sh b/ASTROBOT/VOEUX.create.sh index 2d3f6580..6b70c8e4 100755 --- a/ASTROBOT/VOEUX.create.sh +++ b/ASTROBOT/VOEUX.create.sh @@ -24,7 +24,7 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" ## EXPORT [tag[voeu]] echo "## EXTRACTION DE NOUVEAUX VOEUX pour $PLAYER TW" diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index c0150659..63d5fb6d 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -31,7 +31,7 @@ IPFSNODEID=$(ipfs id -f='\n') myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu diff --git a/ajouter_media.sh b/ajouter_media.sh index 6f39fca3..f6504dd8 100755 --- a/ajouter_media.sh +++ b/ajouter_media.sh @@ -44,7 +44,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" URL="$1" if [ $URL ]; then diff --git a/start.sh b/start.sh index 5348bf43..cebcc6a4 100755 --- a/start.sh +++ b/start.sh @@ -8,7 +8,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" ME="${0##*/}" TS=$(date -u +%s%N | cut -b1-13) diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index ad47d307..c5ea112a 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -5,7 +5,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" IPFSNODEID=$(ipfs id -f='\n') diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index 0381b8a2..6b86fbfa 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -23,7 +23,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" ## LOCAL [[ ${PLAYER} ]] && ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1) @@ -200,7 +200,7 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html - sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or 127.0.1.1) + sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or astroport.localhost) # echo "# CRYPTO ENCODING myIP -> CRYPTIP" @@ -212,15 +212,15 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) echo "# CRYPTO DECODING CRYPTIP -> myIP" tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion' CRYPTIPENC=$(cat ~/.zen/tmp/MadeInZion.json | jq -r .[].secret | base16 -d) - echo "$CRYPTIPENC" > ~/.zen/tmp/myIP.$G1PUB.enc.2 - rm -f ~/.zen/tmp/myIP.2 - # echo "$MY_PATH/natools.py decrypt -f pubsec -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -i $HOME/.zen/tmp/myIP.$G1PUB.enc.2 -o $HOME/.zen/tmp/myIP.2" + echo -n "$CRYPTIPENC" > ~/.zen/tmp/myIP.$G1PUB.enc.2 ### PAS DE RETOUR CHARIOT ! $MY_PATH/natools.py decrypt -f pubsec -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -i $HOME/.zen/tmp/myIP.$G1PUB.enc.2 -o $HOME/.zen/tmp/myIP.2 # ## CRYPTO PROCESS VALIDATED [[ -s ~/.zen/tmp/myIP.2 ]] && echo "$myIP _SECRET_ CRYPTIP SECURED" \ || sed -i "s~$CRYPTIP~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # Revert to plaintext _SECRET_ myIP + rm -f ~/.zen/tmp/myIP.2 + ## ADD SYSTEM TW tiddlywiki --verbose --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \ --import ~/.zen/Astroport.ONE/templates/data/local.api.json "application/json" \ diff --git a/tools/VOEUX.print.sh b/tools/VOEUX.print.sh index ac9a6c75..7eaf43cd 100755 --- a/tools/VOEUX.print.sh +++ b/tools/VOEUX.print.sh @@ -40,7 +40,7 @@ select voeu in "${vlist[@]}"; do myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" VOEUXNS=$(ipfs key list -l | grep $voeu | cut -d ' ' -f1) diff --git a/tools/ipfs_config.sh b/tools/ipfs_config.sh index 165e1a7d..eeed79fe 100755 --- a/tools/ipfs_config.sh +++ b/tools/ipfs_config.sh @@ -21,8 +21,8 @@ ipfs config --json Experimental.P2pHttpProxy true ipfs config --json Swarm.ConnMgr.LowWater 20 ipfs config --json Swarm.ConnMgr.HighWater 40 -[[ ! $isLAN ]] && ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://127.0.1.1:8080" ]' \ - || ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:8080", "http://127.0.1.1:8080" ]' +[[ ! $isLAN ]] && ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://astroport.localhost:8080", "http://127.0.0.1:8080", "http://127.0.1.1:8080" ]' \ + || ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:8080", "http://astroport.localhost:8080", "http://127.0.1.1:8080" ]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index dcc0d2a9..8d937c3a 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -22,7 +22,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" # ~/.zen/game/players/$PLAYER/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN # Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from http://${myIP}:8080/.$IPFNODEID/ diff --git a/tools/vlc_webcam.sh b/tools/vlc_webcam.sh index 6cf2f82a..60ef418f 100755 --- a/tools/vlc_webcam.sh +++ b/tools/vlc_webcam.sh @@ -27,7 +27,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") -[[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" mkdir -p ~/.zen/game/players/${PLAYER}/vlog