This commit is contained in:
fred 2022-12-09 15:55:27 +01:00
parent cf07610968
commit c2ff81ff5a
5 changed files with 78 additions and 70 deletions

View File

@ -321,8 +321,6 @@ while true; do
start=`date +%s`
## RECORD DATA MADE IN BROWSER (JSON)
SALT=$(urldecode ${arr[1]} | xargs)
PEPPER=$(urldecode ${arr[3]} | xargs)
NODEID=$(urldecode ${arr[7]} | xargs)
DATAID=$(urldecode ${arr[9]} | xargs)
@ -454,8 +452,6 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
start=`date +%s`
SALT=$(urldecode ${arr[1]} | xargs)
PEPPER=$(urldecode ${arr[3]} | xargs)
# WHAT can contain urlencoded FullURL
EMAIL=$(urldecode ${arr[7]} | xargs)
PSEUDO=$(urldecode ${arr[9]} | xargs)
@ -480,6 +476,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
echo "# ASTRONAUT NEW VISA Create VISA.new.sh in background (~/.zen/tmp/email.${EMAIL}.${MOATS}.txt)"
(
startvisa=`date +%s`
[[ "$SALT" == "0" && "$PEPPER" == "0" ]] && SALT="" && PEPPER="" # "0" "0" means random salt pepper
echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${WHAT}\"" > ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
$MY_PATH/tools/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
$MY_PATH/tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ## Send VISA.new log to EMAIL

View File

@ -122,7 +122,7 @@ select fav in "${choices[@]}"; do
case $fav in
"IMPRIMER VISA")
echo "IMPRESSION"
${MY_PATH}/tools/VISA.print.sh
${MY_PATH}/tools/VISA.print.sh "$PLAYER"
;;
"EXPORTER VISA")

View File

@ -510,7 +510,7 @@ Error message and password prompt
{"title":"$:/status/RequireReloadDueToPluginChange","text":"no"},
{"created":"20221128200702277","title":"$:/status/UserName","text":"_PSEUDO_","modified":"20221128200702277"},
{"title":"$:/Story/Default","bottom-right-panel":"yes","columns":"1 2 3","created":"20220428183227840","dragging-enable":"yes","follow-active-column":"no","hide-scrollbars":"no","horizontal-columns":"2","modified":"20220428183227841","no-tiddler-box-shadows":"no","palette":"$:/palettes/Vanilla","panel-position":"right","panel-show-numbers":"no","panel-width-above-1170px":"35%","panel-width-below-1170px":"50%","panel-width-below-768px":"90%","river-obscured":"yes","scroll-snap-type":"none","show-edit-preview-per-tiddler":"yes","story-1":"Palettes Tips [[Ceci nest pas une pipe.]] [[Configuration Options]]","story-2":"[[The plugin]] [[Keyboard Shortcuts]] [[The Birth of Venus]] [[Star me on GitHub]]","story-3":"[[Responsive Video]] [[Differences between FireFox and Chromium]] [[The Great Wave off the Coast of Kanagawa]]","story-river-padding":"15","tiddler-border":"1","tiddler-margin":"10","type":"text/vnd.tiddlywiki","view":"vertical","revision":"0","bag":"default"},
{"title":"$:/StoryList","text":"","list":"Bienvenue BunkerBOX CopierYoutube"},
{"title":"$:/StoryList","created":"20221209144025688","creator":"_PSEUDO_","text":"","list":"Bienvenue BunkerBOX CopierYoutube","modified":"20221209144047139","modifier":"_PSEUDO_"},
{"title":"$:/StoryList-2","created":"20220409124735965","list":"","modified":"20220822140718188","type":"text/vnd.tiddlywiki","revision":"0","bag":"default"},
{"title":"$:/StoryList-24","list":"","type":"text/vnd.tiddlywiki","revision":"0","bag":"default"},
{"title":"$:/StoryList-3","created":"20220402104129655","list":"","modified":"20220501113142260","type":"text/vnd.tiddlywiki","revision":"0","bag":"default"},
@ -534,7 +534,7 @@ Error message and password prompt
{"title":"$:/view","created":"20220403091112476","modified":"20220428183149011","type":"text/vnd.tiddlywiki","text":"multi-column","revision":"0","bag":"default"},
{"created":"20221028140644690","text":"Il s'agit du code situé dans le répertoire ASTROBOT de la distribution Astroport.ONE que vous utilisez.\n\nCelui-ci contient les script de traitement de réplication Ŋ1 de vos G1Voeux.\n\nhttps://git.p2p.legal/qo-op/Astroport.ONE/src/branch/master/ASTROBOT\n","title":"AstroBot","modified":"20221028150232387","tags":"$:/isAttachment $:/isEmbedded"},
{"created":"20210804081616558","creator":"_PSEUDO_","text":"!! Participez au développement d'un meilleur Internet !\nContactez support@qo-op.com\n\n''{{Astroport!!pseudo}}'' (Astronaute : ''{{MadeInZion!!player}}'')\n\n> NE SUPPRIMEZ PAS CE \"TIDDLER\"\n","title":"Astroport","modified":"20221208200543177","tags":"","g1pub":"_G1PUB_","qrsec":"_QRSEC_","astroport":"_ASTROPORT_","birthdate":"_BIRTHDATE_","pseudo":"_PSEUDO_","modifier":"_PSEUDO_","chain":"_CHAIN_","moats":"_MOATS_"},
{"created":"20221208200555633","creator":"_PSEUDO_","text":"! Univers Numérique Décentralisé stocké dans IPFS.\n\n* 2 \"phrases de passe\" \n* une adresse email \n\nAvec [[Astroport|https://astroport.com]], nous échangeons des biens, des services, partageons des étoiles sur [[GChange|https://gchange.fr]] afin de tisser Ŋ1, un réseau humain de confiance qui utilise [[Ğ1 (la \"June\")|https://monnaie-libre.fr/]] \n\n! VISA \"Astronaute\" [[MadeInZion]]\n\nImprimez, supprimez ou chiffrez le tiddler [[G1Voeu]] pour en conserver les secrets.\n\n\n''Ce TW profite du protocole de réplication Ŋ1''\n\n\n!!! Comment contrôler son TW ?\n---\n\nCe TW contient des tiddlers qui se partagent selon les ''voeux'' que vous y formulerez\n\n\u003C$list filter=\"[tag[G1Voeu]sort[title]]\">\n\u003C$link>\u003C\u003CcurrentTiddler>>\u003C/$link>\n\u003C/$list>\n\n\n---\n\nAvec le voeu \"CopierYoutube\" actif, votre Tiddler [[BunkerBOX]] contrôle vos copies\n\n\u003C$list filter=\"[tag[G1CopierYoutube]]\">\n\u003C$link>\u003C\u003CcurrentTiddler>>\u003C/$link>\n{{||$:/core/ui/ViewTemplate/tags}}\n\u003C/$list>\n\n---\n\n''Adresse TW.''\n\n* /ipns/k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75\n\n\n''Astroport.ONE ASSURE LA SYNCHRONISATION Ŋ1 DE 20H12''\n\n! NOTRE STOCKAGE A NOUS\n!!! Comment nous aider ?\n\n\u003C\u003C\u003C\n\n* Installez '[[IPFS kubo|https://docs.ipfs.tech/install/command-line/#official-distributions]]' sur votre ordinateur\n* Ajoutez [[ipfs-companion|https://docs.ipfs.tech/install/ipfs-companion/]] à votre navigateur (ou utilisez \"[[Brave|https://brave.com/fr/]]\")\n\nChaque Station qui rejoint notre essaim \"bootstrap\" augmente la taille du \"Disque de Stockage Commun\"\n\nL'essaim qui héberge ce que vous consultez est constitué de 3 machines (24/24), pouvant héberger 1 à 3To\n\nPour nous rejoindre,\n\n* [[Devenez généreux donateur|https://opencollective.com/monnaie-libre]] aidez à notre développement.\n* [[Alimentez notre Constellation|https://opencollective.com/monnaie-libre/projects/bunker-box]] et faite grossir les To Utiles.\n* Installez [[Astroport.ONE|https://git.p2p.legal/qo-op/Astroport.ONE]] sur votre ordinateur, hébergez vos amis en laissant votre machine allumée.\n\n```\nbash \u003C(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.sh)\n```\n\nDEV\n\n* [[Améliorer, diversifier les modèles de TiddlyWiki|https://tiddlywiki.com/languages/fr-FR/index.html]]\n* [[Enrichissez notre application avec des plugins TW|https://tw-cpl.netlify.app/#Index:Index]] \n\n\u003C\u003C\u003C\n","tags":"_PLAYER_","title":"Bienvenue","modified":"20221208200640207","modifier":"_PSEUDO_"},
{"created":"20221208200555633","creator":"_PSEUDO_","text":"!! TW\n!!! Capsule de Sauvegarde Décentralisée sur IPFS.\n\n* Vos 2 \"phrases de passe\" pour clef\n\n_SALT_\n\n_PEPPER_\n\n* Votre adresse email _PLAYER_ pour signature\n\nDans le réseau p2p propulsé par [[Astroport|https://astroport.com]], vous échangez des biens, des services, selon la confiance exprimée par un échange d'étoiles sur [[GChange|https://gchange.fr]].\n\nTissez vos toiles Ŋ1 dans un réseau humain de confiance qui utilise [[Ğ1 (la \"June\")|https://monnaie-libre.fr/]] \n\n''Le protocole de réplication Ŋ1'' consiste à activer des échanges et fonctions supplémentaires lorsque 2 interactions sont présentent dans une blockchain compatible (Etoiles Gchange, Transactions G1, etc )\n\n!! Comment contrôler votre TW ?\n---\n\nCe TW contient des tiddlers qui se partagent selon les ''voeux'' que vous y formulerez\n\n\u003C$list filter=\"[tag[G1Voeu]sort[title]]\">\n\u003C$link>\u003C\u003CcurrentTiddler>>\u003C/$link>\n\u003C/$list>\n\nIl suffit de créer un tiddler ayant pour titre le \"Tag\" souhaité que vous taggez 'voeu' pour en créer un nouveau. Celui-ci fonctionne comme un aimant qui ajoute automatiquement les Tiddlers de vos amis comportant ce \"G1Tag\"\n\n---\n\nExemple avec le voeu \"CopierYoutube\", et le Tiddler [[BunkerBOX]] contrôle indique les chaines videos que vous souhaitez sauvegarder\n\n\u003C$list filter=\"[tag[G1CopierYoutube]]\">\n\u003C$link>\u003C\u003CcurrentTiddler>>\u003C/$link>\n{{||$:/core/ui/ViewTemplate/tags}}\n\u003C/$list>\n\n---\n! NOTRE STOCKAGE A NOUS\n\n!! Votre VISA \"Astronaute\" [[MadeInZion]]\n\nse trouve dans le tiddler [[G1Voeu]].\n\nIMPORTANT. Imprimez, supprimez ce tiddller ou chiffrez le avec le code : _PASS_ \n\n''Adresse de votre TW.''\n\n* /ipns/k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75\n\n''LE '20H12' ASSURE SA SYNCHRONISATION Ŋ1.''\n\n!! Comment aider ?\n\n\u003C\u003C\u003C\n\n* Installez '[[IPFS kubo|https://docs.ipfs.tech/install/command-line/#official-distributions]]' sur votre ordinateur\n* Ajoutez [[ipfs-companion|https://docs.ipfs.tech/install/ipfs-companion/]] à votre navigateur (ou utilisez \"[[Brave|https://brave.com/fr/]]\")\n\nChaque Station qui rejoint l'essaim \"Bootstrap\" collectif ajoute à la taille du \"Disque de Stockage Commun\"\n\nL'essaim actuel est constitué de 3 station (24/24), il vous offre un hébergement gratuit 1 à 3To.\n\nDéveloppez le collectif \n\n* [[Devenez généreux donateur|https://opencollective.com/monnaie-libre]] aidez à notre développement.\n* [[Financez notre Constellation|https://opencollective.com/monnaie-libre/projects/bunker-box]] et faite grossir les \"To Utiles\" de notre disque et hébergement collectif.\n* Activez votre Station. Installez [[Astroport.ONE|https://git.p2p.legal/qo-op/Astroport.ONE]] sur votre ordinateur, hébergez vos amis en laissant votre machine allumée.\n\n\n* [[Améliorer, diversifier les modèles de TiddlyWiki|https://tiddlywiki.com/languages/fr-FR/index.html]]\n* [[Enrichissez notre application avec des plugins TW|https://tw-cpl.netlify.app/#Index:Index]] \n\n\u003C\u003C\u003C\n\n","tags":"_PLAYER_","title":"Bienvenue","modified":"20221209145321379","modifier":"_PSEUDO_"},
{"created":"20221208182057874","creator":"_PSEUDO_","text":"URL QUE SYNCHRONISE VOTRE ASTROBOT\n\n_URL_\n","tags":"_PLAYER_ CopierYoutube","title":"BunkerBOX","modified":"20221208182800247","modifier":"_PSEUDO_"},
{"created":"20220418235829684","text":"\u003C$leafmap\ntileControl\ntile='sat'\nzoom='14'\nplaces='{\"point\":\"44.2301, 1.6518\"}'\n/>\n\nGrace à ce Tiddler, indiquez où se trouve l'endroit où se situe la .\nSi vous bénéficiez d'un Journal Astronaute, géolocalisé, les coordonnées qui se trouvent dans un rayon de 50km vous seront révélées.\n\nhttps://www.openstreetmap.org/","tags":"G1Carte","title":"Carte et GPS","modified":"20221028151145096","gps":"44.2301, 1.6518"},
{"created":"20221028151255914","creator":"_PSEUDO_","text":"''Ce voeu sera fonctionnel après le prochain 20H12''","title":"CopierYoutube","modified":"20221128201251716","tags":"voeu","modifier":"_PSEUDO_"},

View File

@ -34,7 +34,7 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
## CHECK if PLAYER resolve any ASTRONAUTENS
[[ ${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
[[ ${ASTRONAUTENS} ]] && echo "WARNING IPNS $PLAYER EXISTANT https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS} - EXIT -" && exit 0
## Chargement TW !!!
if [[ $SALT != "" && PEPPER != "" ]]; then
@ -48,6 +48,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
mkdir -p ~/.zen/tmp/${MOATS}/TW
echo "SEARCHING FOR ONLINE /ipns/${ASTRONAUTENS}"
## GETTING LAST TW via IPFS or HTTP GW
[[ $YOU ]] \
&& ipfs --timeout 20s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/${MOATS}/TW/index.html
@ -69,17 +70,20 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
IPNSTAIL=$(echo $ASTROPORT | rev | cut -f 1 -d '/' | rev)
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
if [[ $ASTROPORT ]]; then
IPNSTAIL=$(echo $ASTROPORT | rev | cut -f 1 -d '/' | rev)
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
[[ $IPNSTAIL == $IPFSNODEID ]] \
&& echo "UPDATING $PLAYER LOCAL CACHE ~/.zen/game/players/$PLAYER/ipfs/moa" \
&& mkdir -p ~/.zen/game/players/$PLAYER/ipfs/moa \
&& cp ~/.zen/tmp/${MOATS}/TW/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/ \
|| echo "PLAYER on $ASTROPORT Station"
[[ $IPNSTAIL == $IPFSNODEID ]] \
&& echo "UPDATING $PLAYER LOCAL CACHE ~/.zen/game/players/$PLAYER/ipfs/moa" \
&& mkdir -p ~/.zen/game/players/$PLAYER/ipfs/moa \
&& cp ~/.zen/tmp/${MOATS}/TW/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/ \
|| echo "PLAYER on $ASTROPORT Station"
fi
# DO NOT CONTINUE
echo "VISA ALREADY EXISTING"
echo "TW ADDRESS IN USE"
rm -Rf ~/.zen/tmp/${MOATS}
@ -89,7 +93,8 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
fi
################################################################################
TWMODEL="/ipfs/bafybeihk2xserdii7wcnvojbyuyxx6qzlcgtzvraeucpyrhcfwy2ssvbhu"
TWMODEL="/ipfs/bafybeibkf3yc5pqppwcw5n2vnzcvtkh6sml3bhb2h44cxnkwhtrmtx3oxu"
# ipfs cat $TWMODEL > templates/twdefault.html
##################################################### # NEW PLAYER ###############
################################################################################
echo "=============================================
@ -145,18 +150,17 @@ Rendez-vous sur https://gchange.fr"; sleep 3
echo; echo "Création de votre clef multi-accès..."; sleep 2
echo;
${MY_PATH}/keygen -t duniter -o /tmp/secret.dunikey "$SALT" "$PEPPER"
${MY_PATH}/keygen -t duniter -o ~/.zen/tmp/${MOATS}/secret.dunikey "$SALT" "$PEPPER"
G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
G1PUB=$(cat ~/.zen/tmp/${MOATS}/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! $G1PUB ]] && echo "Désolé. clef Cesium absente." && exit 1
## CREATE Player personnal files storage and IPFS publish directory
mkdir -p ~/.zen/game/players/$PLAYER # Prepare PLAYER datastructure
mkdir -p ~/.zen/tmp/
mv /tmp/secret.dunikey ~/.zen/game/players/$PLAYER/
mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/$PLAYER/
# Create Player "IPNS Key" (key import)
${MY_PATH}/keygen -t ipfs -o ~/.zen/game/players/$PLAYER/secret.player "$SALT" "$PEPPER"
@ -169,17 +173,17 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
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)
## SEC PASS PROTECTED QRCODE
secFromDunikey=$(cat ~/.zen/game/players/$PLAYER/secret.dunikey | grep "sec" | cut -d ' ' -f2)
echo "$secFromDunikey" > /tmp/${PSEUDO}.sec
openssl enc -aes-256-cbc -salt -in /tmp/${PSEUDO}.sec -out "/tmp/enc.${PSEUDO}.sec" -k $PASS 2>/dev/null
PASsec=$(cat /tmp/enc.${PSEUDO}.sec | base58) && rm -f /tmp/${PSEUDO}.sec
echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
openssl enc -aes-256-cbc -salt -in ~/.zen/tmp/${MOATS}/${PSEUDO}.sec -out "$HOME/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec" -k $PASS 2>/dev/null
PASsec=$(cat ~/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec | base58) && rm -f ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
qrencode -s 12 -o $HOME/.zen/game/players/$PLAYER/QRsec.png $PASsec
echo "Votre Clef publique G1 est : $G1PUB"; sleep 1
### INITALISATION WIKI dans leurs répertoires de publication IPFS
############ TODO améliorer templates, sed, ajouter index.html, etc...
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
echo
echo "***** Activation du Canal TW Astronaute $PLAYER *****"
mkdir -p ~/.zen/game/players/$PLAYER/ipfs/moa/
@ -188,14 +192,18 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
sed -i "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
# INSERT ASTROPORT ADRESS
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/Astroport.json | jq -r .[].astroport)
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
sed -i "s~$ASTROPORT~/ipns/${IPFSNODEID}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
# TW CHAIN INIT WITH TWMODEL
sed -i "s~_MOATS_~${MOATS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~_CHAIN_~${TWMODEL}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~_SALT_~${SALT}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~_PEPPER_~${PEPPER}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~_PASS_~${PASS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~_URL_~${URL}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
# INSERT PLAYER DATA
@ -218,44 +226,44 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
#
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)
#
echo "# CRYPTO ENCODING secret.dunikey -> TW _SECRET_ "
echo $myIP > ~/.zen/tmp/myIP
$MY_PATH/natools.py encrypt -p $G1PUB -i $HOME/.zen/game/players/$PLAYER/secret.dunikey -o $HOME/.zen/tmp/secret.dunikey.$G1PUB.enc
ENCODING=$(cat ~/.zen/tmp/secret.dunikey.$G1PUB.enc | base16)
###########
echo "# CRYPTO SELFT ENCODING secret.dunikey put in Tiddler MadeInZion._SECRET_ "
echo $myIP > ~/.zen/tmp/${MOATS}/myIP
$MY_PATH/natools.py encrypt -p $G1PUB -i $HOME/.zen/game/players/$PLAYER/secret.dunikey -o $HOME/.zen/tmp/${MOATS}/secret.dunikey.$G1PUB.enc
ENCODING=$(cat ~/.zen/tmp/${MOATS}/secret.dunikey.$G1PUB.enc | base16)
sed -i "s~_SECRET_~$ENCODING~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
#
###########
echo "# CRYPTO DECODING TEST"
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
$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
#
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].secret | base16 -d > ~/.zen/tmp/${MOATS}/myIP.$G1PUB.enc.2
$MY_PATH/natools.py decrypt -f pubsec -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -i $HOME/.zen/tmp/${MOATS}/myIP.$G1PUB.enc.2 -o $HOME/.zen/tmp/${MOATS}/myIP.2
###########
## CRYPTO PROCESS VALIDATED
[[ -s ~/.zen/tmp/myIP.2 ]] && echo "NATOOLS ENCODED secret LOADED" \
[[ -s ~/.zen/tmp/${MOATS}/myIP.2 ]] && echo "NATOOLS ENCODED secret LOADED" \
|| sed -i "s~$ENCODING~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # Revert to plaintext _SECRET_ myIP
rm -f ~/.zen/tmp/myIP.2
rm -f ~/.zen/tmp/${MOATS}/myIP.2
###########
## ADD SYSTEM TW
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
--import ~/.zen/Astroport.ONE/templates/data/local.api.json "application/json" \
--import ~/.zen/Astroport.ONE/templates/data/local.gw.json "application/json" \
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
[[ -f ~/.zen/tmp/newindex.html ]] && cp ~/.zen/tmp/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "newindex.html" "text/plain"
[[ -f ~/.zen/tmp/${MOATS}/newindex.html ]] && cp ~/.zen/tmp/${MOATS}/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
## ID CARD
convert ~/.zen/game/players/$PLAYER/QR.png -resize 300 /tmp/QR.png
convert ${MY_PATH}/../images/astroport.jpg -resize 300 /tmp/ASTROPORT.png
## 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
composite -compose Over -gravity SouthWest -geometry +280+20 /tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png /tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QR.png /tmp/astroport.png /tmp/one.png
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png /tmp/one.png /tmp/image.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 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\"" /tmp/one.png /tmp/image.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,40 \"$PLAYER\"" /tmp/image.png /tmp/pseudo.png
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" /tmp/pseudo.png /tmp/pass.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" /tmp/pass.png /tmp/salt.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" /tmp/salt.png ~/.zen/game/players/$PLAYER/ID.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
# INSERTED IMAGE IPFS
IASTRO=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ID.png | tail -n 1)
@ -281,7 +289,7 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# astrXbian compatible IPFS sub structure =>$XZUID
cp ~/.zen/game/players/$PLAYER/.player ~/.zen/game/players/$PLAYER/ipfs/_xbian.zuid
cp ~/.zen/game/players/$PLAYER/.player ~/.zen/game/players/$PLAYER/ipfs/
# PUBLIC Ŋ7 ZONE
# PUBLIC Ŋ0 ZONE
echo "${ASTRONAUTENS}" > ~/.zen/game/players/$PLAYER/.playerns
@ -294,7 +302,7 @@ echo; echo "Création de votre Clef et QR codes d'accès au niveau Astroport Ŋ1
echo; echo "*** HOME : ~/.zen/game/players/$PLAYER/"; sleep 1
echo "*** PLAYER : $PLAYER";
echo; echo "GW : https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}"; sleep 1
echo; echo "VOTRE TW : https://ipfs.copylaradio.com/ipns/${ASTRONAUTENS}"; sleep 1
# PASS CRYPTING KEY
#~ echo; echo "Sécurisation de vos clefs... "; sleep 1
@ -314,15 +322,15 @@ echo "$PASS" > ~/.zen/game/players/$PLAYER/.pass
#####################################################
## DISCONNECT AND CONNECT CURRENT PLAYER
rm -f ~/.zen/game/players/.current
ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current
#~ rm -f ~/.zen/game/players/.current
#~ ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current
## MANAGE GCHANGE+ & Ŋ1 EXPLORATION
${MY_PATH}/Connect_PLAYER_To_Gchange.sh "$PLAYER"
### IF PRINTER -> PRINT VISA
LP=$(ls /dev/usb/lp*)
[[ $LP ]] && ${MY_PATH}/VISA.print.sh &
LP=$(ls /dev/usb/lp* 2>/dev/null)
[[ $LP ]] && ${MY_PATH}/VISA.print.sh "$PLAYER" &
## INIT FRIENDSHIP CAPTAIN/ASTRONAUTS (LATER THROUGH GCHANGE)
## ${MY_PATH}/FRIENDS.init.sh
@ -335,6 +343,7 @@ echo $PSEUDO > ~/.zen/tmp/PSEUDO ## Return data to start.sh
echo "$PASS"
## CLEANING CACHE
rm -Rf ~/.zen/tmp/${MOATS}
exit 0

View File

@ -11,30 +11,32 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
PLAYER="$1"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
[[ ! -f ~/.zen/game/players/.current/QR.png ]] &&\
echo "ERREUR. Aucun PLAYER Astronaute connecté .ERREUR ~/.zen/game/players/.current/" && exit 1
[[ ! -f ~/.zen/game/players/${PLAYER}/QR.png ]] &&\
echo "ERREUR. Aucun PLAYER Astronaute connecté .ERREUR ~/.zen/game/players/${PLAYER}/" && exit 1
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
PLAYER=$(cat ~/.zen/game/players/${PLAYER}/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
PASS=$(cat ~/.zen/game/players/.current/.pass)
PASS=$(cat ~/.zen/game/players/${PLAYER}/.pass)
SALT=$(cat ~/.zen/game/players/.current/secret.june | head -n 1)
PEPPER=$(cat ~/.zen/game/players/.current/secret.june | tail -n 1)
SALT=$(cat ~/.zen/game/players/${PLAYER}/secret.june | head -n 1)
PEPPER=$(cat ~/.zen/game/players/${PLAYER}/secret.june | tail -n 1)
LP=$(ls /dev/usb/lp*)
convert ~/.zen/game/players/.current/QR.png -resize 300 /tmp/QR.png
convert ~/.zen/game/players/${PLAYER}/QR.png -resize 300 /tmp/QR.png
convert ${MY_PATH}/../images/astroport.jpg -resize 300 /tmp/ASTROPORT.png
composite -compose Over -gravity SouthWest -geometry +280+20 /tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png /tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QR.png /tmp/astroport.png /tmp/one.png
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png /tmp/one.png /tmp/image.png
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/${PLAYER}/QRsec.png /tmp/one.png /tmp/image.png
convert -gravity northwest -pointsize 35 -fill black -draw "text 50,300 \"$PSEUDO\"" /tmp/one.png /tmp/image.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 300,40 \"$PLAYER\"" /tmp/image.png /tmp/pseudo.png