From bff56cd062f8fd35cd09654aaf584852efb0c863 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 12 Mar 2023 22:31:11 +0100 Subject: [PATCH] play more --- 20h12.process.sh | 12 ++++--- API/PLAYER.sh | 2 +- API/QRCODE.sh | 31 +++++++++++------- API/SALT.sh | 2 +- templates/astro.js | 31 ------------------ templates/register.html | 43 +++++++++++++++++-------- tools/make_image_ipfs_index_carousel.sh | 12 +++++-- tools/my.sh | 2 ++ www/G1PalPay/index.html | 21 ++++++------ 9 files changed, 82 insertions(+), 74 deletions(-) delete mode 100644 templates/astro.js diff --git a/20h12.process.sh b/20h12.process.sh index b587915f..3ad1b07c 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -64,10 +64,14 @@ espeak "Restarting Astroport Station API" > /dev/null 2>&1 ## CLOSING API PORT [[ -s ~/.zen/.pid ]] && kill -9 $(cat ~/.zen/.pid) ## KILL ALL REMAINING nc -killall nc +killall nc 12345.sh ## OPEN API ENGINE -~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log & -PID=$! -echo $PID > ~/.zen/.pid +if [[ ! -f /etc/systemd/system/astroport.service ]]; then + ~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log & + PID=$! + echo $PID > ~/.zen/.pid +else + echo "systemd will restart..." +fi exit 0 diff --git a/API/PLAYER.sh b/API/PLAYER.sh index 4d67e1e3..b0c4d45a 100755 --- a/API/PLAYER.sh +++ b/API/PLAYER.sh @@ -4,7 +4,7 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ################################################################################ ################################################################################ -## API: SALT & PEPPER +## API: PLAYER - PUBLIC KEY AUTH ################################################################################ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized diff --git a/API/QRCODE.sh b/API/QRCODE.sh index 172b2cc0..3e7486ad 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -4,7 +4,7 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ################################################################################ ################################################################################ -## API: SALT & PEPPER +## API: QRCODE - ANY/MULTI KEY OPERATIONS ################################################################################ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized @@ -28,14 +28,19 @@ TYPE=$WHAT ## GET TW mkdir -p ~/.zen/tmp/${MOATS}/ - +################################################################################ +## REFRESH STATION & OPEN G1PalPay INTERFACE +################################################################################ if [[ ${QRCODE} == "station" ]]; then + + rm ~/.zen/tmp/WSTATION ## REMOVE IN PROD + if [[ ! -s ~/.zen/tmp/WSTATION ]]; then ## GENERATE PLAYER G1 TO ZEN ACCOUNTING ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1) echo $ISTATION > ~/.zen/ISTATION ## STATION G1WALLET CAROUSEL - ## SHOW G1PALPAY FRONT + ## SHOW G1PALPAY FRONT (IFRAME) 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 @@ -54,8 +59,10 @@ if [[ ${QRCODE} == "station" ]]; then ) & exit 0 fi - -## CHECK IF QRCODE is ASTRONAUTENS or G1PUB format +################################################################################ +## QRCODE can be ASTRONAUTENS or G1PUB format +################################################################################ +## ACCOUNT IPNS FORMAT : CHANGE .current ASTROPATH=$(grep $QRCODE ~/.zen/game/players/*/.playerns | cut -d ':' -f 1 | rev | cut -d '/' -f 2- | rev 2>/dev/null) if [[ $ASTROPATH != "" ]]; then rm ~/.zen/game/players/.current @@ -63,33 +70,35 @@ if [[ $ASTROPATH != "" ]]; then echo "LINKING $ASTROPATH to .current" #### SELECT PARRAIN "G1PalPé" - ## SEND TO TW PAGE - 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 + #>>>>>>>>>>>> # SEND TO G1BILLETS + sed "s~_TWLINK_~${myG1BILLET}?montant=0\&style=jeu~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect + echo "url='"${myG1BILLET}"?montant=0\&style=jeu'" >> ~/.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} 2>/dev/null) [[ ! ${ASTROTOIPFS} ]] \ && 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" ###########################################"" ########################################### -## PROCESS QRCODE = G1PUB or IPNS +## GET G1PUB OR CURRENT SECRET ###########################################"" MYPLAYERKEY=$(grep ${QRCODE} ~/.zen/game/players/*/secret.dunikey | cut -d ':' -f 1) [[ ! $MYPLAYERKEY ]] && MYPLAYERKEY="$HOME/.zen/game/players/.current/secret.dunikey" -echo "$MYPLAYERKEY" +echo "SELECTECT KEY : $MYPLAYERKEY" echo -## PARRAIN +## PARRAIN ID EXTRACTION ########################################### CURPLAYER=$(cat ~/.zen/game/players/.current/.player) CURG1=$(cat ~/.zen/game/players/.current/.g1pub) diff --git a/API/SALT.sh b/API/SALT.sh index 5e330d52..08417c9a 100755 --- a/API/SALT.sh +++ b/API/SALT.sh @@ -4,7 +4,7 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ################################################################################ ################################################################################ -## API: SALT & PEPPER +## API: SALT & PEPPER - PRIVATE KEY AUTH ################################################################################ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized diff --git a/templates/astro.js b/templates/astro.js deleted file mode 100644 index e12a77e4..00000000 --- a/templates/astro.js +++ /dev/null @@ -1,31 +0,0 @@ - -async function homeAstroportStation() { - try { - - let one = await fetch('/?qrcode=station'); // Gets a promise - var doc = await one.text(); - var regex = /url='([^']+)/i; // Get response PORT - var redirectURL = doc.match(regex)[1] - - console.log(redirectURL) - document.getElementById("ainfo").innerHTML = "Teleportation ... (3s) " + redirectURL; - - setTimeout(function() { - // let two = await fetch(redirectURL); - // document.mydiv.innerHTML = await two.text(); // Replaces body with response - window.location.href = redirectURL - // window.open( redirectURL, "AstroTab"); - }, 3000); - - } catch (err) { - console.log('Fetch error:' + err); // Error handling - } -} - -function promptUser(g1pub) { - let salt = prompt("Identifiant"); - let pepper = prompt("Code Secret"); - let resultText = `/?salt=${salt}&pepper=${pepper}&star=1&friend=${g1pub}`; - console.log(resultText) - document.getElementById("debug").innerHTML = resultText; -} diff --git a/templates/register.html b/templates/register.html index 152117eb..0817a428 100644 --- a/templates/register.html +++ b/templates/register.html @@ -3,7 +3,7 @@ [Astroport] :: Station _HOSTNAME_ :: _IPFSNODEID_ - + @@ -41,21 +41,18 @@ header { - +
-

- ♥BOX -

-

- - +

BOX

+
+ +
+
+
@@ -75,8 +72,8 @@ header {

/ LA ♥BOX /^3223

-

Off CLOUD ⛅ On IPFS ⌘^3222

-

Safe In 👉Le Claude👈^3112

+

⌘ Interplanetary Off CLOUD ⛅ ^3222

+

Welcome In 👉Le Claude👈^3112

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

@@ -84,12 +81,14 @@ header { 📺 (👍) :
Email :

+

Renseignez votre lien Youtube préféré et votre Email
Validez

+


- Besoin d'aide ? Contactez support@qo-op.com + support@qo-op.com

@@ -196,5 +195,21 @@ function testLatency(cb) { } + diff --git a/tools/make_image_ipfs_index_carousel.sh b/tools/make_image_ipfs_index_carousel.sh index be4758a3..a32a723b 100755 --- a/tools/make_image_ipfs_index_carousel.sh +++ b/tools/make_image_ipfs_index_carousel.sh @@ -23,11 +23,18 @@ if [[ ! -d $img_dir ]]; then COINS=$(${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance | cut -d '.' -f 1) echo "+++ ${PLAYER} have $COINS Ğ1 Coins +++" + ## USE G1BARRE SERVICE AS 1ST IMAGE curl -so ~/.zen/tmp/carousel/${pub}.png \ "https://g1sms.fr/g1barre/image.php?pubkey=${pub}&target=20000&title=${PLAYER}&node=g1.asycn.io&start_date=2020-01-01&display_pubkey=true&display_qrcode=true" echo "GOT ~/.zen/tmp/carousel/${pub}.png" + + ## WRITE ON IT : ASK FOR REFILL + + ## PREPARE LOOP LINK LINE ASTRONAUTENS=$(cat ~/.zen/game/players/${PLAYER}/.playerns) - echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert + [[ $COINS -gt 0 ]] \ + && echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert \ + || echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert done img_dir="$HOME/.zen/tmp/carousel" @@ -59,6 +66,8 @@ echo " +

$myHOST ACCOUNTS $(date)

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

Astroport $myHOST ZEN Gallery $(date)

diff --git a/tools/my.sh b/tools/my.sh index 7d218539..93ca6541 100755 --- a/tools/my.sh +++ b/tools/my.sh @@ -387,6 +387,7 @@ myAPI="http://$(myIp):5001" myDATA="https://data.gchange.fr" myGCHANGE="https://www.gchange.fr" myCESIUM="https://g1.data.e-is.pro" +myG1BILLET="http://g1billet.localhost:33101" myHOST="$(myHostName)" myIP="$(myIp)" myIPFS="http://ipfs.localhost:8080" @@ -400,4 +401,5 @@ myASTROTUBE="https://$(myAstroTube)" && myAPI="https://ipfs.$(myHostName)" \ && myIPFS="https://ipfs.$(myDomainName)" \ && myHOST="astroport.$(myHostName)" \ + && myG1BILLET="https://g1billet.$(myHostName)" \ || true diff --git a/www/G1PalPay/index.html b/www/G1PalPay/index.html index 09f37900..15d9d7e2 100644 --- a/www/G1PalPay/index.html +++ b/www/G1PalPay/index.html @@ -2,11 +2,14 @@ - + Compte Ğ1 dans le Claude Inter Planetaire - Astroport Ŋ1 - - - - + + + + + +