2022-08-18 18:32:01 +02:00
|
|
|
#!/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##*/}"
|
|
|
|
################################################################################
|
2022-10-09 23:07:30 +02:00
|
|
|
# Create G1VOEU TW for PLAYER
|
2022-10-12 23:29:14 +02:00
|
|
|
# Mon Titre => G1MonTitre => PEPPER
|
|
|
|
## PARAM : "TITRE DU VOEU" "PLAYER" "INDEX"
|
2022-08-18 18:32:01 +02:00
|
|
|
################################################################################
|
2022-10-09 23:07:30 +02:00
|
|
|
TITRE="$1"
|
2022-08-18 18:32:01 +02:00
|
|
|
PLAYER="$2"
|
2022-10-12 23:29:14 +02:00
|
|
|
INDEX="$3"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
[[ $PLAYER == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
|
|
|
|
[[ $PLAYER == "" ]] && echo "Second paramètre PLAYER manquant" && exit 1
|
2022-08-22 17:38:25 +02:00
|
|
|
PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null)
|
|
|
|
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null)
|
2022-08-18 18:32:01 +02:00
|
|
|
[[ $G1PUB == "" ]] && echo "Troisième paramètre G1PUB manquant" && exit 1
|
2022-10-09 23:07:30 +02:00
|
|
|
|
2022-10-24 14:12:34 +02:00
|
|
|
[[ ! $INDEX ]] && echo "MISSING ASTRONAUTE TW index.html - EXIT -" && exit 1
|
2022-10-12 23:29:14 +02:00
|
|
|
|
|
|
|
echo "Working on $INDEX"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
2022-10-24 14:12:34 +02:00
|
|
|
[[ $ASTRONAUTENS == "" ]] && echo "CLEF IPNS ASTRONAUTE MANQUANTE - EXIT -" && exit 1
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
echo "Bienvenue $PSEUDO ($PLAYER) : $G1PUB"
|
|
|
|
echo
|
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
|
|
|
#####################################################
|
|
|
|
# CREATION DU TW G1VOEU
|
|
|
|
#####################################################
|
2022-10-11 13:51:46 +02:00
|
|
|
SALT=$(${MY_PATH}/../tools/diceware.sh 3 | xargs)
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "$SALT"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "## TITRE POUR CE VOEU ? "
|
|
|
|
[[ ! $TITRE ]] && read TITRE
|
2022-08-22 17:38:25 +02:00
|
|
|
PEPPER=$(echo "$TITRE" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
|
2022-10-16 02:57:29 +02:00
|
|
|
echo "$PEPPER" && [[ ! $PEPPER ]] && echo "EMPTY PEPPER - ERROR" && exit 1
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "## keygen CLEF DE VOEUX"
|
2022-10-11 13:51:46 +02:00
|
|
|
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/qrtw.dunikey "$SALT" "$PEPPER"
|
2022-08-18 18:32:01 +02:00
|
|
|
WISHKEY=$(cat ~/.zen/tmp/qrtw.dunikey | grep "pub:" | cut -d ' ' -f 2)
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "WISHKEY (G1PUB) = $WISHKEY"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "# NOUVEAU VOEU"
|
2022-08-18 18:32:01 +02:00
|
|
|
mkdir -p ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
|
2022-10-12 00:50:32 +02:00
|
|
|
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey "$SALT" "$PEPPER"
|
2022-10-10 18:06:37 +02:00
|
|
|
ipfs key import $WISHKEY -f pem-pkcs8-cleartext ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey
|
2022-10-12 01:05:12 +02:00
|
|
|
VOEUNS=$(ipfs key list -l | grep -w "$WISHKEY" | cut -d ' ' -f 1 )
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "/ipns/$VOEUNS"
|
|
|
|
|
2022-10-10 18:18:57 +02:00
|
|
|
## TEST IPFS
|
|
|
|
ipfs --timeout=6s cat /ipns/$VOEUNS > ~/.zen/tmp/$VOEUNS.html
|
2022-10-24 14:12:34 +02:00
|
|
|
[[ -s ~/.zen/tmp/$VOEUNS.html ]] && echo "HEY !!! UN TW EXISTE POUR CE VOEU ! ~/.zen/tmp/$VOEUNS.html - EXIT -" && exit 1
|
2022-10-10 18:22:36 +02:00
|
|
|
## WORLD TEST
|
2022-10-12 01:05:12 +02:00
|
|
|
TEST=$(cat ~/.zen/game/world/*/.pepper 2>/dev/null | grep -w "$PEPPER")
|
2022-10-24 14:12:34 +02:00
|
|
|
[[ $TEST ]] && echo "HEY !!! OH !! VOEU $PEPPER DANS VOTRE MONDE ! $TEST - EXIT -" && exit 1
|
2022-10-10 18:18:57 +02:00
|
|
|
|
2022-08-18 18:32:01 +02:00
|
|
|
# CRYPTO BUG. TODO use natools to protect and share key with Ŋ1 only ;)
|
2022-08-20 17:12:15 +02:00
|
|
|
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
|
2022-10-09 23:07:30 +02:00
|
|
|
echo " Passerelle : $myIP"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-08-23 13:38:37 +02:00
|
|
|
echo "# UPGRADING WORLD WHISHKEY DATABASE"
|
2022-08-18 18:32:01 +02:00
|
|
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
|
|
|
|
|
|
|
mkdir -p ~/.zen/game/world/$WISHKEY/
|
2022-10-09 23:07:30 +02:00
|
|
|
## A la fois Titre du tag et Pepper construction de clef
|
2022-08-18 18:32:01 +02:00
|
|
|
echo $PEPPER > ~/.zen/game/world/$WISHKEY/.pepper
|
|
|
|
|
|
|
|
echo "# CREATION TW"
|
2022-08-23 13:38:37 +02:00
|
|
|
##########################################################################################
|
2022-09-04 12:20:55 +02:00
|
|
|
# ipfs key import _MEDIAKEY_ ~/.zen/Astroport.ONE/templates/_MEDIAKEY_.keystore.key
|
|
|
|
##############
|
2022-09-06 03:53:10 +02:00
|
|
|
# ipfs cat /ipfs/bafybeibqdoegifzejykmc3qw3e3drgsa5i7az6xwjlfcx7rbtcoj5unpkq > ~/.zen/Astroport.ONE/templates/twdefault.html
|
2022-09-06 16:10:57 +02:00
|
|
|
# INTRODUCE HIDING CONTROL (read only from https) https $:/tags/Stylesheet
|
2022-09-06 04:26:17 +02:00
|
|
|
# ipfs cat /ipfs/bafybeidkur2tfbmqwscgmkfh76vmbcqay2m4gznxv5emkenxeffmrgywky > ~/.zen/Astroport.ONE/templates/twdefault.html
|
2022-08-23 13:38:37 +02:00
|
|
|
##########################################################################################
|
2022-08-18 18:32:01 +02:00
|
|
|
cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/game/world/$WISHKEY/index.html
|
2022-10-09 23:07:30 +02:00
|
|
|
# TODO : CREATE ONE TEMPLATE / REMOVE USELESS TID
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-12 23:29:14 +02:00
|
|
|
# PERSONNALISATION "MadeInZion"
|
2022-08-18 18:32:01 +02:00
|
|
|
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
|
2022-09-06 17:32:50 +02:00
|
|
|
sed -i "s~_ASTROPORT_~${ASTRONAUTENS}~g" ~/.zen/game/world/$WISHKEY/index.html
|
|
|
|
sed -i "s~_QRSEC_~${myIP}~g" ~/.zen/game/world/$WISHKEY/index.html
|
|
|
|
|
2022-10-12 01:05:12 +02:00
|
|
|
# IPNS KEY is WISHKEY / VOEUNS
|
2022-08-18 18:32:01 +02:00
|
|
|
sed -i "s~_MEDIAKEY_~${WISHKEY}~g" ~/.zen/game/world/$WISHKEY/index.html
|
2022-10-12 01:05:12 +02:00
|
|
|
sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${VOEUNS}~g" ~/.zen/game/world/$WISHKEY/index.html
|
2022-10-09 23:07:30 +02:00
|
|
|
|
2022-08-22 17:38:25 +02:00
|
|
|
# ASTROPORT LOCAL IP RELAY == Smartphone doesn't resolve LAN DNS. So using Astroport Station IP
|
2022-08-18 18:32:01 +02:00
|
|
|
sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/game/world/$WISHKEY/index.html
|
2022-08-20 17:12:15 +02:00
|
|
|
sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/world/$WISHKEY/index.html
|
|
|
|
|
2022-08-23 13:38:37 +02:00
|
|
|
# ADD API GW TIDDLERS for IPFS SAVE
|
|
|
|
##########################################################################################
|
|
|
|
# [{"title":"$:/ipfs/saver/api/http/local/5001","tags":"$:/ipfs/core $:/ipfs/saver/api","text":"http://127.0.0.1:5001"}]
|
|
|
|
# [{"title":"$:/ipfs/saver/gateway/local/myip","tags":"$:/ipfs/core $:/ipfs/saver/gateway","text":"http://127.0.0.1:8080"}]
|
|
|
|
##########################################################################################
|
2022-10-09 23:07:30 +02:00
|
|
|
tiddlywiki --load ~/.zen/game/world/$WISHKEY/index.html \
|
2022-08-23 13:38:37 +02:00
|
|
|
--import ~/.zen/Astroport.ONE/templates/data/local.api.json "application/json" \
|
|
|
|
--import ~/.zen/Astroport.ONE/templates/data/local.gw.json "application/json" \
|
2022-09-07 16:32:05 +02:00
|
|
|
--deletetiddlers '"Dessin de Moa"' \
|
2022-08-23 13:38:37 +02:00
|
|
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
2022-10-12 23:29:14 +02:00
|
|
|
|
2022-08-24 11:50:26 +02:00
|
|
|
[[ -s ~/.zen/tmp/newindex.html ]] && cp ~/.zen/tmp/newindex.html ~/.zen/game/world/$WISHKEY/index.html
|
2022-10-12 23:29:14 +02:00
|
|
|
[[ ! -s ~/.zen/tmp/newindex.html ]] && echo "ERROR ~/.zen/tmp/newindex.html MISSING" && exit 1
|
2022-08-23 13:38:37 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
## EXTEND ipfs daemon accreditation
|
2022-10-11 13:51:46 +02:00
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP':8080", "http://127.0.0.1:8080", "http://astroport:8080", "http://astroport.com:8080", "https://astroport.com", "https://qo-op.com", "http://qo-op.com:8080", "https://tube.copylaradio.com", "http://'$(hostname)'.local:8080" ]'
|
|
|
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin ## CORS
|
|
|
|
echo "RESTART IPFS !?"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
echo "# CREATION QR CODE"
|
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
|
2022-10-11 13:51:46 +02:00
|
|
|
LIBRA="http://qo-op.com:8080"
|
2022-10-09 23:07:30 +02:00
|
|
|
|
2022-10-12 01:05:12 +02:00
|
|
|
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png" "$LIBRA/ipns/$VOEUNS"
|
2022-10-09 23:07:30 +02:00
|
|
|
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.ASTROLINK.png" "$LIBRA/ipns/$ASTRONAUTENS"
|
2022-08-22 17:38:25 +02:00
|
|
|
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1ASTRO.png" "$G1PUB"
|
|
|
|
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png" "$WISHKEY"
|
2022-10-12 01:05:12 +02:00
|
|
|
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.IPNS.png" "/ipns/$VOEUNS"
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
# Bricolage avec node tiddlywiki (TODO add tiddler with command line)
|
2022-08-22 17:38:25 +02:00
|
|
|
# A suivre .... https://talk.tiddlywiki.org/t/how-to-add-extract-modify-tiddlers-from-command-line-to-do-ipfs-media-transfer/4345/4
|
|
|
|
# cd ~/.zen/game/world/$WISHKEY
|
|
|
|
# tiddlywiki $WISHKEY --load ~/.zen/game/world/$WISHKEY/index.html --savewikifolder ./tw/
|
|
|
|
# cd -
|
|
|
|
|
|
|
|
#################################
|
2022-10-09 23:07:30 +02:00
|
|
|
# PREMIER TYPE ~/.zen/tmp/player.png
|
|
|
|
convert $HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png -resize 300 ~/.zen/tmp/QRWISHLINK.png
|
2022-10-11 13:51:46 +02:00
|
|
|
convert ${MY_PATH}/../images/logoastro.png -resize 220 ~/.zen/tmp/ASTROLOGO.png
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-11 13:51:46 +02:00
|
|
|
composite -compose Over -gravity NorthWest -geometry +350+10 ~/.zen/tmp/ASTROLOGO.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
|
2022-10-09 23:07:30 +02:00
|
|
|
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
|
|
|
|
convert -gravity northwest -pointsize 35 -fill black -draw "text 320,250 \"$PLAYER\"" ~/.zen/tmp/one.png ~/.zen/tmp/hop.png
|
|
|
|
convert -gravity northwest -pointsize 30 -fill black -draw "text 20,320 \"$PEPPER\"" ~/.zen/tmp/hop.png ~/.zen/tmp/pseudo.png
|
|
|
|
convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"$SALT\"" ~/.zen/tmp/pseudo.png ~/.zen/tmp/salt.png
|
|
|
|
convert -gravity northwest -pointsize 33 -fill black -draw "text 320,350 \"$PEPPER\"" ~/.zen/tmp/salt.png ~/.zen/tmp/player.png
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-08-22 17:38:25 +02:00
|
|
|
#################################
|
2022-10-09 23:07:30 +02:00
|
|
|
# SECOND TYPE ~/.zen/tmp/voeu.png
|
|
|
|
convert $HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png -resize 300 ~/.zen/tmp/G1WISH.png
|
2022-10-11 13:51:46 +02:00
|
|
|
convert ${MY_PATH}/../images/logojeu.png -resize 260 ~/.zen/tmp/MIZLOGO.png
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-11 13:51:46 +02:00
|
|
|
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/G1WISH.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
|
2022-10-09 23:07:30 +02:00
|
|
|
composite -compose Over -gravity NorthWest -geometry +300+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
|
|
|
|
composite -compose Over -gravity NorthWest -geometry +320+280 ~/.zen/tmp/MIZLOGO.png ~/.zen/tmp/one.png ~/.zen/tmp/two.png
|
2022-08-18 18:32:01 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
convert -gravity northwest -pointsize 28 -fill black -draw "text 32,350 \"Ğ1 VOEU\"" ~/.zen/tmp/two.png ~/.zen/tmp/pep.png
|
|
|
|
convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"$PEPPER\"" ~/.zen/tmp/pep.png ~/.zen/tmp/voeu.png
|
2022-08-22 17:38:25 +02:00
|
|
|
|
2022-08-31 18:02:06 +02:00
|
|
|
# IMAGE DANS IPFS
|
2022-10-09 23:07:30 +02:00
|
|
|
IVOEUPLAY=$(ipfs add -Hq ~/.zen/tmp/player.png | tail -n 1)
|
2022-08-22 17:38:25 +02:00
|
|
|
|
2022-10-09 23:07:30 +02:00
|
|
|
IVOEU=$(ipfs add -Hq ~/.zen/tmp/voeu.png | tail -n 1)
|
2022-08-24 11:40:49 +02:00
|
|
|
## Replace Template G1Voeu image
|
2022-08-22 17:38:25 +02:00
|
|
|
sed -i "s~bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a~${IVOEU}~g" ~/.zen/game/world/$WISHKEY/index.html
|
|
|
|
|
2022-10-20 18:16:13 +02:00
|
|
|
# TEXT="<a target='_blank' href='"/ipns/${VOEUNS}"'><img src='"/ipfs/${IVOEUPLAY}"'></a><br><br><a target='_blank' href='"/ipns/${VOEUNS}"'>"${PEPPER}"</a>"
|
2022-10-24 16:56:42 +02:00
|
|
|
#:[tag[G1CopierYoutube]] [tag[pdf]]
|
2022-10-20 18:16:13 +02:00
|
|
|
# Contains QRCode linked to G1VoeuTW and BUTTON listing G1Voeux
|
2022-10-24 16:56:42 +02:00
|
|
|
TEXT="<a target='_blank' href='#:[tag[G1"$PEPPER"]]' ><img src='"/ipfs/${IVOEUPLAY}"'></a>
|
|
|
|
<br><a target='_blank' href='"/ipns/${VOEUNS}"'>TW G1Voeu "$PLAYER"</a><br><br>
|
2022-10-20 18:16:13 +02:00
|
|
|
<\$button class='tc-tiddlylink'>
|
2022-10-24 16:56:42 +02:00
|
|
|
<\$list filter='[tag[G1"${PEPPER}"]]'>
|
2022-10-20 18:16:13 +02:00
|
|
|
<\$action-navigate \$to=<<currentTiddler>> \$scroll=no/>
|
|
|
|
</\$list>
|
2022-10-24 16:56:42 +02:00
|
|
|
Afficher tous les G1"${PEPPER}"
|
2022-10-20 18:16:13 +02:00
|
|
|
</$button>"
|
2022-08-25 20:30:02 +02:00
|
|
|
|
2022-08-22 17:38:25 +02:00
|
|
|
# NEW IVEU TIDDLER
|
|
|
|
echo "## Creation json tiddler : Qr${PEPPER} /ipfs/${IVOEU}"
|
|
|
|
echo '[
|
|
|
|
{
|
2022-08-25 21:54:31 +02:00
|
|
|
"title": "'${PEPPER}'",
|
2022-08-26 14:25:47 +02:00
|
|
|
"type": "'text/vnd.tiddlywiki'",
|
2022-10-12 23:29:14 +02:00
|
|
|
"astronautens": "'$ASTRONAUTENS'",
|
|
|
|
"ipns": "'$VOEUNS'",
|
|
|
|
"wish": "'$WISHKEY'",
|
2022-08-25 20:30:02 +02:00
|
|
|
"text": "'$TEXT'",
|
2022-10-24 16:56:42 +02:00
|
|
|
"tags": "'G1Voeu G1${PEPPER} ${PLAYER}'"
|
2022-08-22 17:38:25 +02:00
|
|
|
}
|
|
|
|
]
|
2022-08-22 18:02:26 +02:00
|
|
|
' > ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json
|
2022-08-22 17:38:25 +02:00
|
|
|
|
2022-08-23 13:38:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
rm -f ~/.zen/tmp/newindex.html
|
|
|
|
|
|
|
|
echo "Nouveau Qr$PEPPER dans MOA $PSEUDO : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
|
2022-10-09 23:07:30 +02:00
|
|
|
tiddlywiki --verbose --load $INDEX \
|
|
|
|
--deletetiddlers '[tag[voeu]]' \
|
|
|
|
--import ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json "application/json" \
|
|
|
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
2022-08-23 13:38:37 +02:00
|
|
|
|
2022-08-23 19:43:07 +02:00
|
|
|
echo "PLAYER TW Update..."
|
2022-08-24 11:50:26 +02:00
|
|
|
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "Mise à jour $INDEX"
|
|
|
|
cp -f ~/.zen/tmp/newindex.html $INDEX
|
2022-10-10 15:17:30 +02:00
|
|
|
else
|
|
|
|
echo "ERROR INTO ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json"
|
2022-08-22 17:38:25 +02:00
|
|
|
fi
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
# PRINTING
|
|
|
|
LP=$(ls /dev/usb/lp* | head -n1)
|
2022-10-09 23:07:30 +02:00
|
|
|
if [[ ! $LP ]]; then
|
|
|
|
echo "NO PRINTER FOUND - Plug a Brother QL700 or Add your printer"
|
|
|
|
else
|
|
|
|
echo "IMPRESSION VOEU"
|
|
|
|
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/player.png > ~/.zen/tmp/toprint.bin 2>/dev/null
|
|
|
|
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
|
|
|
|
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/voeu.png > ~/.zen/tmp/toprint.bin 2>/dev/null
|
|
|
|
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
|
|
|
|
fi
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
# COPY QR CODE TO PLAYER ZONE
|
2022-10-09 23:07:30 +02:00
|
|
|
cp ~/.zen/tmp/player.png ~/.zen/tmp/voeu.png ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
|
2022-08-22 17:38:25 +02:00
|
|
|
echo "$PEPPER" > ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/.title
|
2022-10-12 01:05:12 +02:00
|
|
|
echo "http://$myIP:8080/ipns/$VOEUNS" > ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/.link
|
2022-08-22 17:38:25 +02:00
|
|
|
cp ~/.zen/game/world/$WISHKEY/QR.WISHLINK.png ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
|
2022-08-18 18:32:01 +02:00
|
|
|
|
|
|
|
# PUBLISHING
|
2022-10-09 23:07:30 +02:00
|
|
|
echo "## ${PLAYER} RECORDING YOU WISH INTO IPFS"
|
2022-08-24 11:40:49 +02:00
|
|
|
echo "ipfs add -Hq ~/.zen/game/world/$WISHKEY/index.html
|
2022-08-18 18:32:01 +02:00
|
|
|
ipfs name publish --key=${WISHKEY} /ipfs/\$IPUSH"
|
2022-08-24 11:40:49 +02:00
|
|
|
IPUSH=$(ipfs add -Hq ~/.zen/game/world/$WISHKEY/index.html | tail -n 1)
|
2022-08-18 18:32:01 +02:00
|
|
|
ipfs name publish --key=${WISHKEY} /ipfs/$IPUSH 2>/dev/null
|
|
|
|
|
2022-08-24 11:40:49 +02:00
|
|
|
echo $IPUSH > ~/.zen/game/world/$WISHKEY/.chain
|
|
|
|
echo $MOATS > ~/.zen/game/world/$WISHKEY/.moats
|
|
|
|
|
2022-09-08 18:01:38 +02:00
|
|
|
echo
|
2022-10-10 15:17:30 +02:00
|
|
|
echo "Astronaute TW : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
|
|
|
|
echo "Nouveau G1Voeu : $PEPPER (document de contrôle de copie Ŋ1)"
|
2022-10-12 01:05:12 +02:00
|
|
|
echo "TW $PEPPER : http://127.0.0.1:8080/ipns/$VOEUNS"
|
2022-09-08 18:01:38 +02:00
|
|
|
|
2022-10-10 15:17:30 +02:00
|
|
|
echo "## TO RECEIVE G1RONDS Creating Cesium+ Profil #### timeout long ... patience ...."
|
2022-10-12 01:05:12 +02:00
|
|
|
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/tmp/qrtw.dunikey -n "https://g1.data.presles.fr" set --name "G1Voeu $PEPPER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logojune.jpg" --site "https://astroport.com/ipns/$VOEUNS" #CESIUM+
|
2022-08-24 15:10:56 +02:00
|
|
|
[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED !!!!"
|
|
|
|
|
2022-09-03 15:41:15 +02:00
|
|
|
echo "************************************************************"
|
2022-09-08 18:01:38 +02:00
|
|
|
echo "Hop, UNE JUNE pour le Voeu $PEPPER"
|
2022-10-12 01:05:12 +02:00
|
|
|
echo $MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey pay -a 1 -p $WISHKEY -c \'"$VOEUNS G1Voeu $PEPPER"\' -m
|
2022-09-03 15:41:15 +02:00
|
|
|
echo "************************************************************"
|
2022-08-24 15:10:56 +02:00
|
|
|
|
2022-10-11 13:51:46 +02:00
|
|
|
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey pay -a 1 -p $WISHKEY -c "$VOEUXNS G1Voeu $PEPPER" -m
|
2022-09-03 15:41:15 +02:00
|
|
|
echo "************************************************************"
|
2022-08-23 13:38:37 +02:00
|
|
|
|
2022-08-18 18:32:01 +02:00
|
|
|
exit 0
|