From a532345130a2130ccec4727f109a90231b31a67b Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 3 Sep 2023 00:03:05 +0200 Subject: [PATCH] No PASS, just visit PASS = create PLAYER (EMAIL/PASS) --- API/UPLANET.sh | 20 +++++++++++++------- templates/register.html | 10 +++++----- tools/VISA.new.sh | 10 ++++++++++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/API/UPLANET.sh b/API/UPLANET.sh index 9ab9c94cb..995cf5975 100755 --- a/API/UPLANET.sh +++ b/API/UPLANET.sh @@ -67,8 +67,8 @@ else fi PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7) -## CHOOSEN PASS -[[ ${OBJ} == "PASS" ]] && PASS=${VAL} +## RECEIVED PASS +[[ ${OBJ} == "g1pub" && ${VAL} != "" ]] && PASS=${VAL} ### CHECK PLAYER EMAIL EMAIL="${PLAYER,,}" # lowercase @@ -178,10 +178,16 @@ else ) & fi -### CREATE A G1VISA FOR PLAYER -${MY_PATH}/../tools/VISA.new.sh "${EMAIL}" "${PASS}" "${EMAIL}" "UPlanet" "ADD YOUTUBE VIDEO CHANNEL URL" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt -## SEND EMAIL -${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ## Send VISA.new log to EMAIL +### CREATE A G1VISA FOR PLAYER (IF PASS WAS GIVEN AND NO TW EXISTS YET) +if [[ ! -f ~/.zen/tmp/${MOATS}/${EMAIL}/index.html ]]; then + ## Create a redirection to PLAYER (EMAIL/PASS) TW + [[ ${OBJ} == "g1pub" && ${VAL} != "" ]] \ + && mkdir -p ~/.zen/tmp/${MOATS}/${EMAIL} \ + && TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "$EMAIL" "$PASS") \ + && echo "" > ~/.zen/tmp/${MOATS}/${EMAIL}/index.html \ + && ${MY_PATH}/../tools/VISA.new.sh "${EMAIL}" "${PASS}" "${EMAIL}" "UPlanet" "ADD YOUTUBE VIDEO CHANNEL URL" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt \ + && ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ## Send VISA.new log to EMAIL +fi ## HTTP nc ON PORT RESPONSE echo "$HTTPCORS @@ -197,7 +203,7 @@ echo "$HTTPCORS
Download files containing in their name
Use G1Station and compatible G1Card QRCode scanner to operate...
- $(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt) + $(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt 2>/dev/null)

${EMAIL} REGISTERED : ${MOATS} : $(date) " > ~/.zen/tmp/${MOATS}/http.rep cat ~/.zen/tmp/${MOATS}/http.rep | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & diff --git a/templates/register.html b/templates/register.html index bd528581c..5ade6ee05 100644 --- a/templates/register.html +++ b/templates/register.html @@ -84,7 +84,7 @@ header { registre
- Astroport Ŋ1 - Crypto Commons Defender - + Astroport Ŋ1 - Crypto Commons Playground -

@@ -120,10 +120,10 @@ document.addEventListener('DOMContentLoaded', function() { const passElement = document.querySelector('input[name="g1pub"]'); // Generate a random 6-digit number and set it as the default value for "PASS" - if (passElement) { - const randomPass = Math.floor(100000 + Math.random() * 900000); // Generates a random 6-digit number - passElement.value = randomPass.toString(); - } + //~ if (passElement) { + //~ const randomPass = Math.floor(100000 + Math.random() * 900000); // Generates a random 6-digit number + //~ passElement.value = randomPass.toString(); + //~ } if (latElement && lonElement) { latElement.value = salt || '0.00'; // Default to '0.00' if lat is missing diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index e7a5c757d..fc9713f18 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -20,6 +20,11 @@ PSEUDO="$4" ## Fill UP TW with VIDEO URL URL="$5" + +## UPLANET PLAYER +LAT="$6" +LON="$7" + ################################################################################ YOU=$(myIpfsApi); LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) @@ -283,6 +288,11 @@ DISCO="/?salt=${USALT}&pepper=${UPEPPER}" sed -i "s~tube.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html sed -i "s~ipfs.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html + ## template 44.2301, 1.6518 UMAP LAT LON replacement + if [[ ${LAT} && ${LON} ]]; then + sed -i "s~44.2301~${LAT}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html + sed -i "s~1.6518~${LON}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html + fi ## Change myIP #~ sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost)