diff --git a/12345.sh b/12345.sh index 770d26e7..cde3f25d 100755 --- a/12345.sh +++ b/12345.sh @@ -13,6 +13,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +. "${MY_PATH}/tools/myhash.sh" . "${MY_PATH}/tools/myhost.sh" . "${MY_PATH}/tools/template.sh" @@ -36,7 +37,6 @@ Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET Server: Astroport.ONE Content-Type: text/html; charset=UTF-8 - " echo "_________________________________________________________ $(date)" echo "LAUNCHING Astroport API Server - TUBE : $LIBRA - " @@ -99,14 +99,8 @@ while true; do ############### ############### ############### ############### templates/index.http # REPLACE myHOST in http response template (fixing next API meeting point) echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.myHOST.http - [[ $isLAN ]] \ - && template_register_localhost >> ~/.zen/tmp/coucou/${MOATS}.myHOST.http \ - || template_register >> ~/.zen/tmp/coucou/${MOATS}.myHOST.http - - sed -i "s~:12345~:${PORT}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http - sed -i "s~_SESSIONLNK_~${myIPFS}/ipns/${SESSIONNS}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http - sed -i "s~127.0.0.1:12345~${myHOST}:${PORT}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http - ############### ############### ############### ############### + template_register >> ~/.zen/tmp/coucou/${MOATS}.myHOST.http + sed -i "s~:http://127.0.0.1:12345~http://${myHOST}:${PORT}~g" ~/.zen/tmp/coucou/${MOATS}.myHOST.http ############################################################################ ## SERVE LANDING REDIRECT PAGE ~/.zen/tmp/coucou/${MOATS}.myHOST.http on PORT 1234 (LOOP BLOCKING POINT) @@ -117,8 +111,7 @@ while true; do HOSTP=$(echo "$REQ" | grep '^Host:' | cut -d ' ' -f2 | cut -d '?' -f2) HOST=$(echo "$HOSTP" | cut -d ':' -f 1) - ## TODO APPLY GENERAL isLAN or zen !isLAN CALACULA>TONS - [[ ! $isLAN || $USER == "zen" ]] && myHOST="$HOSTNAME" && myHOSTPort="ipfs.$HOSTNAME" && myHTTP="https://" && myASTROPORT="https://$HOSTNAME" ## WAN STATION + ############### ############### ############### ############### ############################################################################ [[ $URL == "/test" || $URL == "" ]] && continue @@ -138,21 +131,9 @@ while true; do ## / CONTACT if [[ $URL == "/" ]]; then echo "/ CONTACT : $HOSTP" - echo "___________________________ Preparing default return register.html" - echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.index.redirect ## HTTP 1.1 HEADER + HTML BODY - sed "s~http://127.0.0.1:1234~${myASTROPORT}~g" $HOME/.zen/Astroport.ONE/templates/register.html >> ~/.zen/tmp/coucou/${MOATS}.index.redirect - sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect - sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect - sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect - - - ## Random Background image ;) - sed -i "s~.000.~.$(printf '%03d' $(echo ${RANDOM} % 18 | bc)).~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect - - cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & end=`date +%s` - echo " (‿/‿) ${myHTTP}$HOSTP / Execution time was "`expr $end - $start` seconds. + echo " (‿/‿) $myHOST:$PORT / Execution time was "`expr $end - $start` seconds. continue fi @@ -208,7 +189,7 @@ while true; do ASTRONAUTENS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key ) [[ ! ${ASTRONAUTENS} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - ASTRONAUTENS COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && continue - echo "TW ADDRESS : ${myHTTP}$HOSTP/ipns/${ASTRONAUTENS}" + echo "TW ADDRESS : $myIPFS/ipns/${ASTRONAUTENS}" echo ################### KEY GEN ################################### @@ -288,7 +269,7 @@ while true; do #~ ( ## USING IPNS SESSION KEY #~ REPONSE=$(cat ~/.zen/tmp/coucou/${MOATS}.messaging.json | ipfs add -q) #~ ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE - #~ echo "SESSION ${myHTTP}$HOSTP/ipns/$SESSIONNS " + #~ echo "SESSION ${myIPFS}/ipns/$SESSIONNS " #~ ) & end=`date +%s` diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 44e6e113..b1676527 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -65,8 +65,8 @@ isLAN=$(route -n |awk '$1 == "0.0.0.0" {print $2}' | grep -E "/(^127\.)|(^192\.1 LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) echo "/ipns/$ASTRONAUTENS ON $LIBRA" - ipfs --timeout 60s -o ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html /ipns/$ASTRONAUTENS \ - || curl -m 30 -so ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$LIBRA/ipns/$ASTRONAUTENS" \ + ipfs --timeout 60s get -o ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html /ipns/$ASTRONAUTENS \ + || curl -m 60 -so ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$LIBRA/ipns/$ASTRONAUTENS" \ || cp ~/.zen/game/players/$PLAYER/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ## PLAYER TW IS ONLINE ? diff --git a/templates/register.html b/templates/register.html index 34f8d785..19627fcd 100644 --- a/templates/register.html +++ b/templates/register.html @@ -15,6 +15,9 @@ body { } html { height: 100% +} +header { + opacity: 0.8; } input[type=submit] { width: 12em; height: 4em; @@ -48,11 +51,11 @@ html { --- Welkom - Mirë se vini - Willkommen - Welkomma - Welcome - Marhaban - Bari galoust - Xos gelmissiniz - Welkum - Ongi etorri- Swagata - Ansuf yiswen - ščyra zaprašajem - Kyo tzo pa eit - Ani kié - Dobro došli - Dagemer mat - Dobre doshŭl - Benvinguts - Ulihebisdi - Huān yíng - Karibu - Eoso eoseyo - Benvenuti - Bel bonjou - Bienvini - Dobrodošli - Velkommen - Bienvenido - Bonvenon - Tere tulemast - Gabitê - Vælkomin - Tervetuloa - Welkom - Wìllkòmme - Binvignut - Fàilte - Benvido - Croeso - Planvenguda - Mikouabô - Kalos irthate - -Eguahé porá - Baroukh habaim - ... ----
@@ -62,7 +65,7 @@ html {

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

@@ -71,7 +74,8 @@ html {

- COCODING : Astroport.ONE - BunkedBOX edition -
+
COCODING TWITCH TW

+ Astroport.ONE - ♥BOX Edition - Olympe.Network
Recopiez les vidéos que vous aimez dans les capsules multimédia de votre TW!
Une fois votre G1Visa obtenu, direction
https://gchange.fr !

diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index 827c3988..45cc61ec 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -192,6 +192,9 @@ NID="${myIPFSGW}" && WID="$NID/api" cp ~/.zen/game/players/$PLAYER/QR.png ~/.zen/game/players/$PLAYER/ipfs/QR.png echo "$G1PUB" > ~/.zen/game/players/$PLAYER/ipfs/G1SSB/_g1.pubkey # G1SSB NOTATION (astrXbian compatible) + qrencode -s 12 -o ~/.zen/game/players/$PLAYER/QR.ASTRONAUTENS.png "https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}" + + ## SEC PASS PROTECTED QRCODE secFromDunikey=$(cat ~/.zen/game/players/$PLAYER/secret.dunikey | grep "sec" | cut -d ' ' -f2) echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec @@ -282,14 +285,20 @@ NID="${myIPFSGW}" && WID="$NID/api" ## ID CARD & QRCODE convert ~/.zen/game/players/$PLAYER/QR.png -resize 300 ~/.zen/tmp/${MOATS}/QR.png - convert ${MY_PATH}/../images/astroport.jpg -resize 300 ~/.zen/tmp/${MOATS}/ASTROPORT.png + convert ~/.zen/game/players/$PLAYER/QR.ASTRONAUTENS.png -resize 240 ~/.zen/tmp/${MOATS}/TW.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 NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/one.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 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 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 300,40 \"$PLAYER\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.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,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/$PLAYER/ID.png @@ -326,8 +335,6 @@ NID="${myIPFSGW}" && WID="$NID/api" echo "$SALT" > ~/.zen/game/players/$PLAYER/secret.june echo "$PEPPER" >> ~/.zen/game/players/$PLAYER/secret.june -qrencode -s 12 -o "$HOME/.zen/game/players/$PLAYER/QR.ASTRONAUTENS.png" "https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}" - echo; echo "Création Clefs et QR codes pour accès au niveau Astroport Ŋ1"; sleep 1 echo "--- PLAYER : $PLAYER"; diff --git a/tools/myhash.sh b/tools/myhash.sh new file mode 100644 index 00000000..e40877df --- /dev/null +++ b/tools/myhash.sh @@ -0,0 +1,51 @@ +#shellcheck shell=sh + +myHash() { + [ -f ~/.zen/game/players/localhost/latest ] \ + && myHash=$(cat ~/.zen/game/players/localhost/latest) \ + || myHash=$(template_register |ipfs add -q) + [ ! -f ~/.zen/game/players/localhost/latest ] \ + && echo "$myHash" > ~/.zen/game/players/localhost/latest + [ -n "$myHash" ] \ + && echo "$myHash" +} + +myHttp() { + echo "$(myHttpHeader)" + echo + echo "$(myHttpContent)" +} + +myIpfs() { + myIpfs=${myIPFS}/ipfs/$(myHash) + echo "$myIpfs" +} + +myIpns() { + myIpns=${myIPFS}/ipns/$(myKey) + echo "$myIpns" +} + +myKey() { + myKey=$(ipfs key list -l | awk '$2 == "self" {print $1}') + [ -n "$myKey" ] && echo "$myKey" +} + +myHttpContent() { + myHash=$(myHash) + myHttpContent="302 Found

Found

+

The document has moved here.

" + echo "$myHttpContent" +} + +myHttpHeader() { + myHttpContent=$(myHttpContent) + myHttpHeader="HTTP/1.0 302 Found +Content-Type: text/html; charset=UTF-8 +Content-Length: $(myHttpContent |wc -c) +Date: $(date -R) +Location: ipfs/$myHash +set-cookie: AND=$myKey; expires=$(date -R -d "+1 month"); path=/; domain=.$myDomainName; Secure; SameSite=lax +Server: and" + echo "$myHttpHeader" +} diff --git a/tools/template.sh b/tools/template.sh index a39f6ba6..268a1bc0 100755 --- a/tools/template.sh +++ b/tools/template.sh @@ -1,16 +1,16 @@ #shellcheck shell=sh -template_register_localhost() { - template_register | sed -e "s~~~g" \ - -e "s~~~g" -} - template_register() { - sed -e "s~http://127.0.0.1:1234~${myASTROPORT}~g" \ - -e "s~http://127.0.0.1:8080~${myIPFS}~g" \ - -e "s~_IPFSNODEID_~${IPFSNODEID}~g" \ - -e "s~_HOSTNAME_~$(hostname)~g" \ - -e "s~.000.~.$(printf '%03d' $(seq 0 17 |shuf -n 1)).~g" \ - ~/.zen/Astroport.ONE/templates/register.html + [ -n "$isLAN" ] \ + && SED_SCRIPT='sed -e "s~~~g" + -e "s~~~g"' \ + || SED_SCRIPT='tee' + $RUN sed -e "s~http://127.0.0.1:1234~${myASTROPORT}~g" \ + -e "s~http://127.0.0.1:8080~${myIPFS}~g" \ + -e "s~_IPFSNODEID_~${IPFSNODEID}~g" \ + -e "s~_HOSTNAME_~$(hostname)~g" \ + -e "s~.000.~.$(printf '%03d' $(seq 0 17 |shuf -n 1)).~g" \ + ~/.zen/Astroport.ONE/templates/register.html | \ + eval ${SED_SCRIPT:-tee} }