forked from STI/Astroport.ONE
Astronaute et Voeux ont leurs TW
This commit is contained in:
parent
5466336d36
commit
bee4c167fd
|
@ -0,0 +1,163 @@
|
|||
#!/bin/bash
|
||||
################################################################################
|
||||
# Author: Fred (support@qo-op.com)
|
||||
# Version: 0.1
|
||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||
################################################################################
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
ME="${0##*/}"
|
||||
################################################################################
|
||||
# Create and print VOEUX.
|
||||
# Attributed to a place shared through Astroport Ŋ1 confidence network IPFS layer
|
||||
# PARAMETRES
|
||||
# Promesse de virement du MONTANT, le nom du joueur PLAYER et sa G1PUB.
|
||||
################################################################################
|
||||
MONTANT="$1"
|
||||
PLAYER="$2"
|
||||
G1PUB="$3"
|
||||
QRTW="$4" # Nombre de QR + TW5 à créer
|
||||
|
||||
[[ $MONTANT == "" ]] && MONTANT="_?_"
|
||||
[[ $PLAYER == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
|
||||
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null)
|
||||
[[ $PLAYER == "" ]] && echo "Second paramètre PLAYER manquant" && exit 1
|
||||
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null)
|
||||
[[ $G1PUB == "" ]] && echo "Troisième paramètre G1PUB manquant" && exit 1
|
||||
[[ $QRTW == "" ]] && QRTW=1
|
||||
|
||||
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
||||
[[ $ASTRONAUTENS == "" ]] && echo "ASTRONAUTE manquant" && exit 1
|
||||
|
||||
echo "Bienvenue $PSEUDO ($PLAYER) : $G1PUB"
|
||||
echo "Astronaute Ŋ1 : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
|
||||
echo
|
||||
|
||||
# BACKING UP IPNS
|
||||
rm -f ~/.zen/tmp/index.html
|
||||
ipfs --timeout 5s get -o ~/.zen/tmp/index.html /ipns/$ASTRONAUTENS
|
||||
if [ ! -f ~/.zen/tmp/index.html ]; then
|
||||
echo "ERROR IPNS TIMEOUT"
|
||||
TW=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1)
|
||||
ipfs name publish --key=$G1PUB /ipfs/$TW
|
||||
else
|
||||
cp ~/.zen/tmp/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||
fi
|
||||
|
||||
# CREATION DE $QRTW BILLETS DE $MONTANT DU
|
||||
boucle=0;
|
||||
while [ $boucle -lt $QRTW ]
|
||||
do
|
||||
boucle=$((boucle+1))
|
||||
SALT=$(${MY_PATH}/tools/diceware.sh 3 | xargs)
|
||||
PEPPER=$(${MY_PATH}/tools/diceware.sh 1 | xargs)
|
||||
|
||||
echo "Entrez un Titre pour ce Voeu"
|
||||
read TITRE
|
||||
PEPPER=$(echo "$TITRE" | sed -r 's/\<./\U&/g' | sed 's/ //g')
|
||||
|
||||
echo "# CREATION CLEF DE VOEUX"
|
||||
${MY_PATH}/tools/keygen -t duniter -o ~/.zen/tmp/qrtw.dunikey "$SALT" "$PEPPER"
|
||||
WISHKEY=$(cat ~/.zen/tmp/qrtw.dunikey | grep "pub:" | cut -d ' ' -f 2)
|
||||
|
||||
echo "# NOUVEAU VOEU ASTRONAUTE"
|
||||
mkdir -p ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
|
||||
${MY_PATH}/tools/keygen -t ipfs -o ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey "$SALT" "$PEPPER"
|
||||
VOEUXNS=$(ipfs key import $WISHKEY -f pem-pkcs8-cleartext ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey)
|
||||
# CRYPTO BUG. TODO use natools to protect and share key with Ŋ1 only ;)
|
||||
|
||||
echo "# CREATION WORLD UPGRADE DATABASE"
|
||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||
|
||||
mkdir -p ~/.zen/game/world/$WISHKEY/
|
||||
echo $PEPPER > ~/.zen/game/world/$WISHKEY/.pepper
|
||||
|
||||
echo "# CREATION TW"
|
||||
# ipfs cat /ipfs/bafybeigw5naxqmxt62ljglgzefmfcchp5gulo3yxs5pu7xrxylhzo2obyu > ~/.zen/Astroport.ONE/templates/twdefault.html
|
||||
cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/game/world/$WISHKEY/index.html
|
||||
|
||||
# PERSONNALISATION
|
||||
sed -i "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_WISHKEY_~${WISHKEY}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_NUMBER_~${SALT}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~_SECRET_~${PEPPER}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
|
||||
# IPNS KEY is WISHKEY / VOEUXNS
|
||||
sed -i "s~_MEDIAKEY_~${WISHKEY}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${VOEUXNS}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
# ASTROPORT RELAY
|
||||
sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
|
||||
echo "# CREATION QR CODE"
|
||||
HOST="$(hostname).local"
|
||||
|
||||
qrencode -s 6 -o "$HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png" "http://$HOST:8080/ipns/$VOEUXNS"
|
||||
qrencode -s 6 -o "$HOME/.zen/game/world/$WISHKEY/QR.ASTROLINK.png" "http://$HOST:8080/ipns/$ASTRONAUTENS"
|
||||
qrencode -s 6 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1ASTRO.png" "$G1PUB"
|
||||
qrencode -s 6 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png" "$WISHKEY"
|
||||
qrencode -s 6 -o "$HOME/.zen/game/world/$WISHKEY/QR.IPNS.png" "/ipns/$VOEUXNS"
|
||||
|
||||
# Bricolage avec node tiddlywiki (TODO add tiddler with command line)
|
||||
#
|
||||
cd ~/.zen/game/world/$WISHKEY
|
||||
tiddlywiki $WISHKEY --load ~/.zen/game/world/$WISHKEY/index.html --savewikifolder ./tw/
|
||||
cd -
|
||||
|
||||
# PREMIER TYPE
|
||||
convert $HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png -resize 300 /tmp/QR.png
|
||||
convert ${MY_PATH}/images/logoastro.png -resize 220 /tmp/ASTROLOGO.png
|
||||
convert ${MY_PATH}/images/logojeu.png -resize 260 /tmp/MIZLOGO.png
|
||||
|
||||
composite -compose Over -gravity NorthWest -geometry +350+10 /tmp/ASTROLOGO.png ${MY_PATH}/images/Brother_600x400.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 35 -fill black -draw "text 320,250 \"$PSEUDO\"" /tmp/one.png /tmp/hop.png
|
||||
convert -gravity northwest -pointsize 30 -fill black -draw "text 20,320 \"$PEPPER\"" /tmp/hop.png /tmp/pseudo.png
|
||||
convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"$SALT\"" /tmp/pseudo.png /tmp/salt.png
|
||||
convert -gravity northwest -pointsize 40 -fill black -draw "text 320,350 \"$PEPPER\"" /tmp/salt.png /tmp/player.png
|
||||
|
||||
# SECOND TYPE
|
||||
convert $HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png -resize 300 /tmp/G1.png
|
||||
convert $HOME/.zen/game/world/$WISHKEY/QR.IPNS.png -resize 300 /tmp/IPNS.png
|
||||
|
||||
composite -compose Over -gravity NorthWest -geometry +300+0 /tmp/G1.png ${MY_PATH}/images/Brother_600x400.png /tmp/astroport.png
|
||||
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/IPNS.png /tmp/astroport.png /tmp/one.png
|
||||
composite -compose Over -gravity NorthWest -geometry +320+280 /tmp/MIZLOGO.png /tmp/one.png /tmp/two.png
|
||||
|
||||
convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"Ğ1 RÊVE\"" /tmp/play.png /tmp/voeu.png
|
||||
convert -gravity northwest -pointsize 28 -fill black -draw "text 32,350 \"$PEPPER\"" /tmp/two.png /tmp/play.png
|
||||
|
||||
|
||||
# IMAGE IPFS
|
||||
IREVE=$(ipfs add -Hq /tmp/voeu.png | tail -n 1)
|
||||
sed -i "s~bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a~${IREVE}~g" ~/.zen/game/world/$WISHKEY/index.html
|
||||
|
||||
# PRINTING
|
||||
LP=$(ls /dev/usb/lp* | head -n1)
|
||||
[[ ! $LP ]] && echo "NO PRINTER FOUND - Brother QL700 validated" # && exit 1
|
||||
echo "IMPRESSION VOEU"
|
||||
brother_ql_create --model QL-700 --label-size 62 /tmp/player.png > /tmp/toprint.bin 2>/dev/null
|
||||
sudo brother_ql_print /tmp/toprint.bin $LP
|
||||
brother_ql_create --model QL-700 --label-size 62 /tmp/voeu.png > /tmp/toprint.bin 2>/dev/null
|
||||
sudo brother_ql_print /tmp/toprint.bin $LP
|
||||
|
||||
# COPY QR CODE TO PLAYER ZONE
|
||||
cp /tmp/player.png /tmp/voeu.png ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
|
||||
|
||||
# PUBLISHING
|
||||
echo "## ${PLAYER} RECORDING YOU WISH INTO BLOCKCHAIN"
|
||||
echo "ipfs add -rHq ~/.zen/game/world/$WISHKEY/
|
||||
ipfs name publish --key=${WISHKEY} /ipfs/\$IPUSH"
|
||||
IPUSH=$(ipfs add -rHq ~/.zen/game/world/$WISHKEY/ | tail -n 1)
|
||||
echo $IPUSH > ~/.zen/game/world/$WISHKEY/.chain # Contains last IPFS backup PLAYER KEY
|
||||
echo $MOATS > ~/.zen/game/world/$WISHKEY/.moats
|
||||
ipfs name publish --key=${WISHKEY} /ipfs/$IPUSH 2>/dev/null
|
||||
|
||||
echo "CAPSULE A REVE $PEPPER : http://127.0.0.1:8080/ipns/$VOEUXNS"
|
||||
|
||||
|
||||
done
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,136 @@
|
|||
#!/bin/bash
|
||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
# 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 "http://127.0.0.1:8080/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 : http://127.0.0.1:8080/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~tube.copylaradio.com~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 get -o ~/.zen/game/world/$G1PUB/index.html /ipns/$IPNSK
|
||||
|
||||
cd ~/.zen/game/world/
|
||||
tiddlywiki $G1PUB --load ~/.zen/game/world/$G1PUB/index.html &
|
||||
sleep 3 && killall node # TRASH PUNK PROGRAMMING
|
||||
echo "BACKUP DONE !!"
|
||||
cd $MY_PATH
|
||||
fi
|
||||
|
||||
## CREATE GCHANGE AD
|
||||
if [[ ! -f ~/.zen/game/world/.gchange.$G1PUB ]]
|
||||
then
|
||||
echo "CREATION ANNONCE CROWDFUNDING"
|
||||
echo ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/tmp/secret.dunikey -n "https://data.gchange.fr" setoffer -t "${TITLE} #ASTROMIZ" -d "http://127.0.0.1:8080/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 "http://127.0.0.1:8080/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
|
Binary file not shown.
After Width: | Height: | Size: 825 B |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
9
start.sh
9
start.sh
|
@ -78,7 +78,7 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w "$PLAYER" | cut -d ' ' -f 1)
|
|||
echo "Votre MOA : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
|
||||
|
||||
PS3="$PLAYER choisissez : __ "
|
||||
choices=("AJOUTER MEDIA" "IMPRIMER VISA" "EXPORTER VISA" "SUPPRIMER VISA" "QUITTER")
|
||||
choices=("CREER UN VOEU" "IMPRIMER VISA" "EXPORTER VISA" "SUPPRIMER VISA" "QUITTER")
|
||||
select fav in "${choices[@]}"; do
|
||||
case $fav in
|
||||
"IMPRIMER VISA")
|
||||
|
@ -111,9 +111,10 @@ select fav in "${choices[@]}"; do
|
|||
break
|
||||
;;
|
||||
|
||||
"AJOUTER MEDIA")
|
||||
echo "VIDEOBLOG"
|
||||
${MY_PATH}/tools/vlc_webcam.sh
|
||||
"CREER UN VOEU")
|
||||
echo "QRCode à coller sur votre REVE"
|
||||
${MY_PATH}/G1VOEUX.sh
|
||||
# ${MY_PATH}/tools/vlc_webcam.sh
|
||||
#~/.zen/astrXbian/ajouter_video.sh
|
||||
;;
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Drag and Drop Interoperability with TiddlyWiki Demo</title>
|
||||
<style>
|
||||
#draggable {
|
||||
padding: 1em;
|
||||
margin: 1em;
|
||||
background: #ecc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="draggable" draggable="true">
|
||||
Drag me to a TiddlyWiki window
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var titleString = "This is the string that appears when the block is dragged to a text input";
|
||||
var tiddlerData = [
|
||||
{title: "Tiddler One", text: "This is one of the payload tiddlers"},
|
||||
{title: "Tiddler Two", text: "This is another of the payload tiddlers", "custom-field": "A custom field value"}
|
||||
];
|
||||
|
||||
document.getElementById("draggable").addEventListener("dragstart",function(event) {
|
||||
event.dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(JSON.stringify(tiddlerData)));
|
||||
event.dataTransfer.setData("Text",titleString);
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,7 @@ echo "CREATING $PLAYER GCHANGE+ PROFILE"
|
|||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/astrXbian/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #GCHANGE+
|
||||
[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && exit 1
|
||||
########################################################################
|
||||
echo "CREATING $PLAYER CESIUM+ PROFILE"
|
||||
#echo "CREATING $PLAYER CESIUM+ PROFILE"
|
||||
########################################################################
|
||||
#~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.e-is.pro" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/astrXbian/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+
|
||||
#[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && exit 1
|
||||
|
|
|
@ -105,6 +105,9 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~_WISHKEY_~${G1PUB}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
|
||||
sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~_QRSEC_~${PASsec}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
|
||||
|
@ -115,9 +118,28 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${ASTRONAUTENS}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
|
||||
## ID CARD
|
||||
convert ~/.zen/game/players/$PLAYER/QR.png -resize 300 /tmp/QR.png
|
||||
convert ${MY_PATH}/../images/astroport.jpg -resize 300 /tmp/ASTROPORT.png
|
||||
|
||||
composite -compose Over -gravity SouthWest -geometry +280+20 /tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png /tmp/astroport.png
|
||||
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QR.png /tmp/astroport.png /tmp/one.png
|
||||
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png /tmp/one.png /tmp/image.png
|
||||
|
||||
convert -gravity northwest -pointsize 35 -fill black -draw "text 50,300 \"$PSEUDO\"" /tmp/one.png /tmp/image.png
|
||||
convert -gravity northwest -pointsize 30 -fill black -draw "text 300,40 \"$PLAYER\"" /tmp/image.png /tmp/pseudo.png
|
||||
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" /tmp/pseudo.png /tmp/pass.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" /tmp/pass.png /tmp/salt.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" /tmp/salt.png ~/.zen/game/players/$PLAYER/ID.png
|
||||
|
||||
# INSERTED IMAGE IPFS
|
||||
IASTRO=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ID.png | tail -n 1)
|
||||
sed -i "s~bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a~${IASTRO}~g" ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html
|
||||
|
||||
echo "## PUBLISHING ${PLAYER} /ipns/$ASTRONAUTENS/"
|
||||
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/moa/index.html | tail -n 1)
|
||||
echo $IPUSH > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/.moachain # Contains last IPFS backup PLAYER KEY
|
||||
echo "/ipfs/$IPUSH"
|
||||
echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/.moats
|
||||
ipfs name publish --key=${PLAYER} /ipfs/$IPUSH 2>/dev/null
|
||||
|
||||
|
|
|
@ -29,19 +29,22 @@ 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.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/carreblanc.png /tmp/astroport.png
|
||||
composite -compose Over -gravity SouthWest -geometry +280+20 /tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png /tmp/astroport.png
|
||||
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QR.png /tmp/astroport.png /tmp/one.png
|
||||
composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png /tmp/one.png /tmp/image.png
|
||||
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png /tmp/one.png /tmp/image.png
|
||||
|
||||
convert -gravity southwest -pointsize 40 -fill black -draw "text 20,40 \"$PLAYER\"" /tmp/image.png /tmp/pseudo.png
|
||||
convert -gravity northwest -pointsize 30 -fill black -draw "text 80,380 \"$PASS\"" /tmp/pseudo.png /tmp/pass.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,200 \"$SALT\"" /tmp/pass.png /tmp/salt.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,240 \"$PEPPER\"" /tmp/salt.png /tmp/done.jpg
|
||||
convert -gravity northwest -pointsize 35 -fill black -draw "text 50,300 \"$PSEUDO\"" /tmp/one.png /tmp/image.png
|
||||
convert -gravity northwest -pointsize 30 -fill black -draw "text 300,40 \"$PLAYER\"" /tmp/image.png /tmp/pseudo.png
|
||||
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" /tmp/pseudo.png /tmp/pass.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" /tmp/pass.png /tmp/salt.png
|
||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" /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
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue