forked from axiom-team/astrXbian
Compare commits
53 Commits
74e478feda
...
9188290831
Author | SHA1 | Date |
---|---|---|
fred | 9188290831 | |
fred | d5ef6a13cc | |
fred | f591f167c1 | |
fred | 9c8f268652 | |
fred | 769d7792c5 | |
fred | c6eff38460 | |
fred | a56adbc487 | |
fred | 9734de08b5 | |
fred | a3dfbe8bf5 | |
fred | 6702aba80e | |
fred | 450ac35d0e | |
fred | db73d66cf1 | |
fred | 1936c6f847 | |
fred | 13820563c1 | |
fred | e9c7219fd0 | |
fred | 2a4eeb914a | |
fred | 8661212506 | |
fred | d4b62d18d0 | |
fred | 299e6d8362 | |
fred | 2c9b05e837 | |
fred | 621da3e18c | |
fred | ff2b35dd30 | |
fred | 1fd00748c1 | |
fred | 2f30a168c5 | |
fred | 0cf824a5f2 | |
fred | 0e1c331f72 | |
fred | 155d174e35 | |
fred | e97b83848e | |
fred | b949ef6dbb | |
fred | 1623b9a892 | |
fred | ea1fd0a09d | |
fred | dba5dc516d | |
fred | 34e5862878 | |
fred | 4835b4831d | |
fred | ea70e9fe3c | |
fred | 9840c45a59 | |
fred | 1845e377dd | |
fred | 731917b876 | |
fred | ed8d25d01c | |
fred | 64f9cce4f5 | |
fred | 8ba4d2df4d | |
fred | a877e12348 | |
fred | b3ca0400bb | |
fred | e21fca1d07 | |
fred | 47671bbd21 | |
fred | 5c193bfa86 | |
fred | d05c60d07d | |
fred | 294a6ae979 | |
fred | 7c71da2015 | |
fred | 82f51a45ba | |
fred | 19892fa79c | |
qo-op | 32447b4255 | |
fred | 97ce9d0be6 |
|
@ -13,7 +13,7 @@ server {
|
|||
index index.php index.html index.htm;
|
||||
location ~ \.php {
|
||||
try_files $uri index.php =404;
|
||||
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||
fastcgi_pass unix:/var/run/php/php-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
# Author: Astrocrew
|
||||
# Version: 0.1
|
||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||
########################################################################
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
ME="${0##*/}"
|
||||
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
|
||||
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 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
|
||||
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1
|
||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ "$IPFSNODEID" == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
|
||||
[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1
|
||||
|
||||
##############################################################"
|
||||
## DO NOT RECORD output.pdf, bu convert to jpg and link throug index.html REDIRECT
|
||||
##############################################################"
|
||||
|
||||
for pdflink in $(ls ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/*/bulle.pdf); do
|
||||
lid=$(echo $pdflink | cut -d '/' -f 11)
|
||||
## PDF convert and crop to JPG / ipfs add / index.html for redirect
|
||||
convert -density 200 -quality 80 $pdflink /tmp/bulle.jpg
|
||||
convert -crop 1260x420+55+30 /tmp/bulle.jpg /tmp/$lid.jpg
|
||||
|
||||
IPFS=$(ipfs add -wq "/tmp/$lid.jpg") ## Add $lid.pdf to IPFS
|
||||
IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) ## Get repertory ipfs link
|
||||
[[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && exit 1
|
||||
## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg
|
||||
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=/ipfs/$IPFSREPFILEID/$lid.jpg\"></head></html>" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
|
||||
# mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
|
||||
rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
|
||||
echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg"
|
||||
cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
|
||||
|
||||
done
|
||||
|
||||
exit 0
|
|
@ -15,6 +15,19 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PU
|
|||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ $IPFSNODEID == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
|
||||
[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1
|
||||
|
||||
|
||||
## INSTALL MISSING PACKAGES
|
||||
if [[ -f /etc/sudoers.d/apt ]]; then
|
||||
for i in chromium nmap httrack imagemagick; do
|
||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
sudo apt install -y $i
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No sudo access for apt install... Please correct situation"
|
||||
echo "PUT : $USER ALL=(ALL) NOPASSWD:/usr/bin/apt INTO /etc/sudoers.d/apt (use sudo visudo)"
|
||||
exit 1
|
||||
fi
|
||||
##############################################################"
|
||||
## Backing up europa p4n collected spots from collective intelligence ##
|
||||
# SWARM is collectively PLAYing bataille navale
|
||||
|
@ -75,19 +88,21 @@ fi
|
|||
##############################################################"
|
||||
## GEODATA. continue. Let's extract lieu pdf from my spot
|
||||
##############################################################"
|
||||
geodata=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null | tail -n 1)
|
||||
geosrc=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null)
|
||||
geodata=$(echo "$geosrc" | tail -n 1)
|
||||
ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2)
|
||||
|
||||
if [[ "$ipfsnodeid" != "$IPFSNODEID" ]]; then
|
||||
echo "This spot.json is already managed by $ipfsnodeid"
|
||||
echo "getting one for mine"
|
||||
echo "This spot.json is managed by
|
||||
$geosrc"
|
||||
echo "getting geodata from one of mine"
|
||||
geodata=$(ls ~/.zen/ipfs/.*/astroport/map/*.*/p4n/spot.json | shuf | tail -n 1)
|
||||
fi
|
||||
|
||||
[[ $geodata ]] && ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) || exit 1
|
||||
|
||||
## SUB-SCRAPE SOME of my p4n/spot.json RANDOM "lieu"
|
||||
echo "SUB-SCRAPING lieu FROM /astroport/map/$lat.$lon/p4n/spot.json"
|
||||
echo "SUB-SCRAPING lieu FROM $geodata"
|
||||
|
||||
loop=1
|
||||
while [ $loop -lt 21 ]; do
|
||||
|
@ -108,28 +123,39 @@ echo "SUB-SCRAPING lieu FROM /astroport/map/$lat.$lon/p4n/spot.json"
|
|||
[ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
|
||||
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
|
||||
|
||||
[[ "$lid" == "" ]] && continue
|
||||
[[ "$lid" == "" ]] && echo "ERROR LIEU NO ID. CONTINUE" && continue
|
||||
|
||||
if [[ $(which chromium) ]]; then
|
||||
mkdir -p /tmp/$lid && cd /tmp/$lid
|
||||
echo "Downloading https://www.park4night.com/?page=lieu&id=$lid&bulle=YES"
|
||||
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code
|
||||
echo "id,latitude,longitude,hauteur_limite,publique,top_liste,code,validation_admin,distance" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
|
||||
echo "$lieu" >> ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
|
||||
|
||||
[ ! -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ] && chromium --timeout=30000 --headless --no-sandbox --disable-gpu --print-to-pdf=output.pdf "https://www.park4night.com/?page=lieu&id=$lid&bulle=YES" 2>/dev/null
|
||||
[ ! -f ./output.pdf ] && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid
|
||||
[ -f ./output.pdf ] && mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
|
||||
mkdir -p /tmp/$lid && cd /tmp/$lid
|
||||
echo "Downloading https://www.park4night.com/?page=lieu&id=$lid&bulle=YES"
|
||||
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code
|
||||
echo "id,latitude,longitude,hauteur_limite,publique,top_liste,code,validation_admin,distance" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
|
||||
echo "$lieu" >> ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
|
||||
cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
|
||||
|
||||
echo "~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.png"
|
||||
sleep $((1 + RANDOM % 2))
|
||||
cd - && rm -Rf /tmp/$lid
|
||||
# Get 1st copy bulle.pdf... Now converting to index.html redirect to $lid.jpg
|
||||
[ -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ] && mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ./output.pdf && echo "ancien fichier bulle.pdf"
|
||||
[ ! -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html ] && echo "running chromium... " && chromium --timeout=10000 --headless --no-sandbox --disable-gpu --print-to-pdf=output.pdf "https://www.park4night.com/?page=lieu&id=$lid&bulle=YES" 2>/dev/null
|
||||
[ ! -f ./output.pdf ] && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && echo "## CHROMIUM TIMEOUT, CANCEL MISSION" && continue
|
||||
|
||||
# TODO FUTURE BATCH to convert & crop to jpg image (imagemagick)
|
||||
# convert -density 300 -depth 8 -quality 90 -trim ./output.pdf ./output.jpg
|
||||
else
|
||||
sudo apt-get install chromium -y
|
||||
## PDF convert and crop to JPG / ipfs add / index.html for redirect
|
||||
if [ -f ./output.pdf ]; then
|
||||
convert -density 200 -quality 80 ./output.pdf ./bulle.jpg
|
||||
convert -crop 1260x420+55+30 ./bulle.jpg ./$lid.jpg
|
||||
|
||||
IPFS=$(ipfs add -wq "./$lid.jpg") && echo "## Added $lid.pdf to IPFS: $IPFS"
|
||||
IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) && echo "## Repertory $IPFSREPFILEID"
|
||||
[[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && rm -Rf /tmp/$lid && loop=$(($loop+1)) && continue
|
||||
## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg
|
||||
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=/ipfs/$IPFSREPFILEID/$lid.jpg\"></head></html>" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
|
||||
# mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
|
||||
rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
|
||||
echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg"
|
||||
fi
|
||||
|
||||
sleep $((1 + RANDOM % 2))
|
||||
cd - && rm -Rf /tmp/$lid
|
||||
|
||||
loop=$(($loop+1));
|
||||
done
|
||||
|
||||
|
|
|
@ -28,12 +28,13 @@ ME="${0##*/}"
|
|||
[[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1
|
||||
|
||||
URL="$1"
|
||||
[ $URL ] && echo "URL: $URL" && REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"\
|
||||
&& IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Choisissez comment copier cette source" --entry-text="Video" MP3 Web) \
|
||||
&& [[ $IMPORT == "Video" ]] && IMPORT="Youtube" \
|
||||
&& CHOICE="$IMPORT"
|
||||
|
||||
|
||||
if [ $URL ]; then
|
||||
echo "URL: $URL"
|
||||
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
|
||||
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Choisissez comment copier cette source" --entry-text="Video" MP3 Web) || IMPORT="Youtube"
|
||||
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
|
||||
CHOICE="$IMPORT"
|
||||
fi
|
||||
|
||||
[[ $CHOICE == "Web" ]] && CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source WEB est à enregistrer comme " --entry-text="Page" WebSite)
|
||||
|
||||
|
@ -115,6 +116,8 @@ YTURL="$URL"
|
|||
[[ $YTURL == "" ]] && YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
|
||||
[[ $YTURL == "" ]] && exit 1
|
||||
|
||||
REVSOURCE="$(echo "$YTURL" | awk -F/ '{print $3}' | rev)_"
|
||||
|
||||
# Create TEMP directory to copy $YID_$TITLE.$FILE_EXT
|
||||
YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)"
|
||||
mkdir -p ${YTEMP}
|
||||
|
@ -126,7 +129,7 @@ echo "VIDEO $YTURL"
|
|||
--no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL
|
||||
|
||||
# Get filename, extract ID, make destination dir and move copy.
|
||||
YFILE=$(ls -t ${YTEMP} | head -n 1)
|
||||
YFILE=$(ls -S ${YTEMP} | head -n 1)
|
||||
FILE_NAME="$(basename "${YFILE}")"
|
||||
FILE_EXT="${FILE_NAME##*.}"
|
||||
|
||||
|
@ -140,7 +143,7 @@ TITLE="${YNAME%.*}"
|
|||
MEDIAKEY="YOUTUBE_${MEDIAID}"
|
||||
## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE
|
||||
|
||||
GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
|
||||
[ ! $2 ] && GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
|
||||
--text="Choisissez le(s) genre(s) d'information(s) contenue(s) dans cette vidéo \"${TITLE}\" publiée sur OASIS" \
|
||||
--column="Use" \
|
||||
--column="Feature" \
|
||||
|
@ -157,7 +160,7 @@ GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
|
|||
FALSE Humain \
|
||||
FALSE Animal \
|
||||
TRUE Eveil \
|
||||
TRUE ${AXID// /-})
|
||||
TRUE ${AXID// /-}) || GENRES="${AXID// /-}"
|
||||
|
||||
# FORMAT GENRES genre1|genre2|genre3
|
||||
|
||||
|
@ -174,7 +177,7 @@ RES=${FILE_RES%?}0p
|
|||
|
||||
## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json
|
||||
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
||||
echo "youtube;${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
echo "youtube;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
|
||||
# _IPFSREPFILEID_ is replaced later
|
||||
|
||||
|
@ -188,10 +191,19 @@ rm -Rf ${YTEMP}
|
|||
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal'
|
||||
|
||||
## httrack all web site
|
||||
## wget current URL -> index.html ## TEST ## TEST httrack ??
|
||||
[[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1
|
||||
echo "httrack --mirror $URL"
|
||||
exit 0
|
||||
FILE_NAME="index.html"
|
||||
REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6"
|
||||
MEDIAID="$REVSOURCE" # MEDIAID=1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
|
||||
MEDIAKEY="PAGE_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
|
||||
FILE_PATH="$HOME/astroport/web/$MEDIAID";
|
||||
mkdir -p $FILE_PATH
|
||||
wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/${FILE_NAME}
|
||||
|
||||
echo "web;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
|
||||
;;
|
||||
|
||||
|
||||
|
@ -201,7 +213,7 @@ rm -Rf ${YTEMP}
|
|||
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal'
|
||||
|
||||
## record one page only
|
||||
## record one page to PDF
|
||||
[[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
|
||||
cd /tmp/ && rm output.pdf && chromium --headless --no-sandbox --print-to-pdf $URL
|
||||
|
||||
|
@ -211,11 +223,11 @@ rm -Rf ${YTEMP}
|
|||
|
||||
MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)"
|
||||
MEDIAKEY="PAGE_${MEDIAID}"
|
||||
FILE_PATH="$HOME/astroport/youtube/$MEDIAID"
|
||||
FILE_PATH="$HOME/astroport/page/$MEDIAID"
|
||||
mkdir -p ${FILE_PATH} && mv -f output.pdf ${FILE_PATH}/${FILE_NAME}
|
||||
|
||||
|
||||
echo "page;${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
echo "page;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
|
||||
;;
|
||||
|
||||
|
@ -521,7 +533,7 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N
|
|||
########################################################################
|
||||
MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY)
|
||||
|
||||
zenity --width=500 --height=500 --text-info \
|
||||
[ ! $2 ] && zenity --width=500 --height=500 --text-info \
|
||||
--title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \
|
||||
--html \
|
||||
--url="http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \
|
||||
|
@ -535,7 +547,7 @@ FILE_SIZE=$(echo "${FILE_SIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; w
|
|||
|
||||
G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1)
|
||||
if [[ $G1BALANCE -gt 0 ]]; then
|
||||
G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="")
|
||||
[ ! $2 ] && G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="")
|
||||
[[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0
|
||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON"
|
||||
ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1)
|
||||
|
@ -550,5 +562,7 @@ cat /tmp/${MEDIAKEY}.log
|
|||
rm -f /tmp/${MEDIAKEY}.pass
|
||||
rm -f /tmp/${MEDIAKEY}.dunikey ## REMOVE KEYS
|
||||
|
||||
[ $? == 0 ] && zenity --warning --width 300 --text "OK! MEDIA transféré ($ZENBALANCE ZEN). URL LOCALHOST prête à coller (/tmp/${MEDIAKEY}.log)" && exit 0 \
|
||||
|| zenity --warning --width 300 --text "Désolé une erreur est survenue... LOG: cat /tmp/${MEDIAKEY}.log" && exit 1
|
||||
if [ ! $2 ]; then
|
||||
[ $? == 0 ] && zenity --warning --width 300 --text "OK! MEDIA transféré ($ZENBALANCE ZEN). URL LOCALHOST prête à coller (/tmp/${MEDIAKEY}.log)" && exit 0 \
|
||||
|| zenity --warning --width 300 --text "Désolé une erreur est survenue... LOG: cat /tmp/${MEDIAKEY}.log" && exit 1
|
||||
fi
|
||||
|
|
|
@ -20,7 +20,7 @@ source $HOME/.profile
|
|||
|
||||
#### CONTROL STATION IPFS DAEMON
|
||||
## timeout is fixing ipfs minimum response time, before considering stuck process
|
||||
IPFSNODEID=$(ipfs --timeout=10s id -f='<id>\n')
|
||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
||||
[[ ! $IPFSNODEID && -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING" && sudo systemctl restart ipfs && exit 1
|
||||
[[ ! $IPFSNODEID && "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && sudo service ipfs restart && exit 1
|
||||
## CONTROL IPFS IS RUNNING OR RESTART
|
||||
|
@ -191,16 +191,47 @@ fi
|
|||
##################################################################
|
||||
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
|
||||
## SYNC GCHANGE EVERY 12 hours runtime
|
||||
[[ $(($runtime % 725)) == 0 || "$runtime" == "5" ]] && $MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt
|
||||
## SYNC SWARM EVERY 6h runtime
|
||||
[[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]] && $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt
|
||||
# QUICK SYNC SWARM EVERY 30 minutes
|
||||
## CLEAN OLD SESSION
|
||||
if [[ $(($runtime % 30)) == 0 ]]; then
|
||||
kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
||||
if [[ $(($runtime % 725)) == 0 || "$runtime" == "5" ]]; then
|
||||
kill -9 $(ps auxf --sort=+utime | grep -w gchange_INIT.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_INIT.sh"
|
||||
$MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt
|
||||
fi
|
||||
# If NEW ~/.ipfs/config.new => restarting IPFS daemon
|
||||
if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) ]]; then
|
||||
cp ~/.ipfs/config.new ~/.ipfs/config
|
||||
[[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && exit 0
|
||||
[[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0
|
||||
fi
|
||||
|
||||
## RESHAPE IPFS FRIENDS SWARM
|
||||
if [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]]; then
|
||||
kill -9 $(ps auxf --sort=+utime | grep -w gchange_IPFS_swarm.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_IPFS_swarm.sh"
|
||||
$MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt
|
||||
fi
|
||||
# SYNC IPFS FRIENDS SWARM
|
||||
if [[ $(($runtime % 25)) == 0 ]]; then
|
||||
kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING p4n.swarmscraper.sh"
|
||||
killall chromium
|
||||
$MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt
|
||||
fi
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# _________ ______
|
||||
# ____ ___ ____ /_ __/ | / ____/
|
||||
# /_ / / _ \/ __ \ / / / /| |/ / __
|
||||
# / /_/ __/ / / / / / / ___ / /_/ /
|
||||
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
||||
#
|
||||
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
|
||||
if [[ $(($runtime % 7)) == 0 ]]; then
|
||||
|
||||
#### Refresh & publish MEDIAKEYs
|
||||
$MY_PATH/zen/ipns_TAG_refresh.sh > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipns_TAG_refresh.txt
|
||||
|
||||
## REINIT dead swarm STATIONS
|
||||
rm -f ~/.zen/A_dead_swarm.txt
|
||||
fi
|
||||
|
||||
## TODO ACTIVATE/DESACTIVATE LOG
|
||||
########################################################################
|
||||
# ACTIVATE ~/astroport directory monitoring (xbian only)
|
||||
|
@ -226,28 +257,6 @@ fi
|
|||
|
||||
##########################################################
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# _________ ______
|
||||
# ____ ___ ____ /_ __/ | / ____/
|
||||
# /_ / / _ \/ __ \ / / / /| |/ / __
|
||||
# / /_/ __/ / / / / / / ___ / /_/ /
|
||||
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
||||
#
|
||||
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
|
||||
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || "$timebar" == "03:03" || $(($runtime % 720)) == 0 || $runtime == 12 ]]; then
|
||||
|
||||
#### Refresh & publish MEDIAKEYs
|
||||
$MY_PATH/zen/ipns_TAG_refresh.sh
|
||||
|
||||
## REINIT dead swarm STATIONS
|
||||
rm -f ~/.zen/A_dead_swarm.txt
|
||||
fi
|
||||
|
||||
# At 03:03 and every 6h runtime restarting IPFS daemon
|
||||
[[ "$timebar" == "03:03" || $(($runtime % 363)) == 0 ]] && [[ -f ~/.ipfs/config.new ]] && cp ~/.ipfs/config.new ~/.ipfs/config
|
||||
[[ "$timebar" == "03:03" || $(($runtime % 363)) == 0 ]] && [[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && exit 0
|
||||
[[ "$timebar" == "03:03" || $(($runtime % 363)) == 0 ]] && [[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0
|
||||
|
||||
##################################################################
|
||||
##################################################################
|
||||
|
@ -275,6 +284,10 @@ echo '
|
|||
youtube-dl -U
|
||||
|
||||
|
||||
### INDEX DATA MIGRATION SCRIPTS
|
||||
$MY_PATH/actions/p4n.data_evolution.sh &
|
||||
## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE.
|
||||
|
||||
##################################################################
|
||||
if [[ $dayoftheweek == 1 ]]; then
|
||||
# EVERY MONDAY
|
||||
|
|
|
@ -27,6 +27,12 @@ for i in build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vl
|
|||
fi
|
||||
done
|
||||
|
||||
## Correct PDF restrictions for imagemagick
|
||||
if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then
|
||||
cat /etc/ImageMagick-6/policy.xml | grep -Ev PDF > /tmp/policy.xml
|
||||
sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml
|
||||
fi
|
||||
|
||||
[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y
|
||||
sudo apt-get install python3-opencv -y ## INSTALLATION IA par reconnaissance d'images
|
||||
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils xclip zenity handbrake* -y
|
||||
|
|
|
@ -26,4 +26,4 @@ default 120x 90 Large Preview
|
|||
*/
|
||||
|
||||
define('YOUTUBE_THUMB', 'https://i.ytimg.com/vi/%s/mqdefault.jpg');
|
||||
define ('MEDIAQR','https://'.HOST.'/ipns/%s/QR.png');
|
||||
define ('MEDIAQR','https://'.$_SERVER['SERVER_NAME'].'/ipns/%s/QR.png');
|
||||
|
|
|
@ -7,7 +7,7 @@ $videosList = array();
|
|||
|
||||
// HOWTO PASS Query parameters to exec ?
|
||||
exec("/bin/bash -c './get_astrxbian_index.sh F'", $videos);
|
||||
exec("/bin/bash -c './check_my_wallet.sh'", $gg1);
|
||||
// exec("/bin/bash -c './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
|
||||
|
@ -17,8 +17,8 @@ foreach ($videos as $v) {
|
|||
list($a, $youtubeID, $c, $videoName, $e, $src, $h, $quality, $videoURI) = explode(";", $v);
|
||||
|
||||
|
||||
$videoURL = 'https://'. HOST. $videoURI;
|
||||
$videoEco = 'https://'. HOST. '/ipns/' . $h;
|
||||
$videoURL = 'https://'. $_SERVER['SERVER_NAME']. $videoURI;
|
||||
$videoEco = 'https://'. $_SERVER['SERVER_NAME']. '/ipns/' . $h;
|
||||
$mimeType = guessTypeFromFilename($videoURI);
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ foreach ($videos as $v) {
|
|||
?><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Astro CLUB - <?php echo $gg1[0]; ?> JUNE</title>
|
||||
<title>Astro CLUB </title>
|
||||
<link rel="stylesheet" href="/ipfs/QmPC5MTqt4do7emMUV4z7feYbjSGoX4kdDYVKB6jU3rEKk/crowdbunker.css" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="./astrocrowdbunker.png" />
|
||||
</head>
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TITLE} in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/${IPNSLINK}/${G1PUB}/">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
<title>${TITLE} in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="Refresh" content="7;URL=/ipns/${IPNSLINK}/${G1PUB}/">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h6>
|
||||
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
<h6>
|
||||
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
</header>
|
||||
<main>
|
||||
<article>
|
||||
|
||||
<h1>${TITLE}</h1>
|
||||
|
||||
<p>Lancement de la video dans 7 secondes...</p>
|
||||
|
||||
<p class="pubkey-and-copy-button">
|
||||
Ce fichier vous est servi par une station amie. Faites lui un don pour la remercier :
|
||||
<input type="text" id="pubkey" readonly value="${G1PUB}" />
|
||||
<button id="copy">Tip !</button>
|
||||
</p>
|
||||
|
||||
<p id="successMsg">
|
||||
La clef de la station amie est maintenant copiée dans le presse-papier. Vous pouvez la coller dans le client Ğ1 de votre choix (Cesium par exemple) afin de faire votre don 😉
|
||||
</p>
|
||||
<script>
|
||||
function copy() {
|
||||
|
||||
var copyText = document.querySelector("input#pubkey");
|
||||
copyText.select();
|
||||
document.execCommand("copy");
|
||||
<h1>${TITLE}</h1>
|
||||
|
||||
var successMsg = document.querySelector("#successMsg");
|
||||
successMsg.style.opacity = "1";
|
||||
<p>Lancement de la video dans 7 secondes...</p>
|
||||
|
||||
var copyButton = document.querySelector("button#copy");
|
||||
copyButton.style.animation = "none";
|
||||
|
||||
}
|
||||
<p class="pubkey-and-copy-button">
|
||||
Ce fichier vous est servi par une station amie. Faites lui un don pour la remercier :
|
||||
<input type="text" id="pubkey" readonly value="${G1PUB}" />
|
||||
<button id="copy">Tip !</button>
|
||||
</p>
|
||||
|
||||
<p id="successMsg">
|
||||
La clef de la station amie est maintenant copiée dans le presse-papier. Vous pouvez la coller dans le client Ğ1 de votre choix (Cesium par exemple) afin de faire votre don 😉
|
||||
</p>
|
||||
<script>
|
||||
function copy() {
|
||||
|
||||
var copyText = document.querySelector("input#pubkey");
|
||||
copyText.select();
|
||||
document.execCommand("copy");
|
||||
|
||||
var successMsg = document.querySelector("#successMsg");
|
||||
successMsg.style.opacity = "1";
|
||||
|
||||
var copyButton = document.querySelector("button#copy");
|
||||
copyButton.style.animation = "none";
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.querySelector("button#copy").addEventListener("click", copy);
|
||||
</script>
|
||||
document.querySelector("button#copy").addEventListener("click", copy);
|
||||
</script>
|
||||
</article>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TITLE} in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
<title>${TITLE} in Astroport</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
|
||||
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h6>
|
||||
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
<h6>
|
||||
<a href='/ipns/${IPFSNODEID}/.${IPFSNODEID}/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
|
||||
</h6>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<article>
|
||||
<video autoplay="autoplay" controls>
|
||||
<source src="/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}">
|
||||
<a href="/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}">${TITLE}</a>
|
||||
</video>
|
||||
<article>
|
||||
<video autoplay="autoplay" controls>
|
||||
<source src="/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}">
|
||||
<a href="/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}">${TITLE}</a>
|
||||
</video>
|
||||
|
||||
<h1 class="video-title">
|
||||
${TITLE}
|
||||
</h1>
|
||||
</article>
|
||||
<h1 class="video-title">
|
||||
${TITLE}
|
||||
</h1>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -125,7 +125,7 @@ do
|
|||
find /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/ -empty -type d -delete;
|
||||
################################################################
|
||||
echo "OK Friend SWARM REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/"
|
||||
ipfs --timeout=60s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
|
||||
ipfs --timeout=120s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
|
||||
################################################################
|
||||
if [ $? != 0 ];
|
||||
then
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
ME="${0##*/}"
|
||||
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
|
||||
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
|
||||
|
||||
########################################################################
|
||||
# \\///
|
||||
|
@ -14,11 +16,9 @@ ME="${0##*/}"
|
|||
############# '$MY_PATH/$ME'
|
||||
########################################################################
|
||||
# ex: ./'$ME'
|
||||
# SYNC IPFS SWARM PEERS SHARED DATA .12D3KooW****
|
||||
########################################################################'
|
||||
|
||||
########################################################################
|
||||
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info
|
||||
########################################################################
|
||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
||||
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
|
||||
|
@ -26,9 +26,12 @@ IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
|||
[[ ! -f ~/.zen/secret.dunikey ]] && exit 1
|
||||
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
########################################################################
|
||||
|
||||
echo "## FRIENDS IPFS PINGing"
|
||||
for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done
|
||||
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
|
||||
########################################################################
|
||||
XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
|
||||
# echo "## FRIENDS IPFS PINGing"
|
||||
# for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done
|
||||
|
||||
|
||||
echo "
|
||||
|
@ -43,39 +46,53 @@ echo "I am /ipns/$IPFSNODEID controling and refreshing my MEDIAKEY IPNS"
|
|||
########################################################################
|
||||
# REFRESH IPNS SELF PUBLISH
|
||||
########################################################################
|
||||
~/.zen/astrXbian/zen/ipns_self_publish.sh
|
||||
# ~/.zen/astrXbian/zen/ipns_self_publish.sh
|
||||
########################################################################
|
||||
|
||||
count=0
|
||||
[[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/ ]] && exit 0
|
||||
# [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/ ]] && exit 0
|
||||
|
||||
## TAKE CARE OF MY KEY
|
||||
for mediakey in $(ls ~/.zen/ipfs/.${IPFSNODEID}/KEY/); # Alternative search
|
||||
for mediakey in $(ls ~/.zen/ipfs/.${IPFSNODEID}/KEY/ 2>/dev/null | shuf ); # Alternative search
|
||||
do
|
||||
[[ "${mediakey}" == "" ]] && continue ## prevent empty mediakey
|
||||
[[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0
|
||||
# [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0
|
||||
IPNSLINK=$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1)
|
||||
[[ "${IPNSLINK}" == "" ]] && continue ## prevent empty IPNSLINK
|
||||
echo "We are refreshing http://127.0.0.1:8181/ipns/${IPNSLINK}"
|
||||
count=$((count+1)) && echo "$count) "
|
||||
FILE_NAME=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filename)
|
||||
TITLE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.title)
|
||||
|
||||
## REFRESH MORE THAN 6 HOURS TIMESTAMP KEY
|
||||
TIMESTAMP=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.timestamp) # INITIAL TIMESTAMP
|
||||
[[ -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/.timestamp ]] && TIMESTAMP=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/.timestamp) # LAST REFRESH
|
||||
timestamp=$(date -u +%s%N | cut -b1-13)
|
||||
STAMPDIFF=$((timestamp - TIMESTAMP))
|
||||
echo "Last Update : $(date -d @$TIMESTAMP)"
|
||||
echo "${mediakey} LAST UPDATED $STAMPDIFF milliseconds AGO"
|
||||
[ $STAMPDIFF -lt 21600000 ] && continue # 6h = 21600000 ms , 10h = 36000000 ms
|
||||
|
||||
source=$(echo $mediakey | cut -d '_' -f 1)
|
||||
|
||||
ANNONCE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.gchange.ad)
|
||||
ANNONCE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.gchange.ad 2>/dev/null)
|
||||
|
||||
## Use natools to decrypt "/tmp/${mediakey}_filelink.txt
|
||||
[[ -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filelink.natools.encrypt ]] && $MY_PATH/tools/natools.py decrypt -f pubsec -k "$HOME/.zen/secret.dunikey" -i "$HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filelink.natools.encrypt" -o "/tmp/${mediakey}_filelink.txt"
|
||||
# file=$(cat /tmp/${mediakey}_filelink.txt | rev | cut -d '/' -f 1 | rev)
|
||||
URLENCODE_FILE_NAME=$(cat /tmp/${mediakey}_filelink.txt | rev | cut -d '/' -f 1 | rev | jq -Rr @uri)
|
||||
IPFSREPFILEID=$(cat /tmp/${mediakey}_filelink.txt | rev | cut -d '/' -f 2- | rev | cut -d '/' -f 3)
|
||||
|
||||
echo "IPFS MEDIA link : /ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME"
|
||||
|
||||
## TREAT OLD DATA from new_file_in_astroport.sh (LATER can be removed)
|
||||
if [[ ! -f $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/MEDIAPUBKEY ]]; then
|
||||
if [[ ! -f $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/content.json && -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/video.json ]]; then
|
||||
mediakeyfile=$($MY_PATH/tools/give_me_keystore_filename.py $mediakey)
|
||||
$MY_PATH/tools/natools.py privkey -f ipfs-keystore -k $HOME/.ipfs/keystore/$mediakeyfile -F pubsec -o /tmp/${mediakey}.dunikey
|
||||
# PubFromDunikey=$(cat /tmp/${mediakey}.dunikey | grep "sec" | cut -d ' ' -f2 | base58 -d | tail -c+33 | base58)
|
||||
PubFromDunikey=$(cat /tmp/${mediakey}.dunikey | grep "pub" | cut -d ' ' -f2)
|
||||
echo "$PubFromDunikey" > $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/MEDIAPUBKEY
|
||||
fi
|
||||
|
||||
MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/MEDIAPUBKEY)
|
||||
echo "MEDIA G1 WALLET = $MEDIAPUBKEY"
|
||||
BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p ${MEDIAPUBKEY}) && [[ $BALANCE == null || "$BALANCE" == "" ]] && BALANCE=0
|
||||
|
@ -84,15 +101,24 @@ do
|
|||
TUBELINK="https://tube.copylaradio.com$(cat /tmp/${mediakey}_filelink.txt)"
|
||||
LOCALTUBELINK="http://127.0.0.1:8181$(cat /tmp/${mediakey}_filelink.txt)"
|
||||
|
||||
### IPNS LINK CAN EVOLVE (REFRESH EVERY 12 H TO MAINTAIN ALIVE IN THE SWARM) # TODO : Use templating
|
||||
### This index.html is ipns link root, 1st welcome page for MEDIAKEY -> *** Redirect to CONTRACTS processing HERE ***
|
||||
|
||||
### IPNS LINK CAN EVOLVE (REFRESH EVERY 12 H TO MAINTAIN ALIVE IN THE SWARM)
|
||||
### This index.html is ipns link root, 1st welcome page for MEDIAKEY -> *** Redirect to CONTRACTS or LOGIN processing HERE ***
|
||||
|
||||
echo "=======> Mediakey Welcome index.html
|
||||
IPNSLINK=$IPNSLINK
|
||||
IPFSNODEID=$IPFSNODEID
|
||||
XZUID=$XZUID
|
||||
G1PUB=$G1PUB
|
||||
TITLE=$TITLE"
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \
|
||||
| sed "s/\${IPNSLINK}/$IPNSLINK/g" \
|
||||
| sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${G1PUB}/$G1PUB/g" \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html
|
||||
|
||||
[ ! -s ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html ] && echo "Problem creating ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html. EXIT" && exit 1
|
||||
|
||||
########################################################################
|
||||
### Scenario are G1PUB subdivized. Thus each friend can establish own contract
|
||||
|
@ -115,12 +141,14 @@ do
|
|||
[[ "$FILETYPE" == "mkv" ]] && MIMETYPE="video/x-matroska"
|
||||
[[ "$FILETYPE" == "mp3" ]] && MIMETYPE="audio/mpeg" && HTMLTAG="audio"
|
||||
|
||||
echo "=======> Mediakey Contract index.html "
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
|
||||
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
| sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
|
||||
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html
|
||||
|
||||
|
||||
if [[ "$source" == "YOUTUBE" ]]
|
||||
|
@ -166,10 +194,12 @@ do
|
|||
# KEY ZenTag IPNS name publish
|
||||
J=$(ipfs name publish --quieter -k ${mediakey} /ipfs/${I})
|
||||
|
||||
echo "$id REFRESHED https://tube.copylaradio.com/ipns/$J"
|
||||
echo "$id REFRESHED ${I}
|
||||
https://tube.copylaradio.com/ipns/$J
|
||||
http://127.0.0.1:8181/ipns/$J"
|
||||
########################################################################
|
||||
########################################################################
|
||||
|
||||
break ## ONE BY ONE (cron_MINUTE.sh task every 7 mn)
|
||||
done
|
||||
|
||||
########################################################################
|
||||
|
@ -178,12 +208,12 @@ done
|
|||
## Then refresh MEDIAKEY IPNS/IPFS RELATION
|
||||
## CORRECT ISSUE : https://git.p2p.legal/axiom-team/astrXbian/issues/25
|
||||
########################################################################
|
||||
for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do
|
||||
for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK 2>/dev/null | shuf ); do
|
||||
ipnsid=$(cat $ipnslink)
|
||||
ipfsid=$(echo $ipnslink | cut -d '/' -f 6)
|
||||
mediakey=$(cat ~/.zen/PIN/${ipfsid}/MEDIAKEY)
|
||||
|
||||
[[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0
|
||||
# [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0
|
||||
|
||||
[[ ! $(ipfs key list | grep ${mediakey}) ]] && echo "ERROR MISSING MEDIAKEY" && continue
|
||||
|
||||
|
@ -192,13 +222,30 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK); do
|
|||
echo "${mediakey} GET IPNS"
|
||||
ipfs get -o /tmp/${mediakey} /ipns/$ipnsid
|
||||
[ $? -ne 0 ] && continue
|
||||
echo "ADD TO IPFS"
|
||||
[ ! -s /tmp/${mediakey}/index.html ] && continue ## DO NOT REPUBLISH empty index.html
|
||||
|
||||
## REFRESH MORE THAN 6 HOURS TIMESTAMP KEY
|
||||
TIMESTAMP=$(cat /tmp/${mediakey}/.timestamp 2>/dev/null) # LAST REFRESH
|
||||
[[ ! $TIMESTAMP ]] && TIMESTAMP=$(cat /tmp/${mediakey}/*/.timestamp 2>/dev/null | tail -n 1 ) # INITIAL TIMESTAMP
|
||||
timestamp=$(date -u +%s%N | cut -b1-13)
|
||||
STAMPDIFF=$((timestamp - TIMESTAMP))
|
||||
echo "Last Update : $(date -d @$TIMESTAMP)"
|
||||
echo "PIN WAS LAST UPDATED $STAMPDIFF milliseconds AGO"
|
||||
[ $STAMPDIFF -lt 39600000 ] && continue # 11h = 39600000 ms / 12h = 43200000 ms
|
||||
|
||||
echo "Refresh MEDIAKEY PIN"
|
||||
NEWIPFS=$(ipfs add -rHq /tmp/${mediakey}/ | tail -n 1)
|
||||
|
||||
## PUBLISH IT
|
||||
ipfs name publish -k ${mediakey} --quieter /ipfs/$NEWIPFS
|
||||
echo "ECHO PUBLISHING https://tube.copylaradio.com/ipns/$ipnsid TO /ipfs/$NEWIPFS"
|
||||
|
||||
echo "$id PIN PUBLISH REFRESHED /ipfs/$NEWIPFS
|
||||
https://tube.copylaradio.com/ipns/$ipnsid
|
||||
http://127.0.0.1:8181/ipns/$ipnsid"
|
||||
|
||||
rm -Rf /tmp/${mediakey}
|
||||
|
||||
break ## DO ONE BY ONE
|
||||
done
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -6,24 +6,24 @@ ME="${0##*/}"
|
|||
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
|
||||
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
|
||||
########################################################################
|
||||
IPFSNODEID=$(ipfs --timeout=30s id -f='<id>\n')
|
||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
||||
[[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1
|
||||
|
||||
########################################################################
|
||||
## TESSERACT DOUBLE ACTION
|
||||
########################################################################
|
||||
echo "Adding ~/.zen/ipfs to IPFS"
|
||||
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
|
||||
echo "OLD: $OLDCHAIN != NEW:$MIPFS ?"
|
||||
if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed
|
||||
then
|
||||
# MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
# OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
|
||||
# echo "OLD: $OLDCHAIN != NEW:$MIPFS ?"
|
||||
# if [[ "$OLDCHAIN" != "$MIPFS" ]] # MODIFY CHAIN only if something was changed
|
||||
# then
|
||||
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp
|
||||
echo $MIPFS > ~/.zen/ipfs/.${IPFSNODEID}/.chain
|
||||
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||
NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS)
|
||||
echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)"
|
||||
fi
|
||||
# fi
|
||||
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8181/ipns/$IPFSNODEID"
|
||||
########################################################################
|
||||
## READ BLOCK CHAIN ##
|
||||
|
|
|
@ -24,6 +24,10 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
# mkdir -p ~/astroport/mp3
|
||||
########################################################################
|
||||
path="$1"
|
||||
|
||||
if [[ "$path" == "" ]]; then
|
||||
echo "## BATCH RUN. READ FIFO FILE."
|
||||
fi
|
||||
# Add trailing / if needed
|
||||
length=${#path}
|
||||
last_char=${path:length-1:1}
|
||||
|
@ -216,7 +220,7 @@ $MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfsid -o "~/.zen/ipfs/.$
|
|||
########################################################################
|
||||
# CREATING QRCODE
|
||||
$MY_PATH/tools/natools.py privkey -f ipfs-keystore -k $HOME/.ipfs/keystore/$KEYFILE -F pubsec -o /tmp/${MEDIAKEY}.dunikey
|
||||
# PubFromDunikey=$(cat /tmp/${MEDIAKEY}.dunikey | grep "sec" | cut -d ' ' -f2 | base58 -d | tail -c+33 | base58)
|
||||
# PubFromDunikey=$(cat /tmp/${MEDIAKEY}.dunikey | grep "sec" | cut -d ' ' -f2 | base58 -d | tail -c+33 | base58) ## HOWTO EXTRACT PUBKEY FROM SECKEY
|
||||
PubFromDunikey=$(cat /tmp/${MEDIAKEY}.dunikey | grep "pub" | cut -d ' ' -f2)
|
||||
qrencode -s 6 -o "$HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" "$PubFromDunikey"
|
||||
echo "$PubFromDunikey" > $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY
|
||||
|
@ -234,6 +238,7 @@ $MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/${MEDIAKEY}.pass -o $HOME/
|
|||
## DECODE MEDIAKEY.dunikey ##
|
||||
# ~/.zen/astrXbian/zen/tools/natools.py decrypt -f pubsec -k "$HOME/.zen/secret.dunikey" -i "$HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.pass.encrypt" -o "/tmp/${MEDIAKEY}.pass"
|
||||
# openssl enc -aes-256-cbc -d -in "$HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/dunikey.enc" -out "/tmp/${MEDIAKEY}.dunikey" -k $(cat "/tmp/${MEDIAKEY}.pass")
|
||||
rm /tmp/${MEDIAKEY}.dunikey
|
||||
|
||||
########################################################################
|
||||
## GET .ipfs/keystore file MAHE .ipns.mediakey.encrypt
|
||||
|
@ -264,7 +269,7 @@ rm /tmp/.ipfsid
|
|||
## ADD "ajouter_video.txt" and "video.json" will be SELF IPNS publish data
|
||||
## ENCRYPT TO STOP CLEAR DATA LEAKING
|
||||
[[ -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
|
||||
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
|
||||
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
|
||||
########################################################################
|
||||
|
||||
########################################################################
|
||||
|
@ -296,24 +301,28 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)
|
|||
# https://tube.copylaradio.com/ipns/$IPNSLINK
|
||||
#envsubst < ./www/boris/youtube_watch_step2.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
|
||||
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \
|
||||
| sed "s/\${IPNSLINK}/$IPNSLINK/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${G1PUB}/$G1PUB/g" \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
|
||||
echo "=======> Mediakey Welcome index.html "
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \
|
||||
| sed "s/\${IPNSLINK}/$IPNSLINK/g" \
|
||||
| sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${G1PUB}/$G1PUB/g" \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html
|
||||
|
||||
|
||||
## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html
|
||||
# https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/
|
||||
|
||||
#envsubst < ../www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
|
||||
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
echo "=======> Mediakey Contract index.html "
|
||||
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
|
||||
| sed "s/\${TITLE}/$TITLE/g" \
|
||||
| sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \
|
||||
| sed "s/\${XZUID}/$XZUID/g" \
|
||||
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
|
||||
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
|
||||
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html
|
||||
|
||||
|
||||
# echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
|
||||
|
@ -328,12 +337,16 @@ cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
|
|||
########################################################################
|
||||
## PUBLISH new IPNS
|
||||
########################################################################
|
||||
NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 )
|
||||
## ADD CHAIN BLOCK ZERO
|
||||
echo $NEWIPFS > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.chain
|
||||
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.timestamp
|
||||
|
||||
NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 )
|
||||
[[ "$NEWIPFS" == "" ]] && echo "~~~ FAILURE ~~~ ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1" && exit 1
|
||||
|
||||
## ADD CHAIN BLOCK ZERO (will be updated by ipns_TAG_refresh.sh)
|
||||
echo $NEWIPFS > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.chain
|
||||
|
||||
IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS)
|
||||
[[ "$IPNS" == "" ]] && echo "~~~ PROBLEM ~~~ ipfs name publish --quieter --key=${MEDIAKEY} $NEWIPFS"
|
||||
########################################################################
|
||||
########################################################################
|
||||
|
||||
|
@ -347,15 +360,18 @@ then
|
|||
## CREATE GCHANGE AD
|
||||
if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad && "${CAT}" != "youtube" ]]
|
||||
then
|
||||
|
||||
GOFFER=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" setoffer -t "${TITLE} #astroport #${MEDIAKEY}" -d "${TITLE} https://tube.copylaradio.com/ipns/$IPNS/ Faites un don à son portefeuille pour le conserver dans le Mediacenter des Amis - https://CopyLaRadio.com - https://astroport.com" -p $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png)
|
||||
echo $GOFFER > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad
|
||||
NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 )
|
||||
IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS)
|
||||
|
||||
echo "Annonce gchange : $(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad)"
|
||||
|
||||
fi
|
||||
echo "Annonce gchange : $(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad)"
|
||||
|
||||
########################################################################
|
||||
# ${PREFIX}ASTRXBIAN FILE : Add Header
|
||||
# CREATION DU FICHIER ${PREFIX}ASTRXBIAN FILE : Add Header
|
||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ]] \
|
||||
&& echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8181" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN
|
||||
|
||||
|
|
Loading…
Reference in New Issue