better stronger

This commit is contained in:
fred 2021-08-11 00:08:27 +02:00
parent 0b8af7a8f6
commit 88a63ef16a
6 changed files with 53 additions and 9 deletions

View File

44
actions/view_count.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
MEDIAKEYIPNS="$1"
tempdir=$(mktemp -d)
cd $tempdir
## GET CURRENT DHT PROPAGATED VERSION
ipfs --timeout=10s get --output="$tempdir" /ipns/$MEDIAKEYIPNS
[[ ! $? == 0 ]] && echo "CANNOT GET MEDIAKEY" && exit 1
## GO INTO $G1PUB EXCHANGE SPACE
[[ ! -d ./$G1PUB ]] && mkdir $G1PUB
cd $G1PUB
## DO I OWN THE KEY, OR SHOUD I REQUEST IT
mediakeyid=$(cat ./*/.id)
if [[ ! $(ipfs key list -l | grep $mediakeyid) ]]; then
## SEND A MESSAGE ASKING FOR THE KEY (I am a bootstrap or http gateway)
for sharedowners in $(ls -d */ | cut -d '/' -f 1); do
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "$sharedowners" -t "MEDIAKEY ask for sharing contract" -m "I was wishing to increment $mediakeyid views, but not in your contracts yet. Please send me your ./ipfs/keystore/$MEDIAKEYIPNS to activate."
done
exit 1
fi
## INCREMENT COUNTER
count=$(cat .views.counter 2>/dev/null) || count=0
echo $((count+1)) > .views.counter
## PUBLISH NEW STATE
I=$(ipfs add -qrH ./ | tail -n 1)
echo "CHAIN: $I"
echo $I > .chain
echo "${mediakeyid} NAME PUBLISHING "
# MEDIAKEY IPNS name publish
J=$(ipfs name publish --quieter -k ${mediakeyid} /ipfs/${I})
echo "$id VIEW COUNTER UPDATED in https://tube.copylaradio.com/ipns/$J/$G1PUB/.views.counter"

View File

@ -185,12 +185,12 @@ fi
##################################################################
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
## SYNC GCHANGE EVERY 2 hours runtime
[[ $(($runtime % 97)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh
[[ $(($runtime % 97)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt
## SYNC SWARM EVERY 20 mn runtime
[[ $(($runtime % 17)) == 0 ]] && $MY_PATH/zen/gchange_IPFS_swarm.sh
[[ $(($runtime % 17)) == 0 ]] && $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt
# QUICK SYNC SWARM EVERY 12 minutes
[[ $(($runtime % 11)) == 0 ]] && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh
[[ $(($runtime % 11)) == 0 ]] && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_FRIENDS_refresh.txt
## TODO ACTIVATE/DESACTIVATE LOG
########################################################################
# ACTIVATE ~/astroport directory monitoring (xbian only)
########################################################################

View File

@ -6,7 +6,7 @@ require_once('functions.php');
$videosList = array();
exec("/bin/bash -c './get_astrxbian_index.sh F'", $videos);
exec("/bin/bash -c './check_my_wallet.sh'", $gg1);
exec("/bin/bash -c '/home/fred/.zen/astrXbian/actions/check_my_wallet.sh'", $gg1);
$videos = array_reverse($videos);
// ## film;MDan5TDuT-0;;Le Manuel de Survie en Dictature v1.1 au format papier;;["onelove"];k51qzi5uqu5dl0hnglpzumjezep2avacrtbx7i15v91elcxac4cpd8290kl1hq;720p;/ipfs/QmZp63RXhLm6QASmw1t2R8fu5waSJFmyW7cmdVNxyuJXzg/MDan5TDuT-0_Le%20Manuel%20de%20Survie%20en%20Dictature%20v1.1%20au%20format%20papier.mp4

View File

@ -103,7 +103,6 @@ do
<head>
<title>$TITLE in Astroport</title>
<meta charset=\"UTF-8\">
<meta http-equiv=\"Refresh\" content=\"10;URL=https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/\">
<link rel='stylesheet' href='/crowdbunker.css' type='text/css' />
<link rel='icon' type='image/png' href='/astrocrowdbunker.png' />
<script type='text/javascript' src='/g1scan_fichiers/adapter.js'></script>
@ -125,7 +124,7 @@ do
<video id='preview' autoplay='autoplay' style='transform: scaleX(-1);' class='active'></video>
</div>
<br>SCANNEZ LE QR CODE DE VOTRE G1 PORTEFEUILLE... <a href='https://cesium.app'>Ouvrez un portefeuille</a><br>
<h1 class='video-title'>Bienvenue sur le Live TEstNET <a href='https://copylaradio.com'>astrXbian</a> démo de lecture vidéo dans 10s</h1>
<h1 class='video-title'>Cliquez sur <a href='https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/'>ce lien de lecture vidéo streaming</a> depuis une Station Bootstrap</h1>
</article>
</main>
<center><br>Service Video Club / Datacenter P2P Libre et Légal.<br>
@ -163,7 +162,7 @@ do
echo "<!DOCTYPE html>
<html>
<head>
<title>$TITLE in Astroport</title>
<title>$TITLE in Astroport served by $G1PUB</title>
<meta charset=\"UTF-8\">
<link rel='stylesheet' href='/crowdbunker.css' type='text/css' />
<link rel='icon' type='image/png' href='/astrocrowdbunker.png' />
@ -182,7 +181,8 @@ do
<$HTMLTAG controls>
<source src=\"$TUBELINK\" type=\"$MIMETYPE\">
</$HTMLTAG>
<h1 class='video-title'>$TITLE (lien station <a href=\"$LOCALTUBELINK\">$MIMETYPE)</a></h1>
<h1 class='video-title'>$TITLE (lien depuis Station locale <a href=\"$LOCALTUBELINK\">$MIMETYPE)</a></h1>
<h1 class='video-title'><a target='google' href='https://www.google.com/search?q=Comment%20installer%20IPFS''>Comment installer IPFS</a> ?</h1>
</article>
</main>
<center><br>Ce media possède un G1 portefeuille avec lequel il paye son hébergement.