From 209c9515c968f0358a7cf34a1325ebe6b0bf1630 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 6 Oct 2023 15:20:55 +0200 Subject: [PATCH] Activate access to SaltPepper G1Card login, TODO arrange better 20H12 sun time multi node (a)sync --- 12345.sh | 17 ++++++++------ 20h12.process.sh | 11 ++++++++- README.md | 2 ++ RUNTIME/PLAYER.refresh.sh | 6 ----- tools/jaklis/.env | 4 ++-- tools/my.sh | 20 ++++++++++++++++ tools/search_for_this_email_in_players.sh | 28 +++++++++++++++-------- 7 files changed, 62 insertions(+), 26 deletions(-) diff --git a/12345.sh b/12345.sh index bf62657a..5c010a18 100755 --- a/12345.sh +++ b/12345.sh @@ -132,13 +132,16 @@ while true; do ## / CONTACT if [[ $URL == "/" ]]; then echo "/ CONTACT : $HOSTP" - echo "$HTTPCORS - - - [Astroport] :powered: Station - - - DING : ${MOATS} : $(date)" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & + + mySalt | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & + + #~ echo "$HTTPCORS + #~ + #~ + #~ [Astroport] :powered: Station + #~ + #~ + #~ DING : ${MOATS} : $(date)" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & end=`date +%s` echo " (‿/‿) $myHOST:$PORT / Execution time was "`expr $end - $start` seconds. continue diff --git a/20h12.process.sh b/20h12.process.sh index 917e0fd8..8a6ff958 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -48,6 +48,15 @@ espeak "Players refresh" > /dev/null 2>&1 # Refresh ~/.zen/game/players/PLAYER ~/.zen/Astroport.ONE/RUNTIME/PLAYER.refresh.sh +espeak "REFRESHING SWARM" > /dev/null 2>&1 +# Refresh ~/.zen/game/players/PLAYER +~/.zen/Astroport.ONE/RUNTIME/MAP.refresh.sh + +espeak "REFRESHING UPLANET" > /dev/null 2>&1 +# Refresh ~/.zen/game/players/PLAYER +~/.zen/Astroport.ONE/RUNTIME/UPLANET.refresh.sh + + ## if [[ ! $isLAN ]]; then ## REFRESH BOOTSTRAP LIST (OFFICIAL SWARM) espeak "bootstrap refresh" > /dev/null 2>&1 @@ -68,7 +77,7 @@ echo "20H12 (♥‿‿♥) Execution time was $dur" seconds. # ~/.zen/Astroport.ONE/tools/ipfs_P2P_forward.sh ## COULD FORWARD LOCAL TCP PORT TO SWARM rm ~/.zen/game/players/localhost/latest -## MAIL LOG : support@qo-op.com +## MAIL LOG : support@qo-op.com ## $MY_PATH/tools/mailjet.sh "support@g1sms.fr" "/tmp/20h12.log" espeak "duration was $dur seconds" > /dev/null 2>&1 diff --git a/README.md b/README.md index 7bd6ae6a..eceb7652 100644 --- a/README.md +++ b/README.md @@ -501,3 +501,5 @@ Did you ever dring a beer bought in G1 ? You can pay me a beer or more by contributing to our OpenCollective https://opencollective.com/monnaie-libre#category-ABOUT +## IPFS Ecosystem Directory Submission Form +https://airtable.com/appLWiIrg9SQaEtEq/shrjwvk9pAeAk0Ci7 diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index e54dd279..85b013bd 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -281,10 +281,4 @@ for PLAYER in ${PLAYERONE[@]}; do done echo "PLAYER.refresh DONE." -echo "REFRESHING MAP" -${MY_PATH}/MAP.refresh.sh - -echo "REFRESHING UPLANET" -${MY_PATH}/UPLANET.refresh.sh - exit 0 diff --git a/tools/jaklis/.env b/tools/jaklis/.env index 6dd40a46..5ceb560b 100644 --- a/tools/jaklis/.env +++ b/tools/jaklis/.env @@ -3,8 +3,8 @@ DUNIKEY=/.zen/game/players/.current/secret.dunikey # Noeud Duniter #NODE=https://g1.asycn.io/gva -NODE=https://duniter.pini.fr/gva -#NODE=https://g1.brussels.ovh/gva +#NODE=https://duniter.pini.fr/gva +NODE=https://g1.copylaradio.com/gva # https://ginspecte.mithril.re/service_types/1 # ??? NODE=https://g1.geragc.es/gva # ??? NODE=https:g1.cuates.net/gva diff --git a/tools/my.sh b/tools/my.sh index 5f7e507a..158b1914 100755 --- a/tools/my.sh +++ b/tools/my.sh @@ -374,6 +374,26 @@ myHtml() { [ -n "$myHtml" ] && echo "$myHtml" } +mySalt() { + local mySalt=$($RUN sed \ + -e "s~http://127.0.0.1:8080~${myIPFS}~g" \ + -e "s~\"http://127.0.0.1:1234\"~\"${myASTROPORT}\"~g" \ + -e "s~http://127.0.0.1:33101~http://${myHOST}:33101~g" \ + -e "s~https://ipfs.copylaradio.com~${myIPFSGW}~g" \ + -e "s~http://g1billet.localhost:33101~${myG1BILLET}~g" \ + -e "s~_IPFSNODEID_~${IPFSNODEID}~g" \ + -e "s~g1billet.localhost~${myIP}~g" \ + -e "s~_HOSTNAME_~$(hostname)~g" \ + -e "s~background.000.~background.$(printf '%03d' "$(seq 0 17 |shuf -n 1)").~g" \ + ~/.zen/Astroport.ONE/templates/saltpepper.http) + [ -z "$isLAN" ] \ + || mySalt=$($RUN echo "$mySalt" | sed \ + -e "s~~~g" \ + -e "s~~~g") + [ -n "$mySalt" ] && echo "$mySalt" +} + + myTs() { local myTs=$(date +%s) [ -n "$myTs" ] && echo "$myTs" diff --git a/tools/search_for_this_email_in_players.sh b/tools/search_for_this_email_in_players.sh index ce989306..b2078841 100755 --- a/tools/search_for_this_email_in_players.sh +++ b/tools/search_for_this_email_in_players.sh @@ -26,19 +26,27 @@ if [[ "${EMAIL}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then ## TODO ? SEARCH WITH DNSLINK echo "export TW=${INDEX}" - ## EXTRACT DATA FROM TW - mkdir -p ~/.zen/tmp/${MOATS} - rm -f ~/.zen/tmp/${MOATS}/Astroport.json + # SWARM CACHE index.html contains + # + EXTERNAL=$(grep -o "url='/[^']*'" ${INDEX} | sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}') - tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' + if [[ ! ${EXTERNAL} ]]; then + ## EXTRACT DATA FROM TW + mkdir -p ~/.zen/tmp/${MOATS} + rm -f ~/.zen/tmp/${MOATS}/Astroport.json - ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport) - ASTROG1=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].g1pub) + tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' - ## GET ASTRONAUTENS - field was missing in TW model Astroport Tiddler - - ASTRONAUTENS=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astronautens) - [[ ${ASTRONAUTENS} == "null" || ${ASTRONAUTENS} == "" ]] && ASTRONAUTENS="/ipns/"$(ipfs key list -l | grep -w ${ASTROG1} | cut -d ' ' -f1) - [[ ${ASTRONAUTENS} == "/ipns/" ]] && ASTRONAUTENS="" + ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport) + ASTROG1=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].g1pub) + + ## GET ASTRONAUTENS - field was missing in TW model Astroport Tiddler - + ASTRONAUTENS=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astronautens) + [[ ${ASTRONAUTENS} == "null" || ${ASTRONAUTENS} == "" ]] && ASTRONAUTENS="/ipns/"$(ipfs key list -l | grep -w ${ASTROG1} | cut -d ' ' -f1) + [[ ${ASTRONAUTENS} == "/ipns/" ]] && ASTRONAUTENS="" + else + ASTRONAUTENS="/ipns/${EXTERNAL}" + fi rm -Rf ~/.zen/tmp/${MOATS} # cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r