soon onboarding

This commit is contained in:
fred 2022-06-06 18:26:35 +02:00
parent 794d5c119f
commit 2921d3010f
13 changed files with 225 additions and 12 deletions

BIN
images/demi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/moa_net.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

BIN
images/qo-op_net.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

View File

@ -1 +1 @@
off
on

View File

@ -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|
<h1>QR Code Scanner - Astronaute présentez votre VISA 'MadeInZion' SVP</h1>
<h1>Astronaute présentez votre VISA</h1>
<video id="preview"></video>
@ -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|
</script>
<h2>Receiver : echo -e 'HTTP/1.1 200 OK\r\n' | nc -l -p 1234 -q 1 | grep '^GET' | cut -d' ' -f2</h2>
<h2>- QR Code Scanner -</h2>
</body>

108
tools/IPFS.print.sh Normal file
View File

@ -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

View File

@ -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 "#-----------------------------------"

View File

@ -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

18
tools/header.sh Executable file
View File

@ -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) "

18
tools/insta/header.sh Executable file
View File

@ -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) "

10
tools/insta/moa_player_tw.sh Executable file
View File

@ -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"

10
tools/insta/qoop_player_tw.sh Executable file
View File

@ -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"

49
tools/instascan_login.sh Executable file
View File

@ -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)