Correct & extend

This commit is contained in:
fred 2023-10-09 22:15:29 +02:00
parent 4cd7ca89d8
commit 73ee81cc12
6 changed files with 33 additions and 21 deletions

View File

@ -218,8 +218,11 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
if [[ $APPNAME == "logout" ]]; then
## REMOVE PLAYER IPNS KEY FROM STATION
PLAYER=${WHAT}
echo "<h1>$PLAYER LOGOUT OK</h1>" > ~/.zen/tmp/coucou/${MOATS}.log
[[ "${salt}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${salt} \
|| PLAYER=${WHAT}
echo "<h1>$PLAYER LOGOUT OK ?</h1>" > ~/.zen/tmp/coucou/${MOATS}.log
ipfs key rm ${G1PUB} >> ~/.zen/tmp/coucou/${MOATS}.log
ipfs key rm ${PLAYER} >> ~/.zen/tmp/coucou/${MOATS}.log
@ -234,7 +237,10 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
if [[ $APPNAME == "login" ]]; then
PLAYER=${WHAT}
[[ "${salt}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${salt} \
|| PLAYER=${WHAT}
ISTHERE=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
echo "IS THERE ? $ISTHERE"
[[ ${ISTHERE} == "" ]] \

View File

@ -433,7 +433,10 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
if [[ $APPNAME == "login" ]]; then
## INSTALL PLAYER IPNS KEY ON STATION
PLAYER=${WHAT}
[[ "${SALT}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${SALT} \
|| PLAYER=${WHAT}
ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key
ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
@ -469,7 +472,10 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
if [[ $APPNAME == "logout" ]]; then
## REMOVE PLAYER IPNS KEY FROM STATION
PLAYER=${WHAT}
[[ "${SALT}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${SALT} \
|| PLAYER=${WHAT}
echo "<h1>$PLAYER LOGOUT OK</h1>" > ~/.zen/tmp/coucou/${MOATS}.log
ipfs key rm ${G1PUB} >> ~/.zen/tmp/coucou/${MOATS}.log

View File

@ -299,7 +299,7 @@ fi
done < ~/.zen/tmp/${IPFSNODEID}/yt-dlp.cache.${PLAYER} # FINISH YID loop 1
## COPY PLAYER CACHE TO STATION SWARM CACHE
cp ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/* \
cp -r ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/* \
~/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/${PLAYER}/
exit 0

View File

@ -267,18 +267,6 @@ for PLAYER in ${PLAYERONE[@]}; do
IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
&& ipfs name publish --key="${PLAYER}_feed" /ipfs/${IRSS}
## Publish on LAT/ON key on 12345 CACHE
[[ ${LAT} && ${LON} ]] \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPNS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/_index.html
# PROTOCOL EVOLUTION (CORRECT & REMOVE)
rm ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/index.html 2>/dev/null
ls -al ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON} 2>/dev/null
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
######################### REPLACE TW with REDIRECT (reduce 12345 cache size)
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${ASTRONAUTENS}'\" />" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
@ -286,6 +274,18 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html
## Publish on LAT/ON key on 12345 CACHE
[[ ${LAT} && ${LON} ]] \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/TW/${PLAYER} \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/TW/${PLAYER}/ \
&& echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPNS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/_index.html
ls -al ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON} 2>/dev/null
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
done
echo "PLAYER.refresh DONE."

View File

@ -61,13 +61,13 @@ mkdir ~/.zen/tmp/${MOATS}
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/RSS
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/_${LAT}_${LON}/RSS/*.rss.json))
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/_${LAT}_${LON}/RSS/*.rss.json 2>/dev/null))
for RSSFILE in ${RSSFILES[@]}; do
cp ${RSSFILE} ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/RSS/
done
## COLLECT TW LINKS FOR SWARM
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/_${LAT}_${LON}/TW/*/index.html))
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/TW/${ZMAIL}

View File

@ -106,7 +106,7 @@ while true; do
## IPFS GET TO /swarm/${ipfsnodeid}
echo "GETTING ${nodeip} : /ipns/${ipfsnodeid}"
ipfs --timeout 360s get -o ~/.zen/tmp/swarm/_${ipfsnodeid}/ /ipns/${ipfsnodeid}/
ipfs --timeout 720s get -o ~/.zen/tmp/swarm/_${ipfsnodeid}/ /ipns/${ipfsnodeid}/
## SHOW WHAT WE GET
echo "__________________________________________________"