From 4ca5ef07ce3cd228191e09ea7c2ce37012b9caf3 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 10 Mar 2023 00:57:16 +0100 Subject: [PATCH] https://astroport.copylaradio.com/?qrcode=station - PalPay Welcome - --- API/QRCODE.sh | 148 +++++++++++++++++------- setup.sh | 3 +- templates/register.html | 6 +- tools/make_image_ipfs_index_carousel.sh | 9 +- tools/my.sh | 2 +- www/G1PalPay/index.html | 66 ++++++++--- www/PasseportTerre/index.html | 3 +- 7 files changed, 166 insertions(+), 71 deletions(-) diff --git a/API/QRCODE.sh b/API/QRCODE.sh index fdb181e3..53caf28b 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -32,10 +32,18 @@ mkdir -p ~/.zen/tmp/${MOATS}/ if [[ ${QRCODE} == "station" ]]; then ## GENERATE PLAYER G1 TO ZEN ACCOUNTING ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1) - echo $ISTATION > ~/.zen/ISTATION - ## SEND TO ISTATION PAGE - sed "s~_TWLINK_~${myIPFSGW}${ISTATION}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect - echo "url='"${myIPFSGW}${ISTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect + echo $ISTATION > ~/.zen/ISTATION ## STATION G1WALLET CAROUSEL + + ## SHOW G1PALPAY FRONT + sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../www/G1PalPay/index.html > ~/.zen/tmp/${MOATS}/index.htm + sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm + + WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)" + echo "NEW WSTATION ${myIPFS}${WSTATION}" + + ## SEND TO WSTATION PAGE + sed "s~_TWLINK_~${myIPFS}${WSTATION}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect + echo "url='"${myIPFS}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 ) & @@ -51,51 +59,129 @@ if [[ $ASTROPATH != "" ]]; then #### SELECT PARRAIN "G1PalPé" ## SEND TO TW PAGE - sed "s~_TWLINK_~${myIPFSGW}${QRCODE}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect - echo "url='"${myIPFSGW}${QRCODE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect + sed "s~_TWLINK_~${myIPFSGW}/ipns/${QRCODE}/#:[tag[G1Voeu]]~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect + echo "url='"${myIPFSGW}/ipns/${QRCODE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 ) & + exit 0 fi ## FILTRAGE NON G1 TO IPFS READY QRCODE -ASTROTOIPFS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${QRCODE}) +ASTROTOIPFS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${QRCODE} 2>/dev/null) [[ ! ${ASTROTOIPFS} ]] \ - && (echo "$HTTPCORS ERROR - ASTRONAUTENS !!" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \ + && echo "INVALID QRCODE : ${QRCODE}" \ + && (echo "$HTTPCORS ERROR - INVALID QRCODE : ${QRCODE}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \ && exit 1 echo ">>> ${QRCODE} g1_to_ipfs $ASTROTOIPFS" - -## SEND MESSAGE TO CESIUM+ ACCOUNT (ME or .current) +###########################################"" +########################################### +## PROCESS QRCODE = G1PUB or IPNS +###########################################"" MYPLAYERKEY=$(grep ${QRCODE} ~/.zen/game/players/*/secret.dunikey | cut -d ':' -f 1) [[ ! $MYPLAYERKEY ]] && MYPLAYERKEY="$HOME/.zen/game/players/.current/secret.dunikey" +echo "$MYPLAYERKEY" +echo +## PARRAIN +########################################### CURPLAYER=$(cat ~/.zen/game/players/.current/.player) CURG1=$(cat ~/.zen/game/players/.current/.g1pub) -CURCOINS=$(~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${CURG1}) +echo "${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${CURG1}" +CURCOINS=$(~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${CURG1} | cut -d '.' -f 1) echo "CURRENT PLAYER : $CURCOINS G1" +## FAUCHE +########################################### +if [[ $CURCOINS == "null" ]]; then +echo "NULL" + sed "s~_TWLINK_~$(cat ~/.zen/ISTATION)~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect + echo "url='"${myIPFSGW}$(cat ~/.zen/ISTATION)"'" >> ~/.zen/tmp/${MOATS}/index.redirect + ( + cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 + ) & + exit 0 +fi +# MOA +########################################### if [[ ${CURG1} == ${QRCODE} ]]; then echo "SAME PLAYER AS CURRENT" else +# PAS MOA +########################################### ## GET VISITOR G1 WANNET AMOUNT : VISITORCOINS - VISITORCOINS=$(~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE}) + echo "${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE}" + VISITORCOINS=$(~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE} | cut -d '.' -f 1) + + ## PALPE COMBIEN ? if [[ $VISITORCOINS == "" || $VISITORCOINS == "null" ]]; then - PALPE=${RANDOM:0:2} + # NOUVEAU 1 G1 + PALPE=1 else PALPE=0 fi + echo "VISITEUR POSSEDE ${VISITORCOINS} G1" + + ## GET G1 WALLET HISTORY + $MY_PATH/../tools/jaklis/jaklis.py history -p ${QRCODE} -j > ~/.zen/tmp/${MOATS}/g1history.json + + ## SCAN CCHANGE + + curl -s ${myDATA}/user/profile/${QRCODE} > ~/.zen/tmp/${MOATS}/gchange.json + GFOUND=$(cat ~/.zen/tmp/${MOATS}/gchange.json | jq -r '.found') + [[ $GFOUND == "false" ]] \ + && echo "AUCUN GCHANGE" \ + && sed "s~_TWLINK_~${myGCHANGE}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect \ + && echo "url='"${myGCHANGE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect \ + && ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1) & + + ## CHECK IF RELATED TO CESIUM + CPUB=$(cat ~/.zen/tmp/${MOATS}/gchange.json | jq -r '._source.pubkey' 2>/dev/null) + ## SCAN GPUB CESIUM + + curl -s ${myCESIUM}/user/profile/${QRCODE} > ~/.zen/tmp/${MOATS}/gplus.json 2>/dev/null + GCFOUND=$(cat ~/.zen/tmp/${MOATS}/gplus.json | jq -r '.found') + [[ $GCFOUND == "false" ]] \ + && echo "AUCUN GCPLUS" \ + && sed "s~_TWLINK_~${myASTRONEF}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect \ + && echo "url='"${myASTRONEF}"'" >> ~/.zen/tmp/${MOATS}/index.redirect \ + && ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1) & + + ##### MEMBER ?? + if [[ $CPUB && $CPUB != 'null' ]]; then + + ## SCAN CPUB CESIUM + + curl -s ${myCESIUM}/user/profile/${CPUB} > ~/.zen/tmp/${MOATS}/cplus.json 2>/dev/null + CCFOUND=$(cat ~/.zen/tmp/${MOATS}/cplus.json | jq -r '.found') + + [[ $CCFOUND == "false" ]] \ + && echo "AUCUN CCPLUS" \ + && sed "s~_TWLINK_~https://monnaie-libre.fr~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect \ + && ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1) & + + ## MESSAGE LINKED CESIUM WALLET + $MY_PATH/../tools/jaklis/jaklis.py -n $myCESIUM -k $MYPLAYERKEY send -d "${QRCODE}" -t "FORGERON" \ + -m "ASTROPORT. G1. FORGERON." + + else + + [[ $GCFOUND != "false" ]] \ + && echo "GPLUS" + ## EXTRACT GPS ... CONTINUE THE GAME + + fi + ## DOES CURRENT IS RICHER THAN 100 G1 - if [ $CURCOINS -gt 99 ]; then + if [[ $CURCOINS -gt 1 && $PALPE != 0 ]]; then ## LE COMPTE VISITOR EST VIDE echo "## PARRAIN $CURPLAYER SEND $PALPE TO ${QRCODE}" ## G1 PAYEMENT $MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/.current/secret.dunikey pay -a ${PALPE} -p ${QRCODE} -c "ASTRO:ZEN_${PALPE}" -m + ## MESSAGE CESIUM + $MY_PATH/../tools/jaklis/jaklis.py -n $myCESIUM -k $MYPLAYERKEY send -d "${QRCODE}" -t "CADEAU" \ -m "ASTRO:${CURPLAYER} VOUS ENVOI ${PALPE} JUNE. @@ -106,38 +192,9 @@ else else ## CURRENT PLAYER IS TOO POOR PALPE=0 - echo "VISITEUR POSSEDE ${CURCOINS} G1" - ## GET G1 WALLET HISTORY - $MY_PATH/../tools/jaklis/jaklis.py history -p ${QRCODE} -j > ~/.zen/tmp/${MOATS}/g1history.json - - ## SCAN CCHANGE + - curl -s ${myDATA}/user/profile/${QRCODE} > ~/.zen/tmp/${MOATS}/gchange.json - ## CHECK IF RELATED TO CESIUM - CPUB=$(cat ~/.zen/tmp/${MOATS}/gchange.json | jq -r '._source.pubkey' 2>/dev/null) - ## SCAN GPUB CESIUM + - curl -s ${myCESIUM}/user/profile/${QRCODE} > ~/.zen/tmp/${MOATS}/gplus.json 2>/dev/null - - ##### MEMBER ?? - if [[ $CPUB && $CPUB != 'null' ]]; then - - ## SCAN CPUB CESIUM + - curl -s ${myCESIUM}/user/profile/${CPUB} > ~/.zen/tmp/${MOATS}/cplus.json 2>/dev/null - - ## LINKED CESIUM WALLET - $MY_PATH/../tools/jaklis/jaklis.py -n $myCESIUM -k $MYPLAYERKEY send -d "${QRCODE}" -t "FORGERON" \ - -m "ASTROPORT. G1. FORGERON ET RESEAU DE CONFIANCE Ŋ1. \ - INSCRIVEZ VOTRE COMPTE GCHANGE SUR : https://astroport.copylaradio.com" - - - - else - - ## EXTRACT GPS ... CONTINUE THE GAME - - fi # $MY_PATH/../tools/jaklis/jaklis.py -n $myGCHANGE -k $MYPLAYERKEY send -d "${QRCODE}" -t "COUCOU" -m "ASTRO ZEN CONTACT" - + ls ~/.zen/tmp/${MOATS}/ fi echo "************************************************************" @@ -222,3 +279,6 @@ if [[ $AND == "url" ]]; then fi fi + + +exit 0 diff --git a/setup.sh b/setup.sh index 6561bf2e..ef09165b 100755 --- a/setup.sh +++ b/setup.sh @@ -84,6 +84,7 @@ User=_USER_ RestartSec=1 Restart=always ExecStart=/home/_USER_/.zen/Astroport.ONE/12345.sh +StandardOutput=file:/home/_USER_/.zen/tmp/12345.log [Install] WantedBy=multi-user.target @@ -94,7 +95,7 @@ sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/astroport.service sudo systemctl daemon-reload sudo systemctl enable astroport -sudo systemctl start astroport +sudo systemctl restart astroport ACTUAL=$(cat /etc/resolv.conf | grep -w nameserver | head -n 1) diff --git a/templates/register.html b/templates/register.html index 088bd72e..9bec73a0 100644 --- a/templates/register.html +++ b/templates/register.html @@ -62,9 +62,9 @@ header {

Activez / LA ♥BOX /^3223

-

Copiez une chaine YOUTUBE 👍 dans IPFS^3222

-

Ajoutez des Voeux 👉OpenSource Planet👈^3112

-

🔥.^999.^888.^777.^666.^555.^444.3^333.2^222.1^111 Go 🚀^4321

+

Echappez-vous du CLOUD 👍 ^3222

+

Alimentez 👉Le Claude👈 sur IPFS^3112

+

🔥.^999.^888.^777.^666.^555.^444.3^333.2^222.1^111 Allez 🚀^4321

diff --git a/tools/make_image_ipfs_index_carousel.sh b/tools/make_image_ipfs_index_carousel.sh index 2750e165..9ccfece7 100755 --- a/tools/make_image_ipfs_index_carousel.sh +++ b/tools/make_image_ipfs_index_carousel.sh @@ -60,7 +60,7 @@ echo "
-

Astroport $myHOST ZEN Gallery $(date)

+
    @@ -124,6 +124,7 @@ echo "
+

Astroport $myHOST ZEN Gallery $(date)

@@ -131,12 +132,10 @@ echo " " >> $core_file cat $core_file >> $html_file -echo " -" >> $html_file +echo "" >> $html_file -coreipfs=$(ipfs add -q $core_file) htmlipfs=$(ipfs add -q $html_file) [[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open http://ipfs.localhost:8080/ipfs/$htmlipfs -echo /ipfs/$core_file +echo /ipfs/$htmlipfs exit 0 diff --git a/tools/my.sh b/tools/my.sh index b6759596..7d218539 100755 --- a/tools/my.sh +++ b/tools/my.sh @@ -389,7 +389,7 @@ myGCHANGE="https://www.gchange.fr" myCESIUM="https://g1.data.e-is.pro" myHOST="$(myHostName)" myIP="$(myIp)" -myIPFS="http://$(myIp):8080" +myIPFS="http://ipfs.localhost:8080" myIPFSGW="$(myIpfsGw)" myTUBE="$(myTube)" myASTROTUBE="https://$(myAstroTube)" diff --git a/www/G1PalPay/index.html b/www/G1PalPay/index.html index 0e8e6802..62260cf2 100644 --- a/www/G1PalPay/index.html +++ b/www/G1PalPay/index.html @@ -2,17 +2,17 @@ - + Compte Ğ1 dans le Claude Inter Planetaire - Astroport Ŋ1 - - - - - - + + + + +