base32
This commit is contained in:
parent
46e7631d36
commit
e5be72fe83
4
12345.sh
4
12345.sh
|
@ -28,7 +28,7 @@ mkdir -p ~/.zen/tmp/coucou/
|
|||
|
||||
## 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=totodu56&pepper=totodu56 " && exit 1
|
||||
[[ $ncrunning ]] && echo "ERROR - API Server Already Running - http://$myIP:1234/?salt=totodu56&pepper=totodu56&getipns " && exit 1
|
||||
## NOT RUNNING TWICE
|
||||
|
||||
# Some client needs to respect that
|
||||
|
@ -404,7 +404,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
|
|||
[[ ! $SECRET ]] && (echo "$HTTPCORS SECRET ERROR - SORRY - CANNOT CONTINUE " | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "BAD SECRET (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && continue
|
||||
#
|
||||
# CRYPTO DECODING CRYPTIP -> myIP
|
||||
cat ~/.zen/tmp/miz.json | jq -r .[].secret | base16 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
cat ~/.zen/tmp/miz.json | jq -r .[].secret | base32 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
$MY_PATH/tools/natools.py decrypt -f pubsec -k ~/.zen/tmp/coucou/${MOATS}.secret.key -i ~/.zen/tmp/myIP.$G1PUB.enc.2 -o ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1
|
||||
GWIP=$(cat ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1)
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
|
|||
[[ ! $SECRET ]] && (echo "$HTTPCORS SECRET ERROR - SORRY - CANNOT CONTINUE " | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "BAD SECRET (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && continue
|
||||
#
|
||||
# CRYPTO DECODING CRYPTIP -> myIP
|
||||
cat ~/.zen/tmp/miz.json | jq -r .[].secret | base16 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
cat ~/.zen/tmp/miz.json | jq -r .[].secret | base32 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
$MY_PATH/../tools/natools.py decrypt -f pubsec -k ~/.zen/game/players/$PLAYER/secret.dunikey -i ~/.zen/tmp/myIP.$G1PUB.enc.2 -o ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1
|
||||
GWIP=$(cat ~/.zen/tmp/myIP.$G1PUB > /dev/null 2>&1)
|
||||
|
||||
|
@ -153,7 +153,7 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
|
|||
echo "# CRYPTO ENCODING $GWIP -> CRYPTIP"
|
||||
echo $GWIP > ~/.zen/tmp/GWIP
|
||||
$MY_PATH/../tools/natools.py encrypt -p $G1PUB -i $HOME/.zen/tmp/GWIP -o $HOME/.zen/tmp/myIP.$G1PUB.enc
|
||||
CRYPTIP=$(cat ~/.zen/tmp/myIP.$G1PUB.enc | base16)
|
||||
CRYPTIP=$(cat ~/.zen/tmp/myIP.$G1PUB.enc | base32)
|
||||
sed -i "s~$GWIP~$CRYPTIP~g" ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
|
||||
|
||||
####################
|
||||
|
|
|
@ -206,12 +206,12 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
echo "# CRYPTO ENCODING myIP -> CRYPTIP"
|
||||
echo $myIP > ~/.zen/tmp/myIP
|
||||
$MY_PATH/natools.py encrypt -p $G1PUB -i $HOME/.zen/tmp/myIP -o $HOME/.zen/tmp/myIP.$G1PUB.enc
|
||||
CRYPTIP=$(cat ~/.zen/tmp/myIP.$G1PUB.enc | base16)
|
||||
CRYPTIP=$(cat ~/.zen/tmp/myIP.$G1PUB.enc | base32)
|
||||
sed -i "s~_SECRET_~$CRYPTIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||
#
|
||||
echo "# CRYPTO DECODING CRYPTIP -> myIP"
|
||||
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
|
||||
cat ~/.zen/tmp/MadeInZion.json | jq -r .[].secret | base16 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
cat ~/.zen/tmp/MadeInZion.json | jq -r .[].secret | base32 -d > ~/.zen/tmp/myIP.$G1PUB.enc.2
|
||||
$MY_PATH/natools.py decrypt -f pubsec -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -i $HOME/.zen/tmp/myIP.$G1PUB.enc.2 -o $HOME/.zen/tmp/myIP.2
|
||||
#
|
||||
## CRYPTO PROCESS VALIDATED
|
||||
|
|
Loading…
Reference in New Issue