Compare commits
No commits in common. "master" and "astrXbian_et_one_nation" have entirely different histories.
master
...
astrXbian_
|
@ -1,4 +0,0 @@
|
||||||
__pycache__
|
|
||||||
www/boris/me
|
|
||||||
www/boris/swarm
|
|
||||||
|
|
Before Width: | Height: | Size: 223 KiB |
|
@ -0,0 +1 @@
|
||||||
|
swp_token=1605043494:0cb63ecc71f6d029418e827aed3e7c9f:c8201b8ffdb3703b1d01884bce4f7584
|
|
@ -0,0 +1 @@
|
||||||
|
swp_token=1603922533:31aac141fc8c1f57a856ac4be928d2c0:067e0bd7719ed36e424bd1d672ebecdb
|
|
@ -8,7 +8,7 @@
|
||||||
<setting id="debug">true</setting>
|
<setting id="debug">true</setting>
|
||||||
<setting id="deco_color" default="true">lightcoral</setting>
|
<setting id="deco_color" default="true">lightcoral</setting>
|
||||||
<setting id="default-view">50</setting>
|
<setting id="default-view">50</setting>
|
||||||
<setting id="download_folder">/tmp/</setting>
|
<setting id="download_folder">/home/xbian/astroport/films/</setting>
|
||||||
<setting id="enregistrement_activer">true</setting>
|
<setting id="enregistrement_activer">true</setting>
|
||||||
<setting id="extendedinfo-view" default="true">false</setting>
|
<setting id="extendedinfo-view" default="true">false</setting>
|
||||||
<setting id="heure_verification">1</setting>
|
<setting id="heure_verification">1</setting>
|
||||||
|
@ -53,21 +53,12 @@
|
||||||
<setting id="marge_auto" default="true">0</setting>
|
<setting id="marge_auto" default="true">0</setting>
|
||||||
<setting id="meta-view">true</setting>
|
<setting id="meta-view">true</setting>
|
||||||
<setting id="movie-view">500</setting>
|
<setting id="movie-view">500</setting>
|
||||||
<setting id="pastebin_cacheDuration" default="true">12</setting>
|
|
||||||
<setting id="pastebin_id_1" default="true">FASTRXBIAN</setting>
|
<setting id="pastebin_id_1" default="true">FASTRXBIAN</setting>
|
||||||
<setting id="pastebin_id_2" default="true">AASTRXBIAN</setting>
|
<setting id="pastebin_id_2" default="true">AASTRXBIAN</setting>
|
||||||
<setting id="pastebin_id_3" default="true">SASTRXBIAN</setting>
|
<setting id="pastebin_id_2_1" default="true"></setting>
|
||||||
<setting id="pastebin_label_1" default="true">Films</setting>
|
<setting id="pastebin_label_1" default="true">films</setting>
|
||||||
<setting id="pastebin_label_2" default="true">Animes</setting>
|
<setting id="pastebin_label_2" default="true">animes</setting>
|
||||||
<setting id="pastebin_label_3" default="true">Series</setting>
|
<setting id="path_enregistrement">/home/xbian/</setting>
|
||||||
<setting id="astroport_cacheDuration" default="true">12</setting>
|
|
||||||
<setting id="astroport_id_1" default="true">FASTRXBIAN</setting>
|
|
||||||
<setting id="astroport_id_2" default="true">AASTRXBIAN</setting>
|
|
||||||
<setting id="astroport_id_3" default="true">SASTRXBIAN</setting>
|
|
||||||
<setting id="astroport_label_1" default="true">Films</setting>
|
|
||||||
<setting id="astroport_label_2" default="true">Animes</setting>
|
|
||||||
<setting id="astroport_label_3" default="true">Series</setting>
|
|
||||||
<setting id="path_enregistrement">/tmp/</setting>
|
|
||||||
<setting id="path_enregistrement_programmation">special://userdata/addon_data/plugin.video.vstream/Enregistrement</setting>
|
<setting id="path_enregistrement_programmation">special://userdata/addon_data/plugin.video.vstream/Enregistrement</setting>
|
||||||
<setting id="path_ffmpeg" default="true"></setting>
|
<setting id="path_ffmpeg" default="true"></setting>
|
||||||
<setting id="playerPlay">1</setting>
|
<setting id="playerPlay">1</setting>
|
||||||
|
@ -78,7 +69,6 @@
|
||||||
<setting id="plugin_animecomplet">true</setting>
|
<setting id="plugin_animecomplet">true</setting>
|
||||||
<setting id="plugin_animeultime">true</setting>
|
<setting id="plugin_animeultime">true</setting>
|
||||||
<setting id="plugin_asia_insane">true</setting>
|
<setting id="plugin_asia_insane">true</setting>
|
||||||
<setting id="plugin_astroport">true</setting>
|
|
||||||
<setting id="plugin_buzzmonclick_com">true</setting>
|
<setting id="plugin_buzzmonclick_com">true</setting>
|
||||||
<setting id="plugin_channelstream">true</setting>
|
<setting id="plugin_channelstream">true</setting>
|
||||||
<setting id="plugin_cinemay_com">true</setting>
|
<setting id="plugin_cinemay_com">true</setting>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<favourites>
|
<favourites>
|
||||||
<favourite name="ASTROPORT _PROFIL_ [COLOR lightcoral](_LOGIN_)[/COLOR] [COLOR lightcoral](_MDP_)[/COLOR]" thumb="special://home/addons/plugin.video.vstream/resources/art/astroport.png">ActivateWindow(10025,"plugin://plugin.video.vstream/?function=load&sFav=load&site=astroport&siteUrl=http%3a%2f%2fvenom&title=ASTROPORT%20_PROFIL_%20(_LOGIN_)%20(_MDP_)",return)</favourite>
|
<favourite name="ASTROPORT _PROFIL_ [COLOR lightcoral](_LOGIN_)[/COLOR] [COLOR lightcoral](_MDP_)[/COLOR]" thumb="special://home/addons/plugin.video.vstream/resources/art/sites/astroport.png">ActivateWindow(10025,"plugin://plugin.video.vstream/?function=load&sFav=load&site=astroport&siteUrl=http%3a%2f%2fvenom&title=ASTROPORT%20_PROFIL_%20(_LOGIN_)%20(_MDP_)",return)</favourite>
|
||||||
</favourites>
|
</favourites>
|
||||||
|
|
|
@ -226,7 +226,7 @@
|
||||||
<setting id="services.useairplaypassword" default="true">false</setting>
|
<setting id="services.useairplaypassword" default="true">false</setting>
|
||||||
<setting id="services.webserver">true</setting>
|
<setting id="services.webserver">true</setting>
|
||||||
<setting id="services.webserverpassword" default="true"></setting>
|
<setting id="services.webserverpassword" default="true"></setting>
|
||||||
<setting id="services.webserverport">8081</setting>
|
<setting id="services.webserverport">8181</setting>
|
||||||
<setting id="services.webserverssl" default="true">false</setting>
|
<setting id="services.webserverssl" default="true">false</setting>
|
||||||
<setting id="services.webserverusername">xbmc</setting>
|
<setting id="services.webserverusername">xbmc</setting>
|
||||||
<setting id="services.webskin" default="true">webinterface.default</setting>
|
<setting id="services.webskin" default="true">webinterface.default</setting>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env xdg-open
|
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Astroport
|
Name=Astroport/Kodi
|
||||||
Exec=/home/_USER_/.zen/astrXbian/ajouter_video.sh
|
Exec=/home/_USER_/.zen/astrXbian/ajouter_video.sh
|
||||||
Icon=/home/_USER_/.zen/astrXbian/logo96.png
|
Icon=/home/_USER_/.zen/astrXbian/logo96.png
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
|
@ -23,13 +23,16 @@ err() {
|
||||||
|
|
||||||
# CHECK if daemon is already running
|
# CHECK if daemon is already running
|
||||||
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
|
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
|
||||||
|
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
|
||||||
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
|
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
|
||||||
echo "ipfs bootstrap list: " && ipfs bootstrap list
|
echo "ipfs bootstrap list: " && ipfs bootstrap list
|
||||||
echo "ipfs daemon already running...!"
|
echo "Please RUN : sudo service ipfs stop"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "Astroport activate IPFS Layer installation..."
|
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1
|
||||||
|
|
||||||
|
echo -e "Astroport IPFS Layer installation..."
|
||||||
|
|
||||||
# CHECK node IP isLAN?
|
# CHECK node IP isLAN?
|
||||||
myIP=$(hostname -I | awk '{print $1}')
|
myIP=$(hostname -I | awk '{print $1}')
|
||||||
|
@ -37,6 +40,24 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
|
||||||
|
|
||||||
MACHINE_TYPE=`uname -m`
|
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
|
||||||
|
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
|
||||||
|
else
|
||||||
|
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||||
|
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
|
||||||
|
rm $MY_PATH/ipfs-update.tar.gz
|
||||||
|
cd /usr/src/ipfs-update/
|
||||||
|
sudo ./install.sh || err "Install ipfs-update"
|
||||||
|
cd $MY_PATH
|
||||||
|
|
||||||
|
echo "INSTALL ipfs 0.7.0 >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
||||||
|
sudo ipfs-update install 0.7.0 || err "Install IPFS"
|
||||||
|
|
||||||
# INIT ipfs
|
# INIT ipfs
|
||||||
[[ $isLAN ]] && ipfs init -p lowpower \
|
[[ $isLAN ]] && ipfs init -p lowpower \
|
||||||
|| ipfs init -p server
|
|| ipfs init -p server
|
||||||
|
@ -58,8 +79,6 @@ After=network.target
|
||||||
User=_USER_
|
User=_USER_
|
||||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
|
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
CPUAccounting=true
|
|
||||||
CPUQuota=60%
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -88,22 +107,14 @@ ipfs config Datastore.StorageMax $diskSize
|
||||||
## Activate Rapid "ipfs p2p"
|
## Activate Rapid "ipfs p2p"
|
||||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
ipfs config --json Experimental.Libp2pStreamMounting true
|
||||||
ipfs config --json Experimental.P2pHttpProxy true
|
ipfs config --json Experimental.P2pHttpProxy true
|
||||||
ipfs config --json Swarm.ConnMgr.LowWater 0
|
|
||||||
ipfs config --json Swarm.ConnMgr.HighWater 0
|
|
||||||
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:8080", "http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com" ]'
|
|
||||||
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
|
|
||||||
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
|
|
||||||
|
|
||||||
ipfs config Addresses.API "/ip4/0.0.0.0/tcp/5001"
|
|
||||||
ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080"
|
|
||||||
|
|
||||||
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
|
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
|
||||||
ipfs bootstrap rm --all
|
ipfs bootstrap rm --all
|
||||||
###########################################
|
###########################################
|
||||||
# BOOTSTRAP NODES ARE ADDED LATER
|
# BOOTSTRAP NODES ARE ADDED LATER
|
||||||
###########################################
|
###########################################
|
||||||
# AVOID CONFLICT WITH KODI ./.install/.kodi/userdata/guisettings.xml
|
# AVOID CONFLICT WITH KODI REMOTE
|
||||||
ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080"
|
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
|
||||||
|
|
||||||
[[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs
|
[[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs
|
||||||
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
########################################################################
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
ME="${0##*/}"
|
|
||||||
######## YOUTUBE-DL ##########
|
|
||||||
## NOW INSTALL yt-dlp AND LINK TO youtube-dl
|
|
||||||
# _ _ _
|
|
||||||
#| | _____ __| (_)
|
|
||||||
#| |/ / _ \ / _` | |
|
|
||||||
#| < (_) | (_| | |
|
|
||||||
#|_|\_\___/ \__,_|_|
|
|
||||||
# COPY UQLOAD LINKS DETECTED IN KODI LOG
|
|
||||||
##############################################
|
|
||||||
### TODO INSTALL FROM START and AUTO SCRAPE KODI LOG
|
|
||||||
##############################################
|
|
||||||
if [[ ! -f $HOME/.local/bin/uqload_downloader ]]; then
|
|
||||||
cd /tmp
|
|
||||||
git clone https://github.com/papiche/uqload_downloader.git
|
|
||||||
cd uqload_downloader/cli
|
|
||||||
./download_from_kodi_log.sh
|
|
||||||
[[ -f $HOME/.local/bin/uqload_downloader ]] && zenity --warning --width ${large} --text "INSTALLATION download_from_kodi_log.sh OK"
|
|
||||||
cp download_from_kodi_log.sh $HOME/.local/bin/
|
|
||||||
else
|
|
||||||
## UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh
|
|
||||||
zenity --warning --width ${large} --text "UTILISEZ download_from_kodi_log.sh en ligne de commande..."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Create custom Nginx reverse proxy easily
|
|
||||||
|
|
||||||
Create a reverse proxy for domain tata.toto.com go to port 80 of device 192.168.1.27, with auto-https and 443 redirection:
|
|
||||||
`./nvh.sh tata.toto.com 192.168.1.27 80 ssl=1`
|
|
||||||
|
|
||||||
Create a reverse proxy for my service on localhost on port 10010, no https:
|
|
||||||
`./nvh.sh mylocalservice.fr 127.0.0.1 10010`
|
|
||||||
|
|
||||||
TODO: Add option to configure a webserver, and option for php-fpm7.4 server
|
|
||||||
|
|
||||||
enjoy
|
|
|
@ -1,116 +0,0 @@
|
||||||
#/bin/bash
|
|
||||||
|
|
||||||
red=`tput setaf 1`
|
|
||||||
green=`tput setaf 2`
|
|
||||||
yellow=`tput setaf 3`
|
|
||||||
bold=`tput bold`
|
|
||||||
blue=`tput setaf 4`
|
|
||||||
reset=`tput sgr0`
|
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
|
|
||||||
sslRedir="$MY_PATH/ssl-bloc-redirect.txt"
|
|
||||||
tplVHost="$MY_PATH/templates/vhost.txt"
|
|
||||||
|
|
||||||
###
|
|
||||||
# Get Arguments
|
|
||||||
###
|
|
||||||
args="$@"
|
|
||||||
domain="$1"
|
|
||||||
ip="$2"
|
|
||||||
port="$3"
|
|
||||||
|
|
||||||
parseArgs(){
|
|
||||||
i=0
|
|
||||||
for cmd in $args; do
|
|
||||||
arg[$i]=$cmd
|
|
||||||
[[ ${arg[$i]} =~ "domain=" ]] && domain=$(echo ${arg[$i]} | grep "\<domain=" | awk -F '=' '{ print $2 }')
|
|
||||||
[[ ${arg[$i]} =~ "ip=" ]] && ip=$(echo ${arg[$i]} | grep "\<ip=" | awk -F '=' '{ print $2 }')
|
|
||||||
[[ ${arg[$i]} =~ "port=" ]] && port=$(echo ${arg[$i]} | grep "\<port=" | awk -F '=' '{ print $2 }')
|
|
||||||
[[ ${arg[$i]} =~ "ssl=" ]] && ssl=$(echo ${arg[$i]} | grep "\<ssl=" | awk -F '=' '{ print $2 }')
|
|
||||||
((i++))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
parseArgs
|
|
||||||
|
|
||||||
newVHost="/etc/nginx/conf.d/$domain.conf"
|
|
||||||
|
|
||||||
[[ $ip == "local" ]] && ip="127.0.0.1"
|
|
||||||
|
|
||||||
addSSL(){
|
|
||||||
echo "${yellow}Création du certificat SSL pour $domain...${reset}"
|
|
||||||
sudo /usr/bin/certbot --nginx certonly -d $domain && echo "${green}Le certificat de $domain a bien été déployé${reset}" || echo "${red}Une erreur s'est produite lors de la création du certificat SSL${reset}"
|
|
||||||
|
|
||||||
sudo sed -i -e 's/listen 80;/listen 443 ssl;/' $newVHost
|
|
||||||
sudo sed -i -e '/includes\/errors.conf/i \\ listen [::]:443 ssl;\n include includes/ssl.conf;' $newVHost
|
|
||||||
sudo sed -i -e '/error_log/i \\ ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;\n' $newVHost
|
|
||||||
sudo cat $sslRedir | sudo tee -a $newVHost > /dev/null
|
|
||||||
sudo sed -i -e 's/$domain/'"$domain"'/g' $newVHost
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ -e $newVHost ]]; then
|
|
||||||
echo "${yellow}Le virtualhost existe déjà${reset}"
|
|
||||||
if [[ -z $(grep "ssl_certificate_key" $newVHost) ]]; then
|
|
||||||
echo "Certificat SSL non présent"
|
|
||||||
if [[ $ssl =~ ^(1|true|oui)$ ]]; then
|
|
||||||
echo "Installation du certificat SSL ..."
|
|
||||||
addSSL
|
|
||||||
sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "${yellow}Aucune action n'a été effectué${reset}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "${yellow}Le SSL est déjà configuré sur le VHost${reset}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
create_vhost(){
|
|
||||||
echo "${yellow}Génération du nouveau VirtualHost...${reset}"
|
|
||||||
sudo cp $tplVHost $newVHost
|
|
||||||
sudo sed -i -e 's/$_DOMAIN/'"$domain"'/g' $newVHost
|
|
||||||
sudo sed -i -e 's/$_IP/'"$ip"'/g' $newVHost
|
|
||||||
sudo sed -i -e 's/$_PORT/'"$port"'/g' $newVHost
|
|
||||||
if [[ $ssl =~ ^(1|true|oui)$ ]]; then
|
|
||||||
printf "${yellow}Configuration SSL du VHost...${reset}"
|
|
||||||
addSSL && echo "${green}OK${reset}" || echo "${red}KO${reset}"
|
|
||||||
else
|
|
||||||
echo "${yellow}Aucune configuration SSL ne sera effectué.${reset}"
|
|
||||||
fi
|
|
||||||
sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Nous allons créer le domaine ${blue}$domain ${reset}qui sera lié au port ${blue}$port ${reset}de l'IP ${blue}$ip.${reset}"
|
|
||||||
if [[ $p2vmProvided != 1 ]]; then
|
|
||||||
read -p "${bold}Confirmez-vous cette action ?${reset} (${green}y${reset} ou ${red}n${reset}) : " yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* ) create_vhost break;;
|
|
||||||
[Nn]* ) echo "${red}Fermeture du script${reset}" && exit;;
|
|
||||||
* ) echo "Merci de sélectionner yes ou no";;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
create_vhost
|
|
||||||
fi
|
|
||||||
|
|
||||||
## 1ere analyse
|
|
||||||
# A priori utiliser avec domain=$IPFSNODEID ip=local port=10101 ssl=no
|
|
||||||
# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs p2p listen /x/10101 /ip4/127.0.0.1/tcp/10101
|
|
||||||
# Chaque station publie ses services/API sur un port numéroté /x/10101 relayé en 127.0.0.1/tcp/20101
|
|
||||||
# Elle publie cette information aux bootstrap (gateway) qui prennent en charge le relai https "ipfs p2p"
|
|
||||||
# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs --timeout=5s ping -n 1 /p2p/$IPFSNODEID && ipfs p2p forward /x/10101 /ip4/127.0.0.1/tcp/20101 /p2p/$IPFSNODEID
|
|
||||||
# A l'autre boût on sort domain=tata.toto.com ip=local port=20101 ssl=yes
|
|
||||||
|
|
||||||
## PAR défaut tous publient ~/.zen/astrXbian/www/boris sur leur port 80 / 443 (pour éxécuter l'API PHP)
|
|
||||||
|
|
||||||
# Ca ressemble au fonctionnement du ln -s ;)
|
|
||||||
# ipfs p2p ln -s /p2p/$IPFSNODEID/tcp/10101 /ip4/127.0.0.1/tcp/20101
|
|
||||||
|
|
||||||
## Dédier Le canal star1 pour le flux m3u8 webcam activable.
|
|
||||||
# Utiliser les canaux stars pour publier ses ports à ceux de ses amis du niveau choisi.
|
|
||||||
# Publier en json !
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,12 +0,0 @@
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name $domain;
|
|
||||||
include includes/letsencrypt.conf;
|
|
||||||
|
|
||||||
if ($host = $domain) {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 404;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
upstream $domain {
|
|
||||||
server 192.168.9.$ipvm:$port; #Production
|
|
||||||
#server 192.168.9.9; #Redirection maintenance
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
server_name $domain;
|
|
||||||
listen 80;
|
|
||||||
include includes/errors.conf;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://$domain;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_redirect off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ipfs {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ipns {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_log /var/log/nginx/$domain_error.log;
|
|
||||||
access_log /var/log/nginx/$domain_access.log;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
upstream $domain {
|
|
||||||
server 192.168.9.$ipvm:$port; #Production
|
|
||||||
#server 192.168.9.9; #Redirection maintenance
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
server_name $domain;
|
|
||||||
listen 80;
|
|
||||||
include includes/errors.conf;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
# pass PHP scripts to FastCGI server
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
|
||||||
include snippets/fastcgi-php.conf;
|
|
||||||
|
|
||||||
# With php-fpm (or other unix sockets):
|
|
||||||
fastcgi_pass unix:/var/run/php/php-fpm.sock; # Faites le ln -s qui va bien
|
|
||||||
# With php-cgi (or other tcp sockets):
|
|
||||||
#fastcgi_pass 127.0.0.1:9000;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ipfs {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ipns {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_log /var/log/nginx/$domain_error.log;
|
|
||||||
access_log /var/log/nginx/$domain_access.log;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
music_directory "/home/_USER_/astroport/mp3"
|
music_directory "/home/_USER_/.zen/audio"
|
||||||
playlist_directory "/home/_USER_/.zen/playlists"
|
playlist_directory "/home/_USER_/.zen/playlists"
|
||||||
user "_USER_"
|
user "_USER_"
|
||||||
bind_to_address "localhost"
|
bind_to_address "localhost"
|
||||||
|
@ -27,3 +27,10 @@ log_file "syslog"
|
||||||
format "44100:16:1"
|
format "44100:16:1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
audio_output {
|
||||||
|
type "fifo"
|
||||||
|
name "my pipe"
|
||||||
|
path "/tmp/snapfifo"
|
||||||
|
format "48000:16:2"
|
||||||
|
mixer_type "software"
|
||||||
|
}
|
||||||
|
|
|
@ -6,9 +6,6 @@ After=network.target
|
||||||
User=_USER
|
User=_USER
|
||||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc
|
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=10s
|
|
||||||
CPUAccounting=true
|
|
||||||
CPUQuota=60%
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -9,13 +9,13 @@ server {
|
||||||
|
|
||||||
# IPFS GATEWAY PROXY
|
# IPFS GATEWAY PROXY
|
||||||
location /ipfs {
|
location /ipfs {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8181;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /ipns {
|
location /ipns {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8181;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ server {
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
location ~ \.php {
|
location ~ \.php {
|
||||||
try_files $uri index.php =404;
|
try_files $uri index.php =404;
|
||||||
fastcgi_pass unix:/var/run/php/php-fpm.sock;
|
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
|
@ -28,13 +28,13 @@ server {
|
||||||
|
|
||||||
# IPFS GATEWAY PROXY
|
# IPFS GATEWAY PROXY
|
||||||
location /ipfs {
|
location /ipfs {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8181;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /ipns {
|
location /ipns {
|
||||||
proxy_pass http://127.0.0.1:8080;
|
proxy_pass http://127.0.0.1:8181;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
# update_bashrc.sh
|
# update_bashrc.sh
|
||||||
# Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
|
# Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
|
||||||
## TODO REMOVE... Not so good idea since Astroport.One switch identities between captains
|
|
||||||
|
|
||||||
XZUID="$1"
|
XZUID="$1"
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
|
||||||
|
@ -26,16 +24,17 @@ if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then
|
||||||
if [[ $IPNSKEY == "_IPNSKEY_" ]]; then
|
if [[ $IPNSKEY == "_IPNSKEY_" ]]; then
|
||||||
ipfs key rm xbian
|
ipfs key rm xbian
|
||||||
IPNSKEY=$(ipfs key gen xbian)
|
IPNSKEY=$(ipfs key gen xbian)
|
||||||
sed -i "s/_IPNSKEY_/$IPNSKEY/g" ~/.bashrc
|
sed -i "s/_IPNSKEY_/$IPNSKEY/g" ~/.bashrc.sh
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# CREATE
|
# CREATE
|
||||||
|
echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc
|
||||||
echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc
|
echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc
|
||||||
echo "export YOU=$newYOU" >> ~/.bashrc
|
echo "export YOU=$newYOU" >> ~/.bashrc
|
||||||
echo "export G1PUB=$newG1PUB" >> ~/.bashrc
|
echo "export G1PUB=$newG1PUB" >> ~/.bashrc
|
||||||
echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc
|
echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc
|
||||||
echo "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc
|
echo "IPNSKEY=_IPNSKEY_" >> ~/.bashrc
|
||||||
[[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc
|
[[ "$XZUID" != "" ]] && echo "XZUID=$XZUID" >> ~/.bashrc
|
||||||
fi
|
fi
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
ME="${0##*/}"
|
|
||||||
######## YOUTUBE-DL ##########
|
######## YOUTUBE-DL ##########
|
||||||
## NOW INSTALL yt-dlp AND LINK TO youtube-dl
|
if [[ ! $(which youtube-dl) ]]; then
|
||||||
|
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || exit 1
|
||||||
if [[ ! -f /usr/local/bin/yt-dlp ]]; then
|
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||||
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \
|
sudo chown $USER /usr/local/bin/youtube-dl
|
||||||
sudo chmod a+rx /usr/local/bin/yt-dlp && sudo chown $USER /usr/local/bin/yt-dlp
|
|
||||||
|
|
||||||
ytdl=$(which youtube-dl) # modify old
|
|
||||||
[[ -f ${ytdl} && ! -f ${ytdl}.old ]] &&\
|
|
||||||
sudo cp ${ytdl} ${ytdl}.old && \
|
|
||||||
sudo rm ${ytdl}
|
|
||||||
|
|
||||||
sudo ln -s /usr/local/bin/yt-dlp /usr/local/bin/youtube-dl ## NOW youtube-dl is linked to yt-dlp (COMMANDS ARE THE SAME ?)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## UPGRADE TO LATEST
|
|
||||||
ls -al /usr/local/bin/youtube-dl
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP)
|
# CONTAINS G1PUB of bootstrap PUB Station
|
||||||
# oasis.astroport.com = 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS
|
# oasis.astroport.com
|
||||||
/ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
|
2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS
|
||||||
# aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2
|
# aries.copylaradio.com (thuya83pk)
|
||||||
/ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
|
HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2
|
||||||
# cancer.copylaradio.com (yan14tricot75) = GmUD53TFfEfb6NiVqYXwxMGbxpP9nKgHPgF4jex6FBvj
|
|
||||||
/ip4/185.202.238.69/udp/4001/quic/p2p/12D3KooWRaqNpB2xr8w5WGDvU9HHj9MST9Rnp1kmMGc67e6z98ef
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
|
|
||||||
/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
|
|
||||||
/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb
|
|
||||||
/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt
|
|
||||||
/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
|
|
|
@ -1 +0,0 @@
|
||||||
Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS
|
|
194
ISOconfig.sh
|
@ -1,15 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
# Author: Fred (support@qo-op.com)
|
# Author: Fred (support@qo-op.com)
|
||||||
# Version: 0.4
|
# Version: 0.2
|
||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
########################################################################
|
########################################################################
|
||||||
|
# AUTOMATIC version of interactive 1stRUNconfig.sh
|
||||||
|
# This script can run from ~/.config/autostart/Astroport_X_config.desktop
|
||||||
# IMPORTANT!!! ipfs MUST BE ALREADY RUNNING
|
# IMPORTANT!!! ipfs MUST BE ALREADY RUNNING
|
||||||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
|
||||||
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
|
||||||
[[ ! ${IPFSNODEID} ]] && echo "IPFS MUST BE INSTALLED" && exit 1
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Create STATION IPFS/G1 IDENTITY & secret key files
|
# Create secret key files
|
||||||
# ~/.zen/secret.june
|
# ~/.zen/secret.june
|
||||||
# ~/.zen/secret.dunikey
|
# ~/.zen/secret.dunikey
|
||||||
# ~/.zen/secret.ipfs & /tmp/config.ipfs
|
# ~/.zen/secret.ipfs & /tmp/config.ipfs
|
||||||
|
@ -19,25 +18,24 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr
|
||||||
[ $(id -u) -eq 0 ] && echo "RUN as root FORBIDDEN. Please run with user: $YOU" && exit 1
|
[ $(id -u) -eq 0 ] && echo "RUN as root FORBIDDEN. Please run with user: $YOU" && exit 1
|
||||||
|
|
||||||
rm -f /tmp/A_booting_log.txt
|
rm -f /tmp/A_booting_log.txt
|
||||||
## TEST ROUTEUR PRESENCE
|
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2> /dev/null && echo "OK" || (echo "NO GATEWAY CONNEXION" && exit 1)
|
||||||
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "CONNEXION OK" || exit 1
|
|
||||||
## TEST BOOTSTRAP IP CONNECTIVITY
|
|
||||||
IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1)
|
|
||||||
ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || (echo "VERIFIER CONNEXION INTERNET" && exit 1)
|
|
||||||
|
|
||||||
# MAJ astrXbian code
|
# UPDATE astrXbian code
|
||||||
[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || ( echo "astrXbian ERROR" && exit 1 )
|
[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || exit 1
|
||||||
|
|
||||||
# CHECK IF CONFIG ALREADY DONE !!
|
# CHECK IF CONFIG ALREADY DONE !!
|
||||||
# ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync
|
# ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync
|
||||||
if [[ -f ~/.zen/ipfs.sync ]]; then
|
if [[ -f ~/.zen/ipfs.sync ]]; then
|
||||||
echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt"
|
echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt"
|
||||||
source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN"
|
source ~/.zen/ipfs.sync
|
||||||
# Wait for IPFS to connect SWARM
|
|
||||||
|
# Wait for ipfs to connect to its swarm
|
||||||
sleep 20
|
sleep 20
|
||||||
~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt
|
~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt
|
||||||
sleep 10
|
sleep 10
|
||||||
~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh >> /tmp/A_booting_log.txt
|
~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh >> /tmp/A_booting_log.txt
|
||||||
|
sleep 10
|
||||||
|
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh >> /tmp/A_booting_log.txt
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -47,19 +45,16 @@ fi
|
||||||
echo "CREATING Gchange credentials"
|
echo "CREATING Gchange credentials"
|
||||||
########################################################################
|
########################################################################
|
||||||
salt="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
|
salt="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
|
||||||
salto="$salt"
|
|
||||||
[[ $salt == "" ]] && echo "ERROR" && exit 1
|
[[ $salt == "" ]] && echo "ERROR" && exit 1
|
||||||
pepper="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
|
pepper="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
|
||||||
XZUID=$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)${RANDOM:0:2}$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)
|
|
||||||
|
|
||||||
[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet identifiant (passphrase 1)? $salt" && read salty && [[ $salty ]] && salt="$salty"
|
[[ "$USER" != "xbian" ]] && echo "Choisir identifiant? $salt" && read salty && [[ $salty ]] && salt="$salty"
|
||||||
[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet mot de passe (passphrase 2)? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery"
|
[[ "$USER" != "xbian" ]] && echo "Choisir mot de passe? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery"
|
||||||
[[ "$USER" != "xbian" && "$salt" != "$salto" ]] && echo "Gardez ou modifiez ce Pseudo? $XZUID" && read XZUIDy && [[ $XZUIDy ]] && XZUID="$XZUIDy"
|
|
||||||
|
|
||||||
g1_salt="$salt"
|
g1_salt="$salt"
|
||||||
g1_pepper="$pepper"
|
g1_pepper="$pepper"
|
||||||
|
|
||||||
echo "Creation secret.june avec ($g1_salt) ($g1_pepper)"
|
echo "FILLING /tmp/secret.june with ($g1_salt) ($g1_pepper)"
|
||||||
echo "$g1_salt" > /tmp/secret.june
|
echo "$g1_salt" > /tmp/secret.june
|
||||||
echo "$g1_pepper" >> /tmp/secret.june
|
echo "$g1_pepper" >> /tmp/secret.june
|
||||||
|
|
||||||
|
@ -77,7 +72,7 @@ echo "CREATING /tmp/config.ipfs"
|
||||||
########################################################################
|
########################################################################
|
||||||
ipfs_ID=$(python3 ~/.zen/astrXbian/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py)
|
ipfs_ID=$(python3 ~/.zen/astrXbian/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py)
|
||||||
echo $ipfs_ID > /tmp/secret.ipfs && source /tmp/secret.ipfs
|
echo $ipfs_ID > /tmp/secret.ipfs && source /tmp/secret.ipfs
|
||||||
[[ $PrivKEY == "" ]] && echo "ERROR CREATING IPFS IDENTITY" && exit 1
|
[[ $PrivKEY == "" ]] && echo "ERROR" && exit 1
|
||||||
jq -r --arg PeerID "$PeerID" '.Identity.PeerID=$PeerID' ~/.ipfs/config > /tmp/config.tmp
|
jq -r --arg PeerID "$PeerID" '.Identity.PeerID=$PeerID' ~/.ipfs/config > /tmp/config.tmp
|
||||||
jq -r --arg PrivKEY "$PrivKEY" '.Identity.PrivKey=$PrivKEY' /tmp/config.tmp > /tmp/config.ipfs
|
jq -r --arg PrivKEY "$PrivKEY" '.Identity.PrivKey=$PrivKEY' /tmp/config.tmp > /tmp/config.ipfs
|
||||||
rm /tmp/config.tmp
|
rm /tmp/config.tmp
|
||||||
|
@ -117,40 +112,37 @@ echo "INIT ~/.zen/ipfs/.${IPFSNODEID} INDEX"
|
||||||
rm -Rf ~/.zen/ipfs
|
rm -Rf ~/.zen/ipfs
|
||||||
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
|
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
|
||||||
########################################################################
|
########################################################################
|
||||||
# Give $XZUID to your (gchange friends)
|
# Give $XZUID to your (gchange friends) to add in Vstream Astroport and access your sharings
|
||||||
|
# IPNS link to "pastebin list" http://localhost:8181/ipns/$IPNSKEY/xbian/$XZUID
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID"
|
XZUID=$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)${RANDOM:0:2}$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)
|
||||||
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player
|
echo "SETTING GCHANGE+ PROFILE NAME = $XZUID"
|
||||||
|
mkdir -p ~/.zen/ipfs/xbian/${IPFSNODEID}
|
||||||
|
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "CREATING GCHANGE+ PROFILE"
|
|
||||||
########################################################################
|
########################################################################
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" set --name "Station $XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #GCHANGE+
|
echo "CREATING GCHANGE+/CESIUM+ PROFILE"
|
||||||
[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && exit 1
|
|
||||||
########################################################################
|
|
||||||
echo "CREATING CESIUM+ PROFILE : TOO MUCH TIMEOUT"
|
|
||||||
########################################################################
|
|
||||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.presles.fr" set --name "Station $XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+
|
|
||||||
# [[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && exit 1
|
|
||||||
########################################################################
|
|
||||||
### DELETE (see uninstall.sh)
|
|
||||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" erase
|
|
||||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" erase
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #GCHANGE+
|
||||||
|
~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+
|
||||||
|
### REVERT
|
||||||
|
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" erase
|
||||||
|
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" erase
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "BECOME FRIEND with A_boostrap_nodes.txt"
|
echo "BECOME FRIEND with A_boostrap_nodes.txt"
|
||||||
########################################################################
|
########################################################################
|
||||||
for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
||||||
do
|
do
|
||||||
if [[ $bootnode != "" ]]; then
|
if [[ $g1node != "" ]]; then
|
||||||
ipfsnodeid=${bootnode##*/}
|
echo "LINKING TO BOOTSTRAP NODE : $g1node"
|
||||||
g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
|
~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" stars -p $g1node -s 5
|
||||||
echo "SENDING STAR TO BOOTSTRAP NODE : $g1node"
|
~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" stars -p $g1node -s 5
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $g1node -n 1
|
### REVERT
|
||||||
### DELETE
|
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.e-is.pro" unstars -p 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS
|
||||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $g1node
|
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://data.gchange.fr" unstars -p 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -165,26 +157,24 @@ echo ".... ACTUAL SWARM PEERS ..."
|
||||||
ipfs swarm peers
|
ipfs swarm peers
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# echo 'UPDATING ~/.bashrc'
|
echo 'UPDATING ~/.bashrc'
|
||||||
########################################################################
|
########################################################################
|
||||||
# ~/.zen/astrXbian/.install/update_bashrc.sh "$XZUID"
|
~/.zen/astrXbian/.install/update_bashrc.sh "$XZUID"
|
||||||
|
|
||||||
## CREATE RAMDISK permanent
|
## CREATE RAMDISK permanent
|
||||||
#sudo mkdir /mnt/ramdisk
|
#sudo mkdir /mnt/ramdisk
|
||||||
#sudo mount -t tmpfs -o size=50m tmpfs /mnt/ramdisk
|
#sudo mount -t tmpfs -o size=50m tmpfs /mnt/ramdisk
|
||||||
|
|
||||||
echo "UPGRADING ~/.kodi"
|
echo "UPGRADING ~/.kodi"
|
||||||
[[ -e ~/.kodi ]] && mv ~/.kodi ~/.kodi.old
|
|
||||||
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
|
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
|
||||||
|
# cp -f ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py \
|
||||||
|
# ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
||||||
|
|
||||||
echo "Configure .kodi/addons/plugin.video.vstream/resources/sites/astroport.py"
|
echo "Configure .kodi/addons/plugin.video.vstream/resources/sites/astroport.py"
|
||||||
|
|
||||||
# CREATE xbian IPNSKEY used to publish ~/.zen/ipfs_swarm/xbian (contains all XZUID pastebin files)
|
# CREATE xbian IPNSKEY used to publish ~/.zen/ipfs_swarm/xbian (contains all XZUID pastebin files)
|
||||||
IPNSKEY=$(ipfs key list -l | grep xbian | cut -d ' ' -f 1)
|
ipfs key rm xbian
|
||||||
[[ ! $IPNSKEY ]] && IPNSKEY=$(ipfs key gen xbian)
|
IPNSKEY=$(ipfs key gen xbian)
|
||||||
sed -i "s/_IPNSKEY_/$IPNSKEY/g" ~/.bashrc
|
sed -i "s/_IPNSKEY_/$IPNSKEY/g" ~/.bashrc
|
||||||
|
|
||||||
## MODIFY astroport.py to match station IDENTITY
|
|
||||||
sed -i "s/_PROFIL_/$XZUID/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
sed -i "s/_PROFIL_/$XZUID/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
||||||
sed -i "s/_LOGIN_/$salt/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
sed -i "s/_LOGIN_/$salt/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
||||||
sed -i "s/_MDP_/$pepper/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
sed -i "s/_MDP_/$pepper/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
|
||||||
|
@ -195,27 +185,30 @@ cp -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ~/.zen/
|
||||||
|
|
||||||
# ADD DESKTOP SHORTCUT
|
# ADD DESKTOP SHORTCUT
|
||||||
[[ "$USER" != "xbian" && -d ~/Bureau ]] && sed "s/_USER_/$USER/g" ~/.zen/astrXbian/.install/astroport.desktop > ~/Bureau/astroport.desktop && chmod +x ~/Bureau/astroport.desktop
|
[[ "$USER" != "xbian" && -d ~/Bureau ]] && sed "s/_USER_/$USER/g" ~/.zen/astrXbian/.install/astroport.desktop > ~/Bureau/astroport.desktop && chmod +x ~/Bureau/astroport.desktop
|
||||||
[[ "$USER" != "xbian" && -d ~/Desktop ]] && sed "s/_USER_/$USER/g" ~/.zen/astrXbian/.install/astroport.desktop > ~/Desktop/astroport.desktop && chmod +x ~/Desktop/astroport.desktop
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo 'Creating my "ipfstryme" message'
|
echo 'Sending "ipfstryme" message'
|
||||||
########################################################################
|
########################################################################
|
||||||
~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh
|
~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo 'Sending \"ipfstryme\" message to BOOTSTRAP nodes' # Add bootstrap in A_boostrap_nodes.txt
|
echo 'Sending \"ipfstryme\" message to BOOTSTRAP nodes' # Add bootstrap in A_boostrap_nodes.txt
|
||||||
########################################################################
|
########################################################################
|
||||||
for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
||||||
do
|
do
|
||||||
if [[ $bootnode != "" ]]; then
|
if [[ $g1node != "" ]]; then
|
||||||
ipfsnodeid=${bootnode##*/}
|
|
||||||
g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
|
|
||||||
echo "SENDING ipfstryme to BOOTSTRAP node : $g1node"
|
echo "SENDING ipfstryme to BOOTSTRAP node : $g1node"
|
||||||
filelines=$(cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr | wc -l)
|
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.le-sou.org" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||||
[[ "$filelines" != "0" ]] && ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "Synchronize GCHANGE+ with IPFS SWARM"
|
||||||
|
########################################################################
|
||||||
|
~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh
|
||||||
|
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo 'Installing Astroport cron_MINUTE'
|
echo 'Installing Astroport cron_MINUTE'
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -223,16 +216,10 @@ echo 'Installing Astroport cron_MINUTE'
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#echo "CHANGE hostname"
|
#echo "CHANGE hostname"
|
||||||
#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
|
|
||||||
#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey"
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname
|
#myname=$(hostname)
|
||||||
#sudo sed -i "s/$(hostname)/$myname/g" /etc/hosts
|
#sudo sed -i "s/$myname/$XZUID/g" /etc/hostname
|
||||||
|
#sudo sed -i "s/$myname/$XZUID/g" /etc/hosts
|
||||||
########################################################################
|
|
||||||
echo "Install youtube-dl" # Avoid provider restrictions
|
|
||||||
########################################################################
|
|
||||||
~/.zen/astrXbian/.install/youtube-dl.sh
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "Changing your DNS with https://FFDN.org and https://opennic.org" # Avoid provider restrictions
|
echo "Changing your DNS with https://FFDN.org and https://opennic.org" # Avoid provider restrictions
|
||||||
|
@ -247,7 +234,6 @@ nameserver 94.247.43.254
|
||||||
nameserver 2001:67c:13e4:1::37
|
nameserver 2001:67c:13e4:1::37
|
||||||
# FFDN.org opennic.org = ns8.he.de + ns5.ru
|
# FFDN.org opennic.org = ns8.he.de + ns5.ru
|
||||||
EOF
|
EOF
|
||||||
sudo cp /etc/resolv.conf /etc/resolv.conf.backup
|
|
||||||
sudo mv /tmp/resolv.conf /etc/resolv.conf
|
sudo mv /tmp/resolv.conf /etc/resolv.conf
|
||||||
sudo chattr +i /etc/resolv.conf
|
sudo chattr +i /etc/resolv.conf
|
||||||
|
|
||||||
|
@ -272,82 +258,22 @@ ipfs config Datastore.StorageMax $diskSize
|
||||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
ipfs config --json Experimental.Libp2pStreamMounting true
|
||||||
ipfs config --json Experimental.P2pHttpProxy true
|
ipfs config --json Experimental.P2pHttpProxy true
|
||||||
|
|
||||||
# CREATE IPFS BOOTSTRAP ###########
|
# EMPTY IPFS BOOTSTRAP - Gchange+ friends sends ipfstryme message ###########
|
||||||
ipfs bootstrap rm --all
|
ipfs bootstrap rm --all
|
||||||
for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
|
||||||
do
|
|
||||||
## ADD $bootnode TO BOOTSTRAP
|
|
||||||
ipfs bootstrap add $bootnode
|
|
||||||
done
|
|
||||||
|
|
||||||
# AVOID CONFLICT WITH KODI REMOTE
|
# AVOID CONFLICT WITH KODI REMOTE
|
||||||
ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080"
|
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
|
||||||
|
|
||||||
########################################################################
|
# RESTRICT $USER NOPASSWD sudo to fail2ban-client ONLY
|
||||||
# SUDO permissions
|
|
||||||
########################################################################
|
|
||||||
## USED FOR fail2ban-client (DEFCON)
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
|
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
|
||||||
## USED FOR RAMDISK (video live streaming)
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/mount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/mount')
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/umount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/umount')
|
|
||||||
## USED FOR SYSTEM UPGRADE
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt-get')
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt')
|
|
||||||
## USED FOR "systemctl restart ipfs"
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
|
|
||||||
|
|
||||||
## brother_ql_print
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/brother_ql_print')
|
|
||||||
|
|
||||||
## INSTALL TiddlyWiki
|
## INSTALL TiddlyWiki
|
||||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
|
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
|
||||||
[[ -f ~/.zen/Astroport.ONE/templates/moawiki.html ]] && cp ~/.zen/Astroport.ONE/templates/moawiki.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# echo "Synchronize GCHANGE+ with IPFS SWARM"
|
# echo 'ONLY XBIAN REBOOT NOW...'
|
||||||
########################################################################
|
|
||||||
# ~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh
|
|
||||||
# ~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# echo 'ONLY XBIAN REBOOT NOW...' else SHOW CONFIG
|
|
||||||
########################################################################
|
########################################################################
|
||||||
[[ "$USER" == "xbian" ]] && sudo reboot
|
[[ "$USER" == "xbian" ]] && sudo reboot
|
||||||
|
|
||||||
echo "Redémarrage des services ipfs & fail2ban..."
|
|
||||||
sudo service ipfs restart
|
|
||||||
sudo service fail2ban restart
|
|
||||||
|
|
||||||
echo "Installation complete !!
|
|
||||||
|
|
||||||
=======================================================
|
|
||||||
BIENVENUE DANS le TestNet Astroport/KODI
|
|
||||||
=======================================================
|
|
||||||
|
|
||||||
1. INSTALLEZ GCHANGE (Firefox) ou allez sur https://gchange.fr
|
|
||||||
https://github.com/duniter-gchange/gchange-client/releases/download/v1.2.7/gchange-v1.2.7-extension-firefox.xpi
|
|
||||||
|
|
||||||
Vos passphrases sont dans dans ~/.zen/secret.june
|
|
||||||
$(cat ~/.zen/secret.june)
|
|
||||||
|
|
||||||
Retrouvez vos amis, et échangez des étoiles avec eux pour créer vos cercles de liaisons amicales.
|
|
||||||
|
|
||||||
2. INSTALLEZ CESIUM (Firefox) ou https://cesium.app
|
|
||||||
https://github.com/duniter/cesium/releases/download/v1.6.7/cesium-v1.6.7-extension-firefox.xpi
|
|
||||||
|
|
||||||
Utilisez vos passphrases ou le fichier trousseau ~/.zen/secret.duniter pour accéder à votre portefeuille
|
|
||||||
|
|
||||||
3. Ajoutez vos vidéos à votre vidéo club grâce à l'application Astroport/Kodi en lien sur votre bureau.
|
|
||||||
|
|
||||||
==========================================================
|
|
||||||
Maintenant, vous pouvez redémarrer votre ordinateur
|
|
||||||
Bienvenue sur le réseau de réseaux d'amis ASTROPORT
|
|
||||||
==========================================================
|
|
||||||
---
|
|
||||||
Ensemble transformons le monde numérique pour qu'il devienne LIBRE P2P et LEGAL
|
|
||||||
%Makers rejoignez la [REC] Team : https://copylaradio.com
|
|
||||||
"
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
30
Makefile
|
@ -1,30 +0,0 @@
|
||||||
MYOS ?= ../myos
|
|
||||||
-include $(MYOS)/make/include.mk
|
|
||||||
.PHONY: all default install shellcheck shellcheck-% shellspec shellspec-% tests uninstall
|
|
||||||
|
|
||||||
SHELL_FILES ?= $(wildcard .*/*.sh */*.sh */*/*.sh)
|
|
||||||
|
|
||||||
$(MYOS):
|
|
||||||
git clone https://git.p2p.legal/aya/myos $(MYOS)
|
|
||||||
|
|
||||||
default: tests
|
|
||||||
|
|
||||||
all: install tests
|
|
||||||
|
|
||||||
install:
|
|
||||||
./install.sh
|
|
||||||
|
|
||||||
tests: shellcheck shellspec
|
|
||||||
|
|
||||||
shellcheck:
|
|
||||||
shellcheck $(SHELL_FILES) ||:
|
|
||||||
|
|
||||||
shellcheck-%:
|
|
||||||
shellcheck $*/*.sh
|
|
||||||
|
|
||||||
shellspec: shellspec-specs
|
|
||||||
|
|
||||||
shellspec-%:
|
|
||||||
shellspec -f tap $*
|
|
||||||
|
|
||||||
uninstall:
|
|
16
PROTOCOL.md
|
@ -1,16 +0,0 @@
|
||||||
Astroport est avant tout un ensemble de logiciels qui définissent un protocole de partage et répartition des données entre individus. Chacun héberge et publie ses données qui sont répliquées à N+1, dans un réseau d'ami connu à N+2. Comme [scuttlebutt]'https://ssbc.github.io/scuttlebutt-protocol-guide/) mais basé sur IPFS.
|
|
||||||
|
|
||||||
la crypto/blockchain sont l'usage du chiffrage pour signer/vérifier, chiffrer/déchiffrer et hasher. 5 outils.
|
|
||||||
|
|
||||||
IPFS par sa structure interne de hash chainé procure les propriétés de blockchain en [2 lignes](https://git.p2p.legal/axiom-team/astrXbian/src/branch/master/zen/ipns_self_publish.sh#L15): mettre à jour le dernier hash et le timestamp associé à la structure de données pour permettre de chainer, historiser les modifications et les publier par IPNS à son réseau proche.
|
|
||||||
|
|
||||||
Cela permet de créer une multitude de chainages sans passer par une blockchain de type Proof of Work (lente et consommatrice de ressources). La confiance n'y est plus absolue, mais relative à chaque individu.
|
|
||||||
|
|
||||||
L'astuce provient de gchange qui fournit une "Web of Trust" dynamique qui permet de "voter", choisir les données qui sont les plus pertinentes (du point de vue de chacun). Cela produit un espace numérique anoptique, hyper relativiste unique en son genre
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Toutes les technos "Web 3.0" utilisent les mêmes outils, la crypto pour signer/ vérifier, chiffrer/ déchiffrer et hasher, chaîner. Astroport réuni l'ensemble comme une boite à outil qui crée une structure réseau / humains amis (wot à 5 niveaux + scuttlebut), un réseau d'échange en monnaie libre, un ciné club, un jukebox... Le code est simple, lisible, modulaire et évolutif. Il s'agit d'un automate lié à des structures de données chaînées sans base de données (blockchain individuelles) un peu comme holochain en fait, mais dont l'usage est concret et pratique.
|
|
||||||
Il est pré réglé sur la solution du problème de l'ange et du démon. On peut y associer des votes, des Wallets, des contrats, le classement et l'enrichissement des métadonnées, la diffusion et l'oubli des données.
|
|
||||||
|
|
||||||
[![](https://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Angel_problem.svg/200px-Angel_problem.svg.png)](https://m.youtube.com/watch?v=sxiKlOK3EJY)
|
|
318
README.md
|
@ -1,290 +1,174 @@
|
||||||
# Astroport répare ton internet
|
# ASTROPORT/KODI (astrXbian)
|
||||||
|
|
||||||
## Tout ce qui t'emmerde dans internet
|
**Vidéo Club pair à pair entre amis**
|
||||||
|
|
||||||
Youtube :
|
|
||||||
- les suggestions te font perdre un temps fou, mais regarder toutes ces vidéos ne t'apportent que rarement de la valeur, car elle te font tourner en boucle sur du contenu toujours similaire
|
|
||||||
- le contenu qui diverge de la norme se retrouve censuré. Ça ne dérange pas trop tant que tu es toi-même dans la norme, mais que se passe-t-il lorsque ta pensée devient minoritaire ? Tu ne peux plus partager ton opinion.
|
|
||||||
- tu es obligé de passer par la page d'accueil pour effectuer une recherche
|
|
||||||
- tu crées des playlists pour organiser toi-même le contenu, mais parfois une vidéo est supprimé, sans que Youtube te laisse même le titre de la vidéo
|
|
||||||
- les commentaires, t'exposent souvent à toute la haine d'inconnus, et sont souvent source de désespoir
|
|
||||||
|
|
||||||
Facebook :
|
|
||||||
- le contenu qui remonte est le contenu le plus consensuel : la photo de profil à 50 likes de Cindy
|
|
||||||
- tu te tapes une pub tous les 4-5 posts
|
|
||||||
|
|
||||||
9gag :
|
|
||||||
- tu y viens pour rire un peu, mais tu te retrouve face à beaucoup de posts à caractère politique, anxiogène ou source de colère
|
|
||||||
- l'humour des autres n'est pas forcément le tiens, et le contenu qui t'es proposé ne te fait pas forcément marrer
|
|
||||||
|
|
||||||
Netflix :
|
|
||||||
- un peu de contenu intéressant, mais il est noyé dans un océan de médiocrité
|
|
||||||
- tu n'as accès à rien si tu n'es pas connecté
|
|
||||||
|
|
||||||
Spotify :
|
|
||||||
- l'interface devient de plus en plus source de nuisances, en te proposant de recommander Spotify à des amis par exemple
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Astroport libère ton internet
|
|
||||||
|
|
||||||
Astroport remplace tous ces services, en apportant quelques degrés de liberté en plus :
|
|
||||||
|
|
||||||
Dans Astroport, le contenu n'est pas filtré par des algorithme, mais par les choix que tu fais de te nourir du contenu partagé par tel ou tel ami.
|
|
||||||
|
|
||||||
Si le contenu est trop abondant, tu peux choisir un algorithme pour le filtrer, mais tu restes toujours maître de la façon dont les choses te sont présentées ; tu peux choisir ton interface parmi une quantité d'interfaces déjà codées, ou coder ta propre interface.
|
|
||||||
|
|
||||||
Un contenu taggué comme "drôle" a plus de chances de l'être, car il t'es apporté par tes amis, et entre amis, on partage souvent le même sens de l'humour.
|
|
||||||
|
|
||||||
|
|
||||||
## C'est le moment idéal pour libérer internet
|
|
||||||
|
|
||||||
Le déploiement massif de la fibre nous fournit la possibilité de revenir au "vrai" internet : un internet pair-à-pair.
|
|
||||||
|
|
||||||
Du l'ADSL, avec son débit asymétrique (80ko/s en débit ascendant, en upload), on passe avec la fibre à 80Mo/s.
|
|
||||||
|
|
||||||
Il devient donc possible de regarder une vidéo en streaming directement depuis chez ses amis, plutôt que de la récupérer depuis un datacenter inconnu localisé à 400km.
|
|
||||||
|
|
||||||
L'apparition et la popularisation des Raspberry Pi rend possible à chacun de se créer son propre petit datacenter de 1 To pour mettre à la disposition de ses amis toute sa vidéothèque. Le Raspberry Pi peut rester allumer en permanence sans faire exploser ta facture électrique ni causer de catastrophe environnementale, puisqu'il a une puissance de l'ordre de 15W. Astroport peut aussi tourner sur un vieux PC de 2005 dont on pensait ne plus jamais pouvoir faire quoi que ce soit.
|
|
||||||
|
|
||||||
La France est par ailleurs le terrain idéal pour expérimenter cette façon de partager du contenu, grâce au droit à la copie privée, qui nous autorise à garder pour soi un contenu diffusé par d'autres (à l'époque : enregistrer sur K7 un contenu diffusé à la radio).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Comment Astroport libère l'internet
|
|
||||||
|
|
||||||
Astroport utilise IPFS pour stocker les fichiers.
|
|
||||||
|
|
||||||
Ces fichiers sont partagés uniquement avec les gens que vous avez explicitement choisis, et vous recevez du contenu uniquement des personnes en qui vous avez confiance. Cette identification des "amis" se fait pour l'instant via Gchange, mais cela pourrait évoluer.
|
|
||||||
|
|
||||||
Les vidéos peuvent être affichées dans différentes interfaces. Astroport en propose pour l'instant deux :
|
|
||||||
1. Une interface web, personnalisable à loisir grâce aux thèmes
|
|
||||||
2. Kodi, qui peut s'installer sur une Android TV
|
|
||||||
|
|
||||||
|
|
||||||
## Un modèle économique pour les créateurs et le partage pair-à-pair
|
|
||||||
|
|
||||||
À chaque fichier, Astroport associe un porte-monnaie de monnaie libre G1.
|
|
||||||
|
|
||||||
Lors de la consultation d'un fichier, un peu de monnaie libre G1 est transmise au noeud qui sert le fichier (vous ou un ami, par exemple), et la monnaie récoltée sera à terme partagée entre le noeud et le créateur du contenu.
|
|
||||||
|
|
||||||
Le modèle pair-à-pair, en diminuant les coûts de diffusion, permet d'augmenter la part récupérée par le créateur.
|
|
||||||
|
|
||||||
D'un point de vue écologique, le modèle pair-à-pair diminue aussi l'électricité consommée, car le terminal de consultation devient aussi serveur de fichiers, et fait ainsi d'une pierre deux coups. S'ils souhaitent rejoindre ce modèle, les créateurs ne seront plus obligés d'utiliser les datacenters de Netflix pour diffuser leur contenu.
|
|
||||||
|
|
||||||
Grâce aux contrats, même Netflix pourra choisir de fermer ses datacenter, pour proposer à tout un chacun de participer à la diffusion de son catalogue, et le rémuner en conséquence.
|
|
||||||
|
|
||||||
|
|
||||||
**Découvrez l'[Internet des gens](https://astroport.com)**
|
|
||||||
|
|
||||||
astrXbian est une première façon de programmer Astroport en le connectant avec KODI.
|
|
||||||
Utilisé de cette façon, il constitue un **Vidéo Club "pair à pair" entre amis**
|
|
||||||
|
|
||||||
Il permet de mettre en partage vos copies privées dans votre essaim au travers du média-center KODI.
|
|
||||||
Vos relations Gchange s'appliquent comme relations (A-B(-C)) (ami (d'amis)) de votre essaim IPFS et de toutes données à échanger selon le nombre d'étoiles envoyées.
|
|
||||||
|
|
||||||
Installez. Importez vos vidéos. Regardez celles de vos amis.
|
|
||||||
En toute tranquilité, légalement, à l'abris de la censure, et des regards indiscrets.
|
|
||||||
|
|
||||||
ASTROPORT anime la station où il est installé de façon programmée toutes les minutes.
|
|
||||||
Il contrôle son réseau IPFS en fonction des "étoiles" transmisent par Gchange.
|
|
||||||
|
|
||||||
ASTROPORT, automate cellulaire sécurisé, prend en compte vos relations pour ouvrir des canaux de partage selon 5 niveaux de confiance.
|
|
||||||
Ces "stargate" permettent de créer des espaces numériques public ou privés tout en contrôlant l'étendue du partage.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## INSTALLATION (Debian/Ubuntu/Mint ou Xbian)
|
|
||||||
|
|
||||||
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
|
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
|
||||||
|
|
||||||
### **IMPORTANT** Restez en contact avec l'équipe de développement!! [Groupe Framagenda en cours de création](https://framagenda.org/apps/contacts/circle/vUAH4ggf7DyfznqN9bJDHu3nitjL7K6)
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## [INSTALLATION sur RaspberryPi (Xbian)](https://www.copylaradio.com/en_US/blog/blog-1/post/astrxbian-20)
|
Qui a le temps quand il rentre du boulot de se creuser la tête à choisir un film pour ensuite rechercher des torrent ou des liens de streaming illégal ?
|
||||||
[TELECHARGER IMAGE POUR RPI](https://qo-op.com/astrXbian_2021_03_10.img) (2021-03-10) **NOUVELLE VERSION** (login = xbian / mot de passe = raspberry)
|
|
||||||
|
|
||||||
---
|
Les solutions payantes en deviendraient presque attirantes.
|
||||||
|
|
||||||
### Comment [transférer votre ancienne station Astroport vers une nouvelle](./docs/backup_restore.md)
|
Presque...
|
||||||
|
|
||||||
---
|
Netflix ? Vive le catalogue...
|
||||||
|
|
||||||
## [Créer un autre modèle de société](https://copylaradio.com)
|
Canal+ ? Vive le prix...
|
||||||
|
|
||||||
|
La solution : Astroport Kodi !
|
||||||
|
|
||||||
|
## Une gigantesque vidéothèque à portée de clic
|
||||||
|
|
||||||
|
Avec Astroport, votre vidéothèque se met à jour en permanence (même quand vous dormez), avec des titres sûrs, puisque choisis par des utilisateurs auxquels vous accordez votre confiance. Dans une configuration basique, votre vidéothèque peut par exemple être stockée sur un unique disque dur dédié de 1 To, ce qui peut déjà représenter 800 films (à la louche). Avec la fibre, il peut suffire de 3 heures pour peupler une telle vidéothèque.
|
||||||
|
|
||||||
|
## Un catalogue qui évolue en même temps que vous
|
||||||
|
|
||||||
|
Un de vos amis pollue votre espace disque avec des épisodes de Plus Belle La Vie ? Révoquez simplement le lien de confiance tissé sur gchange pour enlever cet ami en tant que source de données, et libérer ainsi de l'espace disque. Votre vidéothèque "mute" ainsi au fur et à mesure que vos goûts évoluent, et que vous trouvez de nouvelles personnes à suivre. Vous savez ce qu'on dit : on est la somme des 5 personnes avec lesquelles on est le plus lié. Eh bien c'est pareil pour votre Astroport : il est la somme des Astroports auquel il est connecté.
|
||||||
|
|
||||||
|
## Partout, tout le temps
|
||||||
|
|
||||||
|
Votre vidéothèque disponible partout, où que vous soyez (vraiment). Vous pouvez accéder à votre vidéothèque depuis n'importe quel dispositif (smartphone, tablette, etc.) via internet. Si vous partez un week-end à la campagne, vous pouvez aussi mettre votre Astroport dans votre poche et ainsi regarder, même en forêt, un film de votre choix (si vous êtes dans les bois, on vous suggère La Cabane Dans Les Bois ^_^).
|
||||||
|
|
||||||
|
## Une expérience cinéma riche
|
||||||
|
|
||||||
|
Avec Kodi, votre vidéothèque vous apparaît d'une façon lisible, claire et élégante. Les jackettes et métadonnées des titres de votre catalogue sont automatiquement téléchargées depuis [TMDB](https://www.themoviedb.org/). Vous pouvez ainsi parcourir vos films par date de réalisation ou date d'atterrissage dans votre Astroport, mais aussi par titre, par genre, par réalisateur, etc.
|
||||||
|
|
||||||
|
## Posez vous dans votre canap' et détendez vous
|
||||||
|
|
||||||
|
Vous ne savez pas quoi regarder ce soir ? Trop fatigué pour décider ? Lancez un film au hasard avec le plugin Random Movie.
|
||||||
|
|
||||||
|
## Bien plus que du cinéma.
|
||||||
|
|
||||||
|
Kodi vous offre une expérience media complète : vous pouvez l'utiliser pour passer de la musique en soirée en affichant un diaporama des artistes généré automatiquement par Kodi. Kodi peut aussi gérer vos séries télé, clips vidéos, vidéos et photos personnelles. Vous pouvez l'utiliser pour jouer des vidéos depuis YouTube, Twitch ou TED, ou des musiques depuis Soundcloud, Bandcamp ou autre.
|
||||||
|
|
||||||
|
## Bye bye Hadopi.
|
||||||
|
|
||||||
|
Astroport n'utilise pas le protocole BitTorrent mais IPFS. De plus, vous ne partagez vos films qu'auprès d'un groupe de personnes de confiance. Les autorités de chasse au piratage ne peuvent donc pas vous tomber dessus.
|
||||||
|
|
||||||
|
## Offline first
|
||||||
|
|
||||||
|
Si vous habitez en zone blanche, il vous suffit de brancher votre Astroport sur une connexion fibrée pendant 3 heures une fois tous les 3 ans pour avoir un films à regarder chaque soir.
|
||||||
|
|
||||||
|
## Créer un autre modèle de société
|
||||||
|
|
||||||
Nous aimons la culture. Nous pensons qu'elle permet de penser et qu'on n'est libre qu'à condition de savoir penser. Nous pensons que créateurs devraient être appréciés à hauteur de ce qu'ils créent et qu'une rémunération peut favoriser la création. Mais nous n'aimons pas la façon dont la culture est distribuée. Son accès est très inégalitaire en fonction de la richesse de chacun, et les intermédiaires ponctionnent une part démesurée sur la création, ne laissant généralement pas grand chose au créateur. D'autres modèles existent déjà (financement participatif par exemple, ou encore financement public via l'exception culturelle française), tandis que d'autres restent à inventer. Astroport s'inscrit dans cette logique de création de modèles économiques plus justes et innovants.
|
Nous aimons la culture. Nous pensons qu'elle permet de penser et qu'on n'est libre qu'à condition de savoir penser. Nous pensons que créateurs devraient être appréciés à hauteur de ce qu'ils créent et qu'une rémunération peut favoriser la création. Mais nous n'aimons pas la façon dont la culture est distribuée. Son accès est très inégalitaire en fonction de la richesse de chacun, et les intermédiaires ponctionnent une part démesurée sur la création, ne laissant généralement pas grand chose au créateur. D'autres modèles existent déjà (financement participatif par exemple, ou encore financement public via l'exception culturelle française), tandis que d'autres restent à inventer. Astroport s'inscrit dans cette logique de création de modèles économiques plus justes et innovants.
|
||||||
|
|
||||||
## [Programmation Bash / Introduction](https://fr.wikibooks.org/wiki/Programmation_Bash/Introduction)
|
## [Programmation Bash / Introduction](https://fr.wikibooks.org/wiki/Programmation_Bash/Introduction)
|
||||||
|
Pour comprendre le code il faudra être familier de l'**interpréteur de commandes bash**
|
||||||
Astroport est écrit dans le language primal de votre ordinateur. Il s'éxécute et éxécute divers programmes utiles en "ligne de commande" (CLI)
|
|
||||||
|
|
||||||
Et BASH s'y trouve, cablé au noyau et son système tout entier.
|
|
||||||
Pour comprendre le code il faudra être familier de l'[interpréteur de commandes bash](https://fr.wikibooks.org/wiki/Programmation_Bash/Introduction)
|
|
||||||
Cela tombe bien, parce que tout utilisateur averti de son ordinateur se doit de comprendre un minimum ce qui s'y passe...
|
|
||||||
|
|
||||||
## Installation pour DEBIAN
|
## Installation pour DEBIAN
|
||||||
|
|
||||||
**Installez la sur-couche AstrXbian à votre PC DEBIAN (ou Xbian.org sur RaspberryPi)**
|
**Installez la sur-couche AstrXbian à votre PC DEBIAN (ou Xbian.org sur RaspberryPi)**
|
||||||
Il s'agit des logiciels ipfs et de diverses couches cryptographiques compatible avec toute application du système hote pour en partager les données avec les amis de son essaim
|
|
||||||
cette distribution permet de facilement relier nos ordinateurs en cloud sans datacenter.
|
|
||||||
|
|
||||||
**Ouvrez un terminal puis copiez/collez cette ligne de commande**:
|
**Ouvrez un terminal puis copiez/collez cette ligne de commande**:
|
||||||
|
|
||||||
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
|
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
|
||||||
|
|
||||||
patientez plusieurs minutes, le temps que vous voyez apparaitre
|
patientez plusieurs minutes, le temps que vous voyez inscrit
|
||||||
|
|
||||||
```
|
```
|
||||||
Installation complete !!
|
Installation complete !!
|
||||||
|
|
||||||
=======================================================
|
==================================================
|
||||||
BIENVENUE DANS le TestNet Astroport/KODI
|
BIENVENUE DANS le service ASTROPORT/KODI/VSTREAM
|
||||||
=======================================================
|
==================================================
|
||||||
|
|
||||||
1. INSTALLEZ GCHANGE (Firefox) ou allez sur https://gchange.fr
|
1. Connectez-vous sur https://gchange.fr avec vos identifiants
|
||||||
https://github.com/duniter-gchange/gchange-client/releases/download/v1.2.7/gchange-v1.2.7-extension-firefox.xpi
|
|
||||||
|
|
||||||
Vos passphrases sont dans dans ~/.zen/secret.june
|
|
||||||
$(cat ~/.zen/secret.june)
|
$(cat ~/.zen/secret.june)
|
||||||
|
|
||||||
Retrouvez vos amis, et échangez des étoiles avec eux pour créer vos cercles de liaisons amicales.
|
2. Rejoignez-y vos amis, et échangez des étoiles avec eux pour créer vos cercles de liaisons amicales.
|
||||||
|
|
||||||
2. INSTALLEZ CESIUM (Firefox) ou https://cesium.app
|
3. Ajoutez vos vidéos avec le lien Astroport/Kodi sur votre bureau
|
||||||
|
|
||||||
|
==========================================================
|
||||||
|
Maintenant, redémarrez votre ordinateur pour rejoindre ASTROPORT
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
GCHANGE (Firefox)
|
||||||
|
https://github.com/duniter-gchange/gchange-client/releases/download/v1.2.7/gchange-v1.2.7-extension-firefox.xpi
|
||||||
|
Vos identifiants sont dans dans ~/.zen/secret.june
|
||||||
|
|
||||||
|
CESIUM (Firefox)
|
||||||
https://github.com/duniter/cesium/releases/download/v1.6.7/cesium-v1.6.7-extension-firefox.xpi
|
https://github.com/duniter/cesium/releases/download/v1.6.7/cesium-v1.6.7-extension-firefox.xpi
|
||||||
|
Utilisez ~/.zen/secret.duniter pour accéder à votre portefeuille
|
||||||
|
|
||||||
Utilisez vos passphrases ou le fichier trousseau ~/.zen/secret.duniter pour accéder à votre portefeuille
|
|
||||||
|
|
||||||
3. Ajoutez vos vidéos à votre vidéo club grâce à l'application Astroport/Kodi en lien sur votre bureau.
|
|
||||||
|
|
||||||
==========================================================
|
|
||||||
Maintenant, vous pouvez redémarrer votre ordinateur
|
|
||||||
Bienvenue sur le réseau de réseaux d'amis ASTROPORT
|
|
||||||
==========================================================
|
|
||||||
---
|
---
|
||||||
Ensemble transformons le monde numérique pour qu'il devienne LIBRE P2P et LEGAL
|
Rendons le monde numérique LIBRE P2P et LEGAL
|
||||||
%Makers rejoignez la [REC] Team : https://copylaradio.com
|
[REC] Team : https://copylaradio.com
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation Image pour Rpi4
|
## Installation Image pour Rpi4
|
||||||
|
|
||||||
Nous avons préparé une image système pré-installée
|
Nous avons préparé une image système pré-installée
|
||||||
[TELECHARGER IMAGE POUR RPI](https://qo-op.com/astrXbian_2021_03_10.img)
|
Téléchargez https://oasis.astroport.com/astrxbian-2020/
|
||||||
|
|
||||||
- Copier l'image sur une carte micro-SD. Utiliser un RaspberryPi4 (2 ou 4Go) est recommandé!
|
- Copier l'image sur une carte micro-SD. Utiliser un RaspberryPi4 (2 ou 4Go) est recommandé!
|
||||||
- Au démarrage, votre "noeud" obtient un identifiant (Rendez-vous dans l'Addon "Vstream/Sources/Astroport" pour le récupérer)
|
- Au démarrage, votre "noeud" obtient un identifiant (Rendez-vous dans l'Addon "Vstream/Sources/Astroport" pour le récupérer)
|
||||||
- Vous indiquez vos liens d'amitié (et de partage) sur https://gchange.fr
|
- Vous indiquez vos liens d'amitié (et de partage) sur https://gchange.fr
|
||||||
|
|
||||||
Dès lors vos machines se connectent dans le même essaim ipfs et partagent leurs films, series et animes
|
Dès lors vos machines se connectent dans le même essaim ipfs et partagent leurs films
|
||||||
NB: Les films placés dans ~/astroport/film/$TMDBID/ sont automatiquement transféré sur IPFS et partagés avec vos amis.
|
Les films placés dans ~/astroport/films/$MOVIEID/ sont automatiquement sauvegardé sur IPFS et partagés avec vos amis.
|
||||||
|
|
||||||
-- Automate Astroport/KODI en demonstration pour Xbian.org --
|
-- Astroport Technology demonstration for Xbian.org --
|
||||||
|
|
||||||
## PRINCIPE DE FONCTIONNEMENT ([index des PAD astroport](https://pad.p2p.legal/s/astroport-index))
|
## PRINCIPE DE FONCTIONNEMENT
|
||||||
|
|
||||||
> Astroport/KODI vous permet de partager les vidéos que vous aimez avec les gens que vous aimez.
|
> Astroport/KODI vous permet de partager les vidéos que vous aimez avec les gens que vous aimez.
|
||||||
|
|
||||||
Le répertoire ~/astroport sert de sas de transfert de vos fichiers dans IPFS (vous pouvez en effacer les fichiers une fois importés).
|
Le répertoire ~/astroport sert de sas de transfert de vos fichiers dans IPFS.
|
||||||
Votre essaim de pairs connectés se dessine selon les "étoiles" échangées sur https://gchange.fr
|
Votre essaim de pairs connectés se dessine selon les "étoiles" partagées sur https://gchange.fr
|
||||||
|
|
||||||
Chaque noeud astXbian possède une identité (paire de clef ed25519) qui correspond à son identité sur https://gchange.fr et un portefeuille sur https://cesium.app
|
Chaque noeud astXbian possède une identité (paire de clef ed25519) qui correspond à son identité sur https://gchange.fr et son portefeuille sur https://cesium.app
|
||||||
|
|
||||||
Lorsqu'une identité "like/étoile" un autre compte sur Gchange, elle lui expédie le message "ipfstryme" ```~/.zen/ipfs/.${IPFSNODEID}/tryme.addr``` qui contient les adresses IP/IPFS connues (amis d'ami).
|
Lorsqu'une identité "like/étoile" un autre compte sur Gchange, elle lui expédie le message "ipfstryme" ```~/.zen/ipfs/.${IPFSNODEID}/tryme.addr``` qui contient ses adresses IP/IPFS connues.
|
||||||
|
|
||||||
Chaque fichier placé dans ```~/.zen/ipfs``` est partagé sur la clef IPNS "self" de chacun puis collecté dans ```~/.zen/ipfs_swarm``` régulièrement (c'est la Balise de votre Station)
|
Chaque film ajouté à l'index ajouté à ```~/.zen/ipfs``` est partagé sur la clef IPNS "self" de chacun puis collecté dans ```~/.zen/ipfs_swarm``` les films de vos amis apparaissent dans votre Mediacenter KODI et réciproquement.
|
||||||
|
|
||||||
Chaque noeud conserve la mémoire de sa bibliothèque au travers du fichier ```~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN```
|
Chaque noeud de votre essaim d'amis partage sa bibliothèque au travers du fichier ```~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN```
|
||||||
|
|
||||||
et transmet à Kodi l'ensemble de des "film" dans ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN``` (PREFIX = F), selon le format
|
- Le fichier INDEX commence par la première lettre de la catégorie. Exemple "film" = ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN```
|
||||||
```
|
```
|
||||||
CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS
|
CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS
|
||||||
film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8080/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4
|
film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8181/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4
|
||||||
# FORMAT DU FICHIER : https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
# FORMAT DU FICHIER : https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||||||
|
|
||||||
```
|
```
|
||||||
* ```~/.zen/PIN``` memorise l'état des PIN du réseau
|
* ```~/.zen/ipfs/.${IPFSNODEID}/PIN``` memorise l'état des PIN du réseau
|
||||||
* ```~/.zen/ipfs/.${IPFSNODEID}/KEY``` attribue une clef MEDIAKEY IPNS à chaque SOURCE_ID et applique un contrat fixe ou dynamique (selon le chiffrage appliqué à votre Thunder Network)
|
* ```~/.zen/KEY``` attribue une clef IPNS à chaque SOURCE_ID avec son extension "Zen TAG"
|
||||||
* ```~/.zen/ipfs/.${IPFSNODEID}/index.html``` l'application par défaut de votre Station est [TiddlyWiki](https://tiddlywiki.com/languages/fr-FR/index.html)
|
* ```~/.zen/ipfs/.${IPFSNODEID}/index.html``` contient votre TiddlyWiki
|
||||||
|
|
||||||
L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et active l'automate Astroport/BLOB.
|
L'essaim se restructure avec ```cron_MINUTE.sh``` pour se synchroniser et diffuser les données de façon intelligente.
|
||||||
|
|
||||||
```~/.zen/secret.june``` contient votre identifiant/mot de passe gchange
|
```~/.zen/secret.june``` contient votre identifiant/mot de passe gchange
|
||||||
```~/.zen/secret.dunikey``` est votre fichier de trousseau à utiliser avec cesium
|
|
||||||
|
|
||||||
...
|
```~/.zen/astrXbian/ajouter_video.sh``` permet d'ajouter Film, Serie, Anime et Youtube. Un lien est présent sur votre Bureau
|
||||||
|
|
||||||
```~/.zen/astrXbian/ajouter_video.sh``` permet d'ajouter Film, Serie, Anime et Youtube. Si vous avez installé astrXbian sur votre PC, un lien est présent sur votre Bureau
|
|
||||||
|
|
||||||
# Extension multitube
|
|
||||||
|
|
||||||
Chaque station fabrique 5 clefs qui sont envoyées à tous ses amis en fonction des étoiles attribuées.
|
|
||||||
Ces "stargate" partagés sur le même espace IPNS sont signés par chaque participant qui le modifie construisant une blockchain (sauvegarde).
|
|
||||||
En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procédure envoi des messages aux 2 signatures et invite à résoudre de façon manuelle le problème.
|
|
||||||
|
|
||||||
# Magic commands
|
# Magic commands
|
||||||
|
|
||||||
```
|
```
|
||||||
# DEPANNAGE!! activer/désactiver accès SSH à fred@ONELOVE
|
|
||||||
~/.zen/astrXbian/zen/ssh_forward2onelove.sh
|
|
||||||
|
|
||||||
# Obtenir la liste de tous ses amis (gchange+)
|
# Obtenir la liste de tous ses amis (gchange+)
|
||||||
cat ~/.zen/ipfs_swarm/.12D*/.player
|
cat ~/.zen/ipfs_swarm/.*/G1SSB/_g1.gchange_title
|
||||||
|
|
||||||
# Scan des stations IPFS de son swarm
|
# Obtenir vos PIN IPFS
|
||||||
for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo $ipfsnodeid; echo "$(ipfs --timeout=2s cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs --timeout=1s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)"; ipfs --timeout=1s ls /ipns/$ipfsnodeid/; done
|
for ID in $( ls ~/.zen/ipfs/.${IPFSNODEID}/PIN/ | cut -d '/' -f 8); do ipfs ls $ID; done
|
||||||
|
|
||||||
# Obtenir le nom des fichiers contenus dans PIN IPFS
|
# Lister vos fichiers transférés dans Astroport/Kodi
|
||||||
for ID in $( ls ~/.zen/PIN/ | cut -d '/' -f 6); do ipfs ls $ID; done
|
|
||||||
|
|
||||||
# Lister vos index de fichiers visibles dans votre Kodi
|
|
||||||
cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/*ASTRXBIAN
|
cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/*ASTRXBIAN
|
||||||
|
|
||||||
# Lister les fichiers partagés par votre essaim d'amis
|
# Lister les fichiers partagés par votre essaim d'amis
|
||||||
cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/*ASTRXBIAN | sort | uniq
|
cat ~/.zen/ipfs_swarm/.*/astroport/kodi/vstream/*ASTRXBIAN | sort | uniq
|
||||||
|
|
||||||
# LIVE CODE ASTROPORT beta
|
# CODE ASTROPORT beta
|
||||||
ipfs ls /ipns/k51qzi5uqu5dk1nt1pfbtgfis4bep8pcip78w30xykhgba7y7wk0xyu8nwci5m
|
ipfs ls /ipns/k51qzi5uqu5dgfc3m379rf9820vg20hjhnmo9letrkj2p177tq013ohn68xf2y
|
||||||
|
|
||||||
# Show MyCODE ipfs hash running in your swarm
|
|
||||||
MYCODE=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/.mycode);
|
|
||||||
for CODE in $(ls ~/.zen/ipfs_swarm/.12D*/.mycode);
|
|
||||||
do
|
|
||||||
echo
|
|
||||||
ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 );
|
|
||||||
code=$(cat $CODE);
|
|
||||||
IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode)
|
|
||||||
zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player);
|
|
||||||
# zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)
|
|
||||||
g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title)
|
|
||||||
# g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title)
|
|
||||||
echo "---> $zuid / $g1name : $IPNSCODE"
|
|
||||||
|
|
||||||
[[ "$ipfsnodeid" == "$IPFSNODEID" ]] && echo "MY NODE$ipfsnodeid CODE is $code" || echo "$ipfsnodeid CODE is $code"
|
|
||||||
[[ "$code" != "$MYCODE" ]] && echo ">>> WRONG $zuid $g1name";
|
|
||||||
done;
|
|
||||||
|
|
||||||
# Get your ipfs swarm peers station names (XZUID)
|
|
||||||
for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player; done
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# ANNEXES
|
# ANNEXES
|
||||||
|
|
||||||
## PRESENTATIONS VIDEO
|
|
||||||
|
|
||||||
### [Fred présente Astroport à la Ressourcerie](https://tube.p2p.legal/videos/watch/7ff4a8c9-7fb7-44ef-a1ee-bdf8ecc74cfe)
|
|
||||||
|
|
||||||
### [Première visite de Astroport/KODI](https://tube.p2p.legal/videos/watch/d74631e9-b1bd-43f4-9db7-5effca1ef46a)
|
|
||||||
|
|
||||||
### [Marc se demande comment fonctionne Astroport?](https://tube.p2p.legal/videos/watch/90f0efd6-e1a9-40ed-8583-440b98ab4ef0)
|
|
||||||
|
|
||||||
### [Visite des entrailles IPFS. Pour comprendre comment c'est ficelé dans ~/.zen](https://youtu.be/vfLTz4fiUiQ?t=1984s)
|
|
||||||
[![](./docs/astroport_backup.1.bashrc.ipfs.zen.png)](https://youtu.be/vfLTz4fiUiQ?t=1984s)
|
|
||||||
|
|
||||||
### Outil anti censure.
|
|
||||||
[![](./docs/hayssam.png)](https://tube.p2p.legal/videos/watch/1bf64545-2477-4ce2-b26c-786553681384)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Kodi
|
## Kodi
|
||||||
|
@ -315,18 +199,16 @@ https://monnaie-libre.fr/ - https://cesium.app/ - https://www.gchange.fr/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## AIDE : Marc se demande comment fonctionne Astsroport?
|
||||||
|
https://tube.p2p.legal/videos/watch/90f0efd6-e1a9-40ed-8583-440b98ab4ef0
|
||||||
|
|
||||||
|
|
||||||
|
## BROCHURE https://www.copylaradio.com/en_US/blog/blog-1/post/astrxbian-20
|
||||||
|
|
||||||
|
## CODE SOURCE https://git.p2p.legal/axiom-team/astrXbian
|
||||||
|
|
||||||
|
## IMAGE SYSTEME RPI : https://qo-op.com/astrXbian2020.img (2021-01-12)
|
||||||
|
|
||||||
https://astroport.com
|
https://astroport.com
|
||||||
|
|
||||||
# Surcouche logicielle P2P à Debian (Essaim IPFS/Gchange+) + Interface média center KODI / IPFS
|
Surcouche logicielle P2P Debian (Essaim IPFS/Gchange+)
|
||||||
|
|
||||||
---
|
|
||||||
# NOUS RECRUTONS
|
|
||||||
|
|
||||||
**Activation de la Zen Economie Astroport.**
|
|
||||||
|
|
||||||
Pour rejoindre l'Astrocrew: Installez AstrXbian TestNET apprenez à programmer de votre automate cellulaire (BASH + multilanguage).
|
|
||||||
|
|
||||||
Des offres d'emploi et de stage en pagaille: visitez https://www.copylaradio.com/makers
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# (@Fred) Proposition to extend ~/astroport filesystem structure
|
||||||
|
|
||||||
|
- ~/astroport/private/groups/XZUID = private file exchange
|
||||||
|
|
||||||
|
- ~/astroport/films/year/quality/title.mp4 = SD/HD/4K/3D and better TMDB recognition
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
########################################################################
|
|
||||||
# Author: Astrocrew
|
|
||||||
# Version: 0.1
|
|
||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
||||||
########################################################################
|
|
||||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
|
|
||||||
MYG1PUB=$(cat /home/$YOU/.zen/ipfs/.*/G1SSB/_g1.pubkey)
|
|
||||||
MYIPFSNODEID=$(cat /home/$YOU/.zen/ipfs/.*/.ipfsnodeid)
|
|
||||||
|
|
||||||
[[ $MYG1PUB == "" ]] && echo "$MYIPFSNODEID MISSING $MYG1PUB" && exit 1
|
|
||||||
|
|
||||||
echo $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $MYG1PUB)
|
|
||||||
exit 0
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
||||||
|
|
||||||
###### MOVE MAP FROM SELF IPNS INDEX
|
|
||||||
if [ ! -d ~/.zen/ipfs/map ]; then
|
|
||||||
mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map ~/.zen/
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
## TODO CREATE SPECIAL IPNS KEY FOR SHARING
|
|
||||||
|
|
||||||
##############################################################"
|
|
||||||
## 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:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
|
|
||||||
cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -1,169 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
||||||
|
|
||||||
## 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
|
|
||||||
# Randomly get geaodata in south europe
|
|
||||||
# FOCUS on SOUTH EUROPE
|
|
||||||
# LON = -10 to 30
|
|
||||||
# LAT = 35 to 60
|
|
||||||
# https://fr.mapsofworld.com/lat_long/europe.html
|
|
||||||
##############################################################"
|
|
||||||
# initial first spot.
|
|
||||||
lon=0
|
|
||||||
lat=40
|
|
||||||
try=1
|
|
||||||
|
|
||||||
# Randomly choose spot from in RANGE $lat.$lon
|
|
||||||
while [[ $(ls ~/.zen/ipfs_swarm/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null) ]]; do
|
|
||||||
echo "astroport/$lat.$lon geodata already swarm captured. CONTINUE"
|
|
||||||
FLOOR=-5; #-10;
|
|
||||||
CEILING=10; #30
|
|
||||||
RANGE=$(($CEILING-$FLOOR+1));
|
|
||||||
RESULT=$RANDOM;
|
|
||||||
let "RESULT %= $RANGE";
|
|
||||||
lon=$(($RESULT+$FLOOR));
|
|
||||||
#echo $lon
|
|
||||||
|
|
||||||
FLOOR=40; #35;
|
|
||||||
CEILING=50; #60;
|
|
||||||
RANGE=$(($CEILING-$FLOOR+1));
|
|
||||||
RESULT=$RANDOM;
|
|
||||||
let "RESULT %= $RANGE";
|
|
||||||
lat=$(($RESULT+$FLOOR));
|
|
||||||
#echo $lat
|
|
||||||
try=$(($try+1));
|
|
||||||
[ $try -eq 99 ] && break ## tirages aléatoire maximum
|
|
||||||
done
|
|
||||||
|
|
||||||
##############################################################"
|
|
||||||
## $lat.$lon GEODATA NOT SCRAPED YET ?
|
|
||||||
##############################################################"
|
|
||||||
if [ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/ ]; then
|
|
||||||
### ADD Spot randomness
|
|
||||||
# Fuzzle geoloc
|
|
||||||
one=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12)
|
|
||||||
latitude="$lat.$one"
|
|
||||||
two=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12)
|
|
||||||
longitude="$lon.$two"
|
|
||||||
|
|
||||||
### SCRAPE P4N
|
|
||||||
## curl spot.json into /astroport/map/$lat.$lon/p4n/spot.json
|
|
||||||
echo "GETTING /astroport/map/$lat.$lon/p4n/spot.json"
|
|
||||||
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/
|
|
||||||
echo "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude"
|
|
||||||
curl -s "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude" -o ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json
|
|
||||||
echo "SAVED ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json"
|
|
||||||
## TODO REFRESH OLD spot.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
##############################################################"
|
|
||||||
## GEODATA. continue. Let's extract lieu pdf from my spot
|
|
||||||
##############################################################"
|
|
||||||
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 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 $geodata"
|
|
||||||
|
|
||||||
loop=1
|
|
||||||
while [ $loop -lt 21 ]; do
|
|
||||||
#{"id":"208264","latitude":"40.730727","longitude":"0.367303","hauteur_limite":"0.00","publique":"1","top_liste":"0","code":"APN","validation_admin":"1","distance":"97.341"}
|
|
||||||
# flatten json
|
|
||||||
|
|
||||||
lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
|
|
||||||
## GET RANDOM LIEU ID AND TRY MORE TO GET ( prefered APN)
|
|
||||||
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
|
|
||||||
[[ "$code" != "APN" ]] && [ -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)
|
|
||||||
[[ "$code" != "APN" ]] && [ -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)
|
|
||||||
[[ "$code" != "APN" ]] && [ -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)
|
|
||||||
[ -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)
|
|
||||||
[ -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" == "" ]] && echo "ERROR LIEU NO ID. CONTINUE" && loop=$(($loop+1)) && continue
|
|
||||||
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
# 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" && loop=$(($loop+1)) && continue
|
|
||||||
|
|
||||||
## 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:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
|
|
||||||
rm ./$lid.jpg
|
|
||||||
rm ./bulle.jpg
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd -
|
|
||||||
sleep $((1 + RANDOM % 2))
|
|
||||||
rm -Rf /tmp/$lid
|
|
||||||
|
|
||||||
loop=$(($loop+1));
|
|
||||||
done
|
|
||||||
|
|
||||||
## CHECK SWARM GEODATA MAP
|
|
||||||
# ls -d ~/.zen/ipfs_swarm/.*/astroport/map/*/ | rev | cut -d '/' -f 2 | rev | sort
|
|
||||||
## NB OF lieu: ls -d ~/.zen/ipfs_swarm/.*/astroport/map/p4n/lieu/*/ | rev | cut -d '/' -f 2 | rev | sort | wc
|
|
||||||
# ipfs cat /ipns/$IPFSNODEID/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json | jq
|
|
||||||
exit 0
|
|
|
@ -1,78 +0,0 @@
|
||||||
#!/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') && [[ ! $IPFSNODEID ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
|
|
||||||
|
|
||||||
MEDIAKEYIPNS="$1"&& [[ ! $MEDIAKEYIPNS ]] && echo 'NO MEDIAKEY. Enter ipns/??? value. EXIT' && exit 1
|
|
||||||
OPENACCES="$2" && [[ ! $OPENACCES ]] && echo 'OPEN ACCES TO "$2=$G1PUB"'
|
|
||||||
|
|
||||||
tempdir=$(mktemp -d)
|
|
||||||
cd $tempdir
|
|
||||||
|
|
||||||
## GET CURRENT DHT PROPAGATED VERSION
|
|
||||||
ipfs --timeout=10s get --output="$tempdir" /ipns/$MEDIAKEYIPNS
|
|
||||||
[[ ! $? == 0 ]] && echo "CANNOT GET MEDIAKEY" && exit 1
|
|
||||||
|
|
||||||
## DO I OWN THE KEY, OR SHOUD I REQUEST IT
|
|
||||||
MEDIAKEY=$(cat ./*/.id | tail -n 1)
|
|
||||||
[[ ! $MEDIAKEY ]] && echo "MISSING MATCHING MEDIAKEY ID" && exit 1
|
|
||||||
if [[ ! $(ipfs key list -l | grep $MEDIAKEY) ]]; then
|
|
||||||
## SEND A MESSAGE ASKING FOR THE KEY (I am a bootstrap or http gateway)
|
|
||||||
for sharedowners in $(ls -d */ | cut -d '/' -f 1); do
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "$sharedowners" -t "MEDIAKEY ask for sharing contract" -m "I was wishing to increment $MEDIAKEY views, but not in your contracts yet. Please run ~/.zen/astrXbian/actions/view_counter_increment_or_allow.sh $MEDIAKEYIPNS $G1PUB to activate."
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
## INCREMENT COUNTER
|
|
||||||
## GO INTO $G1PUB EXCHANGE SPACE
|
|
||||||
[[ ! -d ./$G1PUB ]] && echo "MISSING RELATION WITH $G1PUB. EXIT" && exit 1
|
|
||||||
cd $G1PUB
|
|
||||||
count=$(cat .views.counter 2>/dev/null) || count=0
|
|
||||||
echo $((count+1)) > .views.counter
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $OPENACCES ]]; then
|
|
||||||
echo "Creating ${OPENACCES}/.ipns.mediakey.encrypt and .ipfsid.encrypt"
|
|
||||||
## CREATE OFFICIAL RELATION DETECTED BY autoPINfriends.sh with ~/.zen/ipfs_swarm/.12D*/KEY/*/*/${G1PUB}/.ipfsid.encrypt
|
|
||||||
mkdir -p /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/
|
|
||||||
key2send=$(/home/$YOU/.zen/astrXbian/zen/tools/give_me_keystore_filename.py $MEDIAKEY)
|
|
||||||
/home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i /home/$YOU/.ipfs/keystore/$key2send -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipns.mediakey.encrypt
|
|
||||||
|
|
||||||
/home/$YOU/.zen/astrXbian/zen/tools/natools.py decrypt -f pubsec -k "/home/$YOU/.zen/secret.dunikey" -i "/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.ipfsid.encrypt" -o "./ipfsid_$MEDIAKEY.txt"
|
|
||||||
/home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i ./ipfsid_$MEDIAKEY.txt -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipfsid.encrypt
|
|
||||||
## Ask PIN to Bootstraps executed through autoPINfriends.sh
|
|
||||||
rm ./ipfsid_$MEDIAKEY.txt
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## TODO COULD SEND JUNE FOR THAT?
|
|
||||||
syncronizedir="/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}"
|
|
||||||
else
|
|
||||||
syncronizedir="$tempdir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "WE ARE in $syncronizedir"
|
|
||||||
cd $syncronizedir
|
|
||||||
## PUBLISH NEW STATE
|
|
||||||
I=$(ipfs add -qrH $syncronizedir | tail -n 1)
|
|
||||||
echo "CHAIN: $I"
|
|
||||||
echo "$(date -u +%s%N | cut -b1-13)" > .timestamp
|
|
||||||
echo $I > .chain
|
|
||||||
I=$(ipfs add -qrH $syncronizedir | tail -n 1)
|
|
||||||
echo "${MEDIAKEY} NAME PUBLISHING "
|
|
||||||
# MEDIAKEY IPNS name publish
|
|
||||||
J=$(ipfs --timeout=180s name publish --quieter -k ${MEDIAKEY} /ipfs/${I})
|
|
||||||
echo "$MEDIAKEY VIEW COUNTER UPDATED in https://tube.copylaradio.com/ipns/$J/$G1PUB/.views.counter"
|
|
||||||
|
|
470
ajouter_video.sh
|
@ -6,50 +6,27 @@
|
||||||
########################################################################
|
########################################################################
|
||||||
# SCRIPT INTERACTIF POUR AJOUTER UN FICHIER à ASTROPORT/KODI
|
# SCRIPT INTERACTIF POUR AJOUTER UN FICHIER à ASTROPORT/KODI
|
||||||
#
|
#
|
||||||
# 1. CAT: film, serie
|
# 1. CAT: film, serie, anime
|
||||||
# 2. TMDB: ID de la fiche sur https://www.themoviedb.org/
|
# 2. TMDB: ID de la fiche sur https://www.themoviedb.org/
|
||||||
# 3. TITLE: Titre de la vidéo
|
# 3. TITLE: Titre de la vidéo
|
||||||
# 4. YEAR: Année de la vidéo
|
# 4. YEAR: Année de la vidéo
|
||||||
# 5. RES: Résolution 1080p, 4K, SD, 720, HD
|
# 5. RES: Résolution 1080p, 4K, SD, 720, HD
|
||||||
# 6. SAISON: Pour les séries, c'est le numéro de saison.
|
# 6. SAISON: Pour les séries et animes, c'est le numéro de saison.
|
||||||
# Pour un film, le champ SAISON est utilisé pour renseigner la Saga
|
# Pour un film, le champ SAISON est utilisé pour renseigner la Saga
|
||||||
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
|
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
|
||||||
# 8. GROUPES: Stocker la clef IPNS du MEDIAKEY.
|
# 8. GROUPES: Permet de regrouper des films. (choix multiple)
|
||||||
#
|
#
|
||||||
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||||||
########################################################################
|
########################################################################
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
ME="${0##*/}"
|
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 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
|
[[ $(which zenity) == "" ]] && echo "ERREUR! Installez zenity" && echo "sudo apt install zenity" && exit 1
|
||||||
[[ $(which ffmpeg) == "" ]] && echo "ERREUR! Installez ffmpeg" && echo "sudo apt install ffmpeg" && exit 1
|
[[ $(which ffmpeg) == "" ]] && echo "ERREUR! Installez ffmpeg" && echo "sudo apt install ffmpeg" && exit 1
|
||||||
[[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1
|
[[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1
|
||||||
|
|
||||||
# Check who is .current PLAYER
|
|
||||||
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
|
|
||||||
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
|
|
||||||
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
|
|
||||||
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
|
|
||||||
PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
|
|
||||||
MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 )
|
|
||||||
QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 )
|
|
||||||
|
|
||||||
|
|
||||||
URL="$1"
|
|
||||||
if [ $URL ]; then
|
|
||||||
echo "URL: $URL"
|
|
||||||
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
|
|
||||||
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Video" MP3 Web) || IMPORT="Youtube"
|
|
||||||
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
|
|
||||||
CHOICE="$IMPORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ $CHOICE == "Web" ]] && CHOICE="Page" #&& CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source Web est à enregistrer comme " --entry-text="Page" WebSite)
|
|
||||||
|
|
||||||
# REMOVE GtkDialog errors for zenity
|
# REMOVE GtkDialog errors for zenity
|
||||||
shopt -s expand_aliases
|
shopt -s expand_aliases
|
||||||
alias zenity='zenity 2> >(grep -v GtkDialog >&2)'
|
alias zenity='zenity 2> >(grep -v GtkDialog >&2)'
|
||||||
|
@ -62,241 +39,74 @@ large=$((width-300))
|
||||||
haut=$((height-200))
|
haut=$((height-200))
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
|
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||||
[[ -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/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(hostname)
|
||||||
[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
|
|
||||||
|
|
||||||
########################################################################
|
zenity --warning --width 300 --text "Ajoutez une vidéo à ASTROPORT/KODI"
|
||||||
## CADRE EXCEPTION COPIE PRIVE
|
|
||||||
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
|
|
||||||
if [[ ! -f ~/.zen/game/players/.current/legal ]]; then
|
|
||||||
zenity --width ${large} --height=${haut} --text-info \
|
|
||||||
--title="Action conforme avec le Code de la propriété intellectuelle" \
|
|
||||||
--html \
|
|
||||||
--url="https://fr.wikipedia.org/wiki/Droit_d%27auteur_en_France#Les_exceptions_au_droit_d%E2%80%99auteur" \
|
|
||||||
--checkbox="J'ai lu et j'accepte les termes."
|
|
||||||
|
|
||||||
case $? in
|
# CHOOSE CATEGORY
|
||||||
0)
|
CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre vidéo" --entry-text="Film" Serie Anime Youtube MP3)
|
||||||
echo "AUTORISATION COPIE PRIVE ASTROPORT OK !"
|
|
||||||
echo "$G1PUB" > ~/.zen/game/players/.current/legal
|
|
||||||
# next step
|
|
||||||
;;
|
|
||||||
1)
|
|
||||||
echo "Refus conditions"
|
|
||||||
rm -f ~/.zen/game/players/.current/legal
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
-1)
|
|
||||||
echo "Erreur."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
|
|
||||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
|
||||||
[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) && [[ $RUN == "" || $RUN == "NON" ]] && exit 1
|
|
||||||
[[ $YOU && ! $1 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ? Non, vous voulez ajouter un Media?" --entry-text="OUI" NON)
|
|
||||||
## DES/ACTIVATION ASTROPORT
|
|
||||||
if [[ $RUN == "OUI" ]]; then
|
|
||||||
STRAP=$(ipfs bootstrap)
|
|
||||||
BOOT=$(zenity --entry --width 300 --title="Catégorie" --text="$STRAP Changez de Bootstrap" --entry-text="Aucun" astrXbian Public)
|
|
||||||
[[ $BOOT == "Aucun" ]] && ipfs bootstrap rm --all
|
|
||||||
[[ $BOOT == "astrXbian" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
|
||||||
[[ $BOOT == "Public" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_public.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
|
||||||
REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP"
|
|
||||||
fi
|
|
||||||
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 1
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# CHOOSE CATEGORY (remove anime, not working!)
|
|
||||||
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre ajout" --entry-text="AstroBlog" Film Serie Youtube Video)
|
|
||||||
[[ $CHOICE == "" ]] && exit 1
|
[[ $CHOICE == "" ]] && exit 1
|
||||||
|
|
||||||
# LOWER CARACTERS
|
# LOWER CARACTERS
|
||||||
CAT=$(echo "${CHOICE}" | awk '{print tolower($0)}')
|
CAT=$(echo "${CHOICE}" | awk '{print tolower($0)}')
|
||||||
# UPPER CARACTERS
|
PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ...
|
||||||
CHOICE=$(echo "${CAT}" | awk '{print toupper($0)}')
|
|
||||||
|
|
||||||
PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ... P W
|
|
||||||
[[ $PREFIX == "" ]] && exit 1
|
[[ $PREFIX == "" ]] && exit 1
|
||||||
|
|
||||||
########################################################################
|
|
||||||
########################################################################
|
|
||||||
case ${CAT} in
|
case ${CAT} in
|
||||||
########################################################################
|
########################################################################
|
||||||
# CASE ## ASTRONAUTE
|
|
||||||
# _ _
|
|
||||||
# __ _ ___| |_ _ __ ___ _ __ __ _ _ _| |_ ___
|
|
||||||
# / _` / __| __| '__/ _ \| '_ \ / _` | | | | __/ _ \
|
|
||||||
# | (_| \__ \ |_| | | (_) | | | | (_| | |_| | || __/
|
|
||||||
# \__,_|___/\__|_| \___/|_| |_|\__,_|\__,_|\__\___|
|
|
||||||
#
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
astroblog)
|
|
||||||
|
|
||||||
# INSTASCAN G1PUB CAPTURE
|
|
||||||
~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE"
|
|
||||||
|
|
||||||
zenity --warning --width 300 --text "$PLAYER. Prêt à enregistrer votre video ?"
|
|
||||||
|
|
||||||
## RECORD WEBCAM VIDEO
|
|
||||||
~/.zen/Astroport.ONE/tools/vlc_webcam.sh
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
########################################################################
|
|
||||||
# CASE ## YOUTUBE
|
# CASE ## YOUTUBE
|
||||||
# _ _
|
|
||||||
# _ _ ___ _ _| |_ _ _| |__ ___
|
|
||||||
#| | | |/ _ \| | | | __| | | | '_ \ / _ \
|
|
||||||
#| |_| | (_) | |_| | |_| |_| | |_) | __/
|
|
||||||
# \__, |\___/ \__,_|\__|\__,_|_.__/ \___|
|
|
||||||
# |___/
|
|
||||||
########################################################################
|
########################################################################
|
||||||
youtube)
|
youtube)
|
||||||
|
|
||||||
YTURL="$URL"
|
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 == "" ]] && 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
|
[[ $YTURL == "" ]] && exit 1
|
||||||
|
|
||||||
REVSOURCE="$(echo "$YTURL" | awk -F/ '{print $3}' | rev)_"
|
|
||||||
|
|
||||||
# Create TEMP directory to copy $YID_$TITLE.$FILE_EXT
|
# Create TEMP directory to copy $YID_$TITLE.$FILE_EXT
|
||||||
YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)"
|
YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)"
|
||||||
mkdir -p ${YTEMP}
|
mkdir -p ${YTEMP}
|
||||||
|
|
||||||
# youtube-dl $YTURL
|
# youtube-dl $YTURL
|
||||||
echo "VIDEO $YTURL"
|
echo "VIDEO $YTURL"
|
||||||
if [[ ! -f /usr/local/bin/youtube-dl ]]; then
|
/usr/local/bin/youtube-dl -f '[height=720]/best' \
|
||||||
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
|
--write-info-json --write-annotations \
|
||||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
--no-mtime -o "${YTEMP}/%(id)s_%(title)s.%(ext)s" $YTURL
|
||||||
fi
|
|
||||||
/usr/local/bin/youtube-dl -f '[height=360]/best' \
|
|
||||||
--no-playlist --write-info-json \
|
|
||||||
--no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL
|
|
||||||
|
|
||||||
# Get filename, extract ID, make destination dir and move copy.
|
# Get filename, extract ID, make destination dir and move copy.
|
||||||
YFILE=$(ls -S ${YTEMP} | head -n 1)
|
YFILE=$(ls -t ${YTEMP} | head -n 1)
|
||||||
FILE_NAME="$(basename "${YFILE}")"
|
FILE_NAME="$(basename "${YFILE}")"
|
||||||
FILE_EXT="${FILE_NAME##*.}"
|
FILE_EXT="${FILE_NAME##*.}"
|
||||||
|
|
||||||
JSON_FILE=$(echo ${FILE_NAME} | sed "s/${FILE_EXT}/json/g")
|
YID=$(echo "${FILE_NAME}" | cut -d "_" -f 1)
|
||||||
|
YNAME=$(echo "${FILE_NAME}" | cut -d "_" -f 2-)
|
||||||
|
TMDB="${YID}"
|
||||||
|
|
||||||
YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1)
|
FILE_PATH="$HOME/astroport/youtube/$YID"
|
||||||
YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g' ) # Remove YoutubeID_ and (what is in perentheses)
|
|
||||||
[[ $(which detox) ]] && YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)
|
|
||||||
MEDIAID="$REVSOURCE${YID}"
|
|
||||||
TITLE="${YNAME%.*}"
|
|
||||||
MEDIAKEY="YOUTUBE_${MEDIAID}"
|
|
||||||
## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE
|
|
||||||
|
|
||||||
[ ! $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" \
|
|
||||||
FALSE Savoir \
|
|
||||||
FALSE Nature \
|
|
||||||
FALSE Habiter \
|
|
||||||
FALSE Nourrir \
|
|
||||||
FALSE Deplacer \
|
|
||||||
FALSE Guerir \
|
|
||||||
FALSE Divertir \
|
|
||||||
FALSE Musique \
|
|
||||||
FALSE DIY \
|
|
||||||
FALSE Science \
|
|
||||||
FALSE Humain \
|
|
||||||
FALSE Animal \
|
|
||||||
TRUE Eveil \
|
|
||||||
TRUE ${XZUID// /-}) || GENRES="${XZUID// /-}"
|
|
||||||
|
|
||||||
# FORMAT GENRES genre1|genre2|genre3
|
|
||||||
|
|
||||||
FILE_PATH="$HOME/astroport/youtube/$MEDIAID"
|
|
||||||
mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/
|
mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/
|
||||||
# rename FILE_NAME to YNAME (URL clean)
|
|
||||||
mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
|
|
||||||
# get & rename video.json
|
|
||||||
jsonfile=$(ls ${FILE_PATH}/*.json)
|
|
||||||
mv "${jsonfile}" "${FILE_PATH}/video.json"
|
|
||||||
|
|
||||||
|
## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE
|
||||||
|
TITLE="${YNAME%.*}"
|
||||||
|
GENRES="[Youtube]"
|
||||||
|
GROUPES="_IPNSKEY_"
|
||||||
FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2)
|
FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2)
|
||||||
RES=${FILE_RES%?}0p
|
RES=${FILE_RES%?}0p
|
||||||
|
|
||||||
## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json
|
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" (with film CAT !!!)
|
||||||
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
||||||
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
|
echo "film;${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
|
||||||
|
|
||||||
# _IPFSREPFILEID_ is replaced later
|
# _IPFSREPFILEID_ is replaced later
|
||||||
|
|
||||||
rm -Rf ${YTEMP}
|
rm -Rf ${YTEMP}
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# CASE ## WEB
|
|
||||||
web)
|
|
||||||
|
|
||||||
## 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"
|
|
||||||
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="WWW_${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}/
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
zenity --warning --width ${large} --text "Vérifiez que la copie de votre site se trouve bien dans ${FILE_PATH}/"
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# CASE ## PAGE
|
|
||||||
page)
|
|
||||||
|
|
||||||
## 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 -f output.pdf
|
|
||||||
chromium --headless --no-sandbox --print-to-pdf $URL
|
|
||||||
|
|
||||||
TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${URL}")
|
|
||||||
[[ $TITLE == "" ]] && exit 1
|
|
||||||
FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better
|
|
||||||
|
|
||||||
MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)"
|
|
||||||
MEDIAKEY="PAGE_${MEDIAID}"
|
|
||||||
FILE_PATH="$HOME/astroport/page/$MEDIAID"
|
|
||||||
mkdir -p ${FILE_PATH} && mv output.pdf ${FILE_PATH}/${FILE_NAME}
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CASE ## MP3
|
# CASE ## MP3
|
||||||
# _____
|
|
||||||
# _ __ ___ _ __|___ /
|
|
||||||
#| '_ ` _ \| '_ \ |_ \
|
|
||||||
#| | | | | | |_) |__) |
|
|
||||||
#|_| |_| |_| .__/____/
|
|
||||||
# |_|
|
|
||||||
########################################################################
|
########################################################################
|
||||||
mp3)
|
mp3)
|
||||||
|
|
||||||
zenity --warning --width 600 --text 'DEV ZONE . Please Participate https://git.p2p.legal'
|
|
||||||
|
|
||||||
# Create TEMP directory
|
# Create TEMP directory
|
||||||
YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)"
|
YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)"
|
||||||
mkdir -p ${YTEMP}
|
mkdir -p ${YTEMP}
|
||||||
|
|
||||||
artist=$(zenity --entry --width 400 --title "Extraction MP3 depuis Youtube" --text "Artiste recherché ou Lien Youtube" --entry-text="")
|
artist=$(zenity --entry --width 400 --title "Extraction MP3 depuis Youtube" --text "Artiste recherché ou Lien Youtube" --entry-text="")
|
||||||
|
@ -319,7 +129,7 @@ fi
|
||||||
/usr/local/bin/youtube-dl --default-search ytsearch1: \
|
/usr/local/bin/youtube-dl --default-search ytsearch1: \
|
||||||
--ignore-errors --no-mtime \
|
--ignore-errors --no-mtime \
|
||||||
--embed-thumbnail --metadata-from-title "%(artist)s - %(title)s" --add-metadata \
|
--embed-thumbnail --metadata-from-title "%(artist)s - %(title)s" --add-metadata \
|
||||||
--extract-audio --audio-format mp3 -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" "$artist $song"
|
--extract-audio --audio-format mp3 -o "${YTEMP}/%(id)s_%(title)s.%(ext)s" "$artist $song"
|
||||||
|
|
||||||
ls ${YTEMP}
|
ls ${YTEMP}
|
||||||
# Get filename, extract ID, make destination dir and move copy.
|
# Get filename, extract ID, make destination dir and move copy.
|
||||||
|
@ -327,43 +137,34 @@ YFILE=$(ls -t ${YTEMP} | head -n 1)
|
||||||
FILE_NAME="$(basename "${YFILE}")"
|
FILE_NAME="$(basename "${YFILE}")"
|
||||||
FILE_EXT="${FILE_NAME##*.}"
|
FILE_EXT="${FILE_NAME##*.}"
|
||||||
|
|
||||||
YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1)
|
YID=$(echo "${FILE_NAME}" | cut -d "_" -f 1)
|
||||||
YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g') # Remove YoutubeID_ and (what is in perentheses)
|
YNAME=$(echo "${FILE_NAME}" | cut -d "_" -f 2-)
|
||||||
[[ $(which detox) ]] && YNAME="$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)"
|
|
||||||
|
|
||||||
[[ ! $islink && "$song" != "" ]] && FILE_PATH="$HOME/astroport/$CAT/$artist/_o-o_" \
|
[[ ! $islink && "$song" != "" ]] && FILE_PATH="$HOME/astroport/$CAT/$artist/_o-o_" \
|
||||||
|| FILE_PATH="$HOME/astroport/$CAT/${YID}"
|
|| FILE_PATH="$HOME/astroport/$CAT/${YID}"
|
||||||
|
|
||||||
mkdir -p "${FILE_PATH}" && mv -f ${YTEMP}/* "${FILE_PATH}/"
|
mkdir -p "${FILE_PATH}" && mv -f ${YTEMP}/* "${FILE_PATH}/"
|
||||||
# Remove "&" from FILE_NAME rename to YNAME
|
|
||||||
mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
|
|
||||||
|
|
||||||
MEDIAID="${YID}"
|
TMDB="${YID}"
|
||||||
TITLE="${YNAME%.*}"
|
TITLE="${YNAME%.*}"
|
||||||
GENRES="[\"$XZUID\"]"
|
GENRES="[MP3]"
|
||||||
GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY
|
GROUPES="${XZUID}"
|
||||||
MEDIAKEY="MP3_$MEDIAID"
|
|
||||||
|
|
||||||
rm -Rf ${YTEMP}
|
rm -Rf ${YTEMP}
|
||||||
# zenity --warning --width ${large} --text "MP3 copié"
|
# zenity --warning --width ${large} --text "MP3 copié"
|
||||||
echo "~/.zen/astrXbian/zen/new_mp3_in_astroport.sh \"${FILE_PATH}/\" \"${FILE_NAME}\""
|
echo "~/.zen/astrXbian/zen/new_mp3_in_astroport.sh \"${FILE_PATH}/\" \"${FILE_NAME}\""
|
||||||
~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CHOICE}_${MEDIAID}.log 2>&1
|
~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1
|
||||||
|
|
||||||
cat /tmp/${CHOICE}_${MEDIAID}.log
|
cat /tmp/${CAT}_${TMDB}.log
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# __ _ _
|
# CASE ## film serie anime
|
||||||
# / _(_) |_ __ ___
|
|
||||||
#| |_| | | '_ ` _ \
|
|
||||||
#| _| | | | | | | |
|
|
||||||
#|_| |_|_|_| |_| |_| THE MOVIE DATABASE INDEX
|
|
||||||
#
|
|
||||||
########################################################################
|
########################################################################
|
||||||
film | serie)
|
film | serie | anime)
|
||||||
|
|
||||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
||||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
|
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
|
||||||
|
@ -377,25 +178,21 @@ FILE_EXT="${FILE_NAME##*.}"
|
||||||
FILE_TITLE="${FILE_NAME%.*}"
|
FILE_TITLE="${FILE_NAME%.*}"
|
||||||
|
|
||||||
# OPEN default browser and search TMDB
|
# OPEN default browser and search TMDB
|
||||||
zenity --question --width 300 --text "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?"
|
zenity --question --width 300 --text "IMPORTANT! Nous allons ouvrir le site themoviedb pour y récuperer le numéro d'identification de votre vidéo"
|
||||||
[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
|
[ $? == 1 ] && exit 1
|
||||||
|
xdg-open "https://www.themoviedb.org/search?query=${FILE_TITLE}"
|
||||||
|
|
||||||
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Copiez le nom de la page du film. Ex: 301528-toy-story-4 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
|
TMDB=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Exemple: 301528 (à extraire du lien https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
|
||||||
[[ $MEDIAID == "" ]] && exit 1
|
[[ $TMDB == "" ]] && exit 1
|
||||||
CMED=$(echo $MEDIAID | cut -d '-' -f 1)
|
if ! [[ "$TMDB" =~ ^[0-9]+$ ]]
|
||||||
TMTL=$(echo $MEDIAID | cut -d '-' -f 2-) # contient la fin du nom de fichier tmdb (peut servir?)
|
|
||||||
|
|
||||||
if ! [[ "$CMED" =~ ^[0-9]+$ ]]
|
|
||||||
then
|
then
|
||||||
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer... Seules les vidéos référencées sur The Movie Database sont acceptées." && exit 1
|
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer..." && exit 1
|
||||||
fi
|
fi
|
||||||
MEDIAID=$CMED
|
|
||||||
MEDIAKEY="TMDB_$MEDIAID"
|
|
||||||
|
|
||||||
# VIDEO TITLE
|
# VIDEO TITLE
|
||||||
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
|
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
|
||||||
[[ $TITLE == "" ]] && exit 1
|
[[ $TITLE == "" ]] && exit 1
|
||||||
TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;)
|
|
||||||
|
|
||||||
# VIDEO YEAR
|
# VIDEO YEAR
|
||||||
YEAR=$(zenity --entry --width 300 --title "Année" --text "Indiquez année de la vidéo. Exemple: 1985" --entry-text="")
|
YEAR=$(zenity --entry --width 300 --title "Année" --text "Indiquez année de la vidéo. Exemple: 1985" --entry-text="")
|
||||||
|
@ -406,7 +203,7 @@ RES=${FILE_RES%?}0p # Rounding. Replace last digit with 0
|
||||||
#RES=$(zenity --entry --width 300 --title="Résolution" --text="Résolution de la vidéo" --entry-text="${FILE_RES}" SD HD 4K 360p 480p 720p 1080p)
|
#RES=$(zenity --entry --width 300 --title="Résolution" --text="Résolution de la vidéo" --entry-text="${FILE_RES}" SD HD 4K 360p 480p 720p 1080p)
|
||||||
|
|
||||||
# VIDEO SEASON or SAGA
|
# VIDEO SEASON or SAGA
|
||||||
[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
|
[[ "${CAT}" == "serie" || "${CAT}" == "anime" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
|
||||||
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
|
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
|
||||||
|
|
||||||
# VIDEO GENRES
|
# VIDEO GENRES
|
||||||
|
@ -452,93 +249,32 @@ FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
|
||||||
FALSE Sport\
|
FALSE Sport\
|
||||||
FALSE Telefilm\
|
FALSE Telefilm\
|
||||||
FALSE Thriller\
|
FALSE Thriller\
|
||||||
FALSE Western\
|
FALSE Western)
|
||||||
TRUE ${XZUID// /-})
|
|
||||||
|
|
||||||
# FORMAT GENRES ["genre1","genre2"]
|
# FORMAT GENRES ["genre1","genre2"]
|
||||||
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
||||||
|
[[ $GENRES == "" ]] && exit 1
|
||||||
|
|
||||||
|
# VIDEO GROUP (was XZUID, now becoming IPNS key)
|
||||||
|
# GROUPES=$(zenity --entry --width 300 --title "Groupe" --text "Associez la vidéo à un groupe (optionnel). Exemple: PIXAR" --entry-text="${XZUID}")
|
||||||
|
GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS LINK : Replaced later
|
||||||
|
|
||||||
# DEBUG VERIFICATION
|
# DEBUG VERIFICATION
|
||||||
# zenity --question --width ${large} --title "EMBARQUEMENT ASTROPORT! OK?"\
|
# zenity --question --width ${large} --title "EMBARQUEMENT ASTROPORT! OK?"\
|
||||||
# --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})"
|
# --text "${FILE_NAME} (${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})"
|
||||||
# [ $? == 1 ] && echo "ANNULATION." && exit 1
|
# [ $? == 1 ] && echo "ANNULATION." && exit 1
|
||||||
|
|
||||||
########################################################################
|
### OK MOVING FILE TO ASTROPORT ####
|
||||||
# Screen capture is used as thumbnail
|
mkdir -p ~/astroport/${CAT}/${TMDB}/
|
||||||
########################################################################
|
|
||||||
if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then
|
|
||||||
zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA"
|
|
||||||
sleep 1
|
|
||||||
import -window root /tmp/screen.png
|
|
||||||
fi
|
|
||||||
|
|
||||||
###################################
|
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT}" && zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..."
|
||||||
### MOVING FILE TO ~/astroport ####
|
|
||||||
###################################
|
|
||||||
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
|
|
||||||
mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png
|
|
||||||
|
|
||||||
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
|
||||||
|
|
||||||
if [ $? == 0 ]; then
|
|
||||||
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..."
|
|
||||||
else
|
|
||||||
zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
FILE_NAME="${TITLE}.${FILE_EXT}"
|
FILE_NAME="${TITLE}.${FILE_EXT}"
|
||||||
|
|
||||||
|
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt"
|
||||||
## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt"
|
|
||||||
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
||||||
echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
echo "${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
|
||||||
# _IPFSREPFILEID_ is replaced later
|
# _IPFSREPFILEID_ is replaced later
|
||||||
|
|
||||||
;;
|
|
||||||
# _ _
|
|
||||||
#__ _(_) __| | ___ ___
|
|
||||||
#\ \ / / |/ _` |/ _ \/ _ \
|
|
||||||
# \ V /| | (_| | __/ (_) |
|
|
||||||
# \_/ |_|\__,_|\___|\___/
|
|
||||||
# TIMESTAMP INDEX
|
|
||||||
|
|
||||||
video)
|
|
||||||
|
|
||||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Inscrivez-vous sur https://git.p2p.legal'
|
|
||||||
|
|
||||||
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
|
|
||||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
|
||||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier vidéo à ajouter")
|
|
||||||
echo "${FILE}"
|
|
||||||
[[ $FILE == "" ]] && exit 1
|
|
||||||
|
|
||||||
# Remove file extension to get file name => STITLE
|
|
||||||
FILE_PATH="$(dirname "${FILE}")"
|
|
||||||
FILE_NAME="$(basename "${FILE}")"
|
|
||||||
FILE_EXT="${FILE_NAME##*.}"
|
|
||||||
FILE_TITLE="${FILE_NAME%.*}"
|
|
||||||
# VIDEO TITLE
|
|
||||||
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
|
|
||||||
[[ $TITLE == "" ]] && exit 1
|
|
||||||
TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;)
|
|
||||||
|
|
||||||
OUTPUT=$(zenity --forms --width ${large} --title="METADATA" --text="Ajouter des métadonnées" --separator=";" --add-entry="Sous titres" --add-entry="Hashtag(s)")
|
|
||||||
[[ $? != 0 ]] && echo "FAIL" && exit 1
|
|
||||||
|
|
||||||
DESCRIPTION=$(awk -F ';' '{print $1}' <<<$OUTPUT)
|
|
||||||
HASHTAG=$(awk -F ';' '{print $2}' <<<$OUTPUT)
|
|
||||||
|
|
||||||
## video_timestamp INDEX
|
|
||||||
MEDIAID="$(date -u +%s%N | cut -b1-13)"
|
|
||||||
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
|
|
||||||
MEDIAKEY="VIDEO_${MEDIAID}"
|
|
||||||
|
|
||||||
## CREATE SIMPLE JSON
|
|
||||||
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"htag":$htag}' > ~/astroport/${CAT}/${MEDIAID}/video.json
|
|
||||||
## MOVE FILE TO IMPORT ZONE
|
|
||||||
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
|
||||||
FILE_NAME="${TITLE}.${FILE_EXT}"
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -553,97 +289,11 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## Extract thumbnail
|
|
||||||
MIME=$(file --mime-type $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} | cut -d ' ' -f 2)
|
|
||||||
|
|
||||||
[[ $(echo $MIME | grep video) ]] && ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/${CAT}.png
|
|
||||||
[[ ! -f /astroport/${CAT}/${MEDIAID}/${CAT}.png ]] && echo "DEFAULT THUMBNAIL NEEDED"
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# ADD $FILE to IPFS / ASTROPORT / KODI
|
# ADD $FILE to IPFS / ASTROPORT / KODI
|
||||||
echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" $3
|
|
||||||
[[ -f ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt ]] && cat ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
|
||||||
# LOG NOISE # [[ -f ~/astroport/${CAT}/${MEDIAID}/video.json ]] && cat ~/astroport/${CAT}/${MEDIAID}/video.json
|
|
||||||
########################################################################
|
########################################################################
|
||||||
## CREATION DU FICHIER ajouter_video.txt OK
|
~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${TMDB}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1
|
||||||
########################################################################
|
|
||||||
### AJOUT DANS IPFS #######################################################
|
|
||||||
########################################################################
|
|
||||||
####################################new_file_in_astroport.sh##################
|
|
||||||
########################################################################
|
|
||||||
[[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB"
|
|
||||||
|
|
||||||
timestamp=$(date -u +%s%N | cut -b1-13)
|
|
||||||
|
|
||||||
|
|
||||||
## AUTO DESTRUCTIVE LATER ADD TO ASTROPORT SCRIPT
|
|
||||||
echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
#[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\"
|
|
||||||
#reponse=\$1
|
|
||||||
#[[ ! \$reponse ]] && read reponse
|
|
||||||
#if [[ ! \$reponse ]]; then
|
|
||||||
# ffmpeg -i \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/astroport/${MEDIAID}.mp4
|
|
||||||
# mv \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
|
|
||||||
# mv $HOME/astroport/${MEDIAID}.mp4 \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
|
|
||||||
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
|
|
||||||
#else" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
|
|
||||||
# $3 is the G1PUB of the PLAYER (search in code to find where)
|
|
||||||
echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" \"$3\"" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
|
|
||||||
#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
|
|
||||||
echo "rm -f /tmp/\${MEDIAKEY}.pass
|
|
||||||
rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS
|
|
||||||
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
|
|
||||||
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
|
|
||||||
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
|
|
||||||
|
|
||||||
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
|
|
||||||
|
|
||||||
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${MEDIAID}/" "${FILE_NAME}" > /tmp/${MEDIAKEY}.log 2>&1
|
|
||||||
# [ ! $? == 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... Signalez ce log /tmp/${MEDIAKEY}.log sur https://git.p2p.legal/axiom-team/astrXbian" && exit 1
|
|
||||||
########################################################################
|
########################################################################
|
||||||
########################################################################
|
########################################################################
|
||||||
########################################################################
|
[ $? == 0 ] && zenity --warning --width 300 --text "OK! Votre source vidéo $cat a été transférée dans Astroport" && exit 0 \
|
||||||
########################################################################
|
|| zenity --warning --width 300 --text "Désolé une erreur est survenue... LOG: /tmp/${CAT}_${TMDB}.log" && exit 1
|
||||||
########################################################################
|
|
||||||
MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY)
|
|
||||||
|
|
||||||
#[ ! $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:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \
|
|
||||||
# --checkbox="Je m'engage à respecter les auteurs et promet d'offrir la Monnaie Libre collectée à qui de droit."
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY"
|
|
||||||
########################################################################
|
|
||||||
FILE_BSIZE=$(du -b "$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}" | awk '{print $1}')
|
|
||||||
FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }')
|
|
||||||
|
|
||||||
#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
|
|
||||||
# [ ! $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)
|
|
||||||
#else
|
|
||||||
ZENBALANCE=0
|
|
||||||
#fi
|
|
||||||
########################################################################
|
|
||||||
########################################################################
|
|
||||||
if [ $1 ]; then
|
|
||||||
bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"
|
|
||||||
[ $? == 0 ] && echo "${MEDIAKEY} is RECORDED in ASTROPORT. GOOD." && exit 0
|
|
||||||
|
|
||||||
else
|
|
||||||
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \
|
|
||||||
[ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \
|
|
||||||
&& zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
|
|
||||||
&& [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|
|
||||||
&& xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \
|
|
||||||
|| ( zenity --warning --width 300 --text "Désolé une erreur est survenue... cat /tmp/${MEDIAKEY}.log" && exit 1 )\
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
|
|
365
cron_MINUTE.sh
|
@ -5,9 +5,6 @@
|
||||||
# Version: 0.3
|
# Version: 0.3
|
||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
########################################################################
|
########################################################################
|
||||||
# REGULATEUR DES PULSATIONS DE L'AUTOMATE # CADENCE # 1/60 Hz
|
|
||||||
# INJECTEZ VOS ACTIONS DANS LES CYCLES...
|
|
||||||
########################################################################
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
ME="${0##*/}"
|
ME="${0##*/}"
|
||||||
|
@ -18,61 +15,23 @@ source $HOME/.profile
|
||||||
[[ ! $(echo $PATH | grep "$HOME/.local/bin") ]] && export PATH="$PATH:$HOME/.local/bin"
|
[[ ! $(echo $PATH | grep "$HOME/.local/bin") ]] && export PATH="$PATH:$HOME/.local/bin"
|
||||||
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
|
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
|
||||||
|
|
||||||
#### CONTROL STATION IPFS DAEMON
|
#### INIT STATION PARAMETERS
|
||||||
## timeout is fixing ipfs minimum response time, before considering stuck process
|
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID)
|
[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs 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)
|
# CORRECT VSTREAM ASTROPORT SITE REMOVAL AFTER UPDATE
|
||||||
if [[ ! ${YOU} ]]; then
|
|
||||||
|
|
||||||
# Refresh Peering.Peers
|
|
||||||
ipfs config --json Peering.Peers '[]'
|
|
||||||
# DHT PUBSUB mode
|
|
||||||
ipfs config Pubsub.Router gossipsub
|
|
||||||
# MAXSTORAGE = 1/2 available
|
|
||||||
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
|
||||||
diskSize="$((availableDiskSize / 2))"
|
|
||||||
ipfs config Datastore.StorageMax $diskSize
|
|
||||||
## Activate Rapid "ipfs p2p"
|
|
||||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
|
||||||
ipfs config --json Experimental.P2pHttpProxy true
|
|
||||||
# control water levels for swarm
|
|
||||||
ipfs config --json Swarm.ConnMgr.LowWater 50
|
|
||||||
ipfs config --json Swarm.ConnMgr.HighWater 100
|
|
||||||
|
|
||||||
[ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs
|
|
||||||
echo "ERROR! ipfs daemon was not running. RELAUNCHING."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
########################################################################
|
|
||||||
# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE : TODO DEBUG KODI PLUGIN !!! TODO MAKE PLAYER ROTATION
|
|
||||||
[[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ]] && [[ -f ~/.zen/astroport.py ]] && cp -f ~/.zen/astroport.py ~/.kodi/addons/plugin.video.vstream/resources/sites/
|
[[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ]] && [[ -f ~/.zen/astroport.py ]] && cp -f ~/.zen/astroport.py ~/.kodi/addons/plugin.video.vstream/resources/sites/
|
||||||
[[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ]] && cp ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ~/.kodi/addons/plugin.video.vstream/resources/art/ 2>/dev/null
|
#####################################################
|
||||||
########################################################################
|
|
||||||
|
|
||||||
### NO IP GATEWAY : EXIT (COULD BE Astroport.ONE Ambassy Alone !!)
|
### NO IP GATEWAY : EXIT
|
||||||
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "LAN OK" || exit 1
|
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2> /dev/null && echo "OK" > /dev/null || (echo "NO GATEWAY CONNEXION" && exit 1)
|
||||||
|
|
||||||
########################################################################
|
|
||||||
### TEMP CODE (add missing packages to xbian) - TODO REMOVE after 30 mn for git pull & apply
|
|
||||||
# [[ $(which ffmpeg) == "" && "$USER" == "xbian" ]] && sudo apt-get update && sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel mpack libssl-dev libffi-dev build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils vlc mp3info x11-utils -y
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# HELP DEVLT: Search "TODO" in code
|
# HELP DEVLT: Search "TODO" in code
|
||||||
|
# Write what you thing about the situation
|
||||||
|
# AND how you would like to 'fix it'...
|
||||||
|
# Then friends can read and enhance solution.
|
||||||
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
|
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
|
||||||
# _ _____ ____ _ _______ ________ ____
|
# _ _____ ____ _ _______ ________ ____
|
||||||
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
|
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
|
||||||
|
@ -86,12 +45,11 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo
|
||||||
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
|
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
|
||||||
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
|
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
|
||||||
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
||||||
|
export isinotifywaitRunning=$(ps auxf --sort=+utime | grep -w inotifywait | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
||||||
########################################################################
|
########################################################################
|
||||||
cd $MY_PATH
|
cd $MY_PATH
|
||||||
|
|
||||||
########################################################################
|
# WHAT UNIVERSAL TIME is it ?
|
||||||
# WHAT TIME(s) is it ?
|
|
||||||
timestamp="$(date -u +%s%N | cut -b1-13)"
|
|
||||||
minute=$(date -u +%M)
|
minute=$(date -u +%M)
|
||||||
heure=$(date -u +%H)
|
heure=$(date -u +%H)
|
||||||
timebar="$heure:$minute"
|
timebar="$heure:$minute"
|
||||||
|
@ -99,202 +57,91 @@ dayoftheweek=$(date +%w)
|
||||||
dayofthemonth=$(date +%d)
|
dayofthemonth=$(date +%d)
|
||||||
weeknumber=$(date +%V)
|
weeknumber=$(date +%V)
|
||||||
|
|
||||||
# WAKEUP TIME
|
echo $timebar
|
||||||
if [[ ! -f /tmp/A_Station_ON ]]; then
|
|
||||||
echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /tmp/A_Station_ON
|
|
||||||
else
|
|
||||||
source /tmp/A_Station_ON
|
|
||||||
old=$ontimebar
|
|
||||||
new=$timebar
|
|
||||||
# feeding variables by using read and splitting with IFS
|
|
||||||
IFS=: read old_hour old_min <<< "$old"
|
|
||||||
IFS=: read hour min <<< "$new"
|
|
||||||
# convert hours to minutes
|
|
||||||
# the 10# is there to avoid errors with leading zeros
|
|
||||||
# by telling bash that we use base 10
|
|
||||||
total_old_minutes=$((10#$old_hour*60 + 10#$old_min))
|
|
||||||
total_minutes=$((10#$hour*60 + 10#$min))
|
|
||||||
runtime=$((total_minutes - total_old_minutes))
|
|
||||||
runtime=${runtime#-}
|
|
||||||
fi
|
|
||||||
# RUN TIME $runtime
|
|
||||||
|
|
||||||
echo "RUNTIME $runtime mn ($timebar)"
|
|
||||||
|
|
||||||
|
|
||||||
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=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/.player; cat $line; done
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
########################################################################
|
|
||||||
## CHECK & (RE)ACTIVATE ipfs p2p tunnels
|
|
||||||
########################################################################
|
|
||||||
# NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com)
|
|
||||||
~/.zen/astrXbian/zen/ipfs_P2P_forward.sh
|
|
||||||
########## SUPPORT : OPEN OR CLOSE SSH ACCESS #################
|
|
||||||
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH
|
|
||||||
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# DEFCON
|
|
||||||
########################################################################
|
|
||||||
# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use.
|
|
||||||
[[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario
|
[[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario
|
||||||
## DEFCON SYSTEM ACTIVATED
|
|
||||||
|
|
||||||
# _ ____
|
# ____ _______ __ __
|
||||||
# / | | ___| _ __ ___ _ __
|
# / __ \/ ____/ | / / ____ ___ ____ ____/ /__
|
||||||
# | | |___ \ | '_ ` _ \| '_ \
|
# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \
|
||||||
# | | ___) | | | | | | | | | |
|
# / /_/ / /___ | |/ / / / / / / / /_/ / /_/ / __/
|
||||||
# |_| |____/ |_| |_| |_|_| |_|
|
# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/
|
||||||
#
|
#
|
||||||
|
#
|
||||||
########################################################################
|
# ACTIVATE 15-17 MN "git pull" update
|
||||||
# SMARM MAINTENANCE / 15 mn
|
if [[ $(($minute % 15)) == 0 ]]; then
|
||||||
########################################################################
|
|
||||||
# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID
|
|
||||||
########################################################################
|
|
||||||
# ACTIVATE 15 MN "git pull" update
|
|
||||||
if [[ $(($runtime % 15)) == 0 ]]; then
|
|
||||||
|
|
||||||
########## DESYNCH SWARM NODE REQUESTS #################
|
########## DESYNCH SWARM NODE REQUESTS #################
|
||||||
[[ ! -d ~/.zen/Astroport.ONE ]] && cd ~/.zen && git clone https://git.p2p.legal/qo-op/Astroport.ONE.git
|
sleep $((1 + RANDOM % 120))
|
||||||
[[ -d ~/.zen/Astroport.ONE ]] && cd ~/.zen/Astroport.ONE && sleep $((1 + RANDOM % 12)) && git pull
|
git pull
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# RE/LAUNCHING INSTASCAN API
|
|
||||||
instascan=$(ps auxf --sort=+utime | grep -w nc | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
|
||||||
[[ $instascan ]] && killall instascan_login.sh && killall nc # && ~/.zen/Astroport.ONE/tools/instascan_login.sh &
|
|
||||||
# [[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh &
|
|
||||||
|
|
||||||
# git reset --hard
|
|
||||||
cd $MY_PATH
|
|
||||||
sleep $((1 + RANDOM % 3)) && git pull
|
|
||||||
|
|
||||||
[[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE"
|
|
||||||
# if [[ $(diff ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml) ]]; then
|
|
||||||
# cp ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml
|
|
||||||
# echo "MAJ Vstream settings"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE
|
|
||||||
## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd -
|
|
||||||
|
|
||||||
# CLEAN AND REMOVE BAD DIRECTORIES should be in .$IPFSNODEID to avoid Station collision.
|
|
||||||
## BYPASS index.html DELETION
|
|
||||||
[[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html
|
|
||||||
|
|
||||||
[[ -d ~/.zen/ipfs/astroport ]] && rm -Rf ~/.zen/ipfs/astroport
|
|
||||||
[[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport
|
|
||||||
[[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian
|
|
||||||
[[ -d ~/.zen/ipfs_swarm/xbian ]] && rm -Rf ~/.zen/ipfs_swarm/xbian
|
|
||||||
[[ -d ~/.zen/ipfs/PIN ]] && rm -Rf ~/.zen/ipfs/PIN
|
|
||||||
[[ -d ~/.zen/ipfs_swarm/PIN ]] && rm -Rf ~/.zen/ipfs_swarm/PIN
|
|
||||||
## CLEANING PARASITE BAD FILES
|
|
||||||
rm -Rf ~/.zen/ipfs/*
|
|
||||||
rm ~/.zen/ipfs/.*
|
|
||||||
rm -Rf ~/.zen/ipfs_swarm/*
|
|
||||||
rm ~/.zen/ipfs_swarm/.*
|
|
||||||
|
|
||||||
## RESTORE index.html from /tmp/ipfsindex.html
|
|
||||||
[[ -f /tmp/ipfsindex.html ]] && mv /tmp/ipfsindex.html ~/.zen/ipfs/index.html
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# __ __ _____ ____
|
# __ __ _____ ____
|
||||||
# __/ // /_/ ___/ ______ __________ ___ / __ \
|
# __/ // /_/ ___/ ______ __________ ___ / __ \
|
||||||
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
|
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
|
||||||
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
|
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
|
||||||
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync
|
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/
|
||||||
#
|
#
|
||||||
##################################################################
|
##################################################################
|
||||||
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
|
|
||||||
## SYNC GCHANGE EVERY 12 hours runtime
|
|
||||||
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
|
|
||||||
# ~/.zen/Astroport.ONE/tools/Connect_PLAYER_To_Gchange.sh > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.tx
|
|
||||||
# TODO REWRITE GCHANGE SYNC.
|
|
||||||
fi
|
|
||||||
# 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
|
|
||||||
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 % 26)) == 0 ]]; then
|
|
||||||
kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh"
|
|
||||||
killall chromium
|
|
||||||
$MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt
|
|
||||||
$MY_PATH/zen/tools/autoPINfriends.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.autoPINfriends.txt
|
|
||||||
fi
|
|
||||||
##################################################################
|
|
||||||
#
|
#
|
||||||
# _________ ______
|
# REFRESH IPFS SWARM DATA EVERY 20-23 minutes
|
||||||
# ____ ___ ____ /_ __/ | / ____/
|
[[ $(($minute % 20)) == 0 ]] && sleep $((1 + RANDOM % 180)) && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
|
||||||
# /_ / / _ \/ __ \ / / / /| |/ / __
|
|
||||||
# / /_/ __/ / / / / / / ___ / /_/ /
|
|
||||||
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
|
||||||
#
|
#
|
||||||
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
|
|
||||||
### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive
|
|
||||||
################################################
|
|
||||||
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)
|
|
||||||
########################################################################
|
|
||||||
###
|
|
||||||
# _ _
|
# _ _
|
||||||
# __ _| |__ (_) __ _ _ __
|
# __ _| |__ (_) __ _ _ __
|
||||||
# \ \/ / '_ \| |/ _` | '_ \
|
# \ \/ / '_ \| |/ _` | '_ \
|
||||||
# > <| |_) | | (_| | | | |
|
# > <| |_) | | (_| | | | |
|
||||||
# /_/\_\_.__/|_|\__,_|_| |_| inotifywait
|
# /_/\_\_.__/|_|\__,_|_| |_| ASTROPORT youtube mp3
|
||||||
#
|
#
|
||||||
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
|
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
|
||||||
# Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS
|
# Transfert ~/astroport/*/files to IPFS and make Vstream/ASTROPORT indexes in IPNS
|
||||||
## TEST AUTOMATIC NEW FILE IMPORT. xbian only.
|
|
||||||
if [[ "$USER" == "xbian" ]]; then
|
if [[ "$USER" == "xbian" ]]; then
|
||||||
[[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport
|
# LAUNCH inotifywait
|
||||||
# VERIFY LAUNCH inotifywait ?!
|
if [[ ! $isinotifywaitRunning ]]; then
|
||||||
inotifywaitRunning=$(ps auxf --sort=+utime | grep -w inotifywait | grep -w astroport | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
|
mkdir -p /home/$YOU/astroport
|
||||||
if [[ "$inotifywaitRunning" != "xbian" ]]
|
/usr/bin/inotifywait -r -e close_write -m /home/$YOU/astroport | while read dir flags file; do $MY_PATH/zen/new_file_in_astroport.sh "$dir" "$file"; done &
|
||||||
then
|
fi
|
||||||
/usr/bin/inotifywait -r -e close_write -m /home/$USER/astroport | while read dir flags file; do $MY_PATH/zen/new_file_in_astroport.sh "$dir" "$file"; done >> /tmp/astroport.inotify.log 2>&1 &
|
|
||||||
|
# RESTART inotifywait (may be useless)
|
||||||
|
if [[ "$timebar" == "03:03" ]]; then
|
||||||
|
killall inotifywait
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
## TODO investigate could breaks "ipfs p2p" forwards ?
|
||||||
|
##################################################################
|
||||||
|
|
||||||
##########################################################
|
# _________ _______ __ _ __
|
||||||
|
# / ____< / /_ __/ |/ / ____ ___ ____ ____ (_) /_____ _____
|
||||||
|
# / / __ / / / / | / / __ `__ \/ __ \/ __ \/ / __/ __ \/ ___/
|
||||||
|
# / /_/ // / / / / | / / / / / / /_/ / / / / / /_/ /_/ / /
|
||||||
|
# \____//_/ /_/ /_/|_| /_/ /_/ /_/\____/_/ /_/_/\__/\____/_/
|
||||||
|
#
|
||||||
|
##################################################################
|
||||||
|
# MONITOR INPUT TX (NOT ACTIVATED YET)
|
||||||
|
# Activate ZenTx => File become a wallet PASSENGER with CONTRACT(s)
|
||||||
|
# [[ $(($minute % 5)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/g1_MONITOR_zen.sh "5 minutes"
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" ]]; then
|
||||||
|
#### DESYNC
|
||||||
|
sleep $((1 + RANDOM % 5))
|
||||||
|
##################################################################
|
||||||
|
#
|
||||||
|
# _________ ______
|
||||||
|
# ____ ___ ____ /_ __/ | / ____/
|
||||||
|
# /_ / / _ \/ __ \ / / / /| |/ / __
|
||||||
|
# / /_/ __/ / / / / / / ___ / /_/ /
|
||||||
|
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
||||||
|
#
|
||||||
|
# REFRESHing KEY ZenTAG nano DHTs => Zen File ECONOMY door
|
||||||
|
$MY_PATH/zen/ipns_TAG_refresh.sh
|
||||||
|
fi
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
##################################################################
|
##################################################################
|
||||||
# 5 mn / 24h REBOOT & MIDNIGHT:01 : CLEANING & UPDATE
|
# MIDNIGHT:01 : CLEANING & UPDATE
|
||||||
##################################################################
|
##################################################################
|
||||||
##################################################################
|
##################################################################
|
||||||
if [[ "$timebar" == "00:01" || "$runtime" == "30" || $(($runtime % 1380)) == 0 ]]; then
|
if [[ "$timebar" == "00:01" ]]; then
|
||||||
echo '
|
echo '
|
||||||
# ____ ____ ____ ___
|
# ____ ____ ____ ___
|
||||||
# / __ \/ __ \ _ / __ < /
|
# / __ \/ __ \ _ / __ < /
|
||||||
|
@ -304,84 +151,38 @@ echo '
|
||||||
#
|
#
|
||||||
# MAINTENANCE
|
# MAINTENANCE
|
||||||
'
|
'
|
||||||
sleep $((1 + RANDOM % 12)) ### Be careful if random sleep is not activated...
|
sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated...
|
||||||
############################## That swarm could become an aggressive blob !!
|
############################## That swarm could become an aggressive blob !!
|
||||||
### PEACE & LOVE software is processing... We are HyperWeb people here.
|
### PEACE & LOVE software is processing... We are HyperWeb people here.
|
||||||
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.
|
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.
|
||||||
# GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. LIBRE WE ARE.
|
# GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. LIBRE WE ARE.
|
||||||
####################################################################
|
####################################################################
|
||||||
# REFRESH & UPGRADE youtube-dl
|
# REFRESH & UPGRADE youtube-dl
|
||||||
$MY_PATH/.install/youtube-dl.sh ## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE.
|
|
||||||
youtube-dl --rm-cache-dir
|
youtube-dl --rm-cache-dir
|
||||||
youtube-dl -U
|
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
|
if [[ $dayoftheweek == 0 ]]; then
|
||||||
# _____ __ __ ___
|
#
|
||||||
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
|
# _____ __ __ ___
|
||||||
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
|
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
|
||||||
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
|
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
|
||||||
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
|
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
|
||||||
# /____/
|
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
|
||||||
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
|
# /____/
|
||||||
|
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
|
||||||
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
||||||
availableDiskSize="$(($availableDiskSize * 1024))"
|
|
||||||
|
|
||||||
diskSize="$((availableDiskSize / 2))"
|
diskSize="$((availableDiskSize / 2))"
|
||||||
ipfs config Datastore.StorageMax $diskSize
|
ipfs config Datastore.StorageMax $diskSize
|
||||||
echo "StorageMax = $diskSize"
|
echo "StorageMax = $diskSize"
|
||||||
|
|
||||||
# New full test review in gchange_INIT.sh
|
# LOG ROTATE
|
||||||
rm -f ~/.ipfs/test.disk
|
[[ -f /tmp/astroport.log ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
|
||||||
rm -f /tmp/instascan.log
|
|
||||||
|
|
||||||
# LOG ROTATE WEEKLY
|
|
||||||
[[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
##################################################################
|
||||||
|
|
||||||
##################################################################
|
|
||||||
## CHECK STARTGATE LEVEL KEYS
|
|
||||||
# _ open _
|
|
||||||
# ___| |_ __ _ _ __ __ _ __ _| |_ ___
|
|
||||||
#/ __| __/ _` | '__/ _` |/ _` | __/ _ \
|
|
||||||
#\__ \ || (_| | | | (_| | (_| | || __/
|
|
||||||
#|___/\__\__,_|_| \__, |\__,_|\__\___|
|
|
||||||
# |___/
|
|
||||||
# IPNS KEYS used to publish with star friends (creates 5 levels of streaming / file sharing)
|
|
||||||
# RESET
|
|
||||||
ipfs key rm star_1; ipfs key rm star_2; ipfs key rm star_3; ipfs key rm star_4; ipfs key rm star_5
|
|
||||||
rm -Rf ~/.zen/key/
|
|
||||||
# RENEW & SEND STARS TO FRIENDS ~/.zen/astrXbian/zen/manage_stargates.sh
|
|
||||||
$MY_PATH/zen/manage_stargates.sh
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# ACTIVATE TO CONTROL SWARM STATION SAME CODE VERSION
|
|
||||||
########################################################################
|
|
||||||
## myCODE is a SECURITY about code SIMILARITY
|
|
||||||
## EACH NODE CAN CHECK IF ANOTHER HAS SAME IPFS CODE HASH
|
|
||||||
MyCODE=$(ipfs add -rq --ignore="__pycache__" ~/.zen/astrXbian/ | tail -n 1)
|
|
||||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/.mycode ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode
|
|
||||||
[[ "$(cat ~/.zen/ipfs/.${IPFSNODEID}/.mycode)" != "$MyCODE" ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode
|
|
||||||
echo "MyCODE = $MyCODE CODE is ready to be published"
|
|
||||||
########################################################################
|
|
||||||
# MEAN CONTROL SWARM STATION HAVE SAME CODE VERSION
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### DISAPEAR ONE HOUR FROM IPFS SWARM ZOMBIES > 300 peers in swarm
|
|
||||||
#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then
|
|
||||||
#if [[ "$timebar" == "04:05" ]]; then
|
|
||||||
# ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR
|
|
||||||
## SWITCHING ON
|
|
||||||
# echo "1" > ~/.zen/ipfs/.$IPFSNODEID/.switch
|
|
||||||
#fi
|
|
||||||
#fi
|
|
||||||
## BETTER ACTIVATING DEFCON 3 / swarm.key MODE
|
|
||||||
|
|
BIN
disk.png
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 44 KiB |
|
@ -20,27 +20,3 @@
|
||||||
|
|
||||||
* Email de fred: support@qo-op.com (principal contributeur)
|
* Email de fred: support@qo-op.com (principal contributeur)
|
||||||
* contributeur Hayssam: https://t.me/hayssamhoballah
|
* contributeur Hayssam: https://t.me/hayssamhoballah
|
||||||
|
|
||||||
# jaklis : commandes de messaging / like
|
|
||||||
```
|
|
||||||
## GET ALERT MESSAGES
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$G1PUB" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ALERT")' | jq -r '.id'
|
|
||||||
|
|
||||||
## SEND MONITORING MESSAGE TO onelove
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "Ee1n3hDv9vunfd6m3LW6XeYg7bnt5aaRn9EjqnBe8GNS" -t "MONITORING" -f ~/.zen/A_my_swarm.txt
|
|
||||||
|
|
||||||
## LINKING ME PEOPLE
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer'
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# EXEMPLES DE COMMANDES BALISES
|
|
||||||
```
|
|
||||||
|
|
||||||
## CHECK SWARM STATIONS TIMESTAMPS
|
|
||||||
for g1id in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS); do echo $g1id; [[ "$g1id" == "index.html" ]] && continue; ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1id); ts=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.timestamp); echo $(date -ud @$ts); done
|
|
||||||
for ts in $(cat ~/.zen/ipfs_swarm/.*/.timestamp); do echo $(date -ud @$ts); done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 13 KiB |
|
@ -1,110 +0,0 @@
|
||||||
# Sauvegarder / Restaurer votre station Astroport
|
|
||||||
|
|
||||||
Cette procédure va être très vite simplifée, puisqu'il suffit de conserver ses identifiants et de retrouver un ami de niveau 5 pour restaurer sa station.
|
|
||||||
|
|
||||||
Vous avez déjà installé votre station Astroport lors de la phase Alpha lancée en janvier 2021?
|
|
||||||
Vous changez de machine et souhaitez ré-installer Astroport/KODI sur la nouvelle en conservant votre identité, votre cercle d'amis et vos partages?
|
|
||||||
|
|
||||||
Voici comment prendre soin de votre station!
|
|
||||||
|
|
||||||
## Fichiers à conserver
|
|
||||||
|
|
||||||
![](./astroport_backup.1.bashrc.ipfs.zen.png)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### ~/.ipfs
|
|
||||||
|
|
||||||
![](./astroport_backup.2.ipfs.png)
|
|
||||||
|
|
||||||
```~/.ipfs/``` contient contient toutes vos données conservés dans IPFS.
|
|
||||||
A moins que vos amis ne les ai déjà consulté, vous êtes le seul à encore les posséder (PIN)
|
|
||||||
|
|
||||||
Pour les sauvegarder, arrêter le processus ```sudo service ipfs stop``` (ou effacer ultérieurement ```repo.lock``` de votre sauvegarde)
|
|
||||||
|
|
||||||
Conserver tout son contenu pour être sûr de tout retrouver...
|
|
||||||
|
|
||||||
Mais tout n'est pas aussi radical avec Astroport ;)
|
|
||||||
Si vos données se sont déjà "répandues", vos amis vous permettront de les récupérer!!
|
|
||||||
|
|
||||||
IMPORTANT
|
|
||||||
Vous avez confiance en vos amis alors sauvegarder au minimum
|
|
||||||
```
|
|
||||||
# Votre identité dans l'essaim IPFS
|
|
||||||
~/.ipfs/config
|
|
||||||
|
|
||||||
# Le dossier clefs IPNS (qui permettent la mise à jour de vos index et meta-données)
|
|
||||||
~/.ipfs/keystore
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### ~/.zen
|
|
||||||
|
|
||||||
![](./astroport_backup.3.zen.png)
|
|
||||||
|
|
||||||
IMPORTANT
|
|
||||||
C'est là que se trouvent les données utilisées par Astroport pour maintenir la mémoire de l'automate cellulaire qui fait vibrer votre station.
|
|
||||||
|
|
||||||
Indispensable pour conserver vos index, méta-données ainsi que les G1 paramètres de votre station!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### ~/.bashrc
|
|
||||||
|
|
||||||
```
|
|
||||||
~/.bashrc
|
|
||||||
```
|
|
||||||
|
|
||||||
IMPORTANT
|
|
||||||
Ce fichier permet à votre système LINUX de fournir vos clefs publiques au **bash**. Conservez le!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### ~/astroport
|
|
||||||
|
|
||||||
OPTIONNEL
|
|
||||||
Ce sont les vestiges de vos vidéos, mp3, documents qui restent accessibles dans l'espace de votre système de fichier "traditionnel".
|
|
||||||
|
|
||||||
Si vous avez sauvegardé tout ```~/.ipfs``` et que vous comptez sur Astroport/KODI pour les retrouver chez vos amis, vous pouvez les ignorer.
|
|
||||||
Ils pourront être récupérés depuis votre essaim.
|
|
||||||
|
|
||||||
Enfin, si la quantité de données est importante, vous pouvez quand même le sauvegarder pour gagner du temps sur la restauration.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Restaurer
|
|
||||||
|
|
||||||
### Rapsberry Pi
|
|
||||||
|
|
||||||
Monter l'image astrXbian (clic droit "Monter image disque"), puis placer les fichiers de votre sauvegarde dans le répertoire ```/media/$USER/xbian-copy/home/@/xbian``` avant de flasher votre Raspberry Pi
|
|
||||||
|
|
||||||
Activer crontab de l'automate
|
|
||||||
```
|
|
||||||
~/.zen/astrXbian/zen/cron_VRFY.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Tester si tout marche. Lancer à la main les commandes lancées dans cron_MINUTE.sh
|
|
||||||
|
|
||||||
```
|
|
||||||
~/.zen/astrXbian/zen/gchange_INIT.sh
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### PC Debian
|
|
||||||
|
|
||||||
Appuyez sur "Ctrl+C" avant que la phase "INITIALISATIOn Astroport/KODI" ne se lance.
|
|
||||||
Remettez les fichiers précisés plus haut, et voila.
|
|
||||||
|
|
||||||
### Scripts
|
|
||||||
|
|
||||||
A venir... les commandes à lancer pour automatiser la sauvegarde (minimale/intégrale) et sa restauration (par ses amis/entièrement soit-même)
|
|
||||||
|
|
||||||
**NB:** IPFS autorise la sauvegarde/restauration automatique de votre station avec celle(s) de vos amis.
|
|
||||||
Cette fonctionnalité sera activée en même temps que l'activation des "ZEN CONTRACTS" pour permettre de définir un modèle économique à cette étape.
|
|
||||||
|
|
||||||
Chaque ami de niveau 5 va reçevoir la sauvegarde de votre profil.
|
|
||||||
|
|
||||||
|
|
||||||
![](./favori_astroport.png)
|
|
Before Width: | Height: | Size: 41 KiB |
BIN
docs/hayssam.png
Before Width: | Height: | Size: 349 KiB |
128
include.sh
|
@ -1,128 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
[ "${DEBUG}" ] && set -x
|
|
||||||
|
|
||||||
i_am() {
|
|
||||||
echo 'v0.5.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
i_am_root() {
|
|
||||||
[ $(id -u) -eq 0 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
i_am_xbian() {
|
|
||||||
[[ "$USER" == "xbian" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
i_should_install() {
|
|
||||||
[[ ! -f ~/.zen/secret.dunikey ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
import_astrXbian() {
|
|
||||||
echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal"
|
|
||||||
mkdir -p ~/.zen
|
|
||||||
cd ~/.zen
|
|
||||||
# TODO INSTALL FROM IPFS / IPNS
|
|
||||||
[ ! -d astrXbian ] \
|
|
||||||
&& git clone https://git.p2p.legal/axiom-team/astrXbian.git \
|
|
||||||
|| GIT_DIR=astrXbian/.git git pull
|
|
||||||
[ ! -d Astroport.ONE ] \
|
|
||||||
&& git clone https://git.p2p.legal/qo-op/Astroport.ONE.git \
|
|
||||||
|| GIT_DIR=Astroport.ONE git pull
|
|
||||||
}
|
|
||||||
|
|
||||||
import_astroport() {
|
|
||||||
echo "INITIALISATIOn Astroport/KODI"
|
|
||||||
echo "Appuyez sur la touche ENTREE pour démarrer le mode Aventure"
|
|
||||||
echo "sinon interrompez ici l'installation, et activez votre Ambassade ~/.zen/Astroport.ONE/start.sh"
|
|
||||||
read
|
|
||||||
~/.zen/Astroport.ONE/adventure.sh
|
|
||||||
# ~/.zen/astrXbian/ISOconfig.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
import_ipfs() {
|
|
||||||
## Scripts pour systemd ou InitV (xbian)
|
|
||||||
echo "=== Activation SYSTEM IPFS"
|
|
||||||
~/.zen/astrXbian/.install/ipfs_alone.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
import_jaklis() {
|
|
||||||
echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+"
|
|
||||||
cd ~/.zen/astrXbian/zen/jaklis
|
|
||||||
./setup.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
import_kodi() {
|
|
||||||
[[ ! $(which kodi) && "$user" != "xbian" ]] &&\
|
|
||||||
echo ">>> installation kodi + vstream = votre videotheque ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" \
|
|
||||||
&& sudo apt-get install kodi -y \
|
|
||||||
&& ~/.zen/astrXbian/.install/kodi_uqload_downloader.sh
|
|
||||||
|
|
||||||
echo "=== IMPORT configuration ASTROPORT dans ~/.kodi"
|
|
||||||
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
|
|
||||||
}
|
|
||||||
|
|
||||||
install_requirements() {
|
|
||||||
echo "mise à jour des dépots de votre distribution..."
|
|
||||||
sudo apt-get update
|
|
||||||
|
|
||||||
PACKAGES=""
|
|
||||||
INSTALL_PACKAGES=""
|
|
||||||
[[ "$user" != "xbian" ]] && PACKAGES="x11-utils xclip zenity handbrake*"
|
|
||||||
PACKAGES="${PACKAGES} git fail2ban netcat-traditional inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv swig libgpgme-dev mpack libssl-dev libffi-dev"
|
|
||||||
PACKAGES="${PACKAGES} build-essential qrencode jq bc file gawk yt-dlp ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick libcurl4-openssl-dev"
|
|
||||||
# python pip install dependencies
|
|
||||||
PACKAGES="${PACKAGES} libcairo2-dev libgirepository1.0-dev pkg-config"
|
|
||||||
# AstroGEEK OpenCV = 'Intelligence Amie'
|
|
||||||
PACKAGES="${PACKAGES} python3-opencv"
|
|
||||||
for package in ${PACKAGES}; do\
|
|
||||||
[ $(dpkg-query -W -f='${status}' ${package} 2>/dev/null | grep -c "ok installed") -eq 0 ] \
|
|
||||||
&& apt-cache show ${package} > /dev/null 2>&1 \
|
|
||||||
&& INSTALL_PACKAGES="${INSTALL_PACKAGES} ${package}"
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -n "${INSTALL_PACKAGES# *}" ] \
|
|
||||||
&& echo ">>> installation ${INSTALL_PACKAGES} <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" \
|
|
||||||
&& sudo apt install -y ${INSTALL_PACKAGES}
|
|
||||||
|
|
||||||
## Correct PDF restrictions for imagemagick
|
|
||||||
echo "# Correction des droits export PDF 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
|
|
||||||
|
|
||||||
echo "###########################"
|
|
||||||
echo "## INSTALL PYTHON CRYPTO LAYER "
|
|
||||||
echo "###########################"
|
|
||||||
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo ">>> PATH=$PATH"
|
|
||||||
python3 -m pip install -U pip
|
|
||||||
python3 -m pip install setuptools wheel
|
|
||||||
python3 -m pip install cryptography Ed25519 base58 google duniterpy pynacl pgpy gpg
|
|
||||||
python3 -m pip install pycairo
|
|
||||||
python3 -m pip install nicotine-plus silkaj
|
|
||||||
python3 -m pip install protobuf==3.19.0
|
|
||||||
|
|
||||||
if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI
|
|
||||||
echo "Ambassade? Souhaitez vous ajouter imprimante 'brother_ql'? Saisissez OUI, sinon laissez vide et tapez sur ENTRER"
|
|
||||||
read saisie
|
|
||||||
if [[ $saisie != "" ]]; then
|
|
||||||
sudo apt install printer-driver-all cups -y
|
|
||||||
sudo pip3 install brother_ql
|
|
||||||
sudo cupsctl --remote-admin
|
|
||||||
sudo usermod -aG lpadmin pi
|
|
||||||
sudo usermod -a -G gammu pi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# python3 -m pip install -U silkaj
|
|
||||||
## python -> python3 link
|
|
||||||
sudo ln -f -s /usr/bin/python3 /usr/bin/python
|
|
||||||
}
|
|
||||||
|
|
||||||
prepare_next_boot() {
|
|
||||||
cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0"
|
|
||||||
# PREPARE NEXT BOOT - Network config - NEXTBOOT - ISOConfig - NEXTBOOT - OK
|
|
||||||
echo "su - xbian -c '~/.zen/astrXbian/FirstBOOT.sh'" >> /tmp/new.rc.local
|
|
||||||
echo "exit 0" >> /tmp/new.rc.local
|
|
||||||
sudo cp -f /tmp/new.rc.local /etc/rc.local
|
|
||||||
}
|
|
155
install.sh
|
@ -1,63 +1,56 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Version: 0.5.0
|
# Version: 0.2
|
||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||||||
########################################################################
|
########################################################################
|
||||||
{
|
{
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
ME="${0##*/}"
|
|
||||||
|
|
||||||
# INSTALLATION section of README does wget file install.sh and run it with bash
|
if [[ ! -f ~/.zen/secret.june ]];
|
||||||
if [ -f ${MY_PATH}/include.sh ]; then
|
|
||||||
. ${MY_PATH}/include.sh
|
|
||||||
else
|
|
||||||
. <(wget -T3 -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/include.sh)
|
|
||||||
fi
|
|
||||||
|
|
||||||
! type i_should_install >/dev/null 2>&1 && echo 'ERROR: Unable to load include.sh' && exit 1
|
|
||||||
|
|
||||||
i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
|
|
||||||
|
|
||||||
# MAIN # SI AUCUNE CLEF DE STATION...
|
|
||||||
if i_should_install;
|
|
||||||
then
|
then
|
||||||
|
|
||||||
[[ ! $(which ipfs) ]] && echo "=== installez ipfs !!" && echo "https://docs.ipfs.io/install/command-line/#official-distributions" && exit 1
|
# Check requirements
|
||||||
echo "astrxbian installateur pour distributions debian et dérivées : linuxmint (https://www.linuxmint.com/) ou xbian (https://xbian.org) recommandées"
|
echo "AstrXbian installateur pour https://xbian.org et autres ditributions basées sur DEBIAN"
|
||||||
echo "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications)
|
sudo apt-get update
|
||||||
echo
|
sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel mpack libssl-dev libffi-dev -y
|
||||||
|
sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils vlc mp3info -y
|
||||||
|
[[ ! $(which kodi) ]] && sudo apt-get install kodi -y
|
||||||
|
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y
|
||||||
|
# [[ ! $(which apache2) ]] && sudo apt-get install mariadb-server nginx 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
|
||||||
|
pip3 install cryptography Ed25519 base58 google protobuf duniterpy
|
||||||
|
|
||||||
# Install requirements
|
|
||||||
install_requirements
|
|
||||||
|
|
||||||
# Clone astrXbian and Astroport.One
|
|
||||||
import_astrXbian
|
|
||||||
|
|
||||||
# Init ipfs
|
|
||||||
# import_ipfs
|
|
||||||
|
|
||||||
# Copy astroport config in kodi
|
|
||||||
# import_kodi
|
|
||||||
|
|
||||||
# Jaklis setup
|
|
||||||
import_jaklis
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN"
|
echo "Clonage git astrXbian depuis https://git.p2p.legal"
|
||||||
|
mkdir -p ~/.zen
|
||||||
|
cd ~/.zen
|
||||||
|
git clone https://git.p2p.legal/axiom-team/astrXbian.git
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "Configuration ASTROPORT de ~/.kodi"
|
||||||
|
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "Installation de IPFS https://ipfs.io"
|
||||||
|
~/.zen/astrXbian/.install/ipfs_alone.sh
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "Configuration des communications avec GCHANGE+"
|
||||||
|
cd ~/.zen/astrXbian/zen/jaklis
|
||||||
|
./setup.sh
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
echo "Sécurisation DEFCON SUDOERS FAIL2BAN"
|
||||||
## XBIAN fail2ban ERROR correction ##
|
## XBIAN fail2ban ERROR correction ##
|
||||||
#[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
|
#[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
|
||||||
i_am_xbian && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf
|
[[ "$USER" == "xbian" ]] && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf
|
||||||
# NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh
|
|
||||||
|
|
||||||
### MODIFIYING /etc/sudoers ###
|
### MODIFIYING /etc/sudoers ###
|
||||||
i_am_xbian && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport')
|
# DEFCON LEVEL < 5
|
||||||
|
# echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo
|
||||||
|
# NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh
|
||||||
|
|
||||||
# PERSONNAL DEFCON LEVEL
|
if [[ "$USER" == "xbian" ]]
|
||||||
# cp ~/.zen/astrXbian/DEFCON ~/.zen/
|
|
||||||
|
|
||||||
if i_am_xbian
|
|
||||||
then
|
then
|
||||||
echo "enabling ipfs initV service autostart"
|
echo "enabling ipfs initV service autostart"
|
||||||
cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs
|
cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs
|
||||||
|
@ -68,59 +61,51 @@ then
|
||||||
cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs
|
cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs
|
||||||
cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs
|
cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs
|
||||||
cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs
|
cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs
|
||||||
|
|
||||||
# Disable xbian-config auto launch
|
|
||||||
echo 0 > ~/.xbian-config-start
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CREATE ~/astroport FILESYSTEM GATE
|
echo "Configuration ASTROPORT/KODI"
|
||||||
|
~/.zen/astrXbian/ISOconfig.sh
|
||||||
|
|
||||||
|
echo "Redémarrage des services..."
|
||||||
|
sudo service ipfs restart
|
||||||
|
sudo service fail2ban restart
|
||||||
|
|
||||||
|
# CREATE ~/astroport FILE GATE
|
||||||
mkdir -p ~/astroport/film
|
mkdir -p ~/astroport/film
|
||||||
mkdir -p ~/astroport/serie
|
mkdir -p ~/astroport/serie
|
||||||
mkdir -p ~/astroport/anime
|
mkdir -p ~/astroport/anime
|
||||||
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt
|
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
|
||||||
|
|
||||||
echo "## INSTALL open_with_linux.py ##
|
|
||||||
## https://darktrojan.github.io/openwith/webextension.html"
|
|
||||||
~/.zen/astrXbian/open_with_linux.py install
|
|
||||||
|
|
||||||
echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !!
|
|
||||||
# https://addons.mozilla.org/firefox/addon/open-with/
|
|
||||||
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
|
|
||||||
|
|
||||||
if ! i_am_xbian
|
|
||||||
then
|
|
||||||
## Desktop install
|
|
||||||
import_astroport
|
|
||||||
else
|
|
||||||
## Rpi Xbian install.
|
|
||||||
prepare_next_boot
|
|
||||||
|
|
||||||
echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI"
|
|
||||||
echo "Faites une ISO : sudo xbian-config"
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
|
echo "Installation complete !!
|
||||||
else
|
|
||||||
|
|
||||||
echo "Installation existante !!
|
==================================================
|
||||||
========================
|
BIENVENUE DANS le service ASTROPORT/KODI/VSTREAM
|
||||||
Astroport/KODI (Gchange)
|
==================================================
|
||||||
========================
|
|
||||||
Connectez-vous sur https://gchange.fr avec vos identifiants
|
1. Connectez-vous sur https://gchange.fr avec vos identifiants
|
||||||
|
|
||||||
$(cat ~/.zen/secret.june)
|
$(cat ~/.zen/secret.june)
|
||||||
|
|
||||||
https://astroport.com
|
2. Rejoignez-y vos amis, et échangez des étoiles avec eux pour créer vos cercles de liaisons amicales.
|
||||||
|
|
||||||
|
3. Ajoutez vos vidéos avec le lien Astroport/Kodi sur votre bureau
|
||||||
|
|
||||||
|
==========================================================
|
||||||
|
Maintenant, redémarrez votre ordinateur pour rejoindre ASTROPORT
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
GCHANGE (Firefox)
|
||||||
|
https://github.com/duniter-gchange/gchange-client/releases/download/v1.2.7/gchange-v1.2.7-extension-firefox.xpi
|
||||||
|
Vos identifiants sont dans dans ~/.zen/secret.june
|
||||||
|
|
||||||
|
CESIUM (Firefox)
|
||||||
|
https://github.com/duniter/cesium/releases/download/v1.6.7/cesium-v1.6.7-extension-firefox.xpi
|
||||||
|
Utilisez ~/.zen/secret.duniter pour accéder à votre portefeuille
|
||||||
|
|
||||||
|
---
|
||||||
|
Rendons le monde numérique LIBRE P2P et LEGAL
|
||||||
|
[REC] Team : https://copylaradio.com
|
||||||
"
|
"
|
||||||
|
|
||||||
# MAIN #
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~/.zen/astrXbian/zen/cron_VRFY.sh
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/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
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add user to be able to modify nginx directories
|
|
||||||
sudo usermod -a -G "$USER" www-data
|
|
||||||
sudo chmod g+rw /var/www/html
|
|
||||||
|
|
||||||
## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1:8080/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
|
|
||||||
|
|
|
@ -1,257 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
########################################################################
|
|
||||||
{ # this ensures the entire script is downloaded #
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
ME="${0##*/}"
|
|
||||||
|
|
||||||
# CHECK not root user !!
|
|
||||||
if [ "$EUID" -eq 0 ]
|
|
||||||
then echo -e "DO NOT EXECUTE AS root. Choose a user for your Astroport Station (we like pi)"
|
|
||||||
exit 1
|
|
||||||
else echo -e "OK $USER, let's go!";
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Hello,
|
|
||||||
|
|
||||||
This script (you could read and modify as it is open source software) is about to transform your computer into an astroport station.
|
|
||||||
|
|
||||||
This process involve different upgrades to be made on your system.
|
|
||||||
1. install IPFS, the interplanetary file system (https://ipfs.io)
|
|
||||||
2. install python cryptographic libraries to run natools, your key wizard companion
|
|
||||||
3. download 'astroport' code release you have choosen.
|
|
||||||
|
|
||||||
~/.zen directory and datastructure will emerge
|
|
||||||
~/.zen/ipfs & ~/.zen/ipfs_swarm contains all meshed media index from you and your friends.
|
|
||||||
|
|
||||||
ASTROPORT is activated by cron every minute it maintains the connection with your friends.
|
|
||||||
It is the vessel that gives you avvess to your p2p AVATAR.
|
|
||||||
You carry and share your data around your friends through a confidence network
|
|
||||||
established through 1 to 5 'hearts' exchanged, opening 5 stargates where any can push/pull data.
|
|
||||||
|
|
||||||
TODO
|
|
||||||
Just indicate which is the directory assigned to each star.
|
|
||||||
Then any of your friends from such star level can replicate (modify) those data with you.
|
|
||||||
|
|
||||||
Your station is publishing its index every time it changes and every 6 hours for all MEDIAKEY from PIN station.
|
|
||||||
Following that principle add new directory into ~/.zen/ipfs and index any dataset, it will be published on your IPFS semaphore.
|
|
||||||
|
|
||||||
Now you need to enter your password to obtain sudo access.
|
|
||||||
Please.
|
|
||||||
"
|
|
||||||
# Ask user password on start
|
|
||||||
sudo true
|
|
||||||
|
|
||||||
## Error funciton
|
|
||||||
err() {
|
|
||||||
echo -e "ERREUR: $1"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# CHECK if daemon is already running
|
|
||||||
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
|
|
||||||
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
|
|
||||||
echo "ipfs bootstrap list: " && ipfs bootstrap list
|
|
||||||
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
|
|
||||||
echo "Please RUN : sudo service ipfs stop"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script EXIT" && exit 1
|
|
||||||
|
|
||||||
echo -e "Check and install python curl, git and tools."
|
|
||||||
|
|
||||||
[[ $(which pip3) ]] && python3 -m pip install -U pip && python3 -m pip install -U wheel cryptography Ed25519 base58 google protobuf duniterpy==0.62.0 termcolor python-dotenv gql==3.0.0a5 requests pybase64 || (echo "python3 pip3 is missing on your device. EXIT" && exit 1)
|
|
||||||
[[ ! $(which curl) ]] && sudo apt-get install curl -y
|
|
||||||
[[ ! $(which git) ]] && sudo apt-get install git -y
|
|
||||||
|
|
||||||
[[ ! -d ~/.zen ]] && mkdir ~/.zen
|
|
||||||
|
|
||||||
# CHECK node IP isLAN?
|
|
||||||
myIP=$(hostname -I | awk '{print $1}')
|
|
||||||
echo "Your IP is $myIP"
|
|
||||||
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
|
||||||
[[ $isLAN ]] && echo "You are located in a LAN" || echo "You have a public IP address"
|
|
||||||
MACHINE_TYPE=`uname -m`
|
|
||||||
echo "You are running $MACHINE_TYPE CPU"
|
|
||||||
|
|
||||||
echo "Downloading ipfs binaries"
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
else
|
|
||||||
echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
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"
|
|
||||||
rm $MY_PATH/ipfs-update.tar.gz
|
|
||||||
cd /usr/src/ipfs-update/
|
|
||||||
sudo ./install.sh || err "Install ipfs-update"
|
|
||||||
cd $MY_PATH
|
|
||||||
|
|
||||||
echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>>"
|
|
||||||
sudo ipfs-update install 0.9.1 || err "Install IPFS"
|
|
||||||
|
|
||||||
else
|
|
||||||
## TERRAPI4 aarch64 install ipfs_aarch64_v0.9.1
|
|
||||||
echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>> arm64"
|
|
||||||
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
|
|
||||||
cd /usr/src/go-ipfs/
|
|
||||||
sudo ./install.sh || err "Install ipfs_aarch64"
|
|
||||||
cd $MY_PATH
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# INIT ipfs
|
|
||||||
[[ $isLAN ]] && ipfs init -p lowpower \
|
|
||||||
|| ipfs init -p server
|
|
||||||
|
|
||||||
## Special Xbian init.d config
|
|
||||||
## DEBIAN SYSTEMCTL
|
|
||||||
echo "SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>> ON"
|
|
||||||
cat > /tmp/ipfs.service <<EOF
|
|
||||||
[Unit]
|
|
||||||
Description=IPFS daemon
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=_USER_
|
|
||||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
|
|
||||||
Restart=on-failure
|
|
||||||
CPUAccounting=true
|
|
||||||
CPUQuota=60%
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
|
|
||||||
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
|
|
||||||
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
|
|
||||||
echo "Activating ipfs daemon >>>>>>>>>>>>>>>>>> "
|
|
||||||
# echo "Vous pouvez régler la ressouce CPU maximum (60%)?" && read cpuy
|
|
||||||
|
|
||||||
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable ipfs
|
|
||||||
|
|
||||||
|
|
||||||
###########################################
|
|
||||||
echo "# ACTIVATE IPFS OPTIONS: #swarm0 INIT"
|
|
||||||
###########################################
|
|
||||||
### IMPORTANT !!!!!!! IMPORTANT !!!!!!
|
|
||||||
###########################################
|
|
||||||
# DHT PUBSUB mode
|
|
||||||
ipfs config Pubsub.Router gossipsub
|
|
||||||
# MAXSTORAGE = 1/2 available
|
|
||||||
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
|
||||||
diskSize="$((availableDiskSize / 2))"
|
|
||||||
ipfs config Datastore.StorageMax $diskSize
|
|
||||||
## Activate Rapid "ipfs p2p"
|
|
||||||
ipfs config --json Experimental.Libp2pStreamMounting true
|
|
||||||
ipfs config --json Experimental.P2pHttpProxy true
|
|
||||||
ipfs config --json Swarm.ConnMgr.LowWater 50
|
|
||||||
ipfs config --json Swarm.ConnMgr.HighWater 100
|
|
||||||
|
|
||||||
## Install gateway on 8181 port
|
|
||||||
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# GET IPFS KEYS & CONVERSIONS
|
|
||||||
########################################################################
|
|
||||||
IPFSNODEID=$(ipfs config Identity.PeerID)
|
|
||||||
## TODO convert to secret.dunikey
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "CREATION IDENTITE BALISE IPFS ~/.zen/ipfs/.${IPFSNODEID} /G1SSB"
|
|
||||||
########################################################################
|
|
||||||
rm -Rf ~/.zen/ipfs
|
|
||||||
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
|
|
||||||
########################################################################
|
|
||||||
# Give $XZUID to your (gchange friends)
|
|
||||||
########################################################################
|
|
||||||
XZUID="$(hostname)-$RANDOM$RANDOM"
|
|
||||||
echo "SETTING .player PROFILE NAME = $XZUID"
|
|
||||||
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player
|
|
||||||
echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player'
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
########################################################################
|
|
||||||
echo "Getting tryme.addr & .mycode from OASIS
|
|
||||||
-- Change oasis address to fork your Astroport Code Universe --"
|
|
||||||
########################################################################
|
|
||||||
ipfs bootstrap rm --all
|
|
||||||
|
|
||||||
OASIS=12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
|
|
||||||
# aries=12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
|
|
||||||
for bootnode in $(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/tryme.addr)
|
|
||||||
do
|
|
||||||
## ADD $bootnode TO BOOTSTRAP
|
|
||||||
ipfs bootstrap add $bootnode
|
|
||||||
done
|
|
||||||
|
|
||||||
codesign=$(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/.mycode)
|
|
||||||
|
|
||||||
## ADD NETWORK EXPLORATION FROM LIKES
|
|
||||||
########################################################################
|
|
||||||
echo "RESTARTING ipfs"
|
|
||||||
########################################################################
|
|
||||||
sudo service ipfs restart
|
|
||||||
echo ".... WAIT for SWARM to connect ..."
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
echo ".... ACTUAL SWARM PEERS ..."
|
|
||||||
ipfs swarm peers
|
|
||||||
|
|
||||||
echo "IPFS DONE
|
|
||||||
====================
|
|
||||||
Station Astroport INSTALL
|
|
||||||
Activation ~/.zen/astrXbian/zen/cron_VRFY.sh
|
|
||||||
Récupération CODE /ipfs/$codesign
|
|
||||||
"
|
|
||||||
|
|
||||||
## GETTING SAME SOURCE CODE AS OASIS
|
|
||||||
mkdir -p /home/$USER/.zen/astrXbian/
|
|
||||||
ipfs get --output=/home/$USER/.zen/astrXbian/ /ipfs/$codesign
|
|
||||||
|
|
||||||
## Make scripts executable
|
|
||||||
find /home/$USER/.zen/astrXbian/ -name "*.sh" -exec chmod u+x '{}' \;
|
|
||||||
find /home/$USER/.zen/astrXbian/ -name "*.py" -exec chmod u+x '{}' \;
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "# Setting $USER SUDO permissions ON fail2ban mount umount apt-get apt systemctl"
|
|
||||||
########################################################################
|
|
||||||
## USED FOR fail2ban-client (DEFCON)
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
|
|
||||||
## USED FOR RAMDISK (video live streaming)
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/mount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/mount')
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/umount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/umount')
|
|
||||||
## USED FOR SYSTEM UPGRADE
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt-get')
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt')
|
|
||||||
## USED FOR "systemctl restart ipfs"
|
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
|
|
||||||
|
|
||||||
## TODO G1SSB CONFIG
|
|
||||||
echo "## INSTALL TiddlyWiki /ipns/${IPFSNODEID}/.${IPFSNODEID}/index.html"
|
|
||||||
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
|
|
||||||
|
|
||||||
|
|
||||||
echo "Congratulation ! You are part of the astroport interplanetary fleet.
|
|
||||||
|
|
||||||
New. Activate your station offline storage.
|
|
||||||
Install ipfs companion : https://docs.ipfs.io/install/ipfs-companion/
|
|
||||||
FR : https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/
|
|
||||||
"
|
|
||||||
|
|
||||||
echo "FIND AND CONNECT WITH YOUR FRIENDS
|
|
||||||
https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/"
|
|
||||||
## OPEN https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/
|
|
||||||
|
|
||||||
} # this ensures the entire script is downloaded #
|
|
||||||
# IPFS CONFIG documentation: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm
|
|
|
@ -1 +0,0 @@
|
||||||
minetest.conf
|
|
|
@ -1,107 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
enable_damage = false
|
|
||||||
enable_pvp = false
|
|
||||||
creative_mode = true
|
|
||||||
enable_build_where_you_stand = true
|
|
||||||
|
|
||||||
# Controls length of day/night cycle.
|
|
||||||
# Examples:
|
|
||||||
# 72 = 20min, 360 = 4min, 1 = 24hour, 0 = day/night/whatever stays unchanged.
|
|
||||||
# type: int
|
|
||||||
time_speed = 1
|
|
||||||
|
|
||||||
# Name of map generator to be used when creating a new world.
|
|
||||||
# Creating a world in the main menu will override this.
|
|
||||||
# Current mapgens in a highly unstable state:
|
|
||||||
# - The optional floatlands of v7 (disabled by default).
|
|
||||||
# type: enum values: v7, valleys, carpathian, v5, flat, fractal, singlenode, v6
|
|
||||||
# mg_name = v7
|
|
||||||
mg_name = singlenode
|
|
||||||
# singlenode = que de l'air ; le mod "startanode" permet d'ajouter un cube au spawn
|
|
||||||
|
|
||||||
# Player is able to fly without being affected by gravity.
|
|
||||||
# This requires the "fly" privilege on the server.
|
|
||||||
# type: bool
|
|
||||||
free_move = true
|
|
||||||
|
|
||||||
# Fast movement (via the "special" key).
|
|
||||||
# This requires the "fast" privilege on the server.
|
|
||||||
# type: bool
|
|
||||||
fast_move = false
|
|
||||||
|
|
||||||
|
|
||||||
# The privileges that new users automatically get.
|
|
||||||
# See /privs in game for a full list on your server and mod configuration.
|
|
||||||
# type: string
|
|
||||||
default_privs = interact, shout, fly, fast
|
|
||||||
|
|
||||||
# Privileges that players with basic_privs can grant
|
|
||||||
# type: string
|
|
||||||
basic_privs = interact, shout, fly, fast
|
|
||||||
|
|
||||||
# Where the map generator stops.
|
|
||||||
# Please note:
|
|
||||||
# - Limited to 31000 (setting above has no effect)
|
|
||||||
# - The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks).
|
|
||||||
# - Those groups have an offset of -32, -32 nodes from the origin.
|
|
||||||
# - Only groups which are within the map_generation_limit are generated
|
|
||||||
# type: int min: 0 max: 31000
|
|
||||||
#mapgen_limit = 216
|
|
||||||
mapgen_limit = 31000
|
|
||||||
|
|
||||||
# If this is set, players will always (re)spawn at the given position.
|
|
||||||
# type: string
|
|
||||||
static_spawnpoint = (0, 0, 0)
|
|
||||||
|
|
||||||
# magpen flags
|
|
||||||
mg_flags = trees,decorations
|
|
||||||
|
|
||||||
# mapgen v6
|
|
||||||
mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes,noflat,trees
|
|
||||||
mgv6_freq_desert = 0.05
|
|
||||||
mgv6_freq_beach = 0.95
|
|
||||||
|
|
||||||
# Humidity variation for biomes.
|
|
||||||
# type: noise_params_2d
|
|
||||||
mgv6_np_humidity = {
|
|
||||||
offset = 0.5,
|
|
||||||
scale = 0.5,
|
|
||||||
spread = (2, 3, 2),
|
|
||||||
seed = 72384,
|
|
||||||
octaves = 3,
|
|
||||||
persistence = 0.50,
|
|
||||||
lacunarity = 2.0,
|
|
||||||
flags = eased
|
|
||||||
}
|
|
||||||
|
|
||||||
# Defines tree areas and tree density.
|
|
||||||
# type: noise_params_2d
|
|
||||||
mgv6_np_trees = {
|
|
||||||
offset = 0,
|
|
||||||
scale = 1,
|
|
||||||
spread = (2, 3, 2),
|
|
||||||
seed = 2,
|
|
||||||
octaves = 4,
|
|
||||||
persistence = 0.66,
|
|
||||||
lacunarity = 2.0,
|
|
||||||
flags = eased
|
|
||||||
}
|
|
||||||
|
|
||||||
# Defines areas with sandy beaches.
|
|
||||||
# type: noise_params_2d
|
|
||||||
mgv6_np_beach = {
|
|
||||||
offset = 0,
|
|
||||||
scale = 1,
|
|
||||||
spread = (50, 50, 50),
|
|
||||||
seed = 59420,
|
|
||||||
octaves = 3,
|
|
||||||
persistence = 0.50,
|
|
||||||
lacunarity = 2.0,
|
|
||||||
flags = eased
|
|
||||||
}
|
|
||||||
|
|
||||||
secure.trusted_mods = wiki
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,259 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
MINETEST_PATH=/home/pi/.minetest
|
|
||||||
WORLD_NAME=astroport
|
|
||||||
WORLD_PATH=$MINETEST_PATH/worlds/$WORLD_NAME
|
|
||||||
|
|
||||||
rm -rf $WORLD_PATH
|
|
||||||
mkdir $WORLD_PATH
|
|
||||||
|
|
||||||
cp map.sqlite $WORLD_PATH/
|
|
||||||
|
|
||||||
echo "
|
|
||||||
gameid = minetest
|
|
||||||
auth_backend = sqlite3
|
|
||||||
player_backend = sqlite3
|
|
||||||
backend = sqlite3
|
|
||||||
" > $WORLD_PATH/world.mt
|
|
||||||
|
|
||||||
cd ~/.zen/astrXbian/minetest
|
|
||||||
cat ./minetest-common.conf > /home/pi/.minetest/worlds/astroport/minetest.conf
|
|
||||||
echo "
|
|
||||||
|
|
||||||
server_name = Astroport "$XZUID"
|
|
||||||
|
|
||||||
# Message of the day displayed to players connecting.
|
|
||||||
# type: string
|
|
||||||
motd = Bienvenue sur l'Astroport \""$XZUID"\". Un petit cube auto-hébergé par son heureux propriétaire.
|
|
||||||
|
|
||||||
server_description = Astroport
|
|
||||||
|
|
||||||
# Domain name of server, to be displayed in the serverlist.
|
|
||||||
# type: string
|
|
||||||
#server_address = astroport.com
|
|
||||||
|
|
||||||
# Homepage of server, to be displayed in the serverlist.
|
|
||||||
# type: string
|
|
||||||
#server_url = https://astroport.com
|
|
||||||
|
|
||||||
# Automatically report to the serverlist.
|
|
||||||
# type: bool
|
|
||||||
server_announce = false
|
|
||||||
|
|
||||||
# Network port to listen (UDP).
|
|
||||||
# This value will be overridden when starting from the main menu.
|
|
||||||
# type: int
|
|
||||||
port = 30001
|
|
||||||
|
|
||||||
# The network interface that the server listens on.
|
|
||||||
# type: string
|
|
||||||
# bind_address =
|
|
||||||
|
|
||||||
|
|
||||||
" >> /home/pi/.minetest/worlds/astroport/minetest.conf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
|
||||||
#
|
|
||||||
# SystemD
|
|
||||||
#
|
|
||||||
#########################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
MINETEST_LOG_FILE=/var/log/minetest/minetest-astroport.log
|
|
||||||
|
|
||||||
sudo touch $MINETEST_LOG_FILE
|
|
||||||
sudo chown pi:games $MINETEST_LOG_FILE
|
|
||||||
chmod 664 $MINETEST_LOG_FILE
|
|
||||||
|
|
||||||
echo "
|
|
||||||
[Unit]
|
|
||||||
Description=Minetest multiplayer server minetest.conf server config
|
|
||||||
Documentation=man:minetestserver(6)
|
|
||||||
After=network.target
|
|
||||||
RequiresMountsFor=/var/games/minetest-server
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Restart=on-failure
|
|
||||||
User=pi
|
|
||||||
Group=games
|
|
||||||
ExecStart=/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf --logfile /var/log/minetest/minetest-astroport.log
|
|
||||||
StandardOutput=null
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
" >> $WORLD_PATH/systemd.service
|
|
||||||
|
|
||||||
sudo systemctl enable $WORLD_PATH/systemd.service
|
|
||||||
|
|
||||||
sudo systemctl start astroport-minetest.service
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#########################################################################################
|
|
||||||
#
|
|
||||||
# MODS
|
|
||||||
#
|
|
||||||
#########################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
mkdir $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods ]; then
|
|
||||||
mkdir $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ## mg - Experimental Mapgen for Minetest
|
|
||||||
#
|
|
||||||
# if [ ! -d $MINETEST_PATH/mods/mg-master ]; then
|
|
||||||
#
|
|
||||||
# if [ ! -f $MINETEST_PATH/mods/mg.zip ]; then
|
|
||||||
# wget https://github.com/minetest-mods/mg/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mg.zip
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# unzip $MINETEST_PATH/mods/mg.zip -d $MINETEST_PATH/mods
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# cp -r $MINETEST_PATH/mods/mg-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
|
|
||||||
## startanode
|
|
||||||
#
|
|
||||||
# if [ ! -d $MINETEST_PATH/mods/startanode-master ]; then
|
|
||||||
#
|
|
||||||
# if [ ! -f $MINETEST_PATH/mods/startanode.zip ]; then
|
|
||||||
# wget https://github.com/minetest-mods/startanode/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/startanode.zip
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# unzip $MINETEST_PATH/mods/startanode.zip -d $MINETEST_PATH/mods
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# cp -r $MINETEST_PATH/mods/startanode-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Spawnbuilder
|
|
||||||
#
|
|
||||||
# spawnBuilderLocation=`find $MINETEST_PATH/mods -type d -name spawnbuilder`
|
|
||||||
# if [ -z $spawnBuilderLocation ]; then
|
|
||||||
#
|
|
||||||
# if [ ! -f $MINETEST_PATH/mods/spawnbuilder.zip ]; then
|
|
||||||
# wget https://repo.or.cz/minetest_spawnbuilder.git/snapshot/1.1.0.zip -O $MINETEST_PATH/mods/spawnbuilder.zip
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# unzip $MINETEST_PATH/mods/spawnbuilder.zip -d $MINETEST_PATH/mods/spawnbuilder/
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# mkdir $WORLD_PATH/worldmods/spawnbuilder
|
|
||||||
# cp -r $MINETEST_PATH/mods/spawnbuilder/minetest_spawnbuilder-*/* $WORLD_PATH/worldmods/spawnbuilder
|
|
||||||
#
|
|
||||||
# echo "
|
|
||||||
# #Side length of the surface area of the spawn platform
|
|
||||||
# #If the number is odd, the platform will be centered at spawn.
|
|
||||||
# #Using a width lower than 3 is not recommended.
|
|
||||||
# spawnbuilder_width (Spawn platform width) int 5 1
|
|
||||||
# " > $WORLD_PATH/worldmods/spawnbuilder/mod.conf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Unified inventory mod
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/unified_inventory-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/unified_inventory.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/unified_inventory/archive/master.zip -O $MINETEST_PATH/mods/unified_inventory.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/unified_inventory.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/unified_inventory-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
## Spawn mod
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/spawn_command-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/spawn_command.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/spawn_command/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/spawn_command.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/spawn_command.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/spawn_command-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
|
|
||||||
## Jukebok mod
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/jukebox-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/jukebox.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/jukebox/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/jukebox.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/jukebox.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/jukebox-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
## xdecor mod
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/xdecor-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/xdecor.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/xdecor/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/xdecor.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/xdecor.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/xdecor-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
## Display modpack
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/display_modpack-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/display_modpack.zip ]; then
|
|
||||||
wget https://github.com/pyrollo/display_modpack/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/display_modpack.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/display_modpack.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/display_modpack-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
## Letters
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/letters-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/letters.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/letters/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/letters.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/letters.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/letters-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
## mydoors
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d $MINETEST_PATH/mods/mydoors-master ]; then
|
|
||||||
|
|
||||||
if [ ! -f $MINETEST_PATH/mods/mydoors.zip ]; then
|
|
||||||
wget https://github.com/minetest-mods/mydoors/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mydoors.zip
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $MINETEST_PATH/mods/mydoors.zip -d $MINETEST_PATH/mods
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -r $MINETEST_PATH/mods/mydoors-master $WORLD_PATH/worldmods
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf
|
|
39
nginx.conf
|
@ -1,39 +0,0 @@
|
||||||
server {
|
|
||||||
|
|
||||||
root /home/pi/.zen/astrXbian/www/boris;
|
|
||||||
listen 80 default_server;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
# This section can be copied into an existing default setup
|
|
||||||
location / {
|
|
||||||
allow all;
|
|
||||||
index index.php index.html index.htm;
|
|
||||||
location ~ \.php {
|
|
||||||
try_files $uri index.php =404;
|
|
||||||
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
|
||||||
fastcgi_index index.php;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
||||||
include /etc/nginx/fastcgi_params;
|
|
||||||
fastcgi_read_timeout 1800;
|
|
||||||
}
|
|
||||||
error_page 404 = /error/404.html;
|
|
||||||
try_files $uri $uri/ =404;
|
|
||||||
location ~ /albumart/* {
|
|
||||||
expires -1s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
location /ipfs {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /ipns {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,184 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import json
|
|
||||||
import struct
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
VERSION = '7.1b2'
|
|
||||||
|
|
||||||
try:
|
|
||||||
sys.stdin.buffer
|
|
||||||
|
|
||||||
# Python 3.x version
|
|
||||||
# Read a message from stdin and decode it.
|
|
||||||
def getMessage():
|
|
||||||
rawLength = sys.stdin.buffer.read(4)
|
|
||||||
if len(rawLength) == 0:
|
|
||||||
sys.exit(0)
|
|
||||||
messageLength = struct.unpack('@I', rawLength)[0]
|
|
||||||
message = sys.stdin.buffer.read(messageLength).decode('utf-8')
|
|
||||||
return json.loads(message)
|
|
||||||
|
|
||||||
# Send an encoded message to stdout
|
|
||||||
def sendMessage(messageContent):
|
|
||||||
encodedContent = json.dumps(messageContent).encode('utf-8')
|
|
||||||
encodedLength = struct.pack('@I', len(encodedContent))
|
|
||||||
|
|
||||||
sys.stdout.buffer.write(encodedLength)
|
|
||||||
sys.stdout.buffer.write(encodedContent)
|
|
||||||
sys.stdout.buffer.flush()
|
|
||||||
|
|
||||||
except AttributeError:
|
|
||||||
# Python 2.x version (if sys.stdin.buffer is not defined)
|
|
||||||
# Read a message from stdin and decode it.
|
|
||||||
def getMessage():
|
|
||||||
rawLength = sys.stdin.read(4)
|
|
||||||
if len(rawLength) == 0:
|
|
||||||
sys.exit(0)
|
|
||||||
messageLength = struct.unpack('@I', rawLength)[0]
|
|
||||||
message = sys.stdin.read(messageLength)
|
|
||||||
return json.loads(message)
|
|
||||||
|
|
||||||
# Send an encoded message to stdout
|
|
||||||
def sendMessage(messageContent):
|
|
||||||
encodedContent = json.dumps(messageContent)
|
|
||||||
encodedLength = struct.pack('@I', len(encodedContent))
|
|
||||||
|
|
||||||
sys.stdout.write(encodedLength)
|
|
||||||
sys.stdout.write(encodedContent)
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
|
|
||||||
def install():
|
|
||||||
home_path = os.getenv('HOME')
|
|
||||||
|
|
||||||
manifest = {
|
|
||||||
'name': 'open_with',
|
|
||||||
'description': 'Open With native host',
|
|
||||||
'path': os.path.realpath(__file__),
|
|
||||||
'type': 'stdio',
|
|
||||||
}
|
|
||||||
locations = {
|
|
||||||
'chrome': os.path.join(home_path, '.config', 'google-chrome', 'NativeMessagingHosts'),
|
|
||||||
'chromium': os.path.join(home_path, '.config', 'chromium', 'NativeMessagingHosts'),
|
|
||||||
'firefox': os.path.join(home_path, '.mozilla', 'native-messaging-hosts'),
|
|
||||||
}
|
|
||||||
filename = 'open_with.json'
|
|
||||||
|
|
||||||
for browser, location in locations.items():
|
|
||||||
if os.path.exists(os.path.dirname(location)):
|
|
||||||
if not os.path.exists(location):
|
|
||||||
os.mkdir(location)
|
|
||||||
|
|
||||||
browser_manifest = manifest.copy()
|
|
||||||
if browser == 'firefox':
|
|
||||||
browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net']
|
|
||||||
else:
|
|
||||||
browser_manifest['allowed_origins'] = [
|
|
||||||
'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', # Chrome
|
|
||||||
'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', # Opera
|
|
||||||
]
|
|
||||||
|
|
||||||
with open(os.path.join(location, filename), 'w') as file:
|
|
||||||
file.write(
|
|
||||||
json.dumps(browser_manifest, indent=2, separators=(',', ': '), sort_keys=True).replace(' ', '\t') + '\n'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _read_desktop_file(path):
|
|
||||||
with open(path, 'r') as desktop_file:
|
|
||||||
current_section = None
|
|
||||||
name = None
|
|
||||||
command = None
|
|
||||||
for line in desktop_file:
|
|
||||||
if line[0] == '[':
|
|
||||||
current_section = line[1:-2]
|
|
||||||
if current_section != 'Desktop Entry':
|
|
||||||
continue
|
|
||||||
|
|
||||||
if line.startswith('Name='):
|
|
||||||
name = line[5:].strip()
|
|
||||||
elif line.startswith('Exec='):
|
|
||||||
command = line[5:].strip()
|
|
||||||
|
|
||||||
return {
|
|
||||||
'name': name,
|
|
||||||
'command': command
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def find_browsers():
|
|
||||||
apps = [
|
|
||||||
'Chrome',
|
|
||||||
'Chromium',
|
|
||||||
'chromium-browser',
|
|
||||||
'firefox',
|
|
||||||
'Firefox',
|
|
||||||
'Google Chrome',
|
|
||||||
'google-chrome',
|
|
||||||
'opera',
|
|
||||||
'Opera',
|
|
||||||
'SeaMonkey',
|
|
||||||
'seamonkey',
|
|
||||||
]
|
|
||||||
paths = [
|
|
||||||
os.path.join(os.getenv('HOME'), '.local/share/applications'),
|
|
||||||
'/usr/local/share/applications',
|
|
||||||
'/usr/share/applications'
|
|
||||||
]
|
|
||||||
suffix = '.desktop'
|
|
||||||
|
|
||||||
results = []
|
|
||||||
for p in paths:
|
|
||||||
for a in apps:
|
|
||||||
fp = os.path.join(p, a) + suffix
|
|
||||||
if os.path.exists(fp):
|
|
||||||
results.append(_read_desktop_file(fp))
|
|
||||||
return results
|
|
||||||
|
|
||||||
|
|
||||||
def listen():
|
|
||||||
receivedMessage = getMessage()
|
|
||||||
if receivedMessage == 'ping':
|
|
||||||
sendMessage({
|
|
||||||
'version': VERSION,
|
|
||||||
'file': os.path.realpath(__file__)
|
|
||||||
})
|
|
||||||
elif receivedMessage == 'find':
|
|
||||||
sendMessage(find_browsers())
|
|
||||||
else:
|
|
||||||
for k, v in os.environ.items():
|
|
||||||
if k.startswith('MOZ_'):
|
|
||||||
try:
|
|
||||||
os.unsetenv(k)
|
|
||||||
except:
|
|
||||||
os.environ[k] = ''
|
|
||||||
|
|
||||||
devnull = open(os.devnull, 'w')
|
|
||||||
subprocess.Popen(receivedMessage, stdout=devnull, stderr=devnull)
|
|
||||||
sendMessage(None)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
if len(sys.argv) == 2:
|
|
||||||
if sys.argv[1] == 'install':
|
|
||||||
install()
|
|
||||||
sys.exit(0)
|
|
||||||
elif sys.argv[1] == 'find_browsers':
|
|
||||||
print(find_browsers())
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
allowed_extensions = [
|
|
||||||
'openwith@darktrojan.net',
|
|
||||||
'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/',
|
|
||||||
'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/',
|
|
||||||
]
|
|
||||||
for ae in allowed_extensions:
|
|
||||||
if ae in sys.argv:
|
|
||||||
listen()
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
print('Open With native helper, version %s.' % VERSION)
|
|
16
search
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
clear
|
|
||||||
echo "------------------------------------------------------------------------------"
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
echo " Nothing to search for!"
|
|
||||||
else
|
|
||||||
echo " Searching for "$1" recursively. Please Wait..."
|
|
||||||
echo "------------------------------------------------------------------------------"
|
|
||||||
grep -h -r --exclude=B00 -H --colour=always "$1" ./
|
|
||||||
fi
|
|
||||||
echo "------------------------------------------------------------------------------"
|
|
||||||
if [ "$2" != "" ]; then
|
|
||||||
echo " To replace \"$1\" whith \"$2\", please run"
|
|
||||||
echo " grep -rl '$1' ./ | xargs sed -i 's/$1/$2/g'"
|
|
||||||
fi
|
|
||||||
## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS
|
|
|
@ -1,54 +0,0 @@
|
||||||
#shellcheck shell=sh
|
|
||||||
|
|
||||||
Describe 'AstrXbian'
|
|
||||||
Describe 'install.sh'
|
|
||||||
Include ./include.sh
|
|
||||||
It 'should check it applies to me'
|
|
||||||
When call i_am
|
|
||||||
The output should eq 'v0.5.0'
|
|
||||||
End
|
|
||||||
It 'should check I am not superuser'
|
|
||||||
When call i_am_root
|
|
||||||
The status should not be success
|
|
||||||
End
|
|
||||||
It 'should check I need to install'
|
|
||||||
When call i_should_install
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should check requirements, but not tested'
|
|
||||||
Skip "You should implement check_requirements tests"
|
|
||||||
When run check_requirements
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should import astrXbian, but not tested'
|
|
||||||
Skip "You should implement import_astrXbian tests"
|
|
||||||
When run import_astrXbian
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should import astroport, but not tested'
|
|
||||||
Skip "You should implement import_astroport tests"
|
|
||||||
When run import_astroport
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should import IPFS, but not tested'
|
|
||||||
Skip "You should implement import_ipfs tests"
|
|
||||||
When run import_ipfs
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should import Jaklis, but not tested'
|
|
||||||
Skip "You should implement import_jaklis tests"
|
|
||||||
When run import_jaklis
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should import Kodi, but not tested'
|
|
||||||
Skip "You should implement import_kodi tests"
|
|
||||||
When run import_kodi
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
It 'should prepare astrXbian for first boot, but not tested'
|
|
||||||
Skip "You should implement prepare_next_boot tests"
|
|
||||||
When run prepare_next_boot
|
|
||||||
The status should be success
|
|
||||||
End
|
|
||||||
End
|
|
||||||
End
|
|
69
uninstall.sh
|
@ -1,69 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
########################################################################
|
|
||||||
# Version: 0.3
|
|
||||||
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
||||||
########################################################################
|
|
||||||
{
|
|
||||||
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "DISABLE ipfs"
|
|
||||||
if [[ "$USER" == "xbian" ]]
|
|
||||||
then
|
|
||||||
mv /etc/rc2.d/S02ipfs /etc/rc2.d/K01ipfs
|
|
||||||
mv /etc/rc3.d/S02ipfs /etc/rc3.d/K01ipfs
|
|
||||||
mv /etc/rc4.d/S02ipfs /etc/rc4.d/K01ipfs
|
|
||||||
mv /etc/rc5.d/S02ipfs /etc/rc5.d/K01ipfs
|
|
||||||
else
|
|
||||||
# DISABLE ipfs
|
|
||||||
sudo systemctl disable ipfs
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
fi
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# RESTORE OLD KODI
|
|
||||||
[[ -e ~/.kodi.old ]] && echo "RESTORE KODI" && rm -Rf ~/.kodi && mv ~/.kodi.old ~/.kodi
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
## ERASE GCHANGE+ STARS
|
|
||||||
echo "REMOVE STAR TO BOOTSTRAP NODES"
|
|
||||||
for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
|
||||||
do
|
|
||||||
if [[ $bootnode != "" ]]; then
|
|
||||||
ipfsnodeid=${bootnode##*/}
|
|
||||||
g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $g1node
|
|
||||||
## RM BOOTSTRAP
|
|
||||||
ipfs bootstrap rm $bootnode
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "TODO Erase sent messages"
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "ERASE GCHANGE/CESIUM+ PROFILES"
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" erase
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" erase
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "REMOVE cron_MINUTE from CRONTAB"
|
|
||||||
crontab -l > /tmp/mycron
|
|
||||||
# Remove any previous line containing "cron_MINUTE"
|
|
||||||
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron
|
|
||||||
crontab /tmp/newcron
|
|
||||||
rm -f /tmp/mycron
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "REMOVE /etc/sudoers EXTRA PERMISSION"
|
|
||||||
[[ "$USER" == "xbian" ]] && rm -f /etc/sudoers.d/astroport
|
|
||||||
rm -f /etc/sudoers.d/fail2ban-client
|
|
||||||
rm -f /etc/sudoers.d/mount
|
|
||||||
rm -f /etc/sudoers.d/umount
|
|
||||||
rm -f /etc/sudoers.d/apt-get
|
|
||||||
rm -f /etc/sudoers.d/apt
|
|
||||||
rm -f /etc/sudoers.d/systemctl
|
|
||||||
|
|
||||||
echo "UNINSTALL FINISH, PLEASE REMOVE ~/.zen.todelete"
|
|
||||||
mv ~/.zen ~/.zen.todelete
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
# SERVICES FULL JS WEB ACTIVABLES SUR VOTRE STATION
|
|
||||||
Copiez le répertoire du service dans ~/.zen/ipfs/.$IFSNODEID/WWW
|
|
||||||
Copiez le fichier html correspondant au service souhaité dans ~/.zen/ipfs/index.html
|
|
||||||
Adaptez la page d'acceuil en fonction des services souhaités....
|
|
||||||
|
|
||||||
## ACTIVATION GCHANGE CLUSTER NODE
|
|
||||||
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/WWW
|
|
||||||
cp -Rf ~/.zen/astrXbian/www/FULLJS/gchange-web ~/.zen/ipfs/.$IPFSNODEID/WWW
|
|
||||||
cp ~/.zen/astrXbian/www/FULLJS/gchange.html ~/.zen/ipfs/index.html
|
|
||||||
sed -i "s/_IPFSNODEID_/$IPFSNODEID/g" ~/.zen/ipfs/index.html
|
|
||||||
|
|
||||||
~/.zen/astrXbian/zen/ipns_self_publish.sh
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
Tout plugin navigateur, site web JS devraient être compatible avec cette méthode !!
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
/******
|
|
||||||
* !! WARNING: This is a generated file !!
|
|
||||||
*
|
|
||||||
* PLEASE DO NOT MODIFY DIRECTLY
|
|
||||||
*
|
|
||||||
* => Changes should be done on file 'app/config.json'.
|
|
||||||
******/
|
|
||||||
|
|
||||||
angular.module("cesium.config", [])
|
|
||||||
|
|
||||||
.constant("csConfig", {
|
|
||||||
"fallbackLanguage": "fr-FR",
|
|
||||||
"defaultLanguage": "fr-FR",
|
|
||||||
"timeout": 300000,
|
|
||||||
"cacheTimeMs": 300000,
|
|
||||||
"useLocalStorage": true,
|
|
||||||
"rememberMe": true,
|
|
||||||
"useRelative": false,
|
|
||||||
"decimalCount": 2,
|
|
||||||
"shareBaseUrl": "https://gchange.fr",
|
|
||||||
"helptip": {
|
|
||||||
"enable": false
|
|
||||||
},
|
|
||||||
"feed": {
|
|
||||||
"jsonFeed": {
|
|
||||||
"fr-FR": "https://raw.githubusercontent.com/duniter-gchange/gchange-client/master/doc/feed/feed-fr.json",
|
|
||||||
"en": "https://raw.githubusercontent.com/duniter-gchange/gchange-client/master/doc/feed/feed-en.json"
|
|
||||||
},
|
|
||||||
"maxContentLength": 1300
|
|
||||||
},
|
|
||||||
"node": {
|
|
||||||
"host": "data.gchange.fr",
|
|
||||||
"port": "443"
|
|
||||||
},
|
|
||||||
"share": {
|
|
||||||
"mastodonAuthor": "@gchange@framapiaf.org"
|
|
||||||
},
|
|
||||||
"plugins": {
|
|
||||||
"es": {
|
|
||||||
"enable": true,
|
|
||||||
"host": "data.gchange.fr",
|
|
||||||
"port": "443",
|
|
||||||
"maxUploadBodySize": 5242880,
|
|
||||||
"defaultCountry": "France"
|
|
||||||
},
|
|
||||||
"market": {
|
|
||||||
"enable": true,
|
|
||||||
"defaultSearch": {
|
|
||||||
"geoDistance": "50"
|
|
||||||
},
|
|
||||||
"cesiumApi": {
|
|
||||||
"enable": true,
|
|
||||||
"baseUrl": "https://demo.cesium.app/api"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"converse": {
|
|
||||||
"enable": true,
|
|
||||||
"jid": "anonymous.duniter.org",
|
|
||||||
"bosh_service_url": "https://chat.duniter.org/http-bind/",
|
|
||||||
"auto_join_rooms": [
|
|
||||||
"gchange@muc.duniter.org"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"version": "1.2.8",
|
|
||||||
"build": "2021-03-01T16:19:40.420Z",
|
|
||||||
"newIssueUrl": "https://github.com/duniter-gchange/gchange-client/issues/new?labels=bug"
|
|
||||||
})
|
|
||||||
|
|
||||||
;
|
|
||||||
//# sourceMappingURL=maps/config.js.map
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<metadata>Generated by IcoMoon</metadata>
|
|
||||||
<defs>
|
|
||||||
<font id="cesiumicons" horiz-adv-x="1024">
|
|
||||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
|
||||||
<missing-glyph horiz-adv-x="1024" />
|
|
||||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
|
||||||
<glyph unicode="" d="M704.631 571.128c-88.613-141.409-220.403-263.408-385.521-305.473-67.252-18.493-137.112-25.822-206.705-27.022 85.549-163.095 275.81-262.272 458.545-237.95 181.166 19.076 341.662 157.215 388.338 333.162-54.601 103.924-141.49 197.874-254.656 237.283z" />
|
|
||||||
<glyph unicode="" d="M705.937 572.088c-16.756-111.815-85.086-207.2-107.267-317.221-9.188-51.541 26.786-110.642-14.579-155.514-46.21-52.402-118.907-65.379-181.938-87.466 177.73-47.91 379.66 24.215 485.982 174.78 50.55 69.116 80.992 152.689 86.696 238.125-46.085 9.483-69.436 55.020-110.556 74.201-49.917 29.992-103.571 53.514-158.339 73.095z" />
|
|
||||||
<glyph unicode="" d="M704.422 563.4c-23.786-51.408-26.436-109.757-54.084-159.726-7.211-32.909-41.091-84.288-29.498-106.489 101.59-16.542 203.181-33.085 304.771-49.627 18.278 35.649 31.845 73.711 40.201 112.894-73.868 79.269-150.471 163.426-255.358 200.635l-6.032 2.314z" />
|
|
||||||
<glyph unicode="" d="M668.616 445.794c-20.983-31.679-27.245-70.408-44.104-104.426-16.221-35.689-51.415-119.472 19.684-109.89 50.459 24.654 95.050-13.379 145.819-16.929 40.317-5.561 82.137-4.665 121.295 7.201 14.983 31.716 50.686 82.594 38.726 108.305-48.563 9.867-99.473 13.879-145.215 33.69 19.273 45.595-54.974 55.465-89.976 68.84-15.341 4.637-30.765 8.998-46.229 13.208z" />
|
|
||||||
<glyph unicode="" d="M607.714 160.873c-30.183-85.002-123.186-119.948-201.832-145.943 5.020-11.186 71.186-16.325 100.787-17.326 117.115-3.067 234.542 41.086 320.48 120.752-74.831 2.834-149.549 14.784-219.435 42.517z" />
|
|
||||||
<glyph unicode="" d="M598.485 268.534c-4.174-42.764-25.188-115.936 34.028-128.494 58.537-14.581 119.434-18.511 177.067-37.020 45.201 37.447 83.167 83.599 111.12 135.217-107.98-1.681-219.431-10.204-322.215 30.297z" />
|
|
||||||
<glyph unicode="" d="M607.21 600.78c18.959 2.29 35.234 1.896 28.288-21.72 5.935-14.644-36.614-14.607-28.288 1.841 0 6.626 0 13.252 0 19.879z" />
|
|
||||||
<glyph unicode="" d="M444.541 702.962c21.088 3.958 32.654-1.604 26.954-24.435-5.673-11.071-37.697-7.65-26.954 14.036 0 3.466 0 6.933 0 10.399z" />
|
|
||||||
<glyph unicode="" d="M504.532 681.78c13.478-3.298 43.236 9.682 36.755-13.575 6.254-23.030-7.057-26.496-27.15-23.18-18.567-5.496-5.871 26.527-9.605 36.755z" />
|
|
||||||
<glyph unicode="" d="M502.539 417.426c18.786 0 37.572 0 56.358 0 0-18.786 0-37.572 0-56.358-18.786 0-37.572 0-56.358 0 0 18.786 0 37.572 0 56.358z" />
|
|
||||||
<glyph unicode="" d="M508.856 630.157c13.478-3.298 43.236 9.682 36.755-13.575 6.254-23.030-7.057-26.496-27.15-23.18-18.567-5.496-5.871 26.527-9.605 36.755z" />
|
|
||||||
<glyph unicode="" d="M569.103 474.14c18.97 1.929 36.492 2.409 29.404-21.72 6.894-15.932-37.235-15.833-29.404 0.725 0 6.998 0 13.996 0 20.994z" />
|
|
||||||
<glyph unicode="" d="M627.087 531.403c19.35 7.869 29.408-9.582 19.338-22.053-21.583-4.147-20.801 3.387-19.338 22.053z" />
|
|
||||||
<glyph unicode="" d="M547.627 525.231c13.478-3.298 43.236 9.682 36.755-13.575 6.254-23.030-7.057-26.496-27.15-23.18-18.567-5.496-5.871 26.527-9.605 36.755z" />
|
|
||||||
<glyph unicode="" d="M403.802 335.024c14.426-1.998 36.73 3.882 46.556-2.715-2.020-14.315 3.913-36.584-2.715-46.292-12.879 3.545-40.017-7.169-43.841 5.43 0 14.526 0 29.051 0 43.577z" />
|
|
||||||
<glyph unicode="" d="M447.907 406.084c16.836-0.117 39.677 5.77 31.854-19.005 7.82-24.355-16.080-16.99-31.854-17.75 0 12.252 0 24.503 0 36.755z" />
|
|
||||||
<glyph unicode="" d="M515.291 468.567c-18.971 1.894-36.612 2.459-29.51-21.72-2.538-12.99 39.627-13.374 29.51 5.891 0 5.276 0 10.553 0 15.829z" />
|
|
||||||
<glyph unicode="" d="M578.486 572.866c21.232 4.92 29.469-3.156 24.503-24.435-13.104-8.532-32.955-2.106-24.503 19.201v5.234z" />
|
|
||||||
<glyph unicode="" d="M601.471 641.689c-18.971 1.894-36.612 2.459-29.51-21.72-2.538-12.99 39.627-13.374 29.51 5.891 0 5.276 0 10.553 0 15.829z" />
|
|
||||||
<glyph unicode="" glyph-name="diaspora" horiz-adv-x="1064" d="M670.1 22.109c-28.692 40.046-73.459 102.571-99.482 138.945-26.579 37.151-48.202 66.146-49.34 66.161-1.169 0.015-42.986-56.196-98.912-132.961-53.288-73.143-97.33-132.987-97.872-132.987-1.516 0-192.114 134.25-192.605 135.663-0.237 0.684 42.85 63.935 95.751 140.559s96.182 140.523 96.182 141.999c0 2.38-17.142 8.398-151.605 53.226-83.383 27.798-152.422 50.861-153.42 51.251-1.388 0.542 6.55 27.103 33.783 113.032 19.578 61.778 36.040 112.828 36.581 113.444s73.011-22.574 161.043-51.534c88.033-28.96 160.796-52.654 161.696-52.653s1.919 1.348 2.263 2.994c0.344 1.646 1.104 76.601 1.688 166.566s1.546 164.322 2.137 165.236c0.847 1.309 25.576 1.658 116.364 1.642 63.408-0.011 115.948-0.46 116.756-0.997 1.018-0.677 2.757-50.138 5.67-161.226 4.783-182.408 4.886-184.852 7.795-184.852 1.128 0 70.896 23.353 155.041 51.896s153.4 51.433 153.901 50.868c1.7-1.918 70.715-226.602 69.865-227.451-0.464-0.464-70.69-24.514-156.056-53.444-117.432-39.797-155.315-53.143-155.633-54.827-0.235-1.244 40.149-61.594 91.499-136.737 50.555-73.981 91.733-135.062 91.507-135.737-0.521-1.549-189.681-140.884-191.263-140.884-0.642 0-24.643 32.765-53.335 72.81z" />
|
|
||||||
</font></defs></svg>
|
|
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 70 KiB |
|
@ -1,4 +0,0 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="12px" viewBox="0 0 24 12" zoomAndPan="disable">
|
|
||||||
<line x1="0" y1="0" x2="12" y2="12" style="stroke:#ccc;stroke-width:1.5" />
|
|
||||||
<line x1="24" y1="0" x2="12" y2="12" style="stroke:#ccc;stroke-width:1.5" />
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 533 KiB |
Before Width: | Height: | Size: 450 KiB |
Before Width: | Height: | Size: 616 KiB |
Before Width: | Height: | Size: 424 KiB |
Before Width: | Height: | Size: 368 KiB |
Before Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 668 KiB |
Before Width: | Height: | Size: 552 KiB |
Before Width: | Height: | Size: 205 KiB |
Before Width: | Height: | Size: 303 KiB |
Before Width: | Height: | Size: 388 KiB |
Before Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 283 KiB |
Before Width: | Height: | Size: 344 KiB |
Before Width: | Height: | Size: 563 KiB |
Before Width: | Height: | Size: 446 KiB |
Before Width: | Height: | Size: 496 KiB |