Ouverture de votre sas en cours

This commit is contained in:
fred 2022-10-27 16:28:44 +02:00
parent d1f93ac229
commit a54a4c3c45
4 changed files with 14 additions and 8 deletions

View File

@ -26,8 +26,10 @@ mkdir -p ~/.zen/tmp/123/
## CHECK FOR ANY ALREADY RUNNING nc
ncrunning=$(ps auxf --sort=+utime | grep -w 'nc -l -p 1234' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $ncrunning ]] && echo "ERROR - API Server Already Running - http://$myIP:1234/?salt=toto&pepper=toto " && exit 1
echo "LAUNCHING Astroport API Server - http://$myIP:1234/?salt=toto&pepper=toto&official"
echo "_________________________________________________________"
echo "LAUNCHING Astroport API Server "
echo "TEST http://$myIP:1234/?salt=toto&pepper=toto&official"
echo "_________________________________________________________"
# [[ $DISPLAY ]] && xdg-open "file://$HOME/.zen/Astroport.ONE/templates/instascan.html" 2>/dev/null
# [[ $DISPLAY ]] && xdg-open "http://$myIP:1234" 2>/dev/null
@ -86,7 +88,8 @@ sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/123/${MOATS}.index.redirect
echo "GET RECEPTION : $URL"
arr=(${URL//[=&]/ })
echo "PARAM : ${arr[0]} = ${arr[1]} & ${arr[2]} = ${arr[3]} & ${arr[4]} = ${arr[5]} & ${arr[6]} = ${arr[7]} & ${arr[8]} = ${arr[9]}"
# CHECK TYPE
# CHECK TYPE
TYPE=$(urldecode ${arr[4]})
WHAT=$(urldecode ${arr[5]})
@ -97,7 +100,7 @@ sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/123/${MOATS}.index.redirect
###################################################################################################
# API ZERO ## Made In Zion & La Bureautique
if [[ ${arr[0]} == "salt" ]]; then
echo "Application LaBureautique !!"
echo "!!!!!!!!!! Application LaBureautique !! TYPE = $TYPE"
SALT=$(urldecode ${arr[1]} | xargs);
[[ ! $SALT ]] && (echo "ERROR - SALT MISSING" | nc -l -p ${PORT} -q 1 &) && continue
PEPPER=$(urldecode ${arr[3]} | xargs)
@ -180,10 +183,10 @@ cat ~/.zen/tmp/123/${MOATS}.messaging.json >> ~/.zen/tmp/123/${MOATS}.index.redi
ipfs --timeout 12s ping $NODEID &
## COULD BE A RAW FILE, AN HTML, A JSON
echo "CURLING https://ipfs.io/ipfs/$DATAID"
echo "CURLING https://ipfs.io/ipfs/$DATAID ~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}"
(curl -m 12 -so ~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html "https://gateway.ipfs.io/ipfs/$DATAID" && \
[[ -s ~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html ]] && \
[[ ! $(~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html | jq) ]] && \
[[ -s ~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html ]] && echo "index.html" &&\
[[ ! $(~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html | jq) ]] && echo "NOT JSON - DECODING " &&\
$MY_PATH/tools/testcraft.DECODE.sh "~/.zen/tmp/${IPFSNODEID}/$NODEID/${MOATS}/index.html") &
echo "CAT $NODEID /ipfs/$DATAID"

View File

@ -77,6 +77,7 @@ echo
##########################################################################################
# ipfs key import _MEDIAKEY_ ~/.zen/Astroport.ONE/templates/_MEDIAKEY_.keystore.key
##############
#
# ipfs cat /ipfs/bafybeibqdoegifzejykmc3qw3e3drgsa5i7az6xwjlfcx7rbtcoj5unpkq > ~/.zen/Astroport.ONE/templates/twdefault.html
# INTRODUCE HIDING CONTROL (read only from https) https $:/tags/Stylesheet
# ipfs cat /ipfs/bafybeidkur2tfbmqwscgmkfh76vmbcqay2m4gznxv5emkenxeffmrgywky > ~/.zen/Astroport.ONE/templates/twdefault.html

View File

@ -40,6 +40,8 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail
[[ ! $YOU ]] && echo "Lancez 'ipfs daemon' SVP sudo systemctl start ipfs" && exit 1
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
echo 'PRESS ENTER... '; read
## CREATE AND OR CONNECT USER
PS3='Créez VISA ou connectez-vous à votre compte Astronaute ___ '
players=("NOUVEAU VISA" "IMPORT GVISA" $(ls ~/.zen/game/players 2>/dev/null))

View File

@ -18,7 +18,7 @@ Content-Type: text/html; charset=UTF-8
<body>
<center>
<h1>ASTROPORT Ŋ1</h1>
<b>Astronaute... ouverture du sas... S'il a du mal à s'ouvrir: insistez !</b><br>
<b>Astronaute ! Ouverture de votre sas en cours...</b><br>
<a href="/ipns/_IPFSNODEID_" target="json"><img src='http://127.0.0.1:8080/ipfs/QmbY3R4UV43Bz7eQDEYgXZKWnszArGwnJqMmfSZ7CCWFcq' id='wait'/></a>
</center>
</body>