diff --git a/images/demi.png b/images/demi.png new file mode 100644 index 00000000..d895499d Binary files /dev/null and b/images/demi.png differ diff --git a/images/moa_net.png b/images/moa_net.png new file mode 100644 index 00000000..08582133 Binary files /dev/null and b/images/moa_net.png differ diff --git a/images/qo-op_net.jpeg b/images/qo-op_net.jpeg new file mode 100644 index 00000000..5b6e1c0d Binary files /dev/null and b/images/qo-op_net.jpeg differ diff --git a/logic/leverlogic.ben b/logic/leverlogic.ben index cfb931e4..b3d86404 100755 --- a/logic/leverlogic.ben +++ b/logic/leverlogic.ben @@ -1 +1 @@ -off +on diff --git a/templates/instascan.html b/templates/instascan.html index b6c05aac..b6100658 100644 --- a/templates/instascan.html +++ b/templates/instascan.html @@ -65,7 +65,7 @@ p=0;Ei(69,e|0,28,i|0,r|0);Be=p;p=0;if(Be&1)break;p=0;Ge(45,u|0,18,f|0,a|0,t|0,n| -

QR Code Scanner - Astronaute présentez votre VISA 'MadeInZion' SVP

+

Astronaute présentez votre VISA

@@ -80,9 +80,9 @@ p=0;Ei(69,e|0,28,i|0,r|0);Be=p;p=0;if(Be&1)break;p=0;Ge(45,u|0,18,f|0,a|0,t|0,n| data: "qrcode="+content, type: 'GET' }); - alert(content); - $(location).attr('href', content); - + // alert(content); + // $(location).attr('href', content); + // Receiver : echo -e 'HTTP/1.1 200 OK\r\n' | nc -l -p 1234 -q 1 | grep '^GET' | cut -d' ' -f2 | cut -d'=' -f 2 }); Instascan.Camera.getCameras().then(function (cameras) { @@ -105,7 +105,7 @@ p=0;Ei(69,e|0,28,i|0,r|0);Be=p;p=0;if(Be&1)break;p=0;Ge(45,u|0,18,f|0,a|0,t|0,n| -

Receiver : echo -e 'HTTP/1.1 200 OK\r\n' | nc -l -p 1234 -q 1 | grep '^GET' | cut -d' ' -f2

+

- QR Code Scanner -

diff --git a/tools/IPFS.print.sh b/tools/IPFS.print.sh new file mode 100644 index 00000000..da3218e0 --- /dev/null +++ b/tools/IPFS.print.sh @@ -0,0 +1,108 @@ +#!/bin/bash +################################################################################ +# Author: Fred (support@qo-op.com) +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +################################################################################ +################################################################################ +# PREPARE BROTHER QL STICKERS +################################################################################ +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +MOATS=$(date -u +"%Y%m%d%H%M%S%4N") +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) + +[[ ! -f ~/.zen/game/players/.current/QR.png ]] &&\ + echo "ERREUR. Aucun PLAYER Astronaute connecté .ERREUR ~/.zen/game/players/.current/" && exit 1 + +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) + +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) + + +PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) +## Kept for old account upgrade Now in VISA.new +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.PLAYERNS.png" "http://astroport:8080/ipns/$PLAYERNS" + +echo "Raffraichissement IPNS $PLAYERNS" +# CONTROL AND OR REPUBLISH + rm -f ~/.zen/tmp/index.html + # TRYING TO LOAD PLAYERNS + ipfs get --timeout=10s -o ~/.zen/tmp/index.html /ipns/$PLAYERNS/index.html + # NO IPNS RESPONSE... REPUBLISH + [[ ! -f ~/.zen/tmp/index.html ]] && \ + IPUSH=$(cat ~/.zen/game/players/$PLAYER/$PLAYER.chain 2>/dev/null) && \ + ipfs name publish --key=${PLAYER} /ipfs/$IPUSH 2>/dev/null + # IPNS MEMORIZE BLOCKCHAIN + [[ -f ~/.zen/tmp/index.html ]] && \ + cp -f ~/.zen/tmp/index.html ~/.zen/game/players/$PLAYER/ && \ + echo $MOATS > ~/.zen/game/players/$PLAYER/$PLAYER.ts && \ + echo $(($(cat ~/.zen/game/players/$PLAYER/$PLAYER.n) + 1)) > ~/.zen/game/players/$PLAYER/$PLAYER.n &&\ + IPUSH=$(ipfs add -rHq ~/.zen/game/players/$PLAYER/ | tail -n 1) &&\ + echo $IPUSH > ~/.zen/game/players/$PLAYER/$PLAYER.chain + +MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.MOANS.png" "http://astroport:8080/ipns/$MOANS" + +echo "Raffraichissement IPNS $MOANS" +# CONTROL AND OR REPUBLISH + rm -f ~/.zen/tmp/index.html + # TRYING TO LOAD PLAYERNS + ipfs get --timeout=10s -o ~/.zen/tmp/index.html /ipns/$MOANS/index.html + # NO IPNS RESPONSE... REPUBLISH + [[ ! -f ~/.zen/tmp/index.html ]] && \ + IPUSH=$(cat ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.chain 2>/dev/null) && \ + ipfs name publish --key=moa_${PLAYER} /ipfs/$IPUSH 2>/dev/null + # IPNS MEMORIZE BLOCKCHAIN + [[ -f ~/.zen/tmp/index.html ]] && \ + cp -f ~/.zen/tmp/index.html ~/.zen/game/players/$PLAYER/moa/ && \ + echo $MOATS > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.ts && \ + echo $(($(cat ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.n) + 1)) > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.n &&\ + IPUSH=$(ipfs add -rHq ~/.zen/game/players/$PLAYER/moa/ | tail -n 1) &&\ + echo $IPUSH > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.chain + + +QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.QOOPNS.png" "http://astroport:8080/ipns/$QOOPNS" + +echo "Raffraichissement IPNS $QOOPNS" +# CONTROL AND OR REPUBLISH + rm -f ~/.zen/tmp/index.html + # TRYING TO LOAD PLAYERNS + ipfs get --timeout=10s -o ~/.zen/tmp/index.html /ipns/$QOOPNS/index.html + + # NO IPNS RESPONSE... REPUBLISH + [[ ! -f ~/.zen/tmp/index.html ]] && \ + IPUSH=$(cat ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.chain 2>/dev/null) && \ + ipfs name publish --key=qo-op_${PLAYER} /ipfs/$IPUSH 2>/dev/null + # IPNS MEMORIZE BLOCKCHAIN + [[ -f ~/.zen/tmp/index.html ]] && \ + cp -f ~/.zen/tmp/index.html ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/ && \ + echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.ts && \ + echo $(($(cat ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.n) + 1)) > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.n &&\ + IPUSH=$(ipfs add -rHq ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/index.html | tail -n 1) &&\ + echo $IPUSH > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.chain + +PASS=$(cat ~/.zen/game/players/.current/.pass) + +SALT=$(cat ~/.zen/game/players/.current/secret.june | head -n 1) +PEPPER=$(cat ~/.zen/game/players/.current/secret.june | tail -n 1) + +LP=$(ls /dev/usb/lp*) +convert ~/.zen/game/players/.current/QR.QOOPNS.png -resize 300 /tmp/QR.png +convert ${MY_PATH}/../images/astroport.jpg -resize 300 /tmp/ASTROPORT.png + +composite -compose Over -gravity NorthWest -geometry +280+30 /tmp/ASTROPORT.png ${MY_PATH}/../images/demi.png /tmp/astroport.png +composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QR.png /tmp/astroport.png /tmp/one.png +convert -gravity northwest -pointsize 50 -fill black -draw "text 300,200 \"TW\"" /tmp/pass.png /tmp/salt.png +convert -gravity northwest -pointsize 20 -fill black -draw "text 300,240 \"$PLAYER\"" /tmp/salt.png /tmp/done.jpg + +brother_ql_create --model QL-700 --label-size 62 /tmp/done.jpg > /tmp/toprint.bin 2>/dev/null +sudo brother_ql_print /tmp/toprint.bin $LP + +exit 0 diff --git a/tools/PLAYER.entrance.sh b/tools/PLAYER.entrance.sh index f279c0fd..fed1f004 100755 --- a/tools/PLAYER.entrance.sh +++ b/tools/PLAYER.entrance.sh @@ -36,7 +36,7 @@ echo "** Stop or Kill ipfs daemon **" [[ $YOU ]] && sudo killall -5 ipfs #----------------------------------- -### AN ASTROPORT NEEDS A CAPTAIN +### CHECK FOR THE CAPTAIN ############################## if [[ ! -d ~/.zen/game/players/$CAPTAIN || $CAPTAIN == "" || $CAPTAIN == "$HOME/astroport" ]]; then echo "#-----------------------------------" diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index d7995ae3..488c4d40 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -194,16 +194,16 @@ else fi -qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.PLAYERNS.png" "/ipns/$PLAYERNS" -qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.MOANS.png" "/ipns/$MOANS" -qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.QOOPNS.png" "/ipns/$QOOPNS" +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.PLAYERNS.png" "http://astroport:8080/ipns/$PLAYERNS" +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.MOANS.png" "http://astroport:8080/ipns/$MOANS" +qrencode -s 6 -o "$HOME/.zen/game/players/$PLAYER/QR.QOOPNS.png" "http://astroport:8080/ipns/$QOOPNS" echo; echo "Création de vos QR codes IPNS, clefs de votre réseau IPFS."; sleep 1 [[ $1 != "quiet" ]] && echo; echo "*** Espace Astronaute Activé : ~/.zen/game/players/$PLAYER/"; sleep 1 [[ $1 != "quiet" ]] && echo; echo "*** Votre Home : $PLAYER"; echo "http://127.0.0.1:8080/ipns/$PLAYERNS"; sleep 2 -[[ $1 != "quiet" ]] && echo; echo "*** Votre Journal Astronaute (niveau 3) : moa_$PLAYER"; echo " http://127.0.0.1:8080/ipns/$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1)"; sleep 2 -[[ $1 != "quiet" ]] && echo; echo "*** Votre Journal Passerelle (niveau 0/1) : qo-op_$PLAYER"; echo " http://127.0.0.1:8080/ipns/$(ipfs key list -l | grep -w qo-op_$PLAYER | cut -d ' ' -f 1)"; sleep 2 +[[ $1 != "quiet" ]] && echo; echo "*** Votre Journal Astronaute (niveau 3) : moa_$PLAYER"; echo " http://astroport:8080/ipns/$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1)"; sleep 2 +[[ $1 != "quiet" ]] && echo; echo "*** Votre Journal Passerelle (niveau 0/1) : qo-op_$PLAYER"; echo " http://astroport:8080/ipns/$(ipfs key list -l | grep -w qo-op_$PLAYER | cut -d ' ' -f 1)"; sleep 2 # PASS CRYPTING KEY openssl enc -aes-256-cbc -salt -in "$HOME/.zen/game/players/$PLAYER/secret.june" -out "$HOME/.zen/game/players/$PLAYER/enc.secret.june" -k $PASS 2>/dev/null diff --git a/tools/header.sh b/tools/header.sh new file mode 100755 index 00000000..8dc28b55 --- /dev/null +++ b/tools/header.sh @@ -0,0 +1,18 @@ +#!/bin/bash +################################################################################ +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +MOATS=$(date -u +"%Y%m%d%H%M%S%4N") +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) + +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) + +# Check if Astroport Station already has a "captain" +source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN" +echo "Astronaute $PLAYER ($PSEUDO) " diff --git a/tools/insta/header.sh b/tools/insta/header.sh new file mode 100755 index 00000000..8dc28b55 --- /dev/null +++ b/tools/insta/header.sh @@ -0,0 +1,18 @@ +#!/bin/bash +################################################################################ +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +MOATS=$(date -u +"%Y%m%d%H%M%S%4N") +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) + +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) + +# Check if Astroport Station already has a "captain" +source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN" +echo "Astronaute $PLAYER ($PSEUDO) " diff --git a/tools/insta/moa_player_tw.sh b/tools/insta/moa_player_tw.sh new file mode 100755 index 00000000..f184cfc0 --- /dev/null +++ b/tools/insta/moa_player_tw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +################################################################################ +source ./header.sh + +player=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1) +moa=$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1) + +qoop=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1) + +xdg-open "http://127.0.0.1:8080/ipns/$player" diff --git a/tools/insta/qoop_player_tw.sh b/tools/insta/qoop_player_tw.sh new file mode 100755 index 00000000..f184cfc0 --- /dev/null +++ b/tools/insta/qoop_player_tw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +################################################################################ +source ./header.sh + +player=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1) +moa=$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1) + +qoop=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1) + +xdg-open "http://127.0.0.1:8080/ipns/$player" diff --git a/tools/instascan_login.sh b/tools/instascan_login.sh new file mode 100755 index 00000000..c82cf5df --- /dev/null +++ b/tools/instascan_login.sh @@ -0,0 +1,49 @@ +#!/bin/bash +################################################################################ +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +MOATS=$(date -u +"%Y%m%d%H%M%S%4N") +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) + +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) +PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) +MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) +QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) + +# Check if Astroport Station already has a "captain" +source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN" +echo "Astronaute $PLAYER ($PSEUDO) " + +xdg-open "file:///home/fred/workspace/Astroport.ONE/templates/instascan.html" + +while true; do + + REPONSE=$(echo -e 'HTTP/1.1 200 OK\r\n' | nc -l -p 1234 -q 1 | grep '^GET' | cut -d' ' -f2 | cut -d'=' -f 2) + + ## PLAYER G1PUB + g1pubpath=$(grep $REPONSE ~/.zen/game/players/*/.g1pub | cut -d ':' -f 1 2>/dev/null) + PLAYER=$(echo "$g1pubpath" | rev | cut -d '/' -f 2 | rev 2>/dev/null) + + ## + [[ $(echo $REPONSE | grep '/ipns/') ]] && + + [[ $PLAYER ]] &&\ + echo "$PLAYER" && \ + ns=$(ipfs key list -l | grep -w qo-op_$PLAYER | cut -d ' ' -f 1) &&\ + + xdg-open "http://127.0.0.1:8080/ipns/$ns" || \ + echo "? "$REPONSE + +done + + +moa=$(ipfs key list -l | grep -w moa_$PLAYER | cut -d ' ' -f 1) + +qoop=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f 1) +