keeping TW chain updated in TW
This commit is contained in:
parent
09f4b78a06
commit
fbe2d97ad3
|
@ -78,15 +78,16 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
|
||||||
|
|
||||||
if [[ $PASS != "" ]]; then
|
if [[ $PASS != "" ]]; then
|
||||||
echo ${WHAT} ${VAL}
|
echo ${WHAT} ${VAL}
|
||||||
|
## Recreate GPG aes file
|
||||||
urldecode ${QRCODE} | tr '_' '+' | tr '-' '\n' | tr '~' '-' > ~/.zen/tmp/${MOATS}/disco.aes
|
urldecode ${QRCODE} | tr '_' '+' | tr '-' '\n' | tr '~' '-' > ~/.zen/tmp/${MOATS}/disco.aes
|
||||||
sed -i '$ d' ~/.zen/tmp/${MOATS}/disco.aes
|
sed -i '$ d' ~/.zen/tmp/${MOATS}/disco.aes
|
||||||
|
# Decoding
|
||||||
echo "cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "$PASS" --batch"
|
echo "cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "$PASS" --batch"
|
||||||
cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "$PASS" --batch > ~/.zen/tmp/${MOATS}/disco
|
cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "$PASS" --batch > ~/.zen/tmp/${MOATS}/decoded
|
||||||
|
|
||||||
# cat ~/.zen/tmp/${MOATS}/disco
|
# cat ~/.zen/tmp/${MOATS}/disco
|
||||||
## FORMAT SHOULD BE "/?salt=${USALT}&pepper=${UPEPPER}"
|
## FORMAT IS "/?salt=${USALT}&pepper=${UPEPPER}"
|
||||||
DISCO=$(cat ~/.zen/tmp/${MOATS}/disco | cut -d '?' -f2)
|
DISCO=$(cat ~/.zen/tmp/${MOATS}/decoded | cut -d '?' -f2)
|
||||||
arr=(${DISCO//[=&]/ })
|
arr=(${DISCO//[=&]/ })
|
||||||
salt=$(urldecode ${arr[1]} | xargs)
|
salt=$(urldecode ${arr[1]} | xargs)
|
||||||
pepper=$(urldecode ${arr[3]} | xargs)
|
pepper=$(urldecode ${arr[3]} | xargs)
|
||||||
|
|
|
@ -109,6 +109,7 @@ for PLAYER in ${PLAYERONE[@]}; do
|
||||||
--output ~/.zen/tmp/${MOATS} \
|
--output ~/.zen/tmp/${MOATS} \
|
||||||
--render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
|
--render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
|
||||||
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
|
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
|
||||||
|
CURCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain | rev | cut -f 1 -d '/' | rev) # Remove "/ipfs/" part
|
||||||
|
|
||||||
IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
|
IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
|
||||||
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
|
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
|
||||||
|
@ -188,6 +189,11 @@ for PLAYER in ${PLAYERONE[@]}; do
|
||||||
echo "DIFFERENCE DETECTED !! "
|
echo "DIFFERENCE DETECTED !! "
|
||||||
echo "Backup & Upgrade TW local copy..."
|
echo "Backup & Upgrade TW local copy..."
|
||||||
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||||
|
|
||||||
|
[[ -s ~/.zen/game/players/$PLAYER/ipfs/moa/.chain ]] \
|
||||||
|
&& ZCHAIN=$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.chain) \
|
||||||
|
&& echo "# CHAIN : $CURCHAIN -> $ZCHAIN" \
|
||||||
|
&& sed -i "s~$CURCHAIN~$ZCHAIN~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||||
fi
|
fi
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ MOATS="$2"
|
||||||
|
|
||||||
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
|
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
|
||||||
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
|
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
|
||||||
|
COINS=$(cat $HOME/.zen/tmp/coucou/${G1PUB}.COINS)
|
||||||
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
|
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
|
||||||
|
|
||||||
## REFRESH ASTRONAUTE TW
|
## REFRESH ASTRONAUTE TW
|
||||||
|
@ -31,7 +32,7 @@ INDEX="$3"
|
||||||
|
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu
|
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu
|
||||||
|
|
||||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
echo "%% $COINS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||||
###############################
|
###############################
|
||||||
## EXTRACT G1Voeu from PLAYER TW
|
## EXTRACT G1Voeu from PLAYER TW
|
||||||
echo "Exporting ${PLAYER} TW [tag[G1Voeu]]"
|
echo "Exporting ${PLAYER} TW [tag[G1Voeu]]"
|
||||||
|
@ -212,7 +213,7 @@ do
|
||||||
WISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* | tail -n 1) # ADDING JSONS TO IPFS
|
WISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* | tail -n 1) # ADDING JSONS TO IPFS
|
||||||
ipfs name publish -k $VOEUKEY /ipfs/$WISHFLUX # PUBLISH $VOEUKEY
|
ipfs name publish -k $VOEUKEY /ipfs/$WISHFLUX # PUBLISH $VOEUKEY
|
||||||
|
|
||||||
echo "## ASK ${myASTROTUBE} GATEASTRONAUTENSWAY TO REFRESH"
|
echo "## ASK ${myASTROTUBE} $ASTRONAUTENS TO REFRESH"
|
||||||
curl -m 120 -so ~/.zen/tmp/${WISHNAME}.astroindex.html "${myASTROTUBE}${VOEUNS}" &
|
curl -m 120 -so ~/.zen/tmp/${WISHNAME}.astroindex.html "${myASTROTUBE}${VOEUNS}" &
|
||||||
|
|
||||||
## MOVE INTO PLAYER AREA
|
## MOVE INTO PLAYER AREA
|
||||||
|
|
|
@ -79,10 +79,9 @@ header {
|
||||||
</div>
|
</div>
|
||||||
<span id="typed"></span>
|
<span id="typed"></span>
|
||||||
</h2>
|
</h2>
|
||||||
<span><a target="youtube" href="https://youtube.com">📺 (👍)</a> : </span><input name=g1pub value=''></br>
|
<span><a target="youtube" href="https://youtube.com">📺 (👍)</a> : </span><input name=g1pub value='favorite video link'></br>
|
||||||
<span>Email : </span><input name=email value=''></br></br>
|
<span>Email : </span><input name=email value=''></br></br>
|
||||||
<input type='submit' value='[(♥‿‿♥)]'>
|
<input type='submit' value='[(♥‿‿♥)]'>
|
||||||
<p>Renseignez votre lien Youtube préféré et votre Email<br>Validez</p>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -41,14 +41,20 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
|
||||||
ASTRONAUTENS=$(ipfs key import ${MOATS} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/player.key 2>/dev/null)
|
ASTRONAUTENS=$(ipfs key import ${MOATS} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/player.key 2>/dev/null)
|
||||||
# echo "/ipns/${ASTRONAUTENS}"
|
# echo "/ipns/${ASTRONAUTENS}"
|
||||||
|
|
||||||
echo "SCANNING /ipns/${ASTRONAUTENS} for 30s"
|
echo "SCANNING /ipns/${ASTRONAUTENS} for 180s"
|
||||||
## GETTING LAST TW via IPFS or HTTP GW
|
## GETTING LAST TW via IPFS or HTTP GW
|
||||||
[[ $YOU ]] \
|
[[ $YOU ]] \
|
||||||
&& ipfs --timeout 30s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/${MOATS}/TW/index.html
|
&& ipfs --timeout 180s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/${MOATS}/TW/index.html
|
||||||
|
|
||||||
[[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
|
[[ $XDG_SESSION_TYPE == 'x11' ]] \
|
||||||
&& echo "Trying curl on $LIBRA" \
|
&& [[ -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
|
||||||
&& curl -m 30 -so ~/.zen/tmp/${MOATS}/TW/index.html "$LIBRA/ipns/${ASTRONAUTENS}"
|
&& echo "TYPE 'yes' TO RESET TW. HIT ENTER TO KEEP IT." \
|
||||||
|
&& read ENTER \
|
||||||
|
&& [[ $ENTER != "" ]] && rm ~/.zen/tmp/${MOATS}/TW/index.html
|
||||||
|
|
||||||
|
#~ [[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
|
||||||
|
#~ && echo "Trying curl on $LIBRA" \
|
||||||
|
#~ && curl -m 30 -so ~/.zen/tmp/${MOATS}/TW/index.html "$LIBRA/ipns/${ASTRONAUTENS}"
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
## AUCUN RESULTAT
|
## AUCUN RESULTAT
|
||||||
|
@ -66,14 +72,15 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
|
||||||
rm -f ~/.zen/tmp/${MOATS}/Astroport.json
|
rm -f ~/.zen/tmp/${MOATS}/Astroport.json
|
||||||
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
|
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
|
||||||
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
|
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
|
||||||
|
echo "ASTROPORT=$ASTROPORT"
|
||||||
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID'
|
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID'
|
||||||
AstroID=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[]._canonical_uri)
|
AstroID=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[]._canonical_uri)
|
||||||
|
echo "AstroID=$AstroID"
|
||||||
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'G1Visa'
|
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'G1Visa'
|
||||||
G1Visa=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[]._canonical_uri)
|
G1Visa=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[]._canonical_uri)
|
||||||
|
echo "G1Visa=$G1Visa"
|
||||||
|
|
||||||
if [[ $ASTROPORT ]]; then
|
if [[ $ASTROPORT != "" ]]; then
|
||||||
|
|
||||||
IPNSTAIL=$(echo $ASTROPORT | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
|
IPNSTAIL=$(echo $ASTROPORT | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
|
||||||
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
|
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
|
||||||
|
@ -81,7 +88,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
echo ">> NO GOOD TW - CREATING FRESH NEW ONE"
|
echo ">> NO ACTIVE TW - CREATING FRESH NEW ONE"
|
||||||
cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
|
cp ~/.zen/Astroport.ONE/templates/twdefault.html ~/.zen/tmp/${MOATS}/TW/index.html
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -367,16 +374,16 @@ DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
|
||||||
convert ${MY_PATH}/../images/astroport.jpg -resize 240 ~/.zen/tmp/${MOATS}/ASTROPORT.png
|
convert ${MY_PATH}/../images/astroport.jpg -resize 240 ~/.zen/tmp/${MOATS}/ASTROPORT.png
|
||||||
|
|
||||||
|
|
||||||
composite -compose Over -gravity SouthWest -geometry +280+20 ~/.zen/tmp/${MOATS}/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/${MOATS}/astroport.png
|
composite -compose Over -gravity SouthWest -geometry +5+5 ~/.zen/tmp/${MOATS}/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/${MOATS}/astroport.png
|
||||||
composite -compose Over -gravity East -geometry +0+0 ~/.zen/tmp/${MOATS}/TW.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/astroport2.png
|
composite -compose Over -gravity East -geometry +5+5 ~/.zen/tmp/${MOATS}/TW.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/astroport2.png
|
||||||
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport2.png ~/.zen/tmp/${MOATS}/one.png
|
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport2.png ~/.zen/tmp/${MOATS}/one.png
|
||||||
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
|
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
|
||||||
|
|
||||||
convert -gravity northwest -pointsize 35 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
|
convert -gravity northwest -pointsize 25 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
|
||||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,40 \"${PLAYER}\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.png
|
convert -gravity northwest -pointsize 20 -fill black -draw "text 300,40 \"${PLAYER}\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.png
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## WITH CONFIDENTIAL (LOCAL PRINT)
|
||||||
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/${MOATS}/pseudo.png ~/.zen/tmp/${MOATS}/pass.png
|
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/${MOATS}/pseudo.png ~/.zen/tmp/${MOATS}/pass.png
|
||||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/${MOATS}/pass.png ~/.zen/tmp/${MOATS}/salt.png
|
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/${MOATS}/pass.png ~/.zen/tmp/${MOATS}/salt.png
|
||||||
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/${PLAYER}/ID.png
|
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/${PLAYER}/ID.png
|
||||||
|
@ -416,7 +423,7 @@ echo; echo "Création Clefs et QR codes pour accès au niveau Astroport Ŋ1"; sl
|
||||||
echo "--- PLAYER : ${PLAYER} - FILE SYSTEM LOADED";
|
echo "--- PLAYER : ${PLAYER} - FILE SYSTEM LOADED";
|
||||||
# ls ~/.zen/game/players/${PLAYER}
|
# ls ~/.zen/game/players/${PLAYER}
|
||||||
|
|
||||||
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open "${myIPFS}/ipns/${ASTRONAUTENS}" && espeak "YOUR PASS IS $PASS REPEAT $PASS REPEAT $PASS"
|
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open "${myIPFS}/ipns/${ASTRONAUTENS}" && espeak "YOUR PASS IS $PASS"
|
||||||
|
|
||||||
################# PREPARE DOCKERIZATION
|
################# PREPARE DOCKERIZATION
|
||||||
rm ~/.zen/game/players/.current
|
rm ~/.zen/game/players/.current
|
||||||
|
|
Loading…
Reference in New Issue