[STY] Add "barry" (white) theme #1

Open
Boris wants to merge 139 commits from axiom-team/astrXbian:master into boris
61 changed files with 19881 additions and 551 deletions

View File

@ -31,7 +31,7 @@ SITE_IDENTIFIER = 'astroport'
SITE_NAME = 'ASTROPORT _PROFIL_ (_LOGIN_) (_MDP_)' SITE_NAME = 'ASTROPORT _PROFIL_ (_LOGIN_) (_MDP_)'
SITE_DESC = 'Partage ~/astroport/films (animes, series) avec ses amis https://gchange.fr (https://cesium.app ) via IPFS' SITE_DESC = 'Partage ~/astroport/films (animes, series) avec ses amis https://gchange.fr (https://cesium.app ) via IPFS'
URL_MAIN = 'http://127.0.0.1:8181/ipns/_IPFSNODEID_/._IPFSNODEID_/' URL_MAIN = 'http://127.0.0.1:8080/ipns/_IPFSNODEID_/._IPFSNODEID_/'
KEY_PASTE_ID = 'PASTE_ID' KEY_PASTE_ID = 'PASTE_ID'
SETTING_PASTE_ID = SITE_IDENTIFIER + '_id_' SETTING_PASTE_ID = SITE_IDENTIFIER + '_id_'

View File

@ -1 +0,0 @@
swp_token=1605043494:0cb63ecc71f6d029418e827aed3e7c9f:c8201b8ffdb3703b1d01884bce4f7584

View File

@ -1 +0,0 @@
swp_token=1603922533:31aac141fc8c1f57a856ac4be928d2c0:067e0bd7719ed36e424bd1d672ebecdb

View File

@ -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">8181</setting> <setting id="services.webserverport">8081</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>

View File

@ -1,6 +1,6 @@
#!/usr/bin/env xdg-open #!/usr/bin/env xdg-open
[Desktop Entry] [Desktop Entry]
Name=Astroport/Kodi Name=Astroport
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

View File

@ -25,14 +25,11 @@ err() {
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
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...! Must STOP ipfs AND remove ~/.ipfs to install again !!" echo "ipfs daemon already running...!"
echo "Please RUN : sudo service ipfs stop" exit 0
exit 1
fi fi
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1 echo -e "Astroport activate IPFS Layer installation..."
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}')
@ -40,39 +37,6 @@ 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/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-amd64.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz # UPDATER
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz # UPDATER
elif [ ${MACHINE_TYPE} == 'aarch64' ]; then
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz -o /tmp/go_ipfs.tar.gz # BIN
else
echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1
fi
# UPDATER
if [ -f $MY_PATH/ipfs-update.tar.gz ]; then
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
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"
fi
if [ -f /tmp/go_ipfs.tar.gz ]; then
## TERRAPI4 aarch64 install ipfs_aarch64_v0.9.1
sudo tar -xvzf /tmp/go_ipfs.tar.gz -C /usr/src/ || err "Error Untar go_ipfs binaries"
rm /tmp/go_ipfs.tar.gz
cd /usr/src/go-ipfs/
sudo ./install.sh || err "Install ipfs_aarch64"
cd $MY_PATH
fi
# INIT ipfs # INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \ [[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server || ipfs init -p server
@ -126,13 +90,20 @@ 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.LowWater 0
ipfs config --json Swarm.ConnMgr.HighWater 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 REMOTE # AVOID CONFLICT WITH KODI ./.install/.kodi/userdata/guisettings.xml
# ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181" ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080"
[[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs [[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs

View File

@ -0,0 +1,28 @@
#!/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

View File

@ -18,13 +18,13 @@ server {
} }
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

View File

@ -28,13 +28,13 @@ server {
} }
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

View File

@ -9,13 +9,13 @@ server {
# IPFS GATEWAY PROXY # IPFS GATEWAY PROXY
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

View File

@ -28,13 +28,13 @@ server {
# IPFS GATEWAY PROXY # IPFS GATEWAY PROXY
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

File diff suppressed because one or more lines are too long

View File

@ -14247,9 +14247,9 @@ https://astroport.com
</pre> </pre>
</div> </div>
<div created="20210224201642486" modified="20210825002046412" tags="moa" title="Moa" type=""> <div created="20210224201642486" modified="20210825002046412" tags="moa" title="Moa" type="">
<pre>''[[Ouvrez mon WIKI|http://127.0.0.1:8181/ipns/_IPFSNODEID_/._IPFSNODEID_]]'' <pre>''[[Ouvrez mon WIKI|http://127.0.0.1:8080/ipns/_IPFSNODEID_/._IPFSNODEID_]]''
''[[Découvrez mes amis|http://127.0.0.1:8181/ipns/_IPFSNODEID_/._IPFSNODEID_/FRIENDS]]'' dans ma toile de confiance distribuée. ''[[Découvrez mes amis|http://127.0.0.1:8080/ipns/_IPFSNODEID_/._IPFSNODEID_/FRIENDS]]'' dans ma toile de confiance distribuée.
Répondez à mes ''[[petites annonces sur Gchange|https://www.gchange.fr/#/app/user/_G1PUB_/]]'' Répondez à mes ''[[petites annonces sur Gchange|https://www.gchange.fr/#/app/user/_G1PUB_/]]''
@ -14265,7 +14265,7 @@ Chaque Station [[Astroport|Astroport]] possède le sien. Il est publié sur le r
``` ```
IPFSNODEID=$(ipfs --timeout=20s id -f='&lt;id&gt;\n') IPFSNODEID=$(ipfs --timeout=20s id -f='&lt;id&gt;\n')
xdg-open http://127.0.0.1:8181/ipns/$IPFSNODEID/.$IPFSNODEID/ xdg-open http://127.0.0.1:8080/ipns/$IPFSNODEID/.$IPFSNODEID/
``` ```
Vous pouvez le modifier et enregistrer vos modification dans Vous pouvez le modifier et enregistrer vos modification dans

View File

@ -6,6 +6,8 @@
######################################################################## ########################################################################
# 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
@ -17,10 +19,10 @@ newIPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then
# UPDATE # UPDATE
sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc
sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc
sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc
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)
@ -28,12 +30,12 @@ if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then
fi fi
else else
# CREATE # CREATE
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 "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc
[[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc [[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc
fi fi
source ~/.bashrc source ~/.bashrc

View File

@ -4,11 +4,19 @@ 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##*/}"
######## YOUTUBE-DL ########## ######## YOUTUBE-DL ##########
if [[ $(which youtube-dl) ]]; then ## NOW INSTALL yt-dlp AND LINK TO youtube-dl
sudo apt-get remove youtube-dl
fi
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || sudo cp $MY_PATH/youtube-dl /usr/local/bin/ || (echo "error installing youtube-dl" && exit 1)
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $USER /usr/local/bin/youtube-dl
youtube-dl -U
if [[ ! -f /usr/local/bin/yt-dlp ]]; then
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \
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
## UPGRADE TO LATEST
ls -al /usr/local/bin/youtube-dl

View File

@ -3,3 +3,5 @@
/ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN /ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
# aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2 # aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2
/ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx /ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
# cancer.copylaradio.com (yan14tricot75) = GmUD53TFfEfb6NiVqYXwxMGbxpP9nKgHPgF4jex6FBvj
/ip4/185.202.238.69/udp/4001/quic/p2p/12D3KooWRaqNpB2xr8w5WGDvU9HHj9MST9Rnp1kmMGc67e6z98ef

5
A_boostrap_public.txt Normal file
View File

@ -0,0 +1,5 @@
/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

View File

@ -9,7 +9,7 @@ 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) 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 [[ ! ${IPFSNODEID} ]] && echo "IPFS MUST BE INSTALLED" && exit 1
######################################################################## ########################################################################
# Create secret key files # Create STATION IPFS/G1 IDENTITY & 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
@ -25,14 +25,14 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo
IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1) 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) ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || (echo "VERIFIER CONNEXION INTERNET" && exit 1)
# GIT PULL astrXbian code # MAJ astrXbian code
mkdir -p ~/.zen/astrXbian && cd ~/.zen/astrXbian && git pull || exit 1 [[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || ( echo "astrXbian ERROR" && 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 source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN"
# Wait for IPFS to connect SWARM # Wait for IPFS to connect 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
@ -120,18 +120,18 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
# Give $XZUID to your (gchange friends) # Give $XZUID to your (gchange friends)
######################################################################## ########################################################################
echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID" echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID"
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player
######################################################################## ########################################################################
echo "CREATING GCHANGE+ PROFILE" echo "CREATING GCHANGE+ PROFILE"
######################################################################## ########################################################################
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #GCHANGE+ ~/.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+
[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && exit 1 [[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && exit 1
######################################################################## ########################################################################
echo "CREATING CESIUM+ PROFILE" echo "CREATING CESIUM+ PROFILE : TOO MUCH TIMEOUT"
######################################################################## ########################################################################
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" set --name "$XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+ # ~/.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 # [[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && exit 1
######################################################################## ########################################################################
### DELETE (see uninstall.sh) ### 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://g1.data.e-is.pro" erase
@ -165,9 +165,9 @@ 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
@ -223,7 +223,7 @@ echo 'Installing Astroport cron_MINUTE'
######################################################################## ########################################################################
#echo "CHANGE hostname" #echo "CHANGE hostname"
#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) #myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey" #echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey"
######################################################################## ########################################################################
#sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname #sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname
@ -281,7 +281,7 @@ do
done done
# AVOID CONFLICT WITH KODI REMOTE # AVOID CONFLICT WITH KODI REMOTE
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181" ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080"
######################################################################## ########################################################################
# SUDO permissions # SUDO permissions
@ -297,8 +297,12 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo
## USED FOR "systemctl restart ipfs" ## USED FOR "systemctl restart ipfs"
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl') 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
######################################################################## ########################################################################

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
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:

View File

@ -98,7 +98,7 @@ Ces "stargate" permettent de créer des espaces numériques public ou privés to
```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!! [Inscrivez vous à notre mailing list](https://oasis.astroport.com/appel-aux-anarchitectes/) ### **IMPORTANT** Restez en contact avec l'équipe de développement!! [Groupe Framagenda en cours de création](https://framagenda.org/apps/contacts/circle/vUAH4ggf7DyfznqN9bJDHu3nitjL7K6)
--- ---
@ -185,27 +185,27 @@ NB: Les films placés dans ~/astroport/film/$TMDBID/ sont automatiquement transf
> 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. Le répertoire ~/astroport sert de sas de transfert de vos fichiers dans IPFS (vous pouvez en effacer les fichiers une fois importés).
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" échangé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 un 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 les adresses IP/IPFS connues (amis d'ami).
Chaque fichier placé dans ```~/.zen/ipfs``` est partagé sur la clef IPNS "self" de chacun puis collecté dans ```~/.zen/ipfs_swarm``` régulièrement. 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 noeud conserve la mémoire de sa bibliothèque au travers du fichier ```~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN``` Chaque noeud conserve la mémoire de sa bibliothèque au travers du fichier ```~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN```
et transmet à Kodi l'ensemble de des "film" de son swarm dans ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN``` (PREFIX = F), selon le format et transmet à Kodi l'ensemble de des "film" dans ```~/.zen/ipfs/.$IPFSNODEID/FASTRXBIAN``` (PREFIX = F), selon le format
``` ```
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:8181/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4 film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8080/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/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é au Thunder Network) * ```~/.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/ipfs/.${IPFSNODEID}/index.html``` l'application par défaut de votre clef self est un TiddlyWiki * ```~/.zen/ipfs/.${IPFSNODEID}/index.html``` l'application par défaut de votre Station est [TiddlyWiki](https://tiddlywiki.com/languages/fr-FR/index.html)
L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et active l'automate Astroport/BLOB. L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et active l'automate Astroport/BLOB.
@ -229,10 +229,10 @@ En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procé
~/.zen/astrXbian/zen/ssh_forward2onelove.sh ~/.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*/G1SSB/_g1.gchange_title cat ~/.zen/ipfs_swarm/.12D*/.player
# Scan des stations IPFS de son swarm # Scan des stations IPFS de son swarm
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/_xbian.zuid)"; ipfs --timeout=1s ls /ipns/$ipfsnodeid/; done 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
# Obtenir le nom des fichiers contenus dans PIN IPFS # Obtenir le nom des fichiers contenus dans PIN IPFS
for ID in $( ls ~/.zen/PIN/ | cut -d '/' -f 6); do ipfs ls $ID; done for ID in $( ls ~/.zen/PIN/ | cut -d '/' -f 6); do ipfs ls $ID; done
@ -254,8 +254,8 @@ do
ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 ); ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 );
code=$(cat $CODE); code=$(cat $CODE);
IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode) IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode)
zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid); zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player);
# zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)
g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title)
# g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) # g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title)
echo "---> $zuid / $g1name : $IPNSCODE" echo "---> $zuid / $g1name : $IPNSCODE"
@ -265,7 +265,7 @@ do
done; done;
# Get your ipfs swarm peers station names (XZUID) # Get your ipfs swarm peers station names (XZUID)
for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid; done for ipfsnodeid in $(ipfs swarm peers | grep -o '[^/]*$'); do ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player; done
``` ```

View File

@ -15,6 +15,15 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PU
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ "$IPFSNODEID" == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1 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 [ ! -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 ## DO NOT RECORD output.pdf, bu convert to jpg and link throug index.html REDIRECT
##############################################################" ##############################################################"
@ -32,7 +41,7 @@ IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ "$IPFSNODEID"
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 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 # 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 rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg" 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 cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
done done

View File

@ -150,7 +150,7 @@ echo "SUB-SCRAPING lieu FROM $geodata"
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 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 # 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 rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg" echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
rm ./$lid.jpg rm ./$lid.jpg
rm ./bulle.jpg rm ./bulle.jpg
fi fi

View File

@ -29,16 +29,26 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ $(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" URL="$1"
if [ $URL ]; then if [ $URL ]; then
echo "URL: $URL" echo "URL: $URL"
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_" REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Choisissez comment copier cette source" --entry-text="Video" MP3 Web) || IMPORT="Youtube" [ ! $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" [[ $IMPORT == "Video" ]] && IMPORT="Youtube"
CHOICE="$IMPORT" CHOICE="$IMPORT"
fi fi
[[ $CHOICE == "Web" ]] && CHOICE=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source WEB est à enregistrer comme " --entry-text="Page" WebSite) [[ $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
@ -52,17 +62,14 @@ large=$((width-300))
haut=$((height-200)) haut=$((height-200))
######################################################################## ########################################################################
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ -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 ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)"
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) [[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
# zenity --warning --width 300 --text "Ajoutez un MEDIA dans ASTROPORT"
######################################################################## ########################################################################
## CADRE EXCEPTION COPIE PRIVE ## CADRE EXCEPTION COPIE PRIVE
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
if [[ ! -f ~/.zen/legal ]]; then if [[ ! -f ~/.zen/game/players/.current/legal ]]; then
zenity --width ${large} --height=${haut} --text-info \ zenity --width ${large} --height=${haut} --text-info \
--title="Action conforme avec le Code de la propriété intellectuelle" \ --title="Action conforme avec le Code de la propriété intellectuelle" \
--html \ --html \
@ -72,12 +79,12 @@ zenity --width ${large} --height=${haut} --text-info \
case $? in case $? in
0) 0)
echo "AUTORISATION COPIE PRIVE ASTROPORT OK !" echo "AUTORISATION COPIE PRIVE ASTROPORT OK !"
echo "$G1PUB" > ~/.zen/legal echo "$G1PUB" > ~/.zen/game/players/.current/legal
# next step # next step
;; ;;
1) 1)
echo "Refus conditions" echo "Refus conditions"
rm -f ~/.zen/legal rm -f ~/.zen/game/players/.current/legal
exit 1 exit 1
;; ;;
-1) -1)
@ -87,9 +94,25 @@ case $? in
esac esac
fi 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!) # CHOOSE CATEGORY (remove anime, not working!)
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Film" Serie Youtube Video) [[ $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
@ -104,6 +127,29 @@ PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A
######################################################################## ########################################################################
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
# _ _ # _ _
# _ _ ___ _ _| |_ _ _| |__ ___ # _ _ ___ _ _| |_ _ _| |__ ___
@ -121,13 +167,17 @@ YTURL="$URL"
REVSOURCE="$(echo "$YTURL" | awk -F/ '{print $3}' | rev)_" 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="/tmp/$(date -u +%s%N | cut -b1-13)" YTEMP="$HOME/astroport/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"
/usr/local/bin/youtube-dl -f '[height=720]/best' \ if [[ ! -f /usr/local/bin/youtube-dl ]]; then
--no-playlist --write-info-json --write-annotations \ sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
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 --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.
@ -191,21 +241,22 @@ rm -Rf ${YTEMP}
# CASE ## WEB # CASE ## WEB
web) web)
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal'
## wget current URL -> index.html ## TEST ## TEST httrack ?? ## 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 [[ ! $(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" echo "httrack --mirror $URL"
FILE_NAME="index.html" 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" 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_ MEDIAID="$REVSOURCE" # MEDIAID=1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
MEDIAKEY="PAGE_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ MEDIAKEY="WWW_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
FILE_PATH="$HOME/astroport/web/$MEDIAID"; FILE_PATH="$HOME/astroport/web/$MEDIAID";
mkdir -p $FILE_PATH mkdir -p $FILE_PATH
wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/${FILE_NAME}
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 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}/"
;; ;;
@ -213,21 +264,19 @@ rm -Rf ${YTEMP}
# CASE ## PAGE # CASE ## PAGE
page) page)
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal'
## record one page to PDF ## 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 [[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
cd /tmp/ && rm output.pdf && chromium --headless --no-sandbox --print-to-pdf $URL cd /tmp/ && rm -f output.pdf
chromium --headless --no-sandbox --print-to-pdf $URL
TITLE=$(zenity --entry --width 480 --title "Titre" --text "Indiquez le titre de cette page " --entry-text="${URL}") TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${URL}")
[[ $TITLE == "" ]] && exit 1 [[ $TITLE == "" ]] && exit 1
FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better
MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)" MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)"
MEDIAKEY="PAGE_${MEDIAID}" MEDIAKEY="PAGE_${MEDIAID}"
FILE_PATH="$HOME/astroport/page/$MEDIAID" FILE_PATH="$HOME/astroport/page/$MEDIAID"
mkdir -p ${FILE_PATH} && mv -f output.pdf ${FILE_PATH}/${FILE_NAME} 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 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
@ -244,10 +293,10 @@ rm -Rf ${YTEMP}
######################################################################## ########################################################################
mp3) mp3)
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal' zenity --warning --width 600 --text 'DEV ZONE . Please Participate https://git.p2p.legal'
# Create TEMP directory # Create TEMP directory
YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)" YTEMP="$HOME/astroport/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="")
@ -331,12 +380,16 @@ FILE_TITLE="${FILE_NAME%.*}"
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 "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?"
[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')" [ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Ex: 301528 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="") 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="")
[[ $MEDIAID == "" ]] && exit 1 [[ $MEDIAID == "" ]] && exit 1
if ! [[ "$MEDIAID" =~ ^[0-9]+$ ]] CMED=$(echo $MEDIAID | cut -d '-' -f 1)
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... Seules les vidéos référencées sur The Movie Database sont acceptées." && exit 1
fi fi
MEDIAID=$CMED
MEDIAKEY="TMDB_$MEDIAID" MEDIAKEY="TMDB_$MEDIAID"
# VIDEO TITLE # VIDEO TITLE
@ -410,19 +463,32 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
# --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})" # --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})"
# [ $? == 1 ] && echo "ANNULATION." && exit 1 # [ $? == 1 ] && echo "ANNULATION." && exit 1
########################################################################
# Screen capture is used as thumbnail
########################################################################
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
################################### ###################################
### MOVING FILE TO ~/astroport #### ### MOVING FILE TO ~/astroport ####
################################### ###################################
mkdir -p ~/astroport/${CAT}/${MEDIAID}/ 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}" mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
if [ $? == 0 ]; then if [ $? == 0 ]; then
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..." 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 else
zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -" zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -"
exit 1 exit 1
fi fi
FILE_NAME="${TITLE}.${FILE_EXT}" FILE_NAME="${TITLE}.${FILE_EXT}"
## CREATE "~/astroport/${CAT}/${MEDIAID}/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};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
@ -475,31 +541,6 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
;; ;;
# _ _ _
#| | _____ __| (_)
#| |/ / _ \ / _` | |
#| < (_) | (_| | |
#|_|\_\___/ \__,_|_|
# COPY UQLOAD LINKS DETECTED IN KODI LOG
##############################################
### TODO INSTALL FROM START and AUTO SCRAPE KODI LOG
##############################################
kodi)
# OPTION REMOVED
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
;;
######################################################################## ########################################################################
# CASE ## DEFAULT # CASE ## DEFAULT
######################################################################## ########################################################################
@ -512,9 +553,15 @@ 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}\"" 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 [[ -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 # LOG NOISE # [[ -f ~/astroport/${CAT}/${MEDIAID}/video.json ]] && cat ~/astroport/${CAT}/${MEDIAID}/video.json
######################################################################## ########################################################################
@ -526,8 +573,37 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N
######################################################################## ########################################################################
[[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB" [[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB"
~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${MEDIAID}/" "${FILE_NAME}" > /tmp/${MEDIAKEY}.log 2>&1 timestamp=$(date -u +%s%N | cut -b1-13)
[ ! $? == 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
## 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
######################################################################## ########################################################################
######################################################################## ########################################################################
######################################################################## ########################################################################
@ -535,36 +611,39 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N
######################################################################## ########################################################################
MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY) MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY)
[ ! $2 ] && zenity --width=500 --height=500 --text-info \ #[ ! $2 ] && zenity --width=500 --height=500 --text-info \
--title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \ # --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \
--html \ # --html \
--url="http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \ # --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." # --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" echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY"
######################################################################## ########################################################################
FILE_SIZE=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.filesize) FILE_BSIZE=$(du -b "$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}" | awk '{print $1}')
FILE_SIZE=$(echo "${FILE_SIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }') 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) #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 #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="") # [ ! $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 # [[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON" # ~/.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) # ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1)
else #else
ZENBALANCE=0 ZENBALANCE=0
fi #fi
######################################################################## ########################################################################
######################################################################## ########################################################################
echo "${MEDIAKEY} = RECORDED TO IPFS." if [ $1 ]; then
cat /tmp/${MEDIAKEY}.log bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"
[ $? == 0 ] && echo "${MEDIAKEY} is RECORDED in ASTROPORT. GOOD." && exit 0
rm -f /tmp/${MEDIAKEY}.pass else
rm -f /tmp/${MEDIAKEY}.dunikey ## REMOVE KEYS 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" \
if [ ! $2 ]; then && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
[ $? == 0 ] && zenity --warning --width 300 --text "OK! MEDIA transféré ($ZENBALANCE ZEN). URL LOCALHOST prête à coller (/tmp/${MEDIAKEY}.log)" && exit 0 \ && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|| zenity --warning --width 300 --text "Désolé une erreur est survenue... LOG: cat /tmp/${MEDIAKEY}.log" && exit 1 && 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 fi
exit 0

View File

@ -20,7 +20,7 @@ source $HOME/.profile
#### CONTROL STATION IPFS DAEMON #### CONTROL STATION IPFS DAEMON
## timeout is fixing ipfs minimum response time, before considering stuck process ## timeout is fixing ipfs minimum response time, before considering stuck process
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID)
howmany=$(cat /tmp/ipfs.timeout) howmany=$(cat /tmp/ipfs.timeout)
if [[ ! $IPFSNODEID ]]; then if [[ ! $IPFSNODEID ]]; then
## wait a howmany timeout before restarting ipfs ## wait a howmany timeout before restarting ipfs
@ -36,20 +36,33 @@ fi
## CONTROL IPFS IS RUNNING OR RESTART ## 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) YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
if [[ ! ${YOU} ]]; then 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 # control water levels for swarm
ipfs config --json Swarm.ConnMgr.LowWater 50 ipfs config --json Swarm.ConnMgr.LowWater 50
ipfs config --json Swarm.ConnMgr.HighWater 100 ipfs config --json Swarm.ConnMgr.HighWater 100
[ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs [ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs
echo "ERROR! ipfs daemon was not running. RELAUNCHING." echo "ERROR! ipfs daemon was not running. RELAUNCHING."
exit 1 exit 1
fi fi
######################################################################## ########################################################################
# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE # 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 [[ ! -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 ### NO IP GATEWAY : EXIT (COULD BE Astroport.ONE Ambassy Alone !!)
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>&1>/dev/null && echo "LAN OK" || exit 1
######################################################################## ########################################################################
@ -116,7 +129,7 @@ if [[ $(($runtime % 4)) == 0 ]]; then
[[ $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); [[ $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 [[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt
## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt ## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt
# for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid; cat $line; done # 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 done
fi fi
######################################################################## ########################################################################
@ -151,8 +164,19 @@ fi
if [[ $(($runtime % 15)) == 0 ]]; then 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
[[ -d ~/.zen/Astroport.ONE ]] && cd ~/.zen/Astroport.ONE && sleep $((1 + RANDOM % 12)) && 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 # git reset --hard
git pull cd $MY_PATH
sleep $((1 + RANDOM % 3)) && git pull
[[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE" [[ ! $? == 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 # 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 # cp ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml
@ -162,7 +186,7 @@ if [[ $(($runtime % 15)) == 0 ]]; then
## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE ## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE
## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd - ## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd -
# CLEAN AND REMOVE BAD DIRECTORIES # CLEAN AND REMOVE BAD DIRECTORIES should be in .$IPFSNODEID to avoid Station collision.
## BYPASS index.html DELETION ## BYPASS index.html DELETION
[[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html [[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html
@ -183,16 +207,6 @@ if [[ $(($runtime % 15)) == 0 ]]; then
fi fi
if [[ $(($minute % 30)) == 0 ]]; then
########## NextCloud.SMS GUILDE STATION ##############
if [[ -e ~/.zen/SMS/ ]];then
# DONE at 20h01 in taurus crontab
# [[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France
/home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh
fi
########## SMS GUILDE STATION ##############
fi
# __ __ _____ ____ # __ __ _____ ____
# __/ // /_/ ___/ ______ __________ ___ / __ \ # __/ // /_/ ___/ ______ __________ ___ / __ \
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / / # /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
@ -204,7 +218,9 @@ fi
## SYNC GCHANGE EVERY 12 hours runtime ## SYNC GCHANGE EVERY 12 hours runtime
if [[ $(($runtime % 725)) == 0 || "$runtime" == "5" ]]; then 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" 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 # $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 fi
# If NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h) # 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 if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) && $runtime -gt 360 ]]; then
@ -220,12 +236,12 @@ if [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]]; then
$MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt $MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt
fi fi
# SYNC IPFS FRIENDS SWARM # SYNC IPFS FRIENDS SWARM
if [[ $(($runtime % 25)) == 0 ]]; then if [[ $(($runtime % 26)) == 0 ]]; then
kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING p4n.swarmscraper.sh" 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 killall chromium
$MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt $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 fi
################################################################## ##################################################################
# #
# _________ ______ # _________ ______
@ -235,6 +251,8 @@ fi
# /___/\___/_/ /_/ /_/ /_/ |_\____/ # /___/\___/_/ /_/ /_/ /_/ |_\____/
# #
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle # REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive
################################################
if [[ $(($runtime % 7)) == 0 ]]; then if [[ $(($runtime % 7)) == 0 ]]; then
#### Refresh & publish MEDIAKEYs #### Refresh & publish MEDIAKEYs
@ -257,6 +275,7 @@ fi
# #
# 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 Astroport/KODI 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 [[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport
# VERIFY LAUNCH inotifywait ?! # VERIFY LAUNCH inotifywait ?!
@ -292,12 +311,12 @@ echo '
# 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 ### INDEX DATA MIGRATION SCRIPTS
$MY_PATH/actions/p4n.data_evolution.sh & # $MY_PATH/actions/p4n.data_evolution.sh &
## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE. ## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE.
################################################################## ##################################################################
@ -319,6 +338,7 @@ echo '
# New full test review in gchange_INIT.sh # New full test review in gchange_INIT.sh
rm -f ~/.ipfs/test.disk rm -f ~/.ipfs/test.disk
rm -f /tmp/instascan.log
# LOG ROTATE WEEKLY # 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 [[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log

128
include.sh Normal file
View File

@ -0,0 +1,128 @@
#!/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
}

View File

@ -1,107 +1,63 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
# Version: 0.3 # Version: 0.5.0
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) # 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 MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# MAIN # # 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
# Check requirements [[ ! $(which ipfs) ]] && echo "=== installez ipfs !!" && echo "https://docs.ipfs.io/install/command-line/#official-distributions" && exit 1
echo "AstrXbian installateur pour XBIAN (https://xbian.org) distributions DEBIAN et dérivées (https://www.linuxmint.com/)" echo "astrxbian installateur pour distributions debian et dérivées : linuxmint (https://www.linuxmint.com/) ou xbian (https://xbian.org) recommandées"
sudo apt-get update echo "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications)
#sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev -y echo
for i in git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
sudo apt install -y $i
fi
done
#sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack html2text ssmtp sudo -y # Install requirements
for i in build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick ttf-mscorefonts-installer libcurl4-openssl-dev; do install_requirements
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
sudo apt install -y $i
fi
done
## Correct PDF restrictions for imagemagick # Clone astrXbian and Astroport.One
if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then import_astrXbian
cat /etc/ImageMagick-6/policy.xml | grep -Ev PDF > /tmp/policy.xml
sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml
fi
[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y # Init ipfs
sudo apt-get install python3-opencv -y ## INSTALLATION IA par reconnaissance d'images # import_ipfs
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils xclip zenity handbrake* -y
if [[ ! $(which apache2) ]]; then
########################################################################
## INSTALL nginx + php + mariadb + ...
# 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
for i in 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; 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
fi
## INSTALL PYTHON CRYPTO LAYER # Copy astroport config in kodi
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc # import_kodi
python3 -m pip install -U pip
python3 -m pip install -U setuptools wheel # Jaklis setup
python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy import_jaklis
if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER
echo "SOUHAITEZ VOUS AJOUTER UNE IMPRIMANTE A QR CODE? saisissez OUI, sinon tapez sur ENTREE"
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
## GIVE ACCESS TO www-data group
sudo usermod -aG www-data $USER
######################################################################## ########################################################################
echo "Clonage git astrXbian depuis https://git.p2p.legal" echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN"
mkdir -p ~/.zen
cd ~/.zen
git clone https://git.p2p.legal/axiom-team/astrXbian.git
########################################################################
echo "IMPORT configuration ASTROPORT dans ~/.kodi"
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
########################################################################
echo "Installation de IPFS https://ipfs.io"
~/.zen/astrXbian/.install/ipfs_alone.sh
########################################################################
echo "Configuration jaklis: Centre de communication CESIUM+ GCHANGE+ & MONNAIE LIBRE (gva protocole)"
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
[[ "$USER" == "xbian" ]] && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf i_am_xbian && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf
# NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh # NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh
### MODIFIYING /etc/sudoers ### ### MODIFIYING /etc/sudoers ###
[[ "$USER" == "xbian" ]] && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport') i_am_xbian && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport')
# PERSONNAL DEFCON LEVEL # PERSONNAL DEFCON LEVEL
# cp ~/.zen/astrXbian/DEFCON ~/.zen/ # cp ~/.zen/astrXbian/DEFCON ~/.zen/
if [[ "$USER" == "xbian" ]] 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
@ -123,50 +79,36 @@ fi
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};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt
## PREPARE www EXCHANGE ZONE ~/astroport/www
wwwuser=$(ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1) || wwuser="www-data"
sudo chown -R $USER:$wwwuser ~/astroport/www
sudo chmod -R g+rw ~/astroport/www
####################################################################### #######################################################################
## CREATE symlinks for ~/.zen/www/swarm & me
sudo chown -R $USER:www-data ~/.zen/astrXbian/www/boris
sudo chmod -R g+rw ~/.zen/astrXbian/www/boris
ln -s /home/$USER/.zen/ipfs_swarm ~/.zen/astrXbian/www/boris/swarm
ln -s /home/$USER/.zen/ipfs ~/.zen/astrXbian/www/boris/me
## INSTALL open_with_linux.py echo "## INSTALL open_with_linux.py ##
## https://darktrojan.github.io/openwith/webextension.html ## https://darktrojan.github.io/openwith/webextension.html"
# https://addons.mozilla.org/firefox/addon/open-with/
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno
~/.zen/astrXbian/open_with_linux.py install ~/.zen/astrXbian/open_with_linux.py install
if [[ "$USER" != "xbian" ]] echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !!
then # https://addons.mozilla.org/firefox/addon/open-with/
## Desktop install # https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
echo "INITIALISATIOn Astroport/KODI"
echo "Appuyez sur la touche ENTREE pour créer une nouvelle identité"
echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde (~/.zen & ~/.ipfs)"
read
~/.zen/astrXbian/ISOconfig.sh
else
## Rpi Xbian install.
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
echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI" if ! i_am_xbian
echo "Faites une ISO : sudo xbian-config" then
exit 0 ## 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é) ## # MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
else else
echo "Installation déjà faite !! echo "Installation existante !!
======================== ========================
Astroport/KODI (Gchange) Astroport/KODI (Gchange)
======================== ========================
@ -180,3 +122,5 @@ https://astroport.com
# MAIN # # MAIN #
fi fi
} }
~/.zen/astrXbian/zen/cron_VRFY.sh

View File

@ -9,7 +9,7 @@ fi
sudo usermod -a -G "$USER" www-data sudo usermod -a -G "$USER" www-data
sudo chmod g+rw /var/www/html sudo chmod g+rw /var/www/html
## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1:8181/ipns/$IPFSNODEID/.$IPFSNODEID ## 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 # 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 ## AJOUT ADDONS NAVIGATEUR https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts

View File

@ -176,9 +176,9 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
# Give $XZUID to your (gchange friends) # Give $XZUID to your (gchange friends)
######################################################################## ########################################################################
XZUID="$(hostname)-$RANDOM$RANDOM" XZUID="$(hostname)-$RANDOM$RANDOM"
echo "SETTING _xbian.zuid PROFILE NAME = $XZUID" echo "SETTING .player PROFILE NAME = $XZUID"
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player
echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/_xbian.zuid' echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player'
######################################################################## ########################################################################
######################################################################## ########################################################################

View File

@ -25,13 +25,13 @@ server {
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

54
specs/astrXbian_spec.sh Normal file
View File

@ -0,0 +1,54 @@
#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

View File

@ -4,7 +4,7 @@ if (!ini_get('display_errors')) {
ini_set('display_errors', '1'); ini_set('display_errors', '1');
} }
define('STATION_NAME', exec('cat ../../../ipfs/.12D*/_xbian.zuid')); define('STATION_NAME', exec('cat ../../../ipfs/.12D*/.player'));
define('HOST', 'astroport'); define('HOST', 'astroport');
define('THEME', 'astroport'); define('THEME', 'astroport');
define('SITENAME', 'Astroport "' . STATION_NAME . '"'); define('SITENAME', 'Astroport "' . STATION_NAME . '"');
@ -12,7 +12,7 @@ define('SITENAME', 'Astroport "' . STATION_NAME . '"');
exec("/bin/bash -c './get_xzuid.sh'", $xzuid); exec("/bin/bash -c './get_xzuid.sh'", $xzuid);
define('XZUID', $xzuid[0]); define('XZUID', $xzuid[0]);
exec("/bin/bash -c './get_ipfs_node_id.sh'", $output); exec("/bin/bash -c './get_ipfs_node_id.sh' 2>/dev/null", $output);
if (isset($output)) { if (isset($output)) {
define('IPFS_NODE_ID', $output[0]); define('IPFS_NODE_ID', $output[0]);
@ -42,7 +42,7 @@ define('YOUTUBE_THUMB', 'https://i.ytimg.com/vi/%s/mqdefault.jpg');
define ('MEDIAQR','https://'.$_SERVER['SERVER_NAME'].'/ipns/%s/QR.png'); define ('MEDIAQR','https://'.$_SERVER['SERVER_NAME'].'/ipns/%s/QR.png');
// TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/_xbian.zuid" // TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/.player"
$stations = [ $stations = [
'virgo', 'virgo',
'onelove', 'onelove',

View File

@ -2,5 +2,5 @@
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 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
cat /home/$YOU/.zen/ipfs/.12D*/_xbian.zuid cat /home/$YOU/.zen/ipfs/.12D*/.player

View File

@ -9,5 +9,13 @@
<span><a href="https://git.p2p.legal/axiom-team/astrXbian/src/branch/master/www/boris">~/.zen/AstXbian/www/boris</a></span> × <span><a href="/ipfs/QmbmjSBWVNSSjJsMmCeFuFtQiuWyGg6iUGLRyvK7TUkFN8">Voir le code de la page</a></span> <span><a href="https://git.p2p.legal/axiom-team/astrXbian/src/branch/master/www/boris">~/.zen/AstXbian/www/boris</a></span> × <span><a href="/ipfs/QmbmjSBWVNSSjJsMmCeFuFtQiuWyGg6iUGLRyvK7TUkFN8">Voir le code de la page</a></span>
</p> </p>
</footer> </footer>
<!-- Matomo Tag Manager -->
<script>
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://piwik.p2p.legal/js/container_XDhfGZPj.js'; s.parentNode.insertBefore(g,s);
</script>
<!-- End Matomo Tag Manager -->
</body> </body>
</html> </html>

View File

@ -63,13 +63,13 @@ printf ";
} }
location /ipfs { location /ipfs {
proxy_pass http://127.0.0.1:8181; proxy_pass http://127.0.0.1:8080;
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:8181; proxy_pass http://127.0.0.1:8080;
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;
} }

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
# Author: # Author:
# Version: 0.1 # Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
######################################################################## ########################################################################
@ -9,8 +9,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}" ME="${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 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); [[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player);
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)

View File

@ -9,7 +9,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}" ME="${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 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
######################################################################## ########################################################################
# SCAN AND MANAGE KEYS BETWEEN MOVIES & FRIENDS # SCAN AND MANAGE KEYS BETWEEN MOVIES & FRIENDS

View File

@ -34,6 +34,8 @@ if [[ ! $crontest ]]; then
# ADD cron_MINUTE.sh line # ADD cron_MINUTE.sh line
echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron
crontab /tmp/newcron crontab /tmp/newcron
sudo systemctl enable ipfs
sudo systemctl start ipfs
echo "ASTROPORT is ON" echo "ASTROPORT is ON"
else else
## HEADER ## HEADER
@ -42,6 +44,8 @@ else
## REMOVE cron_MINUTE.sh line ## REMOVE cron_MINUTE.sh line
cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron
crontab /tmp/newcron crontab /tmp/newcron
sudo systemctl stop ipfs
sudo systemctl disable ipfs
echo "ASTROPORT is OFF" echo "ASTROPORT is OFF"
fi fi

View File

@ -19,14 +19,14 @@ start=`date +%s`
# INITIALISATION & CONTROL # INITIALISATION & CONTROL
######################################################################## ########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
######################################################################## ########################################################################
[[ ! -f ~/.zen/secret.dunikey ]] && echo "Missing ~/.zen/secret.dunikey. EXIT" && exit 1 [[ ! -f ~/.zen/secret.dunikey ]] && echo "Missing ~/.zen/secret.dunikey. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ $G1PUB == "" ]] && echo "ERROR G1PUB empty !! EXIT" && exit 1 [[ $G1PUB == "" ]] && echo "ERROR G1PUB empty !! EXIT" && exit 1
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) || hostname -s > ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid [[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) || hostname -s > ~/.zen/ipfs/.$IPFSNODEID/.player
######################################################################## ########################################################################
# CREATNG IPFS LOCAL REPOSITORY for Node G1 Identity : G1SSB # CREATNG IPFS LOCAL REPOSITORY for Node G1 Identity : G1SSB
@ -41,12 +41,12 @@ cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
# ADD GCHANGE+ informations # ADD GCHANGE+ informations
######################################################################## ########################################################################
GCHANGE="https://data.gchange.fr" GCHANGE="https://data.gchange.fr"
echo"## GET LATEST GCHANGE PROFILE" echo "## GET LATEST GCHANGE PROFILE"
curl -s ${GCHANGE}/user/profile/${G1PUB} > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json curl -s ${GCHANGE}/user/profile/${G1PUB} > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json
Gtitle=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.title') Gtitle=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.title')
[[ $Gtitle ]] && echo "$Gtitle" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title [[ $Gtitle ]] && echo "$Gtitle" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title
echo"# ACTUAL _g1.gchange_title=$Gtitle" echo "# ACTUAL _g1.gchange_title=$Gtitle"
# UPDATE _g1.astroport_title with city # UPDATE _g1.astroport_title with city
Atitle="Station $YOU@$XZUID" Atitle="Station $YOU@$XZUID"
@ -106,7 +106,7 @@ Customisation TiddlyWiki"
[[ ! $(cat ~/.zen/ipfs/.${IPFSNODEID}/index.html | grep ${IPFSNODEID}) ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html [[ ! $(cat ~/.zen/ipfs/.${IPFSNODEID}/index.html | grep ${IPFSNODEID}) ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
# cp -f ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html # cp -f ~/.zen/astrXbian/.install/templates/tiddlyone/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)"
wiki="/home/$YOU/.zen/ipfs/.$IPFSNODEID/index.html" wiki="/home/$YOU/.zen/ipfs/.$IPFSNODEID/index.html"
updated="$(date +"%m-%d-%Y_%H:%M")" updated="$(date +"%m-%d-%Y_%H:%M")"
@ -120,7 +120,7 @@ sed -i "s/_UPDATED_/$updated/g" $wiki
## CREATE IPFSNODEID G1PUB QR CODE ## CREATE IPFSNODEID G1PUB QR CODE
[[ ! -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/QR.png ]] && qrencode -s 6 -o "/home/$YOU/.zen/ipfs/.$IPFSNODEID/QR.png" "$G1PUB" [[ ! -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/QR.png ]] && qrencode -s 6 -o "/home/$YOU/.zen/ipfs/.$IPFSNODEID/QR.png" "$G1PUB"
# sed -i "s/Personnalisez/<a href=\"http:\/\/127.0.0.1:8181\/ipns\/$IPFSNODEID\/.$IPFSNODEID\/FRIENDS\">Amis de/g" $wiki # sed -i "s/Personnalisez/<a href=\"http:\/\/127.0.0.1:8080\/ipns\/$IPFSNODEID\/.$IPFSNODEID\/FRIENDS\">Amis de/g" $wiki
# https:\/\/www.gchange.fr\/#\/app\/records\/wallet?q=$G1PUB # https:\/\/www.gchange.fr\/#\/app\/records\/wallet?q=$G1PUB
######################################################################## ########################################################################
@ -156,7 +156,7 @@ ipfsnodeid=${IamINBOOTSTRAP##*/}
################## SEND ipfstryme MESSAGES to FRIENDS ################## SEND ipfstryme MESSAGES to FRIENDS
rm -f /tmp/friend_of_mine rm -f /tmp/friend_of_mine
## Getting Gchange liking_me list ## Getting Gchange liking_me list
~/.zen/astrXbian/zen/tools/timeout.sh -t 20 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/liking_me ~/.zen/astrXbian/zen/tools/timeout.sh -t 20 ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' | uniq > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/liking_me
## Adding random bootstrap to liking_me list ## Adding random bootstrap to liking_me list
~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf | head -n 1) >> ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/liking_me ~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf | head -n 1) >> ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/liking_me
@ -182,8 +182,8 @@ do
ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me)
echo "Reading stars.level from Stations IPNS Capsules." echo "Reading stars.level from Stations IPNS Capsules."
starsin=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level) starsin=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level)
starsout=$(ipfs --timeout=10s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$liking_me/stars.level) starsout=$(ipfs --timeout=20s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$liking_me/stars.level)
echo "I received $starsin stars while I sent $starsout stars." echo "I received $starsin stars while I sent $starsout stars."
##### CHECKING IF WE LIKE EACH OTHER (AVOID LIKING MYSELF) ##### CHECKING IF WE LIKE EACH OTHER (AVOID LIKING MYSELF)
@ -214,7 +214,7 @@ do
ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me)
echo ${ipfsnodeid} > ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/ipfsnodeid echo ${ipfsnodeid} > ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/ipfsnodeid
## TIMEOUT... uncomment in DEFCON3 only ## TIMEOUT... uncomment in DEFCON3 only
# zuid=$(ipfs --timeout=10s cat /ipns/${ipfsnodeid}/.${ipfsnodeid}/_xbian.zuid) # zuid=$(ipfs --timeout=10s cat /ipns/${ipfsnodeid}/.${ipfsnodeid}/.player)
# [[ ${zuid} ]] && touch ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/${zuid} # [[ ${zuid} ]] && touch ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/${zuid}
## NOT USEFULL TRYING ## NOT USEFULL TRYING

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
# Author: Fred (support@qo-op.com) # Author: Fred (support@qo-op.com) - Rewriter - Anonymous
# Version: 2020.12.03 # Version: 2020.12.03
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
######################################################################## ########################################################################
@ -13,7 +13,7 @@ start=`date +%s`
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
# CLEAN "A_my_swarm.txt" and "A_swarm_map.txt" # CLEAN "A_my_swarm.txt" and "A_swarm_map.txt"
@ -35,6 +35,18 @@ echo $(date)
######################################################################## ########################################################################
rm -f /tmp/liking_me ## FILE WILL BE REFRESHED rm -f /tmp/liking_me ## FILE WILL BE REFRESHED
## REFRESH IPFS SWARM FROM AVAILABLE FRIENDS
for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d '/' -f 1 | rev);
do
ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend)
echo "### $g1friend ipfs reading XID"
XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player)
if [[ $XID ]]; then
echo "### REFRESH ipfs_swarm $ipfsnodeid ($XID)"
ipfs --timeout=360s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
fi
done
# Check liking_me station in my swarm FRIENDS # Check liking_me station in my swarm FRIENDS
for swarm_frof in $(ls ~/.zen/ipfs_swarm/.*/FRIENDS/$G1PUB/stars.level | cut -d '/' -f 6 | cut -d '.' -f 2); ## FROM IPFS for swarm_frof in $(ls ~/.zen/ipfs_swarm/.*/FRIENDS/$G1PUB/stars.level | cut -d '/' -f 6 | cut -d '.' -f 2); ## FROM IPFS
do do

View File

@ -13,7 +13,7 @@ start=`date +%s`
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
######################################################################## ########################################################################
######################################################################## ########################################################################
@ -43,7 +43,7 @@ do
#echo "REFRESHING Friend /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" #echo "REFRESHING Friend /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/"
#ipfs --timeout=90s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid #ipfs --timeout=90s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
#[[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid || echo "NO ZUID" #[[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player || echo "NO ZUID"
echo "This is the list of your friend $g1id friends liking you" echo "This is the list of your friend $g1id friends liking you"
ls -d ~/.zen/ipfs_swarm/.$ipfsnodeid/FRIENDS/*/ 2>/dev/null | rev | cut -d '/' -f 2 | rev ls -d ~/.zen/ipfs_swarm/.$ipfsnodeid/FRIENDS/*/ 2>/dev/null | rev | cut -d '/' -f 2 | rev

View File

@ -9,7 +9,7 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
######################################################################## ########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
IPFSNODEID=$(ipfs --timeout=5s id -f='<id>\n') || er+=" ipfs id problem" IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) || er+=" ipfs id problem"
[[ "$YOU" == "" || "$IPFSNODEID" == "" ]] && echo "ERROR : $er " && exit 1 [[ "$YOU" == "" || "$IPFSNODEID" == "" ]] && echo "ERROR : $er " && exit 1
######################################################################## ########################################################################
# TODO ESTABLISH A PORT FORWARD STRATEGY (depending on Node Flavour) # TODO ESTABLISH A PORT FORWARD STRATEGY (depending on Node Flavour)
@ -53,7 +53,7 @@ if [[ "$IPFSNODEID" == "12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN" ]]
fi fi
# Every Station publish SSH port "/x/ssh-$zuid" # Every Station publish SSH port "/x/ssh-$zuid"
zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)"
if [[ $zuid ]] if [[ $zuid ]]
then then
if [[ ! $(cat ~/.ssh/authorized_keys | grep "fred@ONELOVE") ]] if [[ ! $(cat ~/.ssh/authorized_keys | grep "fred@ONELOVE") ]]

View File

@ -13,7 +13,7 @@ start=`date +%s`
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
######################################################################## ########################################################################
######################################################################## ########################################################################
@ -61,11 +61,13 @@ rm ~/.zen/A_peering_peers.txt
cp ~/.ipfs/config ~/.ipfs/config.new ## Prepare Peering.Peers changes cp ~/.ipfs/config ~/.ipfs/config.new ## Prepare Peering.Peers changes
# for ipfsnodeid in $( (cat /tmp/ipfs_swarm_peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq); ## TODO ACTIVATE IN DEFCON 4 # for ipfsnodeid in $( (cat /tmp/ipfs_swarm_peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq); ## TODO ACTIVATE IN DEFCON 4
for ipfsnodeid in $(cat ~/.zen/ipfs_swarm/.*/tryme.addr | grep -o '[^/]*$' | sort | uniq); for ipfsnodeid in $(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/tryme.addr | grep -o '[^/]*$' | sort | uniq);
#for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d '/' -f 1 | rev);
do do
# ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend)
## $ipfsnodeid already Treated ? ## $ipfsnodeid already Treated ?
[[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue [[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue
[[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) || XID='' [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) || XID=''
[[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title ]] && GZUID=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) || GZUID='' [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title ]] && GZUID=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) || GZUID=''
# [[ "$XID" == "" ]] && ipfs swarm disconnect /ipfs/$ipfsnodeid ## NOT COMPLIANT FRIEND STATION # [[ "$XID" == "" ]] && ipfs swarm disconnect /ipfs/$ipfsnodeid ## NOT COMPLIANT FRIEND STATION
# [[ $(cat /tmp/treated.ipfs.swarm | grep "$ipfsnodeid") ]] && continue ## TODO ACTIVATE IN DEFCON 4 # [[ $(cat /tmp/treated.ipfs.swarm | grep "$ipfsnodeid") ]] && continue ## TODO ACTIVATE IN DEFCON 4
@ -144,7 +146,8 @@ do
if [[ ! $IsAlreadythere ]]; then if [[ ! $IsAlreadythere ]]; then
echo '{ "ID": "'$ipfsnodeid'", "Addrs": [] }' >> ~/.zen/A_peering_peers.txt echo '{ "ID": "'$ipfsnodeid'", "Addrs": [] }' >> ~/.zen/A_peering_peers.txt
#jq '.Peering.Peers? += { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new #jq '.Peering.Peers? += { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new
jq '.Peering.Peers[.Peering.Peers| length] |= . + { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew && cp ~/.ipfs/config.wew ~/.ipfs/config.new jq '.Peering.Peers[.Peering.Peers| length] |= . + { "Addrs": [], "ID": "'$ipfsnodeid'" }' ~/.ipfs/config.new > ~/.ipfs/config.wew &&\
cp ~/.ipfs/config.wew ~/.ipfs/config.new
fi fi
################################################################ ################################################################
echo "## REFRESH stargates keys from my friend" echo "## REFRESH stargates keys from my friend"
@ -252,7 +255,7 @@ then ## DEFCON 3
echo "BLOB-Brain Friend RENEW /ipns/$ipfsnodeid TO ~/.zen/ipfs_swarm/" echo "BLOB-Brain Friend RENEW /ipns/$ipfsnodeid TO ~/.zen/ipfs_swarm/"
rm - Rf /home/$YOU/.zen/ipfs_swarm/$ipfsnodeid rm - Rf /home/$YOU/.zen/ipfs_swarm/$ipfsnodeid
ipfs --timeout=60s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid ipfs --timeout=60s get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
[[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && zuid=$(cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid) || continue [[ -f /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player ]] && zuid=$(cat /home/$YOU/.zen/ipfs_swarm/.$ipfsnodeid/.player) || continue
stars=$(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1id/stars.level); stars=$(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1id/stars.level);
G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $g1pub) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $g1pub) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1)
@ -276,11 +279,11 @@ fi
echo "******************************************************************" echo "******************************************************************"
echo "### REFRESH Film Serie Anime Youtube ${PREFIX}ASTRXBIAN ###" echo "### REFRESH Film Serie Anime Youtube ${PREFIX}ASTRXBIAN ###"
[[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/ [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/
AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player);
for PREFIX in F S A Y for PREFIX in F S A Y
do do
echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8181" > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8080" > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN
cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sed "s/anime;/film;/g" | sed '/^[[:space:]]*$/d' | grep -Ev "CAT;TMDB" | sort | uniq >> ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sed "s/anime;/film;/g" | sed '/^[[:space:]]*$/d' | grep -Ev "CAT;TMDB" | sort | uniq >> ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN
done done
@ -301,7 +304,7 @@ chmod 644 /home/$YOU/.zen/{ipfs_swarm}/.*/astroport/kodi/vstream/*ASTRXBIAN
######################################################################## ########################################################################
# REFRESH tiddlywiki WALL OF FRIENDS /ipns/${IPFSNODEID}/.${IPFSNODEID}/FRIENDS/index.html # REFRESH tiddlywiki WALL OF FRIENDS /ipns/${IPFSNODEID}/.${IPFSNODEID}/FRIENDS/index.html
######################################################################## ########################################################################
zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)"
updated="$(date +"%Y-%m-%d_%H:%M")" updated="$(date +"%Y-%m-%d_%H:%M")"
echo "******************************************************************" echo "******************************************************************"
@ -325,7 +328,7 @@ for wiki in $(ls ~/.zen/ipfs_swarm/.12D*/index.html | grep -Ev "${IPFSNODEID}" 2
whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid) whoisg1=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
echo "<li> echo "<li>
<a target=\"gchange\" href=\"https://www.gchange.fr/#/app/user/$whoisg1/\"> <a target=\"gchange\" href=\"https://www.gchange.fr/#/app/user/$whoisg1/\">
<img src=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/QR.png\" alt=\"$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid 2>dev/null)\" /> <img src=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/QR.png\" alt=\"$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player 2>dev/null)\" />
</a> </a>
<p class='video-title'> <p class='video-title'>
<a href=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/index.html\"> <a href=\"https://tube.copylaradio.com/ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/index.html\">
@ -340,7 +343,7 @@ echo "<li>
<iframe id=\"$ipfsnodeid\" <iframe id=\"$ipfsnodeid\"
title='tiddlywiki $whoisg1' title='tiddlywiki $whoisg1'
width='600' width='600'
src=\"http://127.0.0.1:8181/ipns/$ipfsnodeid/.$ipfsnodeid/index.html\"> src=\"http://127.0.0.1:8080/ipns/$ipfsnodeid/.$ipfsnodeid/index.html\">
</iframe> </iframe>
</li>" >> ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/index.html </li>" >> ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/index.html
done done

33
zen/ipns_MOA_publish.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
########################################################################
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
########################################################################
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
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 )
ipfs --timeout=3s ls /ipns/$MOANS
if [ $? != 0 ]; then
#echo "## PUBLISHING moa_${PLAYER} /ipns/$MOANS"
ls ~/.zen/game/players/$PLAYER/moa/*
IPUSH=$(ipfs add -rwHq ~/.zen/game/players/$PLAYER/moa/* | tail -n 1)
echo $IPUSH > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.chain
echo $MOATS > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.ts
echo 1 > ~/.zen/game/players/$PLAYER/moa/$PLAYER.moa.n
ipfs name publish --key=moa_${PLAYER} /ipfs/$IPUSH 2>/dev/null
else
## MISE A JOUR CACHE
ipfs get -o ~/.zen/game/players/$PLAYER/moa/ /ipns/$MOANS
fi
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8080/ipns/$QOOPNS"

31
zen/ipns_PLAYER_publish.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
########################################################################
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
########################################################################
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
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 )
ipfs --timeout=3s ls /ipns/$PLAYERNS
if [ $? != 0 ]; then
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/index.html | tail -n 1)
echo $IPUSH > ~/.zen/game/players/$PLAYER/$PLAYER.chain
echo $MOATS > ~/.zen/game/players/$PLAYER/$PLAYER.ts
echo 1 > ~/.zen/game/players/$PLAYER/$PLAYER.n
ipfs name publish --key=${PLAYER} /ipfs/$IPUSH 2>/dev/null
else
## MISE A JOUR CACHE (TODO : ADD CHAIN TO BE ABLE TO REVERSE TIME) - "Activate archive.org"
ipfs get -o ~/.zen/game/players/$PLAYER/index.html /ipns/$PLAYERNS
fi
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8080/ipns/$PLAYERNS"

View File

@ -20,7 +20,7 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr
######################################################################## ########################################################################
######################################################################## ########################################################################
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1
######################################################################## ########################################################################
[[ ! -f ~/.zen/secret.dunikey ]] && exit 1 [[ ! -f ~/.zen/secret.dunikey ]] && exit 1
@ -29,7 +29,7 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); 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 [[ ! $YOU ]] && echo "IPFS NOT RUNNING. EXIT" && exit 1
######################################################################## ########################################################################
XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
# echo "## FRIENDS IPFS PINGing" # echo "## FRIENDS IPFS PINGing"
# for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done # for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=3s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done
@ -59,7 +59,7 @@ do
# [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0 # [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0
IPNSLINK=$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1) IPNSLINK=$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1)
[[ "${IPNSLINK}" == "" ]] && continue ## prevent empty IPNSLINK [[ "${IPNSLINK}" == "" ]] && continue ## prevent empty IPNSLINK
echo "We are refreshing http://127.0.0.1:8181/ipns/${IPNSLINK}" echo "We are refreshing http://127.0.0.1:8080/ipns/${IPNSLINK}"
count=$((count+1)) && echo "$count) " count=$((count+1)) && echo "$count) "
FILE_NAME=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filename) FILE_NAME=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filename)
TITLE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.title) TITLE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.title)
@ -99,7 +99,7 @@ do
ZENBALANCE=$(echo "100 * $BALANCE" | bc -l | cut -d '.' -f 1) ZENBALANCE=$(echo "100 * $BALANCE" | bc -l | cut -d '.' -f 1)
TUBELINK="https://tube.copylaradio.com$(cat /tmp/${mediakey}_filelink.txt)" TUBELINK="https://tube.copylaradio.com$(cat /tmp/${mediakey}_filelink.txt)"
LOCALTUBELINK="http://127.0.0.1:8181$(cat /tmp/${mediakey}_filelink.txt)" LOCALTUBELINK="http://127.0.0.1:8080$(cat /tmp/${mediakey}_filelink.txt)"
### IPNS LINK CAN EVOLVE (REFRESH EVERY 12 H TO MAINTAIN ALIVE IN THE SWARM) ### IPNS LINK CAN EVOLVE (REFRESH EVERY 12 H TO MAINTAIN ALIVE IN THE SWARM)
### This index.html is ipns link root, 1st welcome page for MEDIAKEY -> *** Redirect to CONTRACTS or LOGIN processing HERE *** ### This index.html is ipns link root, 1st welcome page for MEDIAKEY -> *** Redirect to CONTRACTS or LOGIN processing HERE ***
@ -116,7 +116,8 @@ do
| sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${XZUID}/$XZUID/g" \
| sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \
| sed "s/\${TITLE}/$TITLE/g" \ | sed "s/\${TITLE}/$TITLE/g" \
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html > /tmp/${mediakey}_index.html
mv /tmp/${mediakey}_index.html ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html
[ ! -s ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html ] && echo "Problem creating ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html. EXIT" && exit 1 [ ! -s ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html ] && echo "Problem creating ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html. EXIT" && exit 1
@ -130,7 +131,7 @@ do
## THIS MAKES FRENCH COPY RIGHT LAW RESPECT ## THIS MAKES FRENCH COPY RIGHT LAW RESPECT
## LOCALHOST REDIRECT FOR INTERNAL KODI DEFCON 3 (swarm.key) ASTROPORT STATION MODE ## LOCALHOST REDIRECT FOR INTERNAL KODI DEFCON 3 (swarm.key) ASTROPORT STATION MODE
# echo "<meta charset=\"UTF-8\"><meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8181$(cat /tmp/${mediakey}_filelink.txt)\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html # echo "<meta charset=\"UTF-8\"><meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8080$(cat /tmp/${mediakey}_filelink.txt)\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html
# echo "<meta charset=\"UTF-8\"><meta http-equiv=\"Refresh\" content=\"0;URL=https://tube.copylaradio.com$(cat /tmp/${mediakey}_filelink.txt)\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html # echo "<meta charset=\"UTF-8\"><meta http-equiv=\"Refresh\" content=\"0;URL=https://tube.copylaradio.com$(cat /tmp/${mediakey}_filelink.txt)\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html
## DEMO PERIOD ## DEMO PERIOD
@ -196,7 +197,7 @@ do
echo "$id REFRESHED ${I} echo "$id REFRESHED ${I}
https://tube.copylaradio.com/ipns/$J https://tube.copylaradio.com/ipns/$J
http://127.0.0.1:8181/ipns/$J" http://127.0.0.1:8080/ipns/$J"
######################################################################## ########################################################################
######################################################################## ########################################################################
break ## ONE BY ONE (cron_MINUTE.sh task every 7 mn) break ## ONE BY ONE (cron_MINUTE.sh task every 7 mn)
@ -241,7 +242,7 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK 2>/dev/null | shuf ); do
echo "$id PIN PUBLISH REFRESHED /ipfs/$NEWIPFS echo "$id PIN PUBLISH REFRESHED /ipfs/$NEWIPFS
https://tube.copylaradio.com/ipns/$ipnsid https://tube.copylaradio.com/ipns/$ipnsid
http://127.0.0.1:8181/ipns/$ipnsid" http://127.0.0.1:8080/ipns/$ipnsid"
rm -Rf /tmp/${mediakey} rm -Rf /tmp/${mediakey}

32
zen/ipns_TW5_publish.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
########################################################################
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
########################################################################
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
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 )
ipfs --timeout=3s ls /ipns/$QOOPNS
if [ $? != 0 ]; then
IPUSH=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/index.html | tail -n 1)
echo $IPUSH > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.chain
echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.ts
echo 1 > ~/.zen/game/players/$PLAYER/ipfs/.$PeerID/$PLAYER.qo-op.n
ipfs name publish --key=qo-op_${PLAYER} /ipfs/$IPUSH 2>/dev/null
else
## MISE A JOUR CACHE
ipfs get -o ~/.zen/game/players/$PLAYER/ipfs/.$IPFSNODEID/index.html /ipns/$QOOPNS
fi
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8080/ipns/$QOOPNS"

View File

@ -6,13 +6,20 @@ ME="${0##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) 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 [[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
######################################################################## ########################################################################
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1 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 )
######################################################################## ########################################################################
## TESSERACT DOUBLE ACTION ## TESSERACT DOUBLE ACTION
######################################################################## ########################################################################
echo "Adding ~/.zen/ipfs to IPFS" echo "Adding ~/.zen/ipfs/ to IPFS"
# MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) # MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
# OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain) # OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)
# echo "OLD: $OLDCHAIN != NEW:$MIPFS ?" # echo "OLD: $OLDCHAIN != NEW:$MIPFS ?"
@ -20,11 +27,11 @@ echo "Adding ~/.zen/ipfs to IPFS"
# then # then
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp
echo $MIPFS > ~/.zen/ipfs/.${IPFSNODEID}/.chain echo $MIPFS > ~/.zen/ipfs/.${IPFSNODEID}/.chain
MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) MIPFS=$(ipfs add -rHq $(readlink ~/.zen/ipfs) | tail -n 1)
NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS) NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS)
echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)" echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)"
# fi # fi
echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8181/ipns/$IPFSNODEID" echo "PUBLISHED ~/.zen/ipfs TO http://127.0.0.1:8080/ipns/$IPFSNODEID"
######################################################################## ########################################################################
## READ BLOCK CHAIN ## ## READ BLOCK CHAIN ##
# TIME=$(ipfs cat /ipns/${IPFSNODEID}/.${IPFSNODEID}/.timestamp) # TIME=$(ipfs cat /ipns/${IPFSNODEID}/.${IPFSNODEID}/.timestamp)

View File

@ -5,6 +5,6 @@ DUNIKEY=/.zen/secret.dunikey
NODE=https://g1.librelois.fr/gva NODE=https://g1.librelois.fr/gva
# Adresse du pod Cesium ou Gchange à utiliser # Adresse du pod Cesium ou Gchange à utiliser
POD=https://g1.data.le-sou.org #POD=https://g1.data.le-sou.org
#POD=https://g1.data.duniter.fr #POD=https://g1.data.duniter.fr
#POD=https://data.gchange.fr POD=https://data.gchange.fr

View File

@ -10,7 +10,7 @@ ME="${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 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(ipfs id -f='<id>\n')
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); [[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player);
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)
######################################################################## ########################################################################
@ -39,11 +39,11 @@ else
fi fi
echo "******************************************************************" echo "******************************************************************"
echo "STARGATE1 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/1/stargate)" echo "STARGATE1 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/1/stargate)"
echo "STARGATE2 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/2/stargate)" echo "STARGATE2 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/2/stargate)"
echo "STARGATE3 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/3/stargate)" echo "STARGATE3 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/3/stargate)"
echo "STARGATE4 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/4/stargate)" echo "STARGATE4 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/4/stargate)"
echo "STARGATE5 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/5/stargate)" echo "STARGATE5 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/5/stargate)"
echo "******************************************************************" echo "******************************************************************"
######################################################################## ########################################################################
@ -91,7 +91,7 @@ for friendgate in $(ls -d ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/); do
;; ;;
esac esac
ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$fg1pub/ ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$fg1pub/
echo "http://127.0.0.1:8181/ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$fg1pub/" echo "http://127.0.0.1:8080/ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$fg1pub/"
echo "" echo ""
done done

View File

@ -1,4 +1,4 @@
#!/bin/bash -x #!/bin/bash
######################################################################## ########################################################################
# Author: Fred (support@qo-op.com) # Author: Fred (support@qo-op.com)
# Version: 0.3 # Version: 0.3
@ -10,11 +10,16 @@
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##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
start=`date +%s`
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not responding !?' && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN # ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN
# Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from http://127.0.0.1:8181/.$IPFNODEID/ # Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from http://127.0.0.1:8080/.$IPFNODEID/
# Index File Format (could be enhanced) is using Kodi TMDB enhancement # Index File Format (could be enhanced) is using Kodi TMDB enhancement
# 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
######################################################################## ########################################################################
@ -46,9 +51,11 @@ TITLE="${file%.*}"
# GET XZUID # GET XZUID
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(cat /etc/hostname) [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(cat /etc/hostname)
[[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && er="Les fichiers sont à placer dans ~/astroport/ MERCI" && echo "$er" && exit 1 [[ ! $(echo "$path" | cut -d '/' -f 4 | grep 'astroport') ]] && er="Les fichiers sont à placer dans ~/astroport/ MERCI" && echo "$er" && exit 1
TYPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/astroport/... TYPE(film, youtube, mp3, video)/ REFERENCE / TYPE=$(echo "$path" | cut -d '/' -f 5 ) # ex: /home/$YOU/astroport/... TYPE(film, youtube, mp3, video, page)/ REFERENCE /
CAT=$(echo "$TYPE" | awk '{ print tolower($0) }') CAT=$(echo "$TYPE" | awk '{ print tolower($0) }')
echo $CAT
PREFIX=$(echo "$TYPE" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, Y, M ou Y PREFIX=$(echo "$TYPE" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, Y, M ou Y
# File is placed in ROOT ~/astroport ? # File is placed in ROOT ~/astroport ?
if [[ $PREFIX == "" ]] if [[ $PREFIX == "" ]]
@ -73,6 +80,12 @@ case ${CAT} in
REFERENCE=$(echo "$path" | cut -d '/' -f 6 ) REFERENCE=$(echo "$path" | cut -d '/' -f 6 )
TITLE="${file%.*}" TITLE="${file%.*}"
;; ;;
page)
## DIFFERENT TREATMENT
INDEXPREFIX="PAGE_"
REFERENCE=$(echo "$path" | cut -d '/' -f 6 )
TITLE="${file%.*}"
;;
mp3) mp3)
## DIFFERENT TREATMENT ## DIFFERENT TREATMENT
INDEXPREFIX="MP3_" INDEXPREFIX="MP3_"
@ -216,6 +229,13 @@ if [[ ! -d ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode} && "$P
$MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfsid -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfsid.encrypt" $MY_PATH/tools/natools.py encrypt -p $PINnode -i /tmp/.ipfsid -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode}/.ipfsid.encrypt"
# .ipfsid.encrypt is searched by each Station running ./zen/tools/autoPINfriends.sh # .ipfsid.encrypt is searched by each Station running ./zen/tools/autoPINfriends.sh
fi fi
## Ask PIN to myself
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${G1PUB}
$MY_PATH/tools/natools.py encrypt -p $G1PUB -i /tmp/.ipfs.filelink -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${G1PUB}/.ipfs.filelink.encrypt"
$MY_PATH/tools/natools.py encrypt -p $G1PUB -i /tmp/.ipfsid -o "~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${G1PUB}/.ipfsid.encrypt"
######################################################################## ########################################################################
## GREAT natools can convert IPNS MEDIAKEY into .dunikey file ## GREAT natools can convert IPNS MEDIAKEY into .dunikey file
######################################################################## ########################################################################
@ -256,7 +276,7 @@ echo "anonymous" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode
# MEMORIZE my PIN # MEMORIZE my PIN
mkdir -p ~/.zen/PIN/${IPFSREPFILEID}/ mkdir -p ~/.zen/PIN/${IPFSREPFILEID}/
touch ~/.zen/PIN/${IPFSREPFILEID}/${G1PUB} touch ~/.zen/PIN/${IPFSREPFILEID}/${G1PUB}
# echo "$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)" > ~/.zen/PIN/${ipfsrepidfile}/IPNSLINK # NO!! Would let PINing nodes change index.html/// # echo "$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)" > ~/.zen/PIN/${ipfsrepidfile}/IPNSLINK # NO!! CHOOSE TODO Would let PINing nodes change index.html///
######################################################################## ########################################################################
## encrypt links for myself ## encrypt links for myself
@ -271,14 +291,18 @@ rm /tmp/.ipfsid
## ADD "ajouter_video.txt" and "video.json" will be SELF IPNS publish data ## ADD "ajouter_video.txt" and "video.json" will be SELF IPNS publish data
## ENCRYPT TO STOP CLEAR DATA LEAKING ## ENCRYPT TO STOP CLEAR DATA LEAKING
[[ -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ [[ -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ [[ -f ~/astroport/${TYPE}/${REFERENCE}/screen.png ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/screen.png ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
[[ -f ~/astroport/${TYPE}/${REFERENCE}/youtube.png ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/youtube.png ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/screen.png
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] &&\
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ &&\
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
######################################################################## ########################################################################
######################################################################## ########################################################################
## EXPLANATIONS ## EXPLANATIONS
######################################################################## ########################################################################
# What is being in ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ # What is being in ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
# is published on http://127.0.0.1:8181/ipns/$KEY/ AND ipfs ls /ipns/$KEY/ # is published on http://127.0.0.1:8080/ipns/$KEY/ AND ipfs ls /ipns/$KEY/
######################################################################## ########################################################################
######################################################################## ########################################################################
# CONTRACTS, are small App (fulljs or jquery + nginx backend app server) # CONTRACTS, are small App (fulljs or jquery + nginx backend app server)
@ -292,6 +316,8 @@ rm /tmp/.ipfsid
# one star level (no encrypt) # one star level (no encrypt)
# index.html is presenting Astroport/Kodi service then redirect to # index.html is presenting Astroport/Kodi service then redirect to
# $G1PUB/index.html contains redirection to ipfs link # $G1PUB/index.html contains redirection to ipfs link
## NEW RELEASE
## Create TW5 index.html to give easy control access to MEDIAKEY and KEY owner
######################################################################## ########################################################################
######################################################################## ########################################################################
@ -310,31 +336,53 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)
| sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${XZUID}/$XZUID/g" \
| sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \
| sed "s/\${TITLE}/$TITLE/g" \ | sed "s/\${TITLE}/$TITLE/g" \
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html
### PATCH TW5 (TODO SPLIT TEMPLATES & DIFFERENTIATE MIMETYPE TIDDLERS)
echo "=======> Mediakey TW5 /ipns/$KEY"
cp ~/.zen/Astroport.ONE/templates/dreamcatcher.html ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null)
sed -i "s~_MOATS_~${MOATS}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_PLAYER_~${XZUID}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_TITRE_~${TITLE}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_IPFSROOT_~${IPFSREPFILEID}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_IPFSID_~${IPFSID}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2)
sed -i "s~_MIME_~${MIME}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_MEDIAKEY_~${MEDIAKEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
sed -i "s~_KEY_~${KEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
# Configure IPNS publication key
sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${KEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
### PATCH TW5
## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html ## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html
# https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/ # https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/
#envsubst < ../www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html #envsubst < ../www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
echo "=======> Mediakey Contract index.html " # echo "=======> Mediakey Contract index.html "
cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \ # cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \
| sed "s/\${TITLE}/$TITLE/g" \ # | sed "s/\${TITLE}/$TITLE/g" \
| sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ # | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \
| sed "s/\${XZUID}/$XZUID/g" \ # | sed "s/\${XZUID}/$XZUID/g" \
| sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \ # | sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \
| sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \ # | sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \
> ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html # > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
# echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html # echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html
######################################################################## ########################################################################
## MODIFY INTO "./zen/ipns_TAG_refresh.sh" (add crypto/contracts there) ## MODIFY INTO "./zen/ipns_TAG_refresh.sh" (add crypto/contracts there)
######################################################################## ########################################################################
## COPY LOCALHOST IPFS URL TO CLIPBOARD
[[ $(which xclip) ]] && echo "http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c
######################################################################## ########################################################################
######################################################################## ########################################################################
## PUBLISH new IPNS ## PUBLISH new IPNS
@ -348,7 +396,7 @@ NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1
echo $NEWIPFS > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.chain echo $NEWIPFS > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.chain
IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS)
[[ "$IPNS" == "" ]] && echo "~~~ PROBLEM ~~~ ipfs name publish --quieter --key=${MEDIAKEY} $NEWIPFS" [[ "$IPNS" == "" ]] && echo "~~~ PROBLEM ~~~ ipfs name publish --quieter --key=${MEDIAKEY} $NEWIPFS" && IPNS="$(ipfs key list -l | grep -w ${MEDIAKEY} | cut -f 1 -d ' ')"
######################################################################## ########################################################################
######################################################################## ########################################################################
@ -357,17 +405,17 @@ IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS)
######################################################################## ########################################################################
# film/serie PUBLISH "ajouter_video.txt" for KODI # film/serie PUBLISH "ajouter_video.txt" for KODI
######################################################################## ########################################################################
if [[ "${CAT}" =~ ^(film|serie|youtube)$ ]] if [[ "${CAT}" =~ ^(film|serie|youtube|page|video)$ ]]
then then
## CREATE GCHANGE AD ## CREATE GCHANGE AD
if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad && "${CAT}" != "youtube" ]] if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad && ( "${CAT}" == "film" || "${CAT}" == "serie") ]]
then then
GOFFER=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" setoffer -t "${TITLE} #astroport #${MEDIAKEY}" -d "${TITLE} https://tube.copylaradio.com/ipns/$IPNS/ Faites un don à son portefeuille pour le conserver dans le Mediacenter des Amis - https://CopyLaRadio.com - https://astroport.com" -p $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png) GOFFER=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" setoffer -t "${TITLE} #astroport #${MEDIAKEY}" -d "${TITLE} https://tube.copylaradio.com/ipns/$IPNS/ Faites un don à son portefeuille pour le conserver dans le Mediacenter des Amis - https://CopyLaRadio.com - https://astroport.com" -p $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png)
echo $GOFFER > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad echo $GOFFER > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad
NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 ) NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 )
IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS)
[[ "$IPNS" == "" ]] && IPNS="$(ipfs key list -l | grep -w ${MEDIAKEY} | cut -f 1 -d ' ')"
echo "Annonce gchange : $(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad)" echo "Annonce gchange : $(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad)"
fi fi
@ -375,7 +423,7 @@ then
######################################################################## ########################################################################
# CREATION DU FICHIER ${PREFIX}ASTRXBIAN FILE : Add Header # CREATION DU FICHIER ${PREFIX}ASTRXBIAN FILE : Add Header
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ]] \ [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ]] \
&& echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8181" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN && echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8080" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN
# ADD NEW LINE TO INDEX # ADD NEW LINE TO INDEX
if [[ -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ]] if [[ -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ]]
@ -393,14 +441,75 @@ then
echo "$line" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt echo "$line" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt
## UPDATE SOURCE ajouter_video.txt FILE ## UPDATE SOURCE ajouter_video.txt FILE
cp -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt cp -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt
######################################################################## ########################################################################
## TODO: ACTIVATE SUB DEFCON 4 MODE = encrypt/decrypt file in $G1DEST subdirectory ## TODO: ACTIVATE SUB DEFCON 4 MODE = encrypt/decrypt file in $G1DEST subdirectory
######################################################################## ########################################################################
echo "----------------- REFRESH LOCAL KODI INDEX ----------------------" echo "----------------- REFRESH LOCAL KODI INDEX ----------------------"
cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sort | uniq > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sort | uniq > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN
GENRE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt | cut -d ';' -f 6 | sed 's/|/ /g' )
MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2)
REAL=$MIME
if [[ $(echo "$MIME" | grep 'video') ]]; then
TEXT="<video controls><source src='/ipfs/"${IPFSID}"' type='"${MIME}"'></video><h1>"${TITLE}"</h1>"
MIME="text/vnd.tiddlywiki"
TAGS="${CAT} astroport $GENRE"
CANON=''
else
TEXT='${MEDIAKEY}'
TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE
CANON="/ipfs/"${IPFSID}
fi
## Add screen
SCREENDIR=$(ipfs add -wq "$HOME/astroport/${TYPE}/${REFERENCE}/${CAT}.png" | tail -n 1)
echo "## Creation json tiddler"
echo '[
{
"text": "'${TEXT}'",
"title": "'${TITLE}'",
"type": "'${MIME}'",
"mime": "'${REAL}'",
"cat": "'${CAT}'",
"screenshot": "'${SCREENDIR}/screen.png'",
"ipfsroot": "'${IPFSREPFILEID}'",
"file": "'${file}'",
"mediakey": "'${MEDIAKEY}'",
"ipns": "'${IPNS}'",
"tmdb": "'${REFERENCE}'",
"tags": "'${TAGS}'" ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
[[ ${CANON} != "" ]] && echo ',
"_canonical_uri": "'${CANON}'"' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
echo '
}
]
' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
echo "Add tidller into Station Balise"
cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/tiddler.json
echo "SEND TW json to GCHANGE (call from g1-compagnon"
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "$3" -t "MEDIAKEY ${MEDIAKEY}" -m "MEDIA : https;//astroport.com/ipfs/${IPFSREPFILEID} + TW https;//astroport.com/ipns/$IPFSNODEID/.$IPFSNODEID/KEY/${MEDIAKEY}/${G1PUB}/tiddler.json "
# Will be used by caroussel.html template
# CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1)
# COPY TIDDLER JSON TO DESKTOP Journal/${TYPE}
[[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json "$HOME/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json" && xdg-open "$HOME/Bureau/Journal/${TYPE}/"
[[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json "$HOME/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json" && xdg-open "$HOME/Desktop/Journal/${TYPE}/"
fi fi
## COPY LOCALHOST IPFS URL TO CLIPBOARD
[[ $(which xclip) ]] &&\
[[ $TEXT == "" ]] &&\
echo "http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c ||\
echo "$TEXT" | xclip -selection c
######################################################################## ########################################################################
# PUBLISH GENERAL video # PUBLISH GENERAL video
######################################################################## ########################################################################
@ -431,7 +540,12 @@ fi
~/.zen/astrXbian/zen/ipns_self_publish.sh ~/.zen/astrXbian/zen/ipns_self_publish.sh
######################################################################## ########################################################################
echo "DUNIKEY PASS $PASS" echo "DUNIKEY PASS $PASS"
echo "NEW $TYPE ($file) ADDED. http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" echo "NEW $TYPE ($file) ADDED. http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME"
echo "INDEX UPDATED : http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN" echo "INDEX UPDATED : http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN"
echo "VIDEO IPNS LINK : http://127.0.0.1:8181/ipns/$KEY/$G1PUB/" echo "VIDEO IPNS LINK : http://127.0.0.1:8080/ipns/$KEY/$G1PUB/"
echo "#### EXCECUTION TIME"
end=`date +%s`
echo Execution time was `expr $end - $start` seconds.
echo "########################################################################"
[[ ! $3 ]] && zenity --warning --width 300 --text "Votre MEDIA a rejoint ASTROPORT en `expr $end - $start` secondes"
exit 0 exit 0

View File

@ -116,7 +116,7 @@ echo "${TITLE}" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1
echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/.timestamp echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/.timestamp
# IPNS index.html Redirect to ipfs streaming link (could be contract or anything else !!) # IPNS index.html Redirect to ipfs streaming link (could be contract or anything else !!)
echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/index.html echo "<meta http-equiv=\"Refresh\" content=\"0;URL=http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME\">" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/index.html
IPNSLINK=$(ipfs key list -l | grep ${INDEXPREFIX}${REFERENCE} | cut -d ' ' -f 1) IPNSLINK=$(ipfs key list -l | grep ${INDEXPREFIX}${REFERENCE} | cut -d ' ' -f 1)
echo "<meta http-equiv=\"Refresh\" content=\"10;URL=https://aries.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/\"> echo "<meta http-equiv=\"Refresh\" content=\"10;URL=https://aries.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/\">
@ -149,6 +149,6 @@ echo "${TITLE}" > ~/.zen/PIN/${IPFSREPFILEID}/${IPNS}/.title
rm -Rf ${YTEMP} rm -Rf ${YTEMP}
echo "NEW ($file) ADDED." echo "NEW ($file) ADDED."
echo "IPNS LINK : http://127.0.0.1:8181/ipns/$KEY/$G1PUB/" echo "IPNS LINK : http://127.0.0.1:8080/ipns/$KEY/$G1PUB/"
exit 0 exit 0

View File

@ -15,7 +15,7 @@ export IPFSNODEID=$(ipfs id -f='<id>\n')
for PREFIX in F A S for PREFIX in F A S
do do
cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sort | uniq > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | sort | uniq > ~/.zen/ipfs/.${IPFSNODEID}/${PREFIX}ASTRXBIAN
echo "${PREFIX} INDEX UPDATED : http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN" echo "${PREFIX} INDEX UPDATED : http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN"
done done
######################################################################## ########################################################################

View File

@ -2,7 +2,7 @@
HLS_TIME=40 HLS_TIME=40
M3U8_SIZE=3 M3U8_SIZE=3
IPFS_GATEWAY="http://127.0.0.1:8181" IPFS_GATEWAY="http://127.0.0.1:8080"
echo "Astroport stream is playing on star_1 : https://tube.copylaradio.com/ipns/$(ipfs key list -l | grep star_1 | cut -d ' ' -f 1)" echo "Astroport stream is playing on star_1 : https://tube.copylaradio.com/ipns/$(ipfs key list -l | grep star_1 | cut -d ' ' -f 1)"

View File

@ -12,7 +12,7 @@ do
TEST=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me | jq -r '.yours.level') TEST=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me | jq -r '.yours.level')
if [ ! $TEST == 'null' ]; then if [ ! $TEST == 'null' ]; then
echo "$station is my friend" echo "$station is my friend"
ipfs --timeout=6s cat /ipns/$station/.$station/_xbian.zuid ipfs --timeout=6s cat /ipns/$station/.$station/.player
[ ! $? == 0 ] && echo "UNAVAILABLE FRIEND $liking_me" [ ! $? == 0 ] && echo "UNAVAILABLE FRIEND $liking_me"
sleep 1 sleep 1
fi fi

View File

@ -2,7 +2,7 @@
# ADD QR/sec CODE & DUNIKEY TO MEDIAKEY # ADD QR/sec CODE & DUNIKEY TO MEDIAKEY
# Fabrique ou récupère un PASS pour fabriquer le QRCode "privé" sécurisé avec openssl # Fabrique ou récupère un PASS pour fabriquer le QRCode "privé" sécurisé avec openssl
# ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/QRsec.png # ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/QRsec.png
# http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/QRsec.png # http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/QRsec.png
for MEDIAKEY in $(ipfs key list); for MEDIAKEY in $(ipfs key list);
do do

View File

@ -9,7 +9,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}" ME="${0##*/}"
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
myIP=$(hostname -I | awk '{print $1}' | head -n 1) myIP=$(hostname -I | awk '{print $1}' | head -n 1)
IamInLAN=$(echo $myIP | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" ) IamInLAN=$(echo $myIP | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" )

View File

@ -79,7 +79,7 @@ do
############################################ PINNING NODE MAKES ALL HIS FRIENDS MOVIES AVAILABLE TO ALL ############################################ PINNING NODE MAKES ALL HIS FRIENDS MOVIES AVAILABLE TO ALL
## TODO : DECIDE TO ACTIVATE THIS BEHAVIOUR OR NOT ? ## TODO : DECIDE TO ACTIVATE THIS BEHAVIOUR OR NOT ?
## Copy FASTRXBIAN index (makes movies available for ALL) ## Copy FASTRXBIAN index (makes movies available for ALL)
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN ]] && echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8181" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN ]] && echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8080" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN
if [[ "$keytype" == "TMDB" ]]; then if [[ "$keytype" == "TMDB" ]]; then
cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/FASTRXBIAN | grep ";$mediaid;" | tail -n 1 >> ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN cat ~/.zen/ipfs_swarm/.12D*/astroport/kodi/vstream/FASTRXBIAN | grep ";$mediaid;" | tail -n 1 >> ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN
cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN | uniq > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN cat ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN | uniq > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/FASTRXBIAN

View File

@ -13,11 +13,11 @@ for ipfsid in $(cat ~/.zen/ipfs_swarm/.*/.ipfsnodeid); do
echo "TESTING $ipfsid" echo "TESTING $ipfsid"
ipfs -timeout=7s ping -n5 /p2p/$ipfsid 2>/dev/null | tail -n 1 ipfs -timeout=7s ping -n5 /p2p/$ipfsid 2>/dev/null | tail -n 1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/_xbian.zuid 2>/dev/null) || zuidonline="TIMEOUT" zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/.player 2>/dev/null) || zuidonline="TIMEOUT"
[[ -f ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) || zuidoffline="UNKOWN" [[ -f ~/.zen/ipfs_swarm/.$ipfsid/.player ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) || zuidoffline="UNKOWN"
echo "Station $zuidonline [$zuidoffline] : OK" echo "Station $zuidonline [$zuidoffline] : OK"
else else
echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) : DEAD" echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) : DEAD"
fi fi
echo "" echo ""
fi fi

View File

@ -12,7 +12,7 @@ ME="${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 YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n') IPFSNODEID=$(ipfs id -f='<id>\n')
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid); [[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player);
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)
channel="$1" && [[ "$channel" == "" ]] && channel="wordpress" channel="$1" && [[ "$channel" == "" ]] && channel="wordpress"
@ -44,7 +44,7 @@ do
echo "$ipfnodesource wants to publish $mediakey" echo "$ipfnodesource wants to publish $mediakey"
## GET ipns link + title + xzuid ## GET ipns link + title + xzuid
title=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/.title | sed "s/_/ /g") title=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/.title | sed "s/_/ /g")
xzuid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/_xbian.zuid) xzuid=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/.player)
tags=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/video.json | jq -c .tags | sed 's/[][]//g' | sed "s/\"//g" ) tags=$(cat ~/.zen/ipfs_swarm/.$ipfnodesource/KEY/$mediakey/$g1pubsource/video.json | jq -c .tags | sed 's/[][]//g' | sed "s/\"//g" )
mynodename=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/G1SSB/_nodename) mynodename=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/G1SSB/_nodename)

View File

@ -41,37 +41,37 @@ IPFSNODEID=$(ipfs id -f='<id>\n')
G1PUB=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) G1PUB=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
echo "G1SSB Wallet: $G1PUB echo "G1SSB Wallet: $G1PUB
IPFS: $IPFSNODEID IPFS: $IPFSNODEID
__ __ _ _ _______ __ __ _ _ _______
_______ _ __ | \/ | / \ | |/ / ____| _______ _ __ | \/ | / \ | |/ / ____|
|_ / _ \ '_ \ | |\/| | / _ \ | ' /| _| |_ / _ \ '_ \ | |\/| | / _ \ | ' /| _|
/ / __/ | | | | | | |/ ___ \| . \| |___ / / __/ | | | | | | |/ ___ \| . \| |___
/___\___|_| |_| |_| |_/_/ \_\_|\_\_____| /___\___|_| |_| |_| |_/_/ \_\_|\_\_____|
" "
######################################################################## ########################################################################
# ZenTag is an IPFS/IPNS datastructure shared into IPFS, publish # ZenTag is an IPFS/IPNS datastructure shared into IPFS, publish
# ~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~ # ~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~ Draft ~~~~
# _chain # ZenTag IPFS Hash # _chain # ZenTag IPFS Hash
# _chain.n # Sequence Number # _chain.n # Sequence Number
# _chain.nanodate # Current nanodate # _chain.nanodate # Current nanodate
# _chain.prev # Previous IPFS Hash # _chain.prev # Previous IPFS Hash
# _g1.node.creator # G1SSB wallet pubkey # _g1.node.creator # G1SSB wallet pubkey
# _tag.issuer # G1TX ISSUER pubkey # _tag.issuer # G1TX ISSUER pubkey
# _tag.zensource # G1TX HASH or SSB timestamp # _tag.zensource # G1TX HASH or SSB timestamp
# _ipfs.node.creatorcat # NODE IPFS ID # _ipfs.node.creatorcat # NODE IPFS ID
# _ipfs.publishkey.BB.aes # BB SYMcypher of IPNS publish key # _ipfs.publishkey.BB.aes # BB SYMcypher of IPNS publish key
# _ipfs.publishkey.crypt # G1SSB ASYMcypher of IPNS publish key # _ipfs.publishkey.crypt # G1SSB ASYMcypher of IPNS publish key
# _tag.BB.sha # BB sha256sum # _tag.BB.sha # BB sha256sum
# _tag.uid # ZenTag UID # _tag.uid # ZenTag UID
# _tag.zen # ZentTag balance # _tag.zen # ZentTag balance
# _ipns # /ipns/ address # _ipns # /ipns/ address
# PASSENGER FILE (put to IPFS and cypher link in IPNS ZenTag) # PASSENGER FILE (put to IPFS and cypher link in IPNS ZenTag)
# _passenger.filename # Passenger filename # _passenger.filename # Passenger filename
# _passenger.ipfs.crypt # G1SSB cyphered IPFS Passenger link # _passenger.ipfs.crypt # G1SSB cyphered IPFS Passenger link
# _passenger.read # Zen value asked for READING # _passenger.read # Zen value asked for READING
# _passenger.park # Zen value paid for PARKING # _passenger.park # Zen value paid for PARKING
# Only if contract executed => add new cyphered links # Only if contract executed => add new cyphered links
# _passenger.contract.sh # Zen CONTRACT TODO # _passenger.contract.sh # Zen CONTRACT TODO
# COmpare with code to verify and extend Draft # COmpare with code to verify and extend Draft
# TODO: Could be converted into yaml or json if you like... # TODO: Could be converted into yaml or json if you like...
######################################################################## ########################################################################
@ -85,39 +85,39 @@ if [[ "$METADATA" == "" ]]; then
echo " echo "
# LOVE BANK - PrePaid Card ZenTag # LOVE BANK - PrePaid Card ZenTag
# FULLY BACKED ON IRL G1 LIBRE MONEY (https://cesium.app) # FULLY BACKED ON IRL G1 LIBRE MONEY (https://cesium.app)
# ____ ____ _____ _____ _ _ # ____ ____ _____ _____ _ _
# / ___| _ \| ____| ____| \ | | _______ _ __ # / ___| _ \| ____| ____| \ | | _______ _ __
# | | _| |_) | _| | _| | \| | |_ / _ \ '_ \ # | | _| |_) | _| | _| | \| | |_ / _ \ '_ \
# | |_| | _ <| |___| |___| |\ | / / __/ | | | # | |_| | _ <| |___| |___| |\ | / / __/ | | |
# \____|_| \_\_____|_____|_| \_| /___\___|_| |_| # \____|_| \_\_____|_____|_| \_| /___\___|_| |_|
# #
" "
# COMMENT WILL BREAK (G1 <=> ZEN) STRICT RELATION # COMMENT WILL BREAK (G1 <=> ZEN) STRICT RELATION
[[ ! -f ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE ]] && echo "ERROR# UNKNOWN ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE !!" && exit 1 [[ ! -f ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE ]] && echo "ERROR# UNKNOWN ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE !!" && exit 1
ISSUER=$(cat ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE) ISSUER=$(cat ~/.zen/cache/g1_TX_inputs/zen.$ZENSOURCE)
[[ $ISSUER == "" ]] && echo "ERROR# NO ISSUER FOUND FOR TX $ZENSOURCE !!" && exit 1 [[ $ISSUER == "" ]] && echo "ERROR# NO ISSUER FOUND FOR TX $ZENSOURCE !!" && exit 1
echo "ISSUER = $ISSUER SENT TX $ZENSOURCE !!" echo "ISSUER = $ISSUER SENT TX $ZENSOURCE !!"
else else
echo " echo "
_|_ o ._ _ _ _ _|_ _. ._ _ ._ _|_ o ._ _ _ _ _|_ _. ._ _ ._
|_ | | | | (/_ _> |_ (_| | | | |_) |_ | | | | (/_ _> |_ (_| | | | |_)
| |
SSB PASSENGER ~/.zen/miam/$ZENSOURCE SSB PASSENGER ~/.zen/miam/$ZENSOURCE
" "
[[ ! -d ~/.zen/miam/$ZENSOURCE ]] && echo "ERROR# UNKNOWN ~/.zen/miam/$ZENSOURCE !!" && exit 1 [[ ! -d ~/.zen/miam/$ZENSOURCE ]] && echo "ERROR# UNKNOWN ~/.zen/miam/$ZENSOURCE !!" && exit 1
ISSUER=$(cat ~/.zen/miam/$ZENSOURCE/msg_key) ISSUER=$(cat ~/.zen/miam/$ZENSOURCE/msg_key)
[[ $ISSUER == "" ]] && echo "ERROR# NO ISSUER FOUND FOR miam $ZENSOURCE !!" && exit 1 [[ $ISSUER == "" ]] && echo "ERROR# NO ISSUER FOUND FOR miam $ZENSOURCE !!" && exit 1
echo "ISSUER = SSB Message $ISSUER !!" echo "ISSUER = SSB Message $ISSUER !!"
fi fi
######################################################################## ########################################################################
# CREATE ZEN TAG # CREATE ZEN TAG
######################################################################## ########################################################################
# Produce unique 6 words diceware to give a name _tag.uid # Produce unique 6 words diceware to give a name _tag.uid
AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g ) # ZenTag Name = Diceware_6_words AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g ) # ZenTag Name = Diceware_6_words
@ -126,12 +126,12 @@ AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) # ZenTag Name SHA256
# TODO ACTIVATE SWARM UNICITY CHECK # TODO ACTIVATE SWARM UNICITY CHECK
# Create Unique Zentag for all IPFS SWARM! # Create Unique Zentag for all IPFS SWARM!
while [[ $(grep -Rwl "$AA" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.uid) ]]; do while [[ $(grep -Rwl "$AA" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.uid) ]]; do
AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g ) AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g )
AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1)
done done
# BB key is a 4 word diceware printed on QRCode for Human use. # BB key is a 4 word diceware printed on QRCode for Human use.
# SHA256 PASSWORD CHECK FOR ALLOWING WRITE ACTION # SHA256 PASSWORD CHECK FOR ALLOWING WRITE ACTION
BB=$($MY_PATH/tools/diceware.sh 4 | xargs); BB=$($MY_PATH/tools/diceware.sh 4 | xargs);
BBH=$(echo -n "$BB" | sha256sum | cut -d ' ' -f 1) BBH=$(echo -n "$BB" | sha256sum | cut -d ' ' -f 1)
@ -141,14 +141,14 @@ BBH=$(echo -n "$BB" | sha256sum | cut -d ' ' -f 1)
mkdir -p ~/.zen/tag/${AAH} mkdir -p ~/.zen/tag/${AAH}
# LOG # LOG
echo " echo "
_____ _____ _ ____ _____ _____ _ ____
|__ /___ _ _|_ _|/ \ / ___| __/\__ |__ /___ _ _|_ _|/ \ / ___| __/\__
/ // _ \ °_ \| | / _ \| | _ \ / / // _ \ °_ \| | / _ \| | _ \ /
/ /| __/ | | | |/ ___ \ |_| | /_ _\ / /| __/ | | | |/ ___ \ |_| | /_ _\
/____\___|_| |_|_/_/ \_\____| \/ /____\___|_| |_|_/_/ \_\____| \/
******************************************************* *******************************************************
| $AA | $ZEN Zen | $AA | $ZEN Zen
******************************************************* *******************************************************
CREATING ~/.zen/tag/${AAH}/ CREATING ~/.zen/tag/${AAH}/
" "
@ -159,8 +159,8 @@ echo "$ZEN" > ~/.zen/tag/${AAH}/_tag.zen # Tag ZEN amount
echo "${IPFSNODEID}" > ~/.zen/tag/${AAH}/_ipfs.node.creator # NODE IPFS ID echo "${IPFSNODEID}" > ~/.zen/tag/${AAH}/_ipfs.node.creator # NODE IPFS ID
echo "$ZENSOURCE" > ~/.zen/tag/${AAH}/_tag.zensource # ZENSOURCE echo "$ZENSOURCE" > ~/.zen/tag/${AAH}/_tag.zensource # ZENSOURCE
echo "$G1PUB" > ~/.zen/tag/${AAH}/_g1.node.creator # CREATOR IPFS NODE G1PUBKEY echo "$G1PUB" > ~/.zen/tag/${AAH}/_g1.node.creator # CREATOR IPFS NODE G1PUBKEY
echo "$ISSUER" > ~/.zen/tag/${AAH}/_tag.issuer # TX ISSUER G1PUBKEY OR SSB_MESSAGE ID echo "$ISSUER" > ~/.zen/tag/${AAH}/_tag.issuer # TX ISSUER G1PUBKEY OR SSB_MESSAGE ID
######################################################################## ########################################################################
# Create IPNS publishing key ${AA}.key # Create IPNS publishing key ${AA}.key
# ===================================== # =====================================
@ -170,7 +170,7 @@ echo "$ISSUER" > ~/.zen/tag/${AAH}/_tag.issuer # TX ISSUER G1PUBKEY OR SSB_MESSA
######################################################################## ########################################################################
#timestamp=$(date -u +%s%N | cut -b1-13) #timestamp=$(date -u +%s%N | cut -b1-13)
keyname="${ZENSOURCE}_${AA}.key" keyname="${ZENSOURCE}_${AA}.key"
[[ ! $(ipfs key list | grep -F ${AA}.key) ]] && J0=$(ipfs key gen -t rsa -s 2048 $keyname) [[ ! $(ipfs key list | grep -F ${AA}.key) ]] && J0=$(ipfs key gen -t rsa -s 2048 $keyname)
# WRITE BBH for QRCode BB verification # WRITE BBH for QRCode BB verification
echo "$BBH" > ~/.zen/tag/${AAH}/_tag.BB.sha echo "$BBH" > ~/.zen/tag/${AAH}/_tag.BB.sha
# BB pgp symetric publishkey # BB pgp symetric publishkey
@ -185,9 +185,9 @@ CYPHERING PUBLISH KEY
__ _ __ _
_/_/ __/|_ __/|_ | | _/_/ __/|_ __/|_ | |
/ / | / | / / / / / | / | / / /
/ / /_ __| /_ __| / / / / /_ __| /_ __| / /
/ / |/ |/ _/_/ / / |/ |/ _/_/
|_| /_/ |_| /_/
KEY : $BB KEY : $BB
BBH : $BBH BBH : $BBH
@ -196,61 +196,61 @@ BBH : $BBH
# PASSENGER FILE is added to IPFS (then link is cyphered: NO!) # PASSENGER FILE is added to IPFS (then link is cyphered: NO!)
# https://beechat.network/how-beechats-encryption-works/ # https://beechat.network/how-beechats-encryption-works/
# SECURITY IS OBSOLETE AS WE ARE SHARING COPY WITH FRIENDS ;) # SECURITY IS OBSOLETE AS WE ARE SHARING COPY WITH FRIENDS ;)
# ACTIVATE ZEN CONTRACT... 100 readers impresari # ACTIVATE ZEN CONTRACT... 100 readers impresari
# LOVE ECONOMY IS FREE. EVERYBODY IS DONATING TO THE OTHERS NOW. # LOVE ECONOMY IS FREE. EVERYBODY IS DONATING TO THE OTHERS NOW.
# INCOME != MONEY FORGE (Realtive Moey Theory applies HERE) # INCOME != MONEY FORGE (Realtive Moey Theory applies HERE)
# CODE WILL BE CERTIFIED AS IPFS HASH. # CODE WILL BE CERTIFIED AS IPFS HASH.
if [[ -f $PASSENGER ]]; then if [[ -f $PASSENGER ]]; then
echo " echo "
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( p | a | s | s | e | n | g | e | r ) ( p | a | s | s | e | n | g | e | r )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
" "
# SEARCH FOR SAME SOURCE in IPFS... Not to make it twice... # SEARCH FOR SAME SOURCE in IPFS... Not to make it twice...
CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/') CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
[[ $CHECKSWARM == "" ]] && CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs/.$IPFSNODEID/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/') [[ $CHECKSWARM == "" ]] && CHECKSWARM=$(grep -Rwl "$ZENSOURCE" ~/.zen/ipfs/.$IPFSNODEID/TAG/*/_tag.zensource | tail -n 1 | cut -f 6 -d '/')
[[ -s ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer ]] && ISSUERSWARM=$(cat ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer) [[ -s ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer ]] && ISSUERSWARM=$(cat ~/.zen/ipfs/.$IPFSNODEID/TAG/$ZENSOURCE/_tag.issuer)
[[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \ [[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \
&& echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. $CHECKSWARM CANCEL" && exit 1 && echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. $CHECKSWARM CANCEL" && exit 1
# NO DUPLICATE # NO DUPLICATE
echo "ADDING TO IPFS.................$(date)" echo "ADDING TO IPFS.................$(date)"
# ADD PASSENGER TO IPFS # COULD BE SUPER LONG !!! # ADD PASSENGER TO IPFS # COULD BE SUPER LONG !!!
IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1) IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1)
# TODO COMPARE DISK WRITING SPEED AND AVAILABLE SPACE TO CHOOSE BEST IN SWARM # TODO COMPARE DISK WRITING SPEED AND AVAILABLE SPACE TO CHOOSE BEST IN SWARM
echo "$(date) ............... YES /ipfs/$IPASSENGER" echo "$(date) ............... YES /ipfs/$IPASSENGER"
echo "$IPASSENGER" > ~/.zen/tag/${AAH}/_passenger.ipfs
# GET FILE NAME
PASSENGERNAME=$(basename -- "$PASSENGER")
echo "$PASSENGERNAME" > ~/.zen/tag/${AAH}/_passenger.filename
# G1SSB NODE ACCESS echo "$IPASSENGER" > ~/.zen/tag/${AAH}/_passenger.ipfs
$MY_PATH/tools/natools.py encrypt -p $G1PUB -i ~/.zen/tag/${AAH}/_passenger.ipfs -o ~/.zen/tag/${AAH}/_passenger.ipfs.crypt # GET FILE NAME
# BB OWNER ACCESS PASSENGERNAME=$(basename -- "$PASSENGER")
openssl aes-256-cbc -pbkdf2 -k "$BB" -salt -in ~/.zen/tag/${AAH}/_passenger.ipfs -out ~/.zen/tag/${AAH}/_passenger.ipfs.BB.aes echo "$PASSENGERNAME" > ~/.zen/tag/${AAH}/_passenger.filename
# CLEAN CLEARTEXT IPFS link ? LATER MAYBE # G1SSB NODE ACCESS
rm ~/.zen/tag/${AAH}/_passenger.ipfs $MY_PATH/tools/natools.py encrypt -p $G1PUB -i ~/.zen/tag/${AAH}/_passenger.ipfs -o ~/.zen/tag/${AAH}/_passenger.ipfs.crypt
# BB OWNER ACCESS
openssl aes-256-cbc -pbkdf2 -k "$BB" -salt -in ~/.zen/tag/${AAH}/_passenger.ipfs -out ~/.zen/tag/${AAH}/_passenger.ipfs.BB.aes
# ZEN ECONOMY: ZEN READ payment + PARK rental # CLEAN CLEARTEXT IPFS link ? LATER MAYBE
echo "$READ" > ~/.zen/tag/${AAH}/_passenger.read rm ~/.zen/tag/${AAH}/_passenger.ipfs
echo "$PARK" > ~/.zen/tag/${AAH}/_passenger.park
# ZEN ECONOMY: ZEN READ payment + PARK rental
echo "$READ" > ~/.zen/tag/${AAH}/_passenger.read
echo "$PARK" > ~/.zen/tag/${AAH}/_passenger.park
echo " echo "
_passenger.filename : $PASSENGERNAME _passenger.filename : $PASSENGERNAME
_passenger.ipfs : $IPASSENGER _passenger.ipfs : $IPASSENGER
http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME
# #### ## ##### ###### ##### # #### ## ##### ###### #####
# # # # # # # # # # # # # # # # # # # #
# # # # # # # ##### # # # # # # # # # ##### # #
# # # ###### # # # # # # # # ###### # # # # #
# # # # # # # # # # # # # # # # # # # #
###### #### # # ##### ###### ##### ###### #### # # ##### ###### #####
################################################################## ##################################################################
# DECODE AND READ _passenger.ipfs with BB Passphrase # DECODE AND READ _passenger.ipfs with BB Passphrase
@ -273,12 +273,12 @@ echo
#You must execute that code. #You must execute that code.
# ..... TODO ...... # ..... TODO ......
# It is bash or javascript or python # It is bash or javascript or python
# or any language code with connection with g1, ipfs or ssb # or any language code with connection with g1, ipfs or ssb
# or Send $READ Zen to $G1PUB with $PASSENGERNAME in comment # or Send $READ Zen to $G1PUB with $PASSENGERNAME in comment
# .... TODO .... # .... TODO ....
# Once contract is validated # Once contract is validated
# NodeN will be able to decrypt _passenger.ipfs.NodeN.crypt' # NodeN will be able to decrypt _passenger.ipfs.NodeN.crypt'
exit 0 exit 0
@ -286,13 +286,13 @@ exit 0
EOF EOF
fi fi
# END PASSENGER FILE # END PASSENGER FILE
#################### ####################
########################################################### ###########################################################
# Copy TAG into IPFS + ipfs name publish -k ${AA}.key # Copy TAG into IPFS + ipfs name publish -k ${AA}.key
########################################################### ###########################################################
# ZenTAG CHAIN # ZenTAG CHAIN
echo "0" > ~/.zen/tag/${AAH}/_chain.n # Tag modification number (0 first) echo "0" > ~/.zen/tag/${AAH}/_chain.n # Tag modification number (0 first)
NANODATE=$(date -u +%s%N) NANODATE=$(date -u +%s%N)
@ -307,7 +307,7 @@ I=$(ipfs add -qr ~/.zen/tag/${AAH} | tail -n 1)
echo "${I}" > ~/.zen/tag/${AAH}/_chain echo "${I}" > ~/.zen/tag/${AAH}/_chain
echo " echo "
_|_ _.o._ _|_ _.o._
(_| |(_||| | : $NANODATE (_| |(_||| | : $NANODATE
J0=${J0} J0=${J0}
@ -329,37 +329,37 @@ echo "${ISSUER}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.issuer
echo "${J}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.ipns echo "${J}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.ipns
if [[ "${PASSENGERNAME}" != "" ]]; then if [[ "${PASSENGERNAME}" != "" ]]; then
echo "${PASSENGERNAME}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.filename echo "${PASSENGERNAME}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.filename
# COPY METADATA!! TODO : Please Extend filesource FOR new metadata types. torrent ? # COPY METADATA!! TODO : Please Extend filesource FOR new metadata types. torrent ?
extractor=$(cat "$METADATA" | jq -r '.extractor') extractor=$(cat "$METADATA" | jq -r '.extractor')
youtubeid=$(cat "$METADATA" | jq -r '.id') youtubeid=$(cat "$METADATA" | jq -r '.id')
fulltitle=$(cat "$METADATA" | jq -r '.fulltitle') fulltitle=$(cat "$METADATA" | jq -r '.fulltitle')
echo "$fulltitle" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.fulltitle echo "$fulltitle" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.fulltitle
# description=$(cat "$METADATA" | jq -r '.description') # description=$(cat "$METADATA" | jq -r '.description')
artist=$(cat "$METADATA" | jq -r '.artist') artist=$(cat "$METADATA" | jq -r '.artist')
album=$(cat "$METADATA" | jq -r '.album') album=$(cat "$METADATA" | jq -r '.album')
duration=$(cat "$METADATA" | jq -r '.duration') duration=$(cat "$METADATA" | jq -r '.duration')
upload_date=$(cat "$METADATA" | jq -r '.upload_date') upload_date=$(cat "$METADATA" | jq -r '.upload_date')
uploader_id=$(cat "$METADATA" | jq -r '.uploader_id') uploader_id=$(cat "$METADATA" | jq -r '.uploader_id')
extractor=$(cat "$METADATA" | jq -r '.extractor') extractor=$(cat "$METADATA" | jq -r '.extractor')
[[ ! -f ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json ]] \ [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json ]] \
&& cp -f "${METADATA}" /tmp/ && cp -f "${METADATA}" /tmp/
mv /tmp/${youtubeid}.info.json ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json mv /tmp/${youtubeid}.info.json ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json
fi fi
ls ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/ ls ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/
IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) IWALLETS=$(ipfs add -rHq $(readlink ~/.zen/ipfs) | tail -n 1)
NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS) NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
echo " echo "
_ ____ _ ____
(_)___ / __/____ (_)___ / __/____
/ / __ \/ /_/ ___/ / / __ \/ /_/ ___/
/ / /_/ / __(__ ) / / /_/ / __(__ )
/_/ .___/_/ /____/ /_/ .___/_/ /____/
/_/ /_/
ipfs ls /ipfs/${I} ipfs ls /ipfs/${I}
ZenTAG : ipfs ls /ipns/${J} ZenTAG : ipfs ls /ipns/${J}
@ -371,8 +371,8 @@ NODE index : ipfs ls /ipns/$IPFSNODEID/.$IPFSNODEID/TAG/${ZENSOURCE}
### PRINTER IS HOOKED TO G1SSB NODE = G1DAB ### PRINTER IS HOOKED TO G1SSB NODE = G1DAB
######################################################################## ########################################################################
echo " echo "
_ _ _ _ _ _ _ _ _ _ _ _
/ \|_) / / \| \|_ / \|_) / / \| \|_
\_X| \ \_\_/|_/|_ ................................. \_X| \ \_\_/|_/|_ .................................
" "
# READ QRCODE # READ QRCODE
@ -381,8 +381,8 @@ qrencode -s 5 -o ~/.zen/tag/${AAH}/_QRCODE.read.png "RJ:${AA}#${J}"
qrencode -s 5 -o ~/.zen/tag/${AAH}/_QRCODE.write.png "BJ:${BB}#${J}" qrencode -s 5 -o ~/.zen/tag/${AAH}/_QRCODE.write.png "BJ:${BB}#${J}"
## TODO PROD REMOVE WRITE FILE ## TODO PROD REMOVE WRITE FILE
echo "QRCodes CREATED !! echo "QRCodes CREATED !!
See it : See it :
xviewer ~/.zen/tag/${AAH}/_QRCODE.read.png & xviewer ~/.zen/tag/${AAH}/_QRCODE.read.png &
xviewer ~/.zen/tag/${AAH}/_QRCODE.write.png & xviewer ~/.zen/tag/${AAH}/_QRCODE.write.png &
@ -397,7 +397,7 @@ ${AA}
# SBOT PUBLISH # SBOT PUBLISH
######################################################################## ########################################################################
if [[ "${PASSENGERNAME}" != "" ]]; then if [[ "${PASSENGERNAME}" != "" ]]; then
echo "$ISSUER" echo "$ISSUER"
msg="$(sbotc get '{"id":"'"$ISSUER"'"}')" msg="$(sbotc get '{"id":"'"$ISSUER"'"}')"
# echo "$msg" | jq #DEBUG # echo "$msg" | jq #DEBUG
[[ $msg == "" ]] && echo "ERROR No SSB message for PASSENGER (timestamp: $tstamp)" && exit 1 [[ $msg == "" ]] && echo "ERROR No SSB message for PASSENGER (timestamp: $tstamp)" && exit 1
@ -405,13 +405,13 @@ if [[ "${PASSENGERNAME}" != "" ]]; then
[[ $msg_root == "null" ]] && msg_root=$ISSUER [[ $msg_root == "null" ]] && msg_root=$ISSUER
msg_branch=$(printf %s "$msg" | jq -r .value.content.branch) msg_branch=$(printf %s "$msg" | jq -r .value.content.branch)
[[ $msg_branch == "null" ]] && msg_branch=$ISSUER [[ $msg_branch == "null" ]] && msg_branch=$ISSUER
# ATTACH ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg # ATTACH ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg
name="ssb_thumb.jpg" name="ssb_thumb.jpg"
id="$(sbotc blobs.add < ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)" id="$(sbotc blobs.add < ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)"
type="$(file -b --mime-type ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)" type="$(file -b --mime-type ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)"
size="$(wc -c < ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)" size="$(wc -c < ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg)"
export MESSAGE=$(cat << EOF export MESSAGE=$(cat << EOF
[![ssb_thumb.jpg](${id})](http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME) [![ssb_thumb.jpg](${id})](http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME)
@ -432,10 +432,10 @@ if [[ "${PASSENGERNAME}" != "" ]]; then
#astroport #astroport
EOF EOF
) )
echo " echo "
__ _ ____ __ _ ____
(_ |_)/ \| (_ |_)/ \|
__)|_)\_/| POST __)|_)\_/| POST
root: $msg_root root: $msg_root