Compare commits
46 Commits
37392870d9
...
25d3d9d24f
Author | SHA1 | Date |
---|---|---|
Yann Autissier | 25d3d9d24f | |
fred | fb029124bc | |
fred | 4eb521a8a9 | |
fred | 08a91c07b4 | |
fred | 927f61b4d1 | |
fred | 2431cb5369 | |
fred | 0fb0692980 | |
fred | c1eccdfe11 | |
Yann Autissier | f0036ca121 | |
qo-op | cccd6969f9 | |
fred | a800da8a21 | |
Yann Autissier | c1aa201afd | |
fred | 03a032590b | |
fred | 3c9c5faedb | |
fred | 1a1eda6f4a | |
fred | 1f6aa0e23c | |
fred | 251b5f24af | |
fred | b21b7e3426 | |
fred | b36cb9f7c4 | |
fred | efc542158c | |
fred | a67fb6486c | |
fred | c4d8eefd2b | |
fred | de1cedf157 | |
fred | b6bf164b57 | |
fred | 93ba46433d | |
fred | 231c549788 | |
fred | 67e77f20e1 | |
fred | 50cf9e0fcb | |
fred | efda32a4d5 | |
fred | 3825b1bebc | |
fred | a9d76db1a4 | |
aynic.os | bc5c14d2ae | |
aynic.os | ead1ba7a57 | |
aynic.os | dac3cfb158 | |
aynic.os | 5d6a32c1d5 | |
aynic.os | a1976ed498 | |
aynic.os | 785f715830 | |
aynic.os | 2dfa0ee7d2 | |
aynic.os | 68ccdcb394 | |
aynic.os | c7b272dfc5 | |
aynic.os | fba00c3225 | |
aynic.os | e9e1fd989d | |
aynic.os | d2b1d94967 | |
aynic.os | a5ea0292f2 | |
aynic.os | b76111f017 | |
aynic.os | aebacbf56f |
|
@ -1 +0,0 @@
|
||||||
swp_token=1605043494:0cb63ecc71f6d029418e827aed3e7c9f:c8201b8ffdb3703b1d01884bce4f7584
|
|
|
@ -1 +0,0 @@
|
||||||
swp_token=1603922533:31aac141fc8c1f57a856ac4be928d2c0:067e0bd7719ed36e424bd1d672ebecdb
|
|
|
@ -90,7 +90,7 @@ 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 '["*"]'
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["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-Methods '["PUT", "GET", "POST"]'
|
||||||
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
|
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
|
||||||
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
|
######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ###########
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -302,6 +302,7 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'E
|
||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -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:
|
100
ajouter_video.sh
100
ajouter_video.sh
|
@ -29,6 +29,16 @@ 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"
|
||||||
|
@ -38,7 +48,7 @@ if [ $URL ]; then
|
||||||
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
|
||||||
|
@ -102,7 +112,7 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# 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
|
||||||
|
@ -117,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
|
||||||
# _ _
|
# _ _
|
||||||
# _ _ ___ _ _| |_ _ _| |__ ___
|
# _ _ ___ _ _| |_ _ _| |__ ___
|
||||||
|
@ -433,18 +466,20 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
||||||
########################################################################
|
########################################################################
|
||||||
# Screen capture is used as thumbnail
|
# Screen capture is used as thumbnail
|
||||||
########################################################################
|
########################################################################
|
||||||
zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA"
|
if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then
|
||||||
sleep 1
|
zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA"
|
||||||
[[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png
|
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 -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
|
||||||
mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png
|
mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png
|
||||||
|
|
||||||
|
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
||||||
|
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..."
|
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
|
||||||
|
@ -526,7 +561,7 @@ MIME=$(file --mime-type $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} |
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# 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
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -541,29 +576,28 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N
|
||||||
timestamp=$(date -u +%s%N | cut -b1-13)
|
timestamp=$(date -u +%s%N | cut -b1-13)
|
||||||
|
|
||||||
|
|
||||||
## AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT
|
## AUTO DESTRUCTIVE LATER ADD TO ASTROPORT SCRIPT
|
||||||
echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh
|
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...\"
|
#[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\"
|
||||||
reponse=\$1
|
#reponse=\$1
|
||||||
[[ ! \$reponse ]] && read reponse
|
#[[ ! \$reponse ]] && read reponse
|
||||||
if [[ ! \$reponse ]]; then
|
#if [[ ! \$reponse ]]; then
|
||||||
ffmpeg -i \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/astroport/${MEDIAID}.mp4
|
# 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/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
|
||||||
mv $HOME/astroport/${MEDIAID}.mp4 \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
|
# 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\"
|
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
|
||||||
else" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
#else" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" " >> ~/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
|
#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
echo "rm -f /tmp/\${MEDIAKEY}.pass
|
echo "rm -f /tmp/\${MEDIAKEY}.pass
|
||||||
rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS
|
rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS
|
||||||
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
|
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
|
||||||
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
|
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
|
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
|
||||||
|
@ -600,14 +634,16 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1;
|
||||||
#fi
|
#fi
|
||||||
########################################################################
|
########################################################################
|
||||||
########################################################################
|
########################################################################
|
||||||
|
if [ $1 ]; then
|
||||||
|
bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"
|
||||||
|
[ $? == 0 ] && echo "${MEDIAKEY} is RECORDED in ASTROPORT. GOOD." && exit 0
|
||||||
|
|
||||||
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \
|
else
|
||||||
[ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \
|
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \
|
||||||
&& zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
|
[ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \
|
||||||
&& [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|
&& zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
|
||||||
&& xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \
|
&& [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|
||||||
|| ( zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 )\
|
&& xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \
|
||||||
exit 0
|
|| ( zenity --warning --width 300 --text "Désolé une erreur est survenue... cat /tmp/${MEDIAKEY}.log" && exit 1 )\
|
||||||
|
fi
|
||||||
echo "${MEDIAKEY} = RECORDED TO IPFS."
|
exit 0
|
||||||
cat /tmp/${MEDIAKEY}.log
|
|
||||||
|
|
|
@ -164,7 +164,15 @@ 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
|
[[ -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
|
||||||
cd $MY_PATH
|
cd $MY_PATH
|
||||||
sleep $((1 + RANDOM % 3)) && git pull
|
sleep $((1 + RANDOM % 3)) && git pull
|
||||||
|
@ -210,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
|
||||||
|
@ -230,8 +240,8 @@ if [[ $(($runtime % 26)) == 0 ]]; then
|
||||||
kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh"
|
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
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
#
|
#
|
||||||
# _________ ______
|
# _________ ______
|
||||||
|
@ -328,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
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
147
install.sh
147
install.sh
|
@ -1,6 +1,7 @@
|
||||||
#!/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/)
|
||||||
########################################################################
|
########################################################################
|
||||||
{
|
{
|
||||||
|
@ -8,120 +9,55 @@ 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##*/}"
|
||||||
|
|
||||||
[ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1
|
# INSTALLATION section of README does wget file install.sh and run it with bash
|
||||||
|
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
|
||||||
[[ ! $(which ipfs) ]] && echo "=== Installez IPFS !!" && echo "https://docs.ipfs.io/install/command-line/#official-distributions" && exit 1
|
|
||||||
|
|
||||||
# MAIN # SI AUCUNE CLEF DE STATION...
|
# MAIN # SI AUCUNE CLEF DE STATION...
|
||||||
if [[ ! -f ~/.zen/secret.dunikey ]];
|
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 distributions DEBIAN et dérivées : LinuxMint (https://www.linuxmint.com/) ou XBIAN (https://xbian.org) recommandées"
|
echo "astrxbian installateur pour distributions debian et dérivées : linuxmint (https://www.linuxmint.com/) ou xbian (https://xbian.org) recommandées"
|
||||||
echo "Appuyez sur ENTRER pour commencer."; read TEST; [[ "$TEST" != "" ]] && echo "SORTIE" && exit 0 ## Ajouter confirmation à chaque nouvelle étape (+explications)
|
echo "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications)
|
||||||
echo ; echo "Mise à jour des dépots de votre distribution..."
|
echo
|
||||||
sudo apt-get update
|
|
||||||
|
|
||||||
[[ "$USER" != "xbian" ]] &&\
|
# Install requirements
|
||||||
for i in x11-utils xclip zenity handbrake*; do\
|
install_requirements
|
||||||
[ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ] &&\
|
|
||||||
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\
|
|
||||||
sudo apt install -y $i;
|
|
||||||
done
|
|
||||||
|
|
||||||
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
|
# Clone astrXbian and Astroport.One
|
||||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
import_astrXbian
|
||||||
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
|
|
||||||
sudo apt install -y $i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for i in 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 ttf-mscorefonts-installer libcurl4-openssl-dev; do
|
# Init ipfs
|
||||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
import_ipfs
|
||||||
echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
|
|
||||||
sudo apt install -y $i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
[[ ! $(which kodi) && "$USER" != "xbian" ]] &&\
|
# Copy astroport config in kodi
|
||||||
echo ">>> Installation Kodi + Vstream = VOTRE VIDEOTHEQUE ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\
|
# import_kodi
|
||||||
sudo apt-get install kodi -y;\
|
|
||||||
${MY_PATH}/.install/kodi_uqload_downloader.sh
|
|
||||||
|
|
||||||
echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' "
|
# Jaklis setup
|
||||||
sudo apt-get install python3-opencv -y
|
import_jaklis
|
||||||
|
|
||||||
## 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 -U setuptools wheel
|
|
||||||
python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy pynacl pgpy
|
|
||||||
python3 -m pip install -U nicotine-plus silkaj
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal"
|
|
||||||
mkdir -p ~/.zen
|
|
||||||
cd ~/.zen
|
|
||||||
git clone https://git.p2p.legal/axiom-team/astrXbian.git
|
|
||||||
git clone https://git.p2p.legal/qo-op/Astroport.ONE.git
|
|
||||||
# TODO INSTALL FROM IPFS / IPNS
|
|
||||||
|
|
||||||
|
|
||||||
## Scripts pour systemd ou InitV (xbian)
|
|
||||||
echo "=== Activation SYSTEM IPFS"
|
|
||||||
~/.zen/astrXbian/.install/ipfs_alone.sh
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "=== IMPORT configuration ASTROPORT dans ~/.kodi"
|
|
||||||
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+"
|
|
||||||
cd ~/.zen/astrXbian/zen/jaklis
|
|
||||||
./setup.sh
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
echo "=== Sécurisation DEFCON SUDOERS FAIL2BAN"
|
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
|
||||||
|
@ -156,26 +92,17 @@ echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !!
|
||||||
# https://addons.mozilla.org/firefox/addon/open-with/
|
# https://addons.mozilla.org/firefox/addon/open-with/
|
||||||
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
|
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
|
||||||
|
|
||||||
if [[ "$USER" != "xbian" ]]
|
if ! i_am_xbian
|
||||||
then
|
then
|
||||||
## Desktop install
|
## Desktop install
|
||||||
echo "INITIALISATIOn Astroport/KODI"
|
import_astroport
|
||||||
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
|
|
||||||
else
|
else
|
||||||
## Rpi Xbian install.
|
## Rpi Xbian install.
|
||||||
cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0"
|
prepare_next_boot
|
||||||
# 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"
|
echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI"
|
||||||
echo "Faites une ISO : sudo xbian-config"
|
echo "Faites une ISO : sudo xbian-config"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
|
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
|
||||||
|
@ -195,3 +122,5 @@ https://astroport.com
|
||||||
# MAIN #
|
# MAIN #
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~/.zen/astrXbian/zen/cron_VRFY.sh
|
||||||
|
|
|
@ -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
|
|
@ -46,7 +46,7 @@ curl -s ${GCHANGE}/user/profile/${G1PUB} > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gc
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
@ -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/)
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
|
@ -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=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
|
|
||||||
[[ $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,7 +27,7 @@ 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
|
||||||
|
|
|
@ -229,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
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -269,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
|
||||||
|
@ -285,6 +292,7 @@ rm /tmp/.ipfsid
|
||||||
## 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}/screen.png ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/screen.png ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
|
[[ -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 ]] &&\
|
[[ -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}/${G1PUB}/ &&\
|
||||||
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
|
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
|
||||||
|
@ -308,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
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -328,18 +338,44 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)
|
||||||
| 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:8080/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
|
||||||
|
@ -453,14 +489,18 @@ then
|
||||||
]
|
]
|
||||||
' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
|
' >> ~/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
|
# Will be used by caroussel.html template
|
||||||
# CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1)
|
# CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# COPY TIDDLER JSON TO DESKTOP Journal/${TYPE}
|
# 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 "~/Bureau/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 "~/Desktop/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
|
||||||
|
|
||||||
|
@ -507,5 +547,5 @@ echo "#### EXCECUTION TIME"
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo Execution time was `expr $end - $start` seconds.
|
echo Execution time was `expr $end - $start` seconds.
|
||||||
echo "########################################################################"
|
echo "########################################################################"
|
||||||
zenity --warning --width 300 --text "Votre MEDIA a rejoint ASTROPORT en `expr $end - $start` secondes"
|
[[ ! $3 ]] && zenity --warning --width 300 --text "Votre MEDIA a rejoint ASTROPORT en `expr $end - $start` secondes"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
256
zen/zen_MAKE.sh
256
zen/zen_MAKE.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue