diff --git a/12345.sh b/12345.sh index 630c6502..b3dcc9f8 100755 --- a/12345.sh +++ b/12345.sh @@ -329,7 +329,8 @@ cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.inde (echo "ERROR - NO TW FOUND - ERROR" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && continue fi else - echo "***** READER MODE *****" + echo "***** COULD BE READER MODE *****" + fi sed "s~_TWLINK_~http://$TWIP:8080/ipns/${ASTRONAUTENS}~g" ~/.zen/Astroport.ONE/templates/index.redirect > ~/.zen/tmp/coucou/${MOATS}.index.redirect @@ -344,7 +345,7 @@ cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.inde ## CHECK IF ALREADY EXISTING WHAT # IF NOT = BATCH CREATE TW end=`date +%s` - echo Execution time was `expr $end - $start` seconds. + echo $type Execution time was `expr $end - $start` seconds. fi ## END IF SALT diff --git a/templates/index.redirect b/templates/index.redirect index a56befb4..d8421f69 100644 --- a/templates/index.redirect +++ b/templates/index.redirect @@ -1,4 +1,7 @@ HTTP/1.1 200 OK +Access-Control-Allow-Origin: * +Access-Control-Allow-Credentials: true +Access-Control-Allow-Methods: GET Server: Astroport Content-Type: text/html; charset=UTF-8 diff --git a/tools/VISA.new.sh b/tools/VISA.new.sh index eec70295..e1b350e7 100755 --- a/tools/VISA.new.sh +++ b/tools/VISA.new.sh @@ -16,7 +16,7 @@ PLAYER="$3" PSEUDO="$4" myIP=$(hostname -I | awk '{print $1}' | head -n 1) -ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1) +[[ ${PLAYER} ]] && ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1) [[ $ASTRONAUTENS ]] && echo "IPNS $PLAYER EXISTANT http://$myIP:8080/$ASTRONAUTENS !! DO NOTHING - EXIT -" && exit 0 ## Chargement TW !!! @@ -51,7 +51,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then OLDIP=$(cat ~/.zen/tmp/miz.json | jq -r .[].secret) echo "TW OFFICIAL GATEWAY : http://$OLDIP:8080//ipns/$GNS" if [[ ! -d ~/.zen/game/players/$PLAYER/ipfs/moa ]]; then - echo "UPDATE LOCAL COPY ~/.zen/game/players/$PLAYER/ipfs/moa" + echo "UPDATE $PLAYER LOCAL COPY ~/.zen/game/players/$PLAYER/ipfs/moa" [[ "$myIP" == "$OLDIP" ]] && cp ~/.zen/tmp/TW/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/ fi # DO NOT CONTINUE @@ -94,7 +94,7 @@ PSEUDO=${PSEUDO%%[0-9]*} # PSEUDO=${PSEUDO,,} #lowercase [[ ! $PLAYER ]] && PLAYER=${PSEUDO}${RANDOM:0:2}$(${MY_PATH}/diceware.sh 1 | xargs)${RANDOM:0:2} \ - && echo "$PLAYER ! Vous aviez déjà un autre Player ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER + && echo "$PLAYER ! A quelle adresse email vous joindre ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER [[ -d ~/.zen/game/players/$PLAYER ]] && echo "FATAL ERROR $PLAYER NAME COLLISION. TRY AGAIN." && exit 1 [[ ! $PSEUDO ]] && PSEUDO=$PLAYER