forked from axiom-team/astrXbian
Compare commits
30 Commits
23a6aad73c
...
af8092e7d4
Author | SHA1 | Date |
---|---|---|
Boris | af8092e7d4 | |
fred | 0a9151fad4 | |
fred | 68b9fd99fc | |
fred | 034e12fc70 | |
fred | cc25371f36 | |
fred | 1cf80f7d52 | |
fred | e38b4c24c1 | |
fred | 6b5f84a6a7 | |
fred | aeaa479375 | |
fred | 2817b63402 | |
fred | 536395d79d | |
fred | 968980cd97 | |
fred | 3bc3d47253 | |
fred | 83b80b55b7 | |
fred | 110949861a | |
fred | 64492a3053 | |
fred | c20da1a995 | |
fred | 4195c15b5d | |
fred | 2e50939e86 | |
fred | 9ad325e3d5 | |
fred | 8d92aa42b6 | |
fred | 4cb5df1775 | |
fred | f277c215d5 | |
fred | 1a1cfab4cc | |
fred | 0a96267577 | |
fred | 9c8498e05b | |
fred | 52b616fb96 | |
fred | 09f5dae89a | |
fred | 6e77095ff5 | |
qo-op | 4552f89d93 |
|
@ -41,15 +41,18 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
|
|||
MACHINE_TYPE=`uname -m`
|
||||
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-amd64.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz # UPDATER
|
||||
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
|
||||
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
|
||||
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz # UPDATER
|
||||
elif [ ${MACHINE_TYPE} == 'aarch64' ]; then
|
||||
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz -o /tmp/ipfs_aarch64_v0.9.1.tar.gz
|
||||
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
|
||||
else
|
||||
echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1
|
||||
fi
|
||||
|
||||
# UPDATER
|
||||
if [ -f $MY_PATH/ipfs-update.tar.gz ]; then
|
||||
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
|
||||
|
@ -60,10 +63,11 @@ if [ -f $MY_PATH/ipfs-update.tar.gz ]; then
|
|||
|
||||
echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
sudo ipfs-update install 0.9.1 || err "Install IPFS"
|
||||
else
|
||||
fi
|
||||
if [ -f /tmp/go_ipfs.tar.gz ]; then
|
||||
## TERRAPI4 aarch64 install ipfs_aarch64_v0.9.1
|
||||
sudo tar -xvzf /tmp/ipfs_aarch64_v0.9.1.tar.gz -C /usr/src/ || err "Untar ipfs_aarch64"
|
||||
rm /tmp/ipfs_aarch64_v0.9.1.tar.gz
|
||||
sudo tar -xvzf /tmp/go_ipfs.tar.gz -C /usr/src/ || err "Error Untar go_ipfs binaries"
|
||||
rm /tmp/go_ipfs.tar.gz
|
||||
cd /usr/src/go-ipfs/
|
||||
sudo ./install.sh || err "Install ipfs_aarch64"
|
||||
cd $MY_PATH
|
||||
|
|
|
@ -151,10 +151,13 @@ echo "SUB-SCRAPING lieu FROM $geodata"
|
|||
# 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"
|
||||
rm ./$lid.jpg
|
||||
rm ./bulle.jpg
|
||||
fi
|
||||
|
||||
cd -
|
||||
sleep $((1 + RANDOM % 2))
|
||||
cd - && rm -Rf /tmp/$lid
|
||||
rm -Rf /tmp/$lid
|
||||
|
||||
loop=$(($loop+1));
|
||||
done
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
ME="${0##*/}"
|
||||
|
||||
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
########################################################################
|
||||
[[ $(which ipfs) == "" ]] && echo "ERREUR! Installez ipfs" && echo "wget https://git.p2p.legal/axiom-team/astrXbian/raw/master/.install/ipfs_alone.sh -O /tmp/ipfs_install.sh && chmod +x /tmp/ipfs_install.sh && /tmp/ipfs_install.sh" && exit 1
|
||||
[[ $(which zenity) == "" ]] && echo "ERREUR! Installez zenity" && echo "sudo apt install zenity" && exit 1
|
||||
|
@ -51,8 +53,8 @@ haut=$((height-200))
|
|||
|
||||
########################################################################
|
||||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XZUID="$(cat /etc/hostname)"
|
||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
|
||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)"
|
||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
|
||||
|
||||
# zenity --warning --width 300 --text "Ajoutez un MEDIA dans ASTROPORT"
|
||||
|
||||
|
@ -160,7 +162,7 @@ MEDIAKEY="YOUTUBE_${MEDIAID}"
|
|||
FALSE Humain \
|
||||
FALSE Animal \
|
||||
TRUE Eveil \
|
||||
TRUE ${AXID// /-}) || GENRES="${AXID// /-}"
|
||||
TRUE ${XZUID// /-}) || GENRES="${XZUID// /-}"
|
||||
|
||||
# FORMAT GENRES genre1|genre2|genre3
|
||||
|
||||
|
@ -289,7 +291,7 @@ mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
|
|||
|
||||
MEDIAID="${YID}"
|
||||
TITLE="${YNAME%.*}"
|
||||
GENRES="[\"$AXID\"]"
|
||||
GENRES="[\"$XZUID\"]"
|
||||
GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY
|
||||
MEDIAKEY="MP3_$MEDIAID"
|
||||
|
||||
|
@ -398,7 +400,7 @@ FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
|
|||
FALSE Telefilm\
|
||||
FALSE Thriller\
|
||||
FALSE Western\
|
||||
TRUE ${AXID// /-})
|
||||
TRUE ${XZUID// /-})
|
||||
|
||||
# FORMAT GENRES ["genre1","genre2"]
|
||||
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
||||
|
|
|
@ -20,16 +20,26 @@ source $HOME/.profile
|
|||
|
||||
#### CONTROL STATION IPFS DAEMON
|
||||
## timeout is fixing ipfs minimum response time, before considering stuck process
|
||||
IPFSNODEID=$(ipfs --timeout=30s 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
|
||||
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
|
||||
howmany=$(cat /tmp/ipfs.timeout)
|
||||
if [[ ! $IPFSNODEID ]]; then
|
||||
## wait a howmany timeout before restarting ipfs
|
||||
howmany=$((howmany + 1)) && echo $howmany > /tmp/ipfs.timeout
|
||||
[ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo service ipfs restart && exit 1
|
||||
[ $howmany -gt 3 ] && [[ -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING $(date)" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo systemctl restart ipfs
|
||||
rm ~/.zen/restart.txt
|
||||
exit 1
|
||||
else
|
||||
echo 0 > /tmp/ipfs.timeout
|
||||
fi
|
||||
|
||||
## CONTROL IPFS IS RUNNING OR RESTART
|
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||
if [[ ! ${YOU} ]]; then
|
||||
# reduice water levels for swarm
|
||||
# control water levels for swarm
|
||||
ipfs config --json Swarm.ConnMgr.LowWater 50
|
||||
ipfs config --json Swarm.ConnMgr.HighWater 100
|
||||
[[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs
|
||||
[ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs
|
||||
echo "ERROR! ipfs daemon was not running. RELAUNCHING."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -79,7 +89,6 @@ weeknumber=$(date +%V)
|
|||
# WAKEUP TIME
|
||||
if [[ ! -f /tmp/A_Station_ON ]]; then
|
||||
echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /tmp/A_Station_ON
|
||||
[[ -f /home/$YOU/.zen/A_Station_ON ]] && cp /home/$YOU/.zen/A_Station_ON /tmp/A_Station_ON && rm /home/$YOU/.zen/A_Station_ON
|
||||
else
|
||||
source /tmp/A_Station_ON
|
||||
old=$ontimebar
|
||||
|
@ -104,8 +113,10 @@ if [[ $(($runtime % 4)) == 0 ]]; then
|
|||
## PING ALL MY FRIENDS TO ENHANCE SWARM CONNECTIVITY
|
||||
echo "## FRIENDS IPFS PINGing"
|
||||
for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do
|
||||
[[ $g1pub ]] && latency=$(ipfs ping --timeout=2s -n 3 /p2p/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null | grep "Average" | cut -d ':' -f 2);
|
||||
[[ $g1pub ]] && latency=$(ipfs ping --timeout=1s -n 1 /p2p/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null | grep "Average" | cut -d ':' -f 2);
|
||||
[[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt
|
||||
## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt
|
||||
# for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid; cat $line; done
|
||||
done
|
||||
fi
|
||||
########################################################################
|
||||
|
@ -195,8 +206,9 @@ 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
|
||||
# If NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h)
|
||||
if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) && $runtime -gt 360 ]]; then
|
||||
echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /tmp/A_Station_ON
|
||||
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
|
||||
|
|
|
@ -21,7 +21,7 @@ for i in git fail2ban inotify-tools curl net-tools libsodium* python3-dev python
|
|||
done
|
||||
|
||||
#sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack html2text ssmtp sudo -y
|
||||
for i in build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick ttf-mscorefonts-installer; do
|
||||
for i in build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick ttf-mscorefonts-installer libcurl4-openssl-dev; do
|
||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
sudo apt install -y $i
|
||||
fi
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
echo "Installation Astroport/RompR et activation du mode JUKEBOX mp3"
|
||||
|
||||
if [[ "$jukebox" == "oui" ]] then
|
||||
sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
|
||||
if [[ "$jukebox" == "oui" ]] then
|
||||
sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
|
||||
fi
|
||||
|
||||
# Add user to be able to modify nginx directories
|
||||
|
@ -12,3 +12,8 @@ sudo chmod g+rw /var/www/html
|
|||
## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1:8181/ipns/$IPFSNODEID/.$IPFSNODEID
|
||||
# STRUCTURE DE DONNEE SITUE DANS ~/.zen/ipfs/ PUBLIEE PAR IPNS SELF
|
||||
|
||||
## AJOUT ADDONS NAVIGATEUR https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts
|
||||
# OpenWith #
|
||||
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno
|
||||
# https://addons.mozilla.org/firefox/downloads/file/3831723/open_with-7.2.6-fx.xpi
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ $bodyClasses .= $home ? 'home' : '';
|
|||
<title>Astroport "<?php echo STATION_NAME; ?>"</title>
|
||||
<link rel="stylesheet" href="styles/<?php echo THEME; ?>/style.css" type="text/css" />
|
||||
<link rel="icon" type="image/png" href="./styles/<?php echo THEME; ?>/logo.png" />
|
||||
<script type="text/javascript" src="/lib/lazyImg.min.js"></script>
|
||||
</head>
|
||||
<body class="<?php echo $bodyClasses; ?>">
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PU
|
|||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||
|
||||
[[ $(which apache2) ]] && echo "Apache est installé. Le plugin nécessite nginx. EXIT" && exit 1
|
||||
[[ $(netstat -tan | grep ':10111 ') ]] && echo "Serveur web existant sur port 10111. Installation manuelle recommandée... EXIT" && exit 1
|
||||
[[ $(netstat -tan | grep ':80 ') ]] && echo "Serveur web existant sur port 80. Installation manuelle recommandée... EXIT" && exit 1
|
||||
|
||||
########################################################################
|
||||
## INSTALL nginx + php + mariadb + ...
|
||||
|
@ -29,39 +29,39 @@ ln -s ../ipfs me
|
|||
## CREATE site config file
|
||||
printf "
|
||||
server {
|
||||
listen 10111 default_server;
|
||||
listen [::]:10111 default_server;
|
||||
listen 10111 default_server;
|
||||
listen [::]:10111 default_server;
|
||||
|
||||
root " | sudo tee /etc/nginx/sites-available/tube.copylaradio.com
|
||||
root " | sudo tee /etc/nginx/sites-available/tube.copylaradio.com
|
||||
|
||||
printf root /home/$YOU/.zen/astrXbian/www/boris | sudo tee -a /etc/nginx/sites-available/tube.copylaradio.com
|
||||
|
||||
printf ";
|
||||
|
||||
# Add index.php to the list if you are using PHP
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
# Add index.php to the list if you are using PHP
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
server_name tube.copylaradio.com;
|
||||
server_name tube.copylaradio.com;
|
||||
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files \$uri \$uri/ =404;
|
||||
}
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files \$uri \$uri/ =404;
|
||||
}
|
||||
|
||||
index index.php;
|
||||
index index.php;
|
||||
|
||||
# pass PHP scripts to FastCGI server
|
||||
# pass PHP scripts to FastCGI server
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
|
||||
# With php-fpm (or other unix sockets):
|
||||
fastcgi_pass unix:/var/run/php/php-fpm.sock;
|
||||
# With php-cgi (or other tcp sockets):
|
||||
#fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
# With php-fpm (or other unix sockets):
|
||||
fastcgi_pass unix:/var/run/php/php-fpm.sock;
|
||||
# With php-cgi (or other tcp sockets):
|
||||
#fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
location /ipfs {
|
||||
proxy_pass http://127.0.0.1:8181;
|
||||
proxy_set_header Host $host;
|
||||
|
@ -73,7 +73,7 @@ printf ";
|
|||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
" | sudo tee -a /etc/nginx/sites-available/tube.copylaradio.com
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
var lazyImg={};!function(){lazyImg.image="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEA",lazyImg.custom_offset=100,lazyImg.view_elements=[],lazyImg.viewportHeight=lazyImg.viewportWidth=0,lazyImg.body=lazyImg.docEl=null,lazyImg.initVar=function(){lazyImg.viewportHeight=window.innerHeight,lazyImg.viewportWidth=window.innerWidth,lazyImg.body=document.body,lazyImg.docEl=document.documentElement},lazyImg.setConfig=function(a,b){lazyImg.image=a||lazyImg.image,lazyImg.custom_offset=b||lazyImg.custom_offset},lazyImg.reveal=function(){for(var a=window.scrollTop||lazyImg.docEl.scrollTop||lazyImg.body.scrollTop,b=window.scrollLeft||lazyImg.docEl.scrollLeft||lazyImg.body.scrollLeft,c=lazyImg.docEl.clientTop||lazyImg.body.clientTop||0,d=lazyImg.docEl.clientLeft||lazyImg.body.clientLeft||0,e=0;e<lazyImg.view_elements.length;e++){var f=lazyImg.view_elements[e],g=f.getBoundingClientRect(),h=Math.round(g.top+a-c),i=Math.round(g.bottom+a-c),j=Math.round(g.left+b-d);i>a-lazyImg.custom_offset&&h<a+lazyImg.viewportHeight+lazyImg.custom_offset&&j>b-lazyImg.custom_offset&&j<b+lazyImg.viewportWidth+lazyImg.custom_offset&&(f.src=f.getAttribute("data-lazyimg-src"),f.srcset=f.getAttribute("data-lazyimg-srcset"),f.removeAttribute("data-lazyimg-loading"),f.removeAttribute("data-lazyimg-src"),f.removeAttribute("data-lazyimg-srcset"),lazyImg.view_elements.splice(e,1),e--)}0==lazyImg.view_elements.length&&lazyImg.removeListener()},lazyImg.list_maker=function(){for(var a=document.querySelectorAll("img:not([data-lazyimg-list])"),b=0;b<a.length;b++){var c=a[b];lazyImg.view_elements.push(c),c.setAttribute("data-lazyimg-list","true"),c.setAttribute("data-lazyimg-loading","true"),c.setAttribute("data-lazyimg-src",c.src),c.setAttribute("data-lazyimg-srcset",c.srcset),c.src=lazyImg.image,c.srcset=""}},lazyImg.throttle=function(a,b){var c=!1;return function(){c||(a.call(),c=!0,setTimeout(function(){c=!1},b))}},lazyImg.listener=function(){lazyImg.initVar(),lazyImg.reveal()},lazyImg.throttleListener=lazyImg.throttle(lazyImg.listener,100),lazyImg.removeListener=function(){window.removeEventListener("scroll",lazyImg.throttleListener),window.removeEventListener("resize",lazyImg.throttleListener)},lazyImg.activeListener=function(){window.addEventListener("scroll",lazyImg.throttleListener,!1),window.addEventListener("resize",lazyImg.throttleListener,!1)},lazyImg.activeListener(),lazyImg.intervalObject=setInterval(function(){lazyImg.list_maker()},20),window.addEventListener("load",function(){clearInterval(lazyImg.intervalObject),lazyImg.list_maker(),lazyImg.activeListener(),lazyImg.initVar(),lazyImg.reveal()},!1)}();
|
|
@ -9,6 +9,7 @@ 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
|
||||
start=`date +%s`
|
||||
|
||||
# Retrieve Gchange profil data
|
||||
# Sends "ipfstryme" messages to liked linking_me NODES
|
||||
|
@ -40,18 +41,18 @@ cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
|||
# ADD GCHANGE+ informations
|
||||
########################################################################
|
||||
GCHANGE="https://data.gchange.fr"
|
||||
## GET LATEST GCHANGE PROFILE
|
||||
echo"## GET LATEST GCHANGE PROFILE"
|
||||
curl -s ${GCHANGE}/user/profile/${G1PUB} > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json
|
||||
|
||||
# UPDATE _g1.gchange_title
|
||||
title=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.title')
|
||||
[[ $title ]] && echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title
|
||||
Gtitle=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.title')
|
||||
[[ $Gtitle ]] && echo "$Gtitle" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title
|
||||
echo"# ACTUAL _g1.gchange_title=$Gtitle"
|
||||
|
||||
# UPDATE _g1.astroport_title with city
|
||||
title="Station $YOU@$XZUID"
|
||||
Atitle="Station $YOU@$XZUID"
|
||||
city=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.city')
|
||||
[[ "$city" != "null" ]] && title="$title in $city"
|
||||
echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.astroport_title
|
||||
[[ "$city" != "null" ]] && Atitle="$Atitle in $city"
|
||||
echo "$Atitle" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.astroport_title
|
||||
|
||||
# UPDATE _g1.gchange_avatar.png
|
||||
cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.avatar._content' | base64 -d > "/home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_avatar.png"
|
||||
|
@ -73,7 +74,6 @@ export LANG=C.UTF-8 #attipix
|
|||
|
||||
# _g1.pubkey
|
||||
[[ ! ~/.zen/ipfs/.${IPFSNODEID}/G1SSB/_g1.pubkey ]] && echo "$G1PUB" > ~/.zen/ipfs/.${IPFSNODEID}/G1SSB/_g1.pubkey
|
||||
|
||||
# ipfsnodeid
|
||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/.ipfsnodeid ]] && echo ${IPFSNODEID} > ~/.zen/ipfs/.${IPFSNODEID}/.ipfsnodeid
|
||||
|
||||
|
@ -124,12 +124,14 @@ sed -i "s/_UPDATED_/$updated/g" $wiki
|
|||
|
||||
# https:\/\/www.gchange.fr\/#\/app\/records\/wallet?q=$G1PUB
|
||||
########################################################################
|
||||
## PREPARE www EXCHANGE ZONE .$IPFSNODEID/astroport/www
|
||||
## CREATING www EXCHANGE ZONE .$IPFSNODEID/astroport/www
|
||||
if [[ ! -d /home/$YOU/astroport/www ]]; then
|
||||
wwwuser=$(ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1) || wwuser="www-data"
|
||||
mkdir -p /home/$YOU/astroport/www
|
||||
chown -R $YOU:$wwwuser /home/$YOU/astroport/www
|
||||
chmod -R g+rw /home/$YOU/astroport/www
|
||||
else
|
||||
echo ".$IPFSNODEID/astroport/www exchange zone OK"
|
||||
fi
|
||||
########################################################################
|
||||
###
|
||||
|
@ -170,6 +172,10 @@ do
|
|||
sleep $((1 + RANDOM % 2)) # SLOW DOWN
|
||||
~/.zen/astrXbian/zen/tools/timeout.sh -t 12 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me -n 1
|
||||
sleep $((1 + RANDOM % 2)) # SLOW DOWN
|
||||
|
||||
## IF DISCONNECTED FROM GCHANGE - create FRIEND Space (Need Web UI session)
|
||||
## touch ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/tryme.addr
|
||||
## echo 1 > ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/stars.level
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -267,5 +273,8 @@ done
|
|||
# https://forum.monnaie-libre.fr/t/etude-commencer-a-la-moyenne/15231/34?u=qoop
|
||||
# https://forum.monnaie-libre.fr/t/formules-en-referentiel-du-et-m-n/10417
|
||||
|
||||
|
||||
echo "#### EXCECUTION TIME"
|
||||
end=`date +%s`
|
||||
echo Execution time was `expr $end - $start` seconds.
|
||||
echo "########################################################################"
|
||||
exit 0
|
||||
|
|
|
@ -9,6 +9,7 @@ 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
|
||||
start=`date +%s`
|
||||
|
||||
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 "ERREUR G1PUB. EXIT" && exit 1
|
||||
|
@ -59,7 +60,7 @@ do
|
|||
ipfs --timeout=30s cat /ipns/$ipfsnodeid/.$ipfsnodeid/tryme.addr > /tmp/ipfstryme.$liking_me
|
||||
|
||||
if [[ ! -f /tmp/ipfstryme.$liking_me ]]; then
|
||||
echo ": READING 'ipfstryme' message from $liking_me"
|
||||
echo "TIMEOUT : READING 'ipfstryme' message from $liking_me" ## GCHANGE ACCESS
|
||||
## Get "/tmp/ipfstryme.$liking_me" from Gchange "ipfstryme" message
|
||||
~/.zen/astrXbian/zen/tools/timeout.sh -t 12 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.content' > /tmp/ipfstryme.$liking_me
|
||||
fi
|
||||
|
@ -72,8 +73,12 @@ do
|
|||
for line in $(cat /tmp/ipfstryme.$liking_me | shuf);
|
||||
do
|
||||
ipfsnodeid=$(echo $line | rev | cut -d '/' -f 1 | rev)
|
||||
stationip=$(echo $line | cut -d '/' -f 3)
|
||||
ping -c 1 -W 1 $stationip 2>&1>/dev/null && sping="OK" || sping="NOK"
|
||||
ipfs swarm connect $line 2>&1>/dev/null && swarmping="OK" || swarmping="NOK"
|
||||
echo "## ping $stationip : $sping / STATION $ipfsnodeid ($swarmping)"
|
||||
[[ $ipfsnodeid == "" ]] && break
|
||||
[[ ! $(cat /tmp/ipfstryme.clean | grep $ipfsnodeid) ]] && echo $line >> /tmp/ipfstryme.clean
|
||||
[[ ! $(cat /tmp/ipfstryme.clean | grep $ipfsnodeid) ]] && [[ "$swarmping" == "OK" ]] && echo $line >> /tmp/ipfstryme.clean
|
||||
done
|
||||
|
||||
cat /tmp/ipfstryme.clean | sort | uniq > /tmp/ipfstryme.$liking_me
|
||||
|
@ -105,9 +110,9 @@ do
|
|||
[[ $nbmessage == 0 ]] && echo "NO ipfstryme MESSAGE from $whoisg1" && echo "$ipfsnodeid" >> ~/.zen/A_dead_swarm.txt && continue
|
||||
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $whoisg1 -t 'Astroport' -m 'Aucun message de ta part https://copylaradio.com'"
|
||||
|
||||
## CHECKING VALUE CAPSULE
|
||||
starsin=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level)
|
||||
starsout=$(ipfs --timeout=10s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$whoisg1/stars.level)
|
||||
## CHECKING STARS FROM IPNS
|
||||
starsin=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level || echo 0)
|
||||
starsout=$(ipfs --timeout=10s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$whoisg1/stars.level || echo 0)
|
||||
|
||||
# REFRESH A_swarm_map.txt
|
||||
echo $peerline >> ~/.zen/A_swarm_map.txt
|
||||
|
@ -116,17 +121,18 @@ do
|
|||
|
||||
# FRIEND ADDRESS DISCOVERY
|
||||
echo "Am I friend with my FRIEND friend $whoisg1 ?"
|
||||
echo "starsin=$starsin * starsout=$starsout *"
|
||||
# ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/tryme.addr # IS my own /ipns/$IPFSNODEID/.$IPFSNODEID/tryme.addr
|
||||
|
||||
# GCHANGE : friend_of_mine=$(~/.zen/astrXbian/zen/tools/timeout.sh -t 12 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $whoisg1 | jq -r '.yours.pseudo'); # must contains my XZUID
|
||||
## LOOKING IN SWARM CACHE
|
||||
friend_of_mine=$(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$whoisg1 2>/dev/null)
|
||||
if [[ $friend_of_mine ]]; then
|
||||
# COUNTING MY FRIENDS
|
||||
friend_of_mine_count=$((friend_of_mine_count+1))
|
||||
if [[ ! $(grep "$ipfsnodeid" ~/.zen/A_my_swarm.txt) ]]
|
||||
then
|
||||
echo "OK FRIEND"
|
||||
# COUNT UNIQ FRIENDS
|
||||
friend_of_mine_count=$((friend_of_mine_count+1))
|
||||
echo "$peerline" >> ~/.zen/A_my_swarm.txt
|
||||
# ipfs bootstrap add "$peerline"
|
||||
## NOW WILL BE USING Peering.Peers config
|
||||
|
@ -134,21 +140,21 @@ do
|
|||
echo "ALREADY RECORDED FRIEND"
|
||||
fi
|
||||
## Sync 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
|
||||
else
|
||||
## REMOVE FRIENDS DIRECTORY (should be removed from Astroport App)
|
||||
echo "NOT FULL FRIEND $ipfsnodeid / $whoisg1"
|
||||
[[ "$liking_me" != "" ]] && rm -Rf ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me
|
||||
[[ "$liking_me" != "" ]] && rm -Rf ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me && rm -Rf ~/.zen/ipfs_swarm/.$ipfsnodeid && echo "REMOVING SWARM SYNC"
|
||||
# SEND ME A MESSAGE TO DECIDE WHAT TO DO ?
|
||||
# SEND MESSAGE ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $whoisg1 -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'"
|
||||
fi
|
||||
done;
|
||||
|
||||
# UNIQ file
|
||||
cat ~/.zen/A_my_swarm.txt | sort | uniq > /tmp/A_my_swarm.txt
|
||||
cat ~/.zen/A_my_swarm.txt | rev | sort | uniq | rev > /tmp/A_my_swarm.txt
|
||||
cp -f /tmp/A_my_swarm.txt ~/.zen/A_my_swarm.txt
|
||||
|
||||
cat ~/.zen/A_Qm_swarm.txt | sort | uniq > /tmp/A_Qm_swarm.txt
|
||||
cat ~/.zen/A_Qm_swarm.txt | rev | sort | uniq | rev > /tmp/A_Qm_swarm.txt
|
||||
cp -f /tmp/A_Qm_swarm.txt ~/.zen/A_Qm_swarm.txt
|
||||
|
||||
echo "####################################################
|
||||
|
@ -195,3 +201,8 @@ done
|
|||
cat ~/.zen/A_my_swarm.txt | sort | uniq > /tmp/A_my_swarm.txt
|
||||
cp -f /tmp/A_my_swarm.txt ~/.zen/A_my_swarm.txt
|
||||
cp -f ~/.zen/A_my_swarm.txt ~/.zen/A_swarm_map.txt
|
||||
|
||||
echo "#### EXCECUTION TIME"
|
||||
end=`date +%s`
|
||||
echo Execution time was `expr $end - $start` seconds.
|
||||
echo "########################################################################"
|
||||
|
|
|
@ -9,6 +9,7 @@ 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
|
||||
start=`date +%s`
|
||||
|
||||
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 "ERREUR G1PUB. EXIT" && exit 1
|
||||
|
@ -50,6 +51,9 @@ do
|
|||
ls -d ~/.zen/ipfs_swarm/.$ipfsnodeid/FRIENDS/$G1PUB/ 2>/dev/null | rev | cut -d '/' -f 2 | rev
|
||||
done
|
||||
|
||||
|
||||
echo "#### EXCECUTION TIME"
|
||||
end=`date +%s`
|
||||
echo Execution time was `expr $end - $start` seconds.
|
||||
echo "########################################################################"
|
||||
exit 0
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ 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
|
||||
start=`date +%s`
|
||||
|
||||
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 "ERREUR G1PUB. EXIT" && exit 1
|
||||
|
@ -113,19 +114,21 @@ do
|
|||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
################################################################
|
||||
## Refresh bootstrap if XID exists
|
||||
if [[ "$XID" != "" ]]; then
|
||||
echo "Removing 8 days older data from ~/.zen/ipfs_swarm/.$ipfsnodeid/"
|
||||
find /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/ -type f -mtime +8 -exec rm '{}' \;
|
||||
find /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/ -empty -type d -delete;
|
||||
################################################################
|
||||
## Refresh bootstrap if XID exists AND PING not null
|
||||
if [[ "$XID" != "" && "$(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$whoisg1/ping.average.txt 2>dev/null)" != "" ]]; then
|
||||
ipfs bootstrap rm "/ipfs/$ipfsnodeid" && ipfs bootstrap add "$peerline" || ipfs bootstrap rm "$peerline"
|
||||
|
||||
################################################################
|
||||
################################################################
|
||||
echo "Removing 8 days older data from ~/.zen/ipfs_swarm/.$ipfsnodeid/"
|
||||
find /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/ -type f -mtime +8 -exec rm '{}' \;
|
||||
find /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/ -empty -type d -delete;
|
||||
|
||||
################################################################
|
||||
echo "OK Friend SWARM REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/"
|
||||
ipfs --timeout=120s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
|
||||
ipfs --timeout=360s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
|
||||
################################################################
|
||||
if [ $? != 0 ];
|
||||
then
|
||||
|
@ -211,7 +214,9 @@ do
|
|||
|
||||
done
|
||||
|
||||
|
||||
########################################################################
|
||||
## REMOVE SWARM EMPTY DIRECTORIES
|
||||
find /home/$YOU/.zen/ipfs_swarm/ -empty -type d -delete
|
||||
########################################################################
|
||||
## FIND LOCAL IPFS NODE - SERACH FOR FOAF stargate replications
|
||||
########################################################################
|
||||
|
@ -279,7 +284,9 @@ do
|
|||
cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sed "s/anime;/film;/g" | sed '/^[[:space:]]*$/d' | grep -Ev "CAT;TMDB" | sort | uniq >> ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN
|
||||
done
|
||||
|
||||
## ACCESS TO www-data FOR www/boris ACCESS
|
||||
## CORRECT ACCESS RIGHTS
|
||||
chmod 664 ~/.zen/ipfs_swarm/.*/astroport/kodi/vstream/*ASTRXBIAN
|
||||
## www-data FOR www ACCESS
|
||||
chown $YOU:www-data ~/.zen/ipfs/.$IPFSNODEID/*ASTRXBIAN
|
||||
chmod 664 ~/.zen/ipfs/.$IPFSNODEID/*ASTRXBIAN
|
||||
|
||||
|
@ -307,7 +314,7 @@ echo "<html>
|
|||
</head>
|
||||
<body><header>
|
||||
<h1>
|
||||
<a href='https://astroport.com'><span>Astroport</span> × <span>WIKI des Amis de $zuid $updated</span></a>
|
||||
<a href=\"https://www.gchange.fr/#/app/user/$G1PUB/\"><span>$zuid (gchange)</span> x <span>, Amis Astroport ($updated)</span></a>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
|
@ -318,13 +325,18 @@ for wiki in $(ls ~/.zen/ipfs_swarm/.12D*/index.html | grep -Ev "${IPFSNODEID}" 2
|
|||
whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
|
||||
echo "<li>
|
||||
<a target=\"gchange\" href=\"https://www.gchange.fr/#/app/user/$whoisg1/\">
|
||||
<img src=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/QR.png\" alt=\"$whoisg1\" />
|
||||
<img src=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/QR.png\" alt=\"$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid 2>dev/null)\" />
|
||||
</a>
|
||||
<p class='video-title'>
|
||||
<a href=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/index.html\">
|
||||
$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.astroport_title 2>dev/null) <br>
|
||||
$ipfsnodeid
|
||||
</a>
|
||||
</p>
|
||||
<p class='video-title'>
|
||||
Disk :: $(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/disk.perf) :: $(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/disk.bytes) octets
|
||||
<br>Ping :: $(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$whoisg1/ping.average.txt)
|
||||
</p>
|
||||
<iframe id=\"$ipfsnodeid\"
|
||||
title='tiddlywiki $whoisg1'
|
||||
width='600'
|
||||
|
@ -347,5 +359,8 @@ echo "</main></body></html>" >> ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/index.html
|
|||
########################################################################
|
||||
~/.zen/astrXbian/zen/ipns_self_publish.sh
|
||||
########################################################################
|
||||
|
||||
echo "#### EXCECUTION TIME"
|
||||
end=`date +%s`
|
||||
echo Execution time was `expr $end - $start` seconds.
|
||||
echo "########################################################################"
|
||||
exit 0
|
||||
|
|
|
@ -141,7 +141,7 @@ IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2)
|
|||
IPFSID=$(echo $IPFS | cut -d ' ' -f 1)
|
||||
[[ $IPFSREPFILEID == "" ]] && echo "ipfs add ERROR" && exit 1
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "IPFS $file DIRECTORY: ipfs ls /ipfs/$IPFSID"
|
||||
echo "IPFS $file DIRECTORY: ipfs ls /ipfs/$IPFSREPFILEID"
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "New $TYPE INDEX ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN "
|
||||
|
||||
|
@ -175,9 +175,9 @@ if [[ $KEY ]]; then
|
|||
# > STARGATE 1 - 2 - 3 - 4 - 5 !!
|
||||
################ ENCRYPT keystore/$KEYFILE
|
||||
else
|
||||
## OLD IPNS KEY
|
||||
KEY=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.ipns.link)
|
||||
KEYFILE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.ipns.key.keystore_filename)
|
||||
echo "## ALREADY EXISTING IPNS KEY $KEYFILE ($KEY)"
|
||||
fi
|
||||
|
||||
[[ ! $KEY ]] && echo "FATAL ERROR" && exit 1
|
||||
|
@ -209,12 +209,13 @@ PINnode=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $nodeid)
|
|||
|
||||
echo "ASK AUTOPIN to $PINnode"
|
||||
## CREATE $PINnode IPFS communication directory
|
||||
[[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode} ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}
|
||||
## ENCRYPT .ipfsid & .ipfs.filelink (THESE FILES ARE
|
||||
$MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfs.filelink -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfs.filelink.encrypt"
|
||||
$MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfsid -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfsid.encrypt"
|
||||
# .ipfsid.encrypt is searched by each Station running ./zen/tools/autoPINfriends.sh
|
||||
|
||||
if [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode} && "$PINnode" != "$G1PUB" ]]; then
|
||||
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}
|
||||
## ENCRYPT .ipfsid & .ipfs.filelink (THESE FILES ARE
|
||||
$MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfs.filelink -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfs.filelink.encrypt"
|
||||
$MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfsid -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfsid.encrypt"
|
||||
# .ipfsid.encrypt is searched by each Station running ./zen/tools/autoPINfriends.sh
|
||||
fi
|
||||
########################################################################
|
||||
## GREAT natools can convert IPNS MEDIAKEY into .dunikey file
|
||||
########################################################################
|
||||
|
@ -255,6 +256,7 @@ echo "anonymous" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode
|
|||
# MEMORIZE my PIN
|
||||
mkdir -p ~/.zen/PIN/${IPFSREPFILEID}/
|
||||
touch ~/.zen/PIN/${IPFSREPFILEID}/${G1PUB}
|
||||
# echo "$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)" > ~/.zen/PIN/${ipfsrepidfile}/IPNSLINK # NO!! Would let PINing nodes change index.html///
|
||||
|
||||
########################################################################
|
||||
## encrypt links for myself
|
||||
|
|
Loading…
Reference in New Issue