From aebacbf56f885b2babdedd52ea6b3d33283fa3cb Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Sun, 9 May 2021 09:03:52 +0200 Subject: [PATCH 001/133] cleanup warning git clone --- .../addon_data/plugin.video.vstream/Cookie_www_zt-za_com.txt | 1 - .../addon_data/plugin.video.vstream/Cookie_zt-protect_com.txt | 1 - .../{Cookie_zt-protect_net.txt => cookie_zt-protect_net.txt} | 0 3 files changed, 2 deletions(-) delete mode 100644 .install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_www_zt-za_com.txt delete mode 100644 .install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_com.txt rename .install/.kodi/userdata/addon_data/plugin.video.vstream/{Cookie_zt-protect_net.txt => cookie_zt-protect_net.txt} (100%) diff --git a/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_www_zt-za_com.txt b/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_www_zt-za_com.txt deleted file mode 100644 index 3d46abf..0000000 --- a/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_www_zt-za_com.txt +++ /dev/null @@ -1 +0,0 @@ -swp_token=1605043494:0cb63ecc71f6d029418e827aed3e7c9f:c8201b8ffdb3703b1d01884bce4f7584 \ No newline at end of file diff --git a/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_com.txt b/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_com.txt deleted file mode 100644 index ec58db7..0000000 --- a/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_com.txt +++ /dev/null @@ -1 +0,0 @@ -swp_token=1603922533:31aac141fc8c1f57a856ac4be928d2c0:067e0bd7719ed36e424bd1d672ebecdb \ No newline at end of file diff --git a/.install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_net.txt b/.install/.kodi/userdata/addon_data/plugin.video.vstream/cookie_zt-protect_net.txt similarity index 100% rename from .install/.kodi/userdata/addon_data/plugin.video.vstream/Cookie_zt-protect_net.txt rename to .install/.kodi/userdata/addon_data/plugin.video.vstream/cookie_zt-protect_net.txt -- 2.39.2 From b76111f017e61bd06a3acc909552a39db5a9c09b Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Sun, 9 May 2021 14:50:17 +0200 Subject: [PATCH 002/133] add make --- Makefile | 7 +++++++ specs/astrXbian_spec.sh | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Makefile create mode 100644 specs/astrXbian_spec.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8be89b1 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +tests: ~/.zen/secret.june shellcheck-specs shellspec-specs + +shellcheck-%: + shellcheck $*/* + +shellspec-%: + shellspec $* diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh new file mode 100644 index 0000000..6e57e6f --- /dev/null +++ b/specs/astrXbian_spec.sh @@ -0,0 +1,15 @@ +#shellcheck shell=sh + +Describe "AstrXbian" + Describe "install()" + install() { + echo # + } + + It "installs world, but not implemented" + Pending "You should implement install function" + When call install world + The output should eq "amen" + End + End +End -- 2.39.2 From a5ea0292f2aa92d619194d228eeee53f36b07023 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Sun, 9 May 2021 19:27:07 +0200 Subject: [PATCH 003/133] 1st test --- Makefile | 2 ++ include.sh | 13 +++++++++++++ install.sh | 8 +++++--- specs/astrXbian_spec.sh | 24 ++++++++++++++---------- 4 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 include.sh diff --git a/Makefile b/Makefile index 8be89b1..0cc7de9 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,5 @@ shellcheck-%: shellspec-%: shellspec $* + +~/.zen/secret.june: diff --git a/include.sh b/include.sh new file mode 100644 index 0000000..1811918 --- /dev/null +++ b/include.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +i_am() { + echo 'v0.4' +} + +i_am_root() { + [ $(id -u) -eq 0 ] +} + +i_should_install() { + [[ ! -f ~/.zen/secret.june ]] +} diff --git a/install.sh b/install.sh index 5eeea4b..ea54064 100755 --- a/install.sh +++ b/install.sh @@ -1,13 +1,15 @@ #!/bin/bash +set -x +. ./include.sh ######################################################################## -# Version: 0.3 +# Version: 0.4 # 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 +i_am_root && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 # MAIN # -if [[ ! -f ~/.zen/secret.june ]]; +if i_should_install; then # Check requirements diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 6e57e6f..f9d3201 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -1,15 +1,19 @@ #shellcheck shell=sh -Describe "AstrXbian" - Describe "install()" - install() { - echo # - } - - It "installs world, but not implemented" - Pending "You should implement install function" - When call install world - The output should eq "amen" +Describe 'AstrXbian' + Describe 'install()' + Include ./include.sh + It 'should be me' + When call i_am + The output should eq 'v0.4' + End + It 'should not be superuser' + When call i_am_root + The status should not be success + End + It 'should install AstrXbian' + When call i_should_install + The status should be success End End End -- 2.39.2 From d2b1d94967fda9aa08fcbd1e3ea6b0a68a9b51f7 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 17:25:49 +0200 Subject: [PATCH 004/133] test --- include.sh | 15 +++++++++++++++ install.sh | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include.sh b/include.sh index 1811918..15395ab 100644 --- a/include.sh +++ b/include.sh @@ -1,5 +1,20 @@ #!/bin/sh +check_requirements() { +sudo apt-get update +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 +sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack -y +[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y +sudo apt-get install python3-opencv -y +[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y +## INSTALL PYTHON CRYPTO LAYER +echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc +python3 -m pip install -U pip +python3 -m pip install -U setuptools wheel +python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy +# python3 -m pip install -U silkaj +} + i_am() { echo 'v0.4' } diff --git a/install.sh b/install.sh index ea54064..2e669d9 100755 --- a/install.sh +++ b/install.sh @@ -14,19 +14,7 @@ then # Check requirements echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBIAN et dérivées (https://www.linuxmint.com/)" -sudo apt-get update -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 -sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack sudo -y -[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y -sudo apt-get install python3-opencv -y -[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y -## INSTALL PYTHON CRYPTO LAYER -echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc -python3 -m pip install -U pip -python3 -m pip install -U setuptools wheel -python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy -# python3 -m pip install -U silkaj - +check_requirements ######################################################################## echo "Clonage git astrXbian depuis https://git.p2p.legal" mkdir -p ~/.zen -- 2.39.2 From e9e1fd989dba1ee87fcf7fe50a66fa43ec327ad9 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 17:36:31 +0200 Subject: [PATCH 005/133] test --- include.sh | 30 ++++++++++++++++++------------ install.sh | 4 +--- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/include.sh b/include.sh index 15395ab..e15492a 100644 --- a/include.sh +++ b/include.sh @@ -1,18 +1,24 @@ #!/bin/sh check_requirements() { -sudo apt-get update -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 -sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack -y -[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y -sudo apt-get install python3-opencv -y -[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y -## INSTALL PYTHON CRYPTO LAYER -echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc -python3 -m pip install -U pip -python3 -m pip install -U setuptools wheel -python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy -# python3 -m pip install -U silkaj + sudo apt-get update + 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 + sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack -y + [[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y + sudo apt-get install python3-opencv -y + [[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y + ## INSTALL PYTHON CRYPTO LAYER + echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc + python3 -m pip install -U pip + python3 -m pip install -U setuptools wheel + python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy + # python3 -m pip install -U silkaj +} + +git_clone() { + mkdir -p ~/.zen + cd ~/.zen + git clone https://git.p2p.legal/axiom-team/astrXbian.git } i_am() { diff --git a/install.sh b/install.sh index 2e669d9..349461c 100755 --- a/install.sh +++ b/install.sh @@ -17,9 +17,7 @@ echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBI check_requirements ######################################################################## echo "Clonage git astrXbian depuis https://git.p2p.legal" -mkdir -p ~/.zen -cd ~/.zen -git clone https://git.p2p.legal/axiom-team/astrXbian.git +git_clone ######################################################################## echo "IMPORT configuration ASTROPORT dans ~/.kodi" -- 2.39.2 From fba00c3225b1cfc3fcb8b36e9c49554499f5f85d Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 17:41:30 +0200 Subject: [PATCH 006/133] test --- include.sh | 16 ++++++++++------ install.sh | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include.sh b/include.sh index e15492a..8ce0c42 100644 --- a/include.sh +++ b/include.sh @@ -15,12 +15,6 @@ check_requirements() { # python3 -m pip install -U silkaj } -git_clone() { - mkdir -p ~/.zen - cd ~/.zen - git clone https://git.p2p.legal/axiom-team/astrXbian.git -} - i_am() { echo 'v0.4' } @@ -32,3 +26,13 @@ i_am_root() { i_should_install() { [[ ! -f ~/.zen/secret.june ]] } + +import_astrXbian() { + mkdir -p ~/.zen + cd ~/.zen + git clone https://git.p2p.legal/axiom-team/astrXbian.git +} + +import_kodi() { + cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ +} diff --git a/install.sh b/install.sh index 349461c..fd1b9f6 100755 --- a/install.sh +++ b/install.sh @@ -17,11 +17,11 @@ echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBI check_requirements ######################################################################## echo "Clonage git astrXbian depuis https://git.p2p.legal" -git_clone +import_astrXbian ######################################################################## echo "IMPORT configuration ASTROPORT dans ~/.kodi" -cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ +import_kodi ######################################################################## echo "Installation de IPFS https://ipfs.io" -- 2.39.2 From c7b272dfc50f38583dec661b73beefbece290c45 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 17:51:18 +0200 Subject: [PATCH 007/133] test --- include.sh | 9 +++++++++ install.sh | 5 ++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include.sh b/include.sh index 8ce0c42..b31791b 100644 --- a/include.sh +++ b/include.sh @@ -1,5 +1,14 @@ #!/bin/sh +check_ipfs() { + ~/.zen/astrXbian/.install/ipfs_alone.sh +} + +check_jaklis() { + cd ~/.zen/astrXbian/zen/jaklis + ./setup.sh +} + check_requirements() { sudo apt-get update 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 diff --git a/install.sh b/install.sh index fd1b9f6..f511a2b 100755 --- a/install.sh +++ b/install.sh @@ -25,12 +25,11 @@ import_kodi ######################################################################## echo "Installation de IPFS https://ipfs.io" -~/.zen/astrXbian/.install/ipfs_alone.sh +check_ipfs ######################################################################## echo "Configuration jaklis: Centre de communication GCHANGE+" -cd ~/.zen/astrXbian/zen/jaklis -./setup.sh +check_jaklis ######################################################################## echo "Sécurisation DEFCON SUDOERS FAIL2BAN" -- 2.39.2 From 68ccdcb3942fd7a749cd52a58a8f1cf0dcdaa836 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 18:12:02 +0200 Subject: [PATCH 008/133] test --- specs/astrXbian_spec.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index f9d3201..a8044a4 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -15,5 +15,30 @@ Describe 'AstrXbian' When call i_should_install The status should be success End + It 'should check requirements, but not tested' + Pending "You should implement check_requirements tests" + When call check_requirements + The status should be success + End + It 'should import AstrXbian, but not tested' + Pending "You should implement import_astrXbian tests" + When call import_astrXbian + The status should be success + End + It 'should import Kodi, but not tested' + Pending "You should implement import_kodi tests" + When call import_kodi + The status should be success + End + It 'should check IPFS, but not tested' + Pending "You should implement check_ipfs tests" + When call check_ipfs + The status should be success + End + It 'should check Jaklis, but not tested' + Pending "You should implement check_jaklis tests" + When call check_jaklis + The status should be success + End End End -- 2.39.2 From 2dfa0ee7d2499c7295fe45acd6aa7a8eda53ae11 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 18:47:13 +0200 Subject: [PATCH 009/133] test --- include.sh | 4 ++++ install.sh | 2 +- specs/astrXbian_spec.sh | 34 +++++++++++++++++++--------------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/include.sh b/include.sh index b31791b..0574219 100644 --- a/include.sh +++ b/include.sh @@ -32,6 +32,10 @@ i_am_root() { [ $(id -u) -eq 0 ] } +i_am_xbian() { + [[ "$USER" == "xbian" ]] +} + i_should_install() { [[ ! -f ~/.zen/secret.june ]] } diff --git a/install.sh b/install.sh index f511a2b..6e80ca9 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,7 @@ check_jaklis echo "Sécurisation DEFCON SUDOERS FAIL2BAN" ## XBIAN fail2ban ERROR correction ## #[....] 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 ### MODIFIYING /etc/sudoers ### diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index a8044a4..563efcb 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -3,6 +3,21 @@ Describe 'AstrXbian' Describe 'install()' Include ./include.sh + It 'should check IPFS, but not tested' + Pending "You should implement check_ipfs tests" + When call check_ipfs + The status should be success + End + It 'should check Jaklis, but not tested' + Pending "You should implement check_jaklis tests" + When call check_jaklis + The status should be success + End + It 'should check requirements, but not tested' + Pending "You should implement check_requirements tests" + When call check_requirements + The status should be success + End It 'should be me' When call i_am The output should eq 'v0.4' @@ -11,13 +26,12 @@ Describe 'AstrXbian' When call i_am_root The status should not be success End - It 'should install AstrXbian' - When call i_should_install + It 'should be xbian' + When call i_am_xbian The status should be success End - It 'should check requirements, but not tested' - Pending "You should implement check_requirements tests" - When call check_requirements + It 'should install AstrXbian' + When call i_should_install The status should be success End It 'should import AstrXbian, but not tested' @@ -30,15 +44,5 @@ Describe 'AstrXbian' When call import_kodi The status should be success End - It 'should check IPFS, but not tested' - Pending "You should implement check_ipfs tests" - When call check_ipfs - The status should be success - End - It 'should check Jaklis, but not tested' - Pending "You should implement check_jaklis tests" - When call check_jaklis - The status should be success - End End End -- 2.39.2 From 785f715830a34a263c9e9a2275e26d95c9a67a8c Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 19:00:14 +0200 Subject: [PATCH 010/133] test --- include.sh | 13 +++++++++++++ install.sh | 31 +++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/include.sh b/include.sh index 0574219..cdebc7f 100644 --- a/include.sh +++ b/include.sh @@ -40,6 +40,10 @@ i_should_install() { [[ ! -f ~/.zen/secret.june ]] } +iso_config() { + ~/.zen/astrXbian/ISOconfig.sh +} + import_astrXbian() { mkdir -p ~/.zen cd ~/.zen @@ -49,3 +53,12 @@ import_astrXbian() { import_kodi() { cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ } + +prepare_next_boot() { + ## 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 +} diff --git a/install.sh b/install.sh index 6e80ca9..1cceb48 100755 --- a/install.sh +++ b/install.sh @@ -39,12 +39,12 @@ 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 ### 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 # cp ~/.zen/astrXbian/DEFCON ~/.zen/ -if [[ "$USER" == "xbian" ]] +if i_am_xbian then echo "enabling ipfs initV service autostart" cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs @@ -67,25 +67,20 @@ mkdir -p ~/astroport/film mkdir -p ~/astroport/serie mkdir -p ~/astroport/anime -if [[ "$USER" != "xbian" ]] +if ! i_am_xbian then - ## Desktop install - echo "INITIALISATIOn Astroport/KODI" - echo "Appuyez sur la touche ENTREE pour créer votre nouvelle identité" - echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde" - read - ~/.zen/astrXbian/ISOconfig.sh + ## Desktop install + echo "INITIALISATIOn Astroport/KODI" + echo "Appuyez sur la touche ENTREE pour créer votre nouvelle identité" + echo "sinon interrompez ici l'installation pour copier la restauration d'une sauvegarde" + read + iso_config 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 + 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 + echo "STOP!! Redémarrer Xbian pour continuer la configuration de votre station Astroport/KODI" + echo "Faites une ISO : sudo xbian-config" + exit 0 fi # MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ## -- 2.39.2 From a1976ed4987ace0c2d830d2678204e41b25a7ab9 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 12 May 2021 19:15:43 +0200 Subject: [PATCH 011/133] test --- specs/astrXbian_spec.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 563efcb..69ee156 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -3,21 +3,6 @@ Describe 'AstrXbian' Describe 'install()' Include ./include.sh - It 'should check IPFS, but not tested' - Pending "You should implement check_ipfs tests" - When call check_ipfs - The status should be success - End - It 'should check Jaklis, but not tested' - Pending "You should implement check_jaklis tests" - When call check_jaklis - The status should be success - End - It 'should check requirements, but not tested' - Pending "You should implement check_requirements tests" - When call check_requirements - The status should be success - End It 'should be me' When call i_am The output should eq 'v0.4' @@ -34,6 +19,21 @@ Describe 'AstrXbian' When call i_should_install The status should be success End + It 'should check IPFS, but not tested' + Pending "You should implement check_ipfs tests" + When call check_ipfs + The status should be success + End + It 'should check Jaklis, but not tested' + Pending "You should implement check_jaklis tests" + When call check_jaklis + The status should be success + End + It 'should check requirements, but not tested' + Pending "You should implement check_requirements tests" + When call check_requirements + The status should be success + End It 'should import AstrXbian, but not tested' Pending "You should implement import_astrXbian tests" When call import_astrXbian -- 2.39.2 From 5d6a32c1d5e1378e619eef0e442f2137f5ff0177 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Thu, 13 May 2021 15:28:46 +0200 Subject: [PATCH 012/133] test --- specs/astrXbian_spec.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 69ee156..71a36ac 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -44,5 +44,15 @@ Describe 'AstrXbian' When call import_kodi The status should be success End + It 'should prepare astrXbian for first boot, but not tested' + Pending "You should implement prepare_next_boot tests" + When call prepare_next_boot + The status should be success + End + It 'should create astrXbian id, but not tested' + Pending "You should implement iso_config tests" + When call iso_config + The status should be success + End End End -- 2.39.2 From dac3cfb1586d1ed87db6edd6b92d8b4760cccc55 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Sat, 15 May 2021 18:31:46 +0200 Subject: [PATCH 013/133] test --- Makefile | 2 +- include.sh | 33 ++++++++++++++++++++------------- install.sh | 4 ++-- specs/astrXbian_spec.sh | 32 ++++++++++++++------------------ 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 0cc7de9..1631547 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,6 @@ shellcheck-%: shellcheck $*/* shellspec-%: - shellspec $* + shellspec -f tap $* ~/.zen/secret.june: diff --git a/include.sh b/include.sh index cdebc7f..266670d 100644 --- a/include.sh +++ b/include.sh @@ -1,15 +1,7 @@ #!/bin/sh -check_ipfs() { - ~/.zen/astrXbian/.install/ipfs_alone.sh -} - -check_jaklis() { - cd ~/.zen/astrXbian/zen/jaklis - ./setup.sh -} - check_requirements() { + return 0 sudo apt-get update 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 sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack -y @@ -40,21 +32,36 @@ i_should_install() { [[ ! -f ~/.zen/secret.june ]] } -iso_config() { - ~/.zen/astrXbian/ISOconfig.sh -} - import_astrXbian() { + return 0 mkdir -p ~/.zen cd ~/.zen git clone https://git.p2p.legal/axiom-team/astrXbian.git } +import_ipfs() { + return 0 + ~/.zen/astrXbian/.install/ipfs_alone.sh +} + +import_jaklis() { + return 0 + cd ~/.zen/astrXbian/zen/jaklis + ./setup.sh +} + import_kodi() { + return 0 cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ } +iso_config() { + return 0 + ~/.zen/astrXbian/ISOconfig.sh +} + prepare_next_boot() { + return 0 ## 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 diff --git a/install.sh b/install.sh index 1cceb48..6c5b670 100755 --- a/install.sh +++ b/install.sh @@ -25,11 +25,11 @@ import_kodi ######################################################################## echo "Installation de IPFS https://ipfs.io" -check_ipfs +import_ipfs ######################################################################## echo "Configuration jaklis: Centre de communication GCHANGE+" -check_jaklis +import_jaklis ######################################################################## echo "Sécurisation DEFCON SUDOERS FAIL2BAN" diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 71a36ac..190dce8 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -11,24 +11,10 @@ Describe 'AstrXbian' When call i_am_root The status should not be success End - It 'should be xbian' - When call i_am_xbian - The status should be success - End - It 'should install AstrXbian' + It 'should allow install' When call i_should_install The status should be success End - It 'should check IPFS, but not tested' - Pending "You should implement check_ipfs tests" - When call check_ipfs - The status should be success - End - It 'should check Jaklis, but not tested' - Pending "You should implement check_jaklis tests" - When call check_jaklis - The status should be success - End It 'should check requirements, but not tested' Pending "You should implement check_requirements tests" When call check_requirements @@ -44,9 +30,14 @@ Describe 'AstrXbian' When call import_kodi The status should be success End - It 'should prepare astrXbian for first boot, but not tested' - Pending "You should implement prepare_next_boot tests" - When call prepare_next_boot + It 'should import IPFS, but not tested' + Pending "You should implement import_ipfs tests" + When call import_ipfs + The status should be success + End + It 'should import Jaklis, but not tested' + Pending "You should implement import_jaklis tests" + When call import_jaklis The status should be success End It 'should create astrXbian id, but not tested' @@ -54,5 +45,10 @@ Describe 'AstrXbian' When call iso_config The status should be success End + It 'should prepare astrXbian for first boot, but not tested' + Pending "You should implement prepare_next_boot tests" + When call prepare_next_boot + The status should be success + End End End -- 2.39.2 From ead1ba7a578af0f68a4e76d0ead9f091d0b207e5 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Mon, 31 May 2021 00:10:07 +0200 Subject: [PATCH 014/133] test --- specs/astrXbian_spec.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 190dce8..390bd65 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -3,15 +3,15 @@ Describe 'AstrXbian' Describe 'install()' Include ./include.sh - It 'should be me' + It 'should check it applies to me' When call i_am The output should eq 'v0.4' End - It 'should not be superuser' + It 'should check I am not superuser' When call i_am_root The status should not be success End - It 'should allow install' + It 'should check I allow install' When call i_should_install The status should be success End -- 2.39.2 From bc5c14d2aeafe11b474564dd4194fc96ce6613f2 Mon Sep 17 00:00:00 2001 From: "aynic.os" Date: Wed, 9 Jun 2021 00:55:20 +0200 Subject: [PATCH 015/133] rebase master --- Makefile | 2 ++ include.sh | 9 +-------- specs/astrXbian_spec.sh | 30 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 1631547..ed3d763 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +-include $(if $(MYOS),$(MYOS),../myos)/make/include.mk + tests: ~/.zen/secret.june shellcheck-specs shellspec-specs shellcheck-%: diff --git a/include.sh b/include.sh index 266670d..22bd7b9 100644 --- a/include.sh +++ b/include.sh @@ -1,10 +1,9 @@ #!/bin/sh check_requirements() { - return 0 sudo apt-get update 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 - sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack -y + sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack sudo -y [[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y sudo apt-get install python3-opencv -y [[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y @@ -33,35 +32,29 @@ i_should_install() { } import_astrXbian() { - return 0 mkdir -p ~/.zen cd ~/.zen git clone https://git.p2p.legal/axiom-team/astrXbian.git } import_ipfs() { - return 0 ~/.zen/astrXbian/.install/ipfs_alone.sh } import_jaklis() { - return 0 cd ~/.zen/astrXbian/zen/jaklis ./setup.sh } import_kodi() { - return 0 cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ } iso_config() { - return 0 ~/.zen/astrXbian/ISOconfig.sh } prepare_next_boot() { - return 0 ## 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 diff --git a/specs/astrXbian_spec.sh b/specs/astrXbian_spec.sh index 390bd65..83e181a 100644 --- a/specs/astrXbian_spec.sh +++ b/specs/astrXbian_spec.sh @@ -11,43 +11,43 @@ Describe 'AstrXbian' When call i_am_root The status should not be success End - It 'should check I allow install' + 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' - Pending "You should implement check_requirements tests" - When call check_requirements + Skip "You should implement check_requirements tests" + When run check_requirements The status should be success End It 'should import AstrXbian, but not tested' - Pending "You should implement import_astrXbian tests" - When call import_astrXbian + Skip "You should implement import_astrXbian tests" + When run import_astrXbian The status should be success End It 'should import Kodi, but not tested' - Pending "You should implement import_kodi tests" - When call import_kodi + Skip "You should implement import_kodi tests" + When run import_kodi The status should be success End It 'should import IPFS, but not tested' - Pending "You should implement import_ipfs tests" - When call import_ipfs + Skip "You should implement import_ipfs tests" + When run import_ipfs The status should be success End It 'should import Jaklis, but not tested' - Pending "You should implement import_jaklis tests" - When call import_jaklis + Skip "You should implement import_jaklis tests" + When run import_jaklis The status should be success End It 'should create astrXbian id, but not tested' - Pending "You should implement iso_config tests" - When call iso_config + Skip "You should implement iso_config tests" + When run iso_config The status should be success End It 'should prepare astrXbian for first boot, but not tested' - Pending "You should implement prepare_next_boot tests" - When call prepare_next_boot + Skip "You should implement prepare_next_boot tests" + When run prepare_next_boot The status should be success End End -- 2.39.2 From 2d978f0aca1f4056ee8d18315ccce1f07c0f2bd3 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 29 Sep 2021 22:08:23 +0200 Subject: [PATCH 016/133] delayed new_file_in_astroport put in ~/.astroport/nf_$timestamp_cmd.sh --- ajouter_video.sh | 28 ++++++++++++++++------------ zen/new_file_in_astroport.sh | 14 +++++++++++--- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index d6d89a7..3cc84c2 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -526,8 +526,14 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N ######################################################################## [[ "$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 -[ ! $? == 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 +echo "MEDIAKEY=${MEDIAKEY} +~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" +rm -f /tmp/\${MEDIAKEY}.pass +rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS +" >> ~/astroport/nf_$(date -u +%s%N | cut -b1-13)_cmd.sh + +# ~/.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 ######################################################################## ######################################################################## ######################################################################## @@ -547,22 +553,20 @@ echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY" FILE_SIZE=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.filesize) 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] }') -G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) -if [[ $G1BALANCE -gt 0 ]]; then - [ ! $2 ] && G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="") - [[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0 - ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON" - ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1) -else +#G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) +#if [[ $G1BALANCE -gt 0 ]]; then +# [ ! $2 ] && G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="") +# [[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0 +# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON" +# ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1) +#else ZENBALANCE=0 -fi +#fi ######################################################################## ######################################################################## echo "${MEDIAKEY} = RECORDED TO IPFS." cat /tmp/${MEDIAKEY}.log -rm -f /tmp/${MEDIAKEY}.pass -rm -f /tmp/${MEDIAKEY}.dunikey ## REMOVE KEYS if [ ! $2 ]; then [ $? == 0 ] && zenity --warning --width 300 --text "OK! MEDIA transféré ($ZENBALANCE ZEN). URL LOCALHOST prête à coller (/tmp/${MEDIAKEY}.log)" && exit 0 \ diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 73b7e86..509a5e3 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash ######################################################################## # Author: Fred (support@qo-op.com) # Version: 0.3 @@ -10,6 +10,10 @@ 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 +start=`date +%s` + 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='\n') G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) @@ -310,7 +314,7 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${TITLE}/$TITLE/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/index.html + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html ## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html @@ -324,7 +328,7 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \ | sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html # echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html @@ -434,4 +438,8 @@ echo "DUNIKEY PASS $PASS" echo "NEW $TYPE ($file) ADDED. http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" echo "INDEX UPDATED : http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN" echo "VIDEO IPNS LINK : http://127.0.0.1:8181/ipns/$KEY/$G1PUB/" +echo "#### EXCECUTION TIME" +end=`date +%s` +echo Execution time was `expr $end - $start` seconds. +echo "########################################################################" exit 0 -- 2.39.2 From 02b22a5515fc3ccd5eef73012d88fdb739be19cc Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 29 Sep 2021 22:20:21 +0200 Subject: [PATCH 017/133] libre --- ajouter_video.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 3cc84c2..05baddf 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -526,11 +526,13 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N ######################################################################## [[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB" +timestamp=$(date -u +%s%N | cut -b1-13) echo "MEDIAKEY=${MEDIAKEY} ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS -" >> ~/astroport/nf_$(date -u +%s%N | cut -b1-13)_cmd.sh +rm ~/astroport/nf_$timestamp_cmd.sh +" > ~/astroport/nf_$timestamp_cmd.sh # ~/.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 @@ -541,11 +543,11 @@ rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS ######################################################################## MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY) -[ ! $2 ] && zenity --width=500 --height=500 --text-info \ - --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \ - --html \ - --url="http://127.0.0.1:8181/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." +#[ ! $2 ] && zenity --width=500 --height=500 --text-info \ +# --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \ +# --html \ +# --url="http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \ +# --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" @@ -569,6 +571,6 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then - [ $? == 0 ] && zenity --warning --width 300 --text "OK! MEDIA transféré ($ZENBALANCE ZEN). URL LOCALHOST prête à coller (/tmp/${MEDIAKEY}.log)" && exit 0 \ - || zenity --warning --width 300 --text "Désolé une erreur est survenue... LOG: cat /tmp/${MEDIAKEY}.log" && exit 1 + [ $? == 0 ] && zenity --warning --width 300 --text "OK! ${MEDIAKEY} transféré ($FILE_SIZE) sur Astroport" && exit 0 \ + || zenity --warning --width 300 --text "Désolé une erreur est survenue..." && exit 1 fi -- 2.39.2 From 68a092176049f34df9973f7aef797ae543626ba0 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 29 Sep 2021 22:48:34 +0200 Subject: [PATCH 018/133] deplace map dans ~/.zen --- actions/p4n.data_evolution.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/actions/p4n.data_evolution.sh b/actions/p4n.data_evolution.sh index 7b02c47..aa3da1e 100755 --- a/actions/p4n.data_evolution.sh +++ b/actions/p4n.data_evolution.sh @@ -15,6 +15,15 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PU IPFSNODEID=$(ipfs --timeout=20s id -f='\n' 2>/dev/null) && [[ "$IPFSNODEID" == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1 [ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1 + +###### MOVE MAP FROM SELF IPNS INDEX +if [ ! -d ~/.zen/ipfs/map ]; then + mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map ~/.zen/ +else + exit 0 +fi +## TODO CREATE SPECIAL IPNS KEY FOR SHARING + ##############################################################" ## DO NOT RECORD output.pdf, bu convert to jpg and link throug index.html REDIRECT ##############################################################" -- 2.39.2 From 92dcc8ef67590fcc3c1c31d2b15f25a82722c777 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 7 Oct 2021 10:08:24 +0200 Subject: [PATCH 019/133] get FRIEND list from my own balise --- zen/ipfs_SWARM_refresh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index c693296..38c058f 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -61,7 +61,7 @@ rm ~/.zen/A_peering_peers.txt 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 ~/.zen/ipfs_swarm/.*/tryme.addr | grep -o '[^/]*$' | sort | uniq); +for ipfsnodeid in $(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/tryme.addr | grep -o '[^/]*$' | sort | uniq); do ## $ipfsnodeid already Treated ? [[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue -- 2.39.2 From 376dcb71254f4163abfa39676ea57043866ccaa9 Mon Sep 17 00:00:00 2001 From: qo-op Date: Thu, 7 Oct 2021 10:48:14 +0200 Subject: [PATCH 020/133] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'zen/ipfs?= =?UTF-8?q?=5FSWARM=5Frefresh.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zen/ipfs_SWARM_refresh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index c693296..38c058f 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -61,7 +61,7 @@ rm ~/.zen/A_peering_peers.txt 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 ~/.zen/ipfs_swarm/.*/tryme.addr | grep -o '[^/]*$' | sort | uniq); +for ipfsnodeid in $(cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/tryme.addr | grep -o '[^/]*$' | sort | uniq); do ## $ipfsnodeid already Treated ? [[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue -- 2.39.2 From 001ca73aa29e096dd42aef328b1de999cdd3198d Mon Sep 17 00:00:00 2001 From: poka Date: Sun, 17 Oct 2021 19:30:40 +0200 Subject: [PATCH 021/133] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'zen/jaklis?= =?UTF-8?q?/.env'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zen/jaklis/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/jaklis/.env b/zen/jaklis/.env index 22d31e4..4376e7c 100644 --- a/zen/jaklis/.env +++ b/zen/jaklis/.env @@ -5,6 +5,6 @@ DUNIKEY=/.zen/secret.dunikey NODE=https://g1.librelois.fr/gva # 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://data.gchange.fr +POD=https://data.gchange.fr -- 2.39.2 From ea3e841fea39ead0cd78c58abc198962eddb14e0 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 21 Oct 2021 02:42:48 +0200 Subject: [PATCH 022/133] swarm desync correction --- zen/gchange_IPFS_swarm.sh | 12 ++++++++++++ zen/ipfs_SWARM_refresh.sh | 2 ++ 2 files changed, 14 insertions(+) diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index d548686..1608097 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -35,6 +35,18 @@ echo $(date) ######################################################################## 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/_xbian.zuid) + 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 for swarm_frof in $(ls ~/.zen/ipfs_swarm/.*/FRIENDS/$G1PUB/stars.level | cut -d '/' -f 6 | cut -d '.' -f 2); ## FROM IPFS do diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 38c058f..e868982 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -62,7 +62,9 @@ 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 ~/.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 +# ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend) ## $ipfsnodeid already Treated ? [[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue [[ -f ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid ]] && XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) || XID='' -- 2.39.2 From 8db2ef98585c3962ecf2564f92351013cb30bdcd Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 31 Oct 2021 21:30:13 +0100 Subject: [PATCH 023/133] ASTROPORT START if no ipfs daemon is running --- ajouter_video.sh | 7 +++++++ zen/cron_VRFY.sh | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/ajouter_video.sh b/ajouter_video.sh index 05baddf..b618e70 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -87,6 +87,13 @@ case $? in esac fi +## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport/IPFS is OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) +[[ $RUN == "" || $RUN == "NON" ]] && exit 1 +## ACTIVATION ASTROPORT +[[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" + ######################################################################## # 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) diff --git a/zen/cron_VRFY.sh b/zen/cron_VRFY.sh index fe84265..0fb197e 100755 --- a/zen/cron_VRFY.sh +++ b/zen/cron_VRFY.sh @@ -34,6 +34,8 @@ if [[ ! $crontest ]]; then # ADD cron_MINUTE.sh line echo "* * * * * /bin/bash $MY_PATH/../cron_MINUTE.sh 2>&1>/dev/null" >> /tmp/newcron crontab /tmp/newcron + sudo systemctl enable ipfs + sudo systemctl start ipfs echo "ASTROPORT is ON" else ## HEADER @@ -42,6 +44,8 @@ else ## REMOVE cron_MINUTE.sh line cat /tmp/mycron | grep -Ev 'cron_MINUTE.sh' >> /tmp/newcron crontab /tmp/newcron + sudo systemctl stop ipfs + sudo systemctl disable ipfs echo "ASTROPORT is OFF" fi -- 2.39.2 From a540cea051a2bb5f0985b4adde71f39a669dfd10 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 31 Oct 2021 21:36:10 +0100 Subject: [PATCH 024/133] activate/desactivate astroport/cron/ipfs --- ajouter_video.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index b618e70..727a021 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -89,8 +89,9 @@ 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 is OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) +[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) [[ $RUN == "" || $RUN == "NON" ]] && exit 1 +[[ $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ?" --entry-text="OUI" NON) ## ACTIVATION ASTROPORT [[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" -- 2.39.2 From 284feb8e7bb60af83faa187311167f620f767775 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 31 Oct 2021 22:33:05 +0100 Subject: [PATCH 025/133] Demande activation/desactivation Astroport/CRON/ipfs --- ajouter_video.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 727a021..565199f 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x ######################################################################## # Author: Fred (support@qo-op.com) # Version: 0.1 @@ -89,11 +89,12 @@ 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 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) && [[ $RUN == "" || $RUN == "NON" ]] && exit 1 [[ $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ?" --entry-text="OUI" NON) -## ACTIVATION ASTROPORT +## DES/ACTIVATION ASTROPORT [[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" +YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ $YOU == "" ]] && exit 1 ######################################################################## # CHOOSE CATEGORY (remove anime, not working!) -- 2.39.2 From 1b91bab05627fcbbc2016881a3a6f259e03f3916 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 2 Nov 2021 17:53:04 +0100 Subject: [PATCH 026/133] Astroport Desktop link --- .install/astroport.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.install/astroport.desktop b/.install/astroport.desktop index 59e24a9..8293342 100755 --- a/.install/astroport.desktop +++ b/.install/astroport.desktop @@ -1,6 +1,6 @@ #!/usr/bin/env xdg-open [Desktop Entry] -Name=Astroport/Kodi +Name=Astroport Exec=/home/_USER_/.zen/astrXbian/ajouter_video.sh Icon=/home/_USER_/.zen/astrXbian/logo96.png Type=Application -- 2.39.2 From 4e1c0c6cf592a2ddbc3ae58140493eb6c0115bfd Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 29 Nov 2021 16:37:02 +0100 Subject: [PATCH 027/133] IPFS add delayed in ~/astroport/Add_${MEDIAKEY}_script.sh --- ajouter_video.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 565199f..3b7c490 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -540,8 +540,12 @@ echo "MEDIAKEY=${MEDIAKEY} ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS -rm ~/astroport/nf_$timestamp_cmd.sh -" > ~/astroport/nf_$timestamp_cmd.sh +rm ~/astroport/Add_${MEDIAKEY}_script.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 @@ -580,6 +584,6 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then - [ $? == 0 ] && zenity --warning --width 300 --text "OK! ${MEDIAKEY} transféré ($FILE_SIZE) sur Astroport" && exit 0 \ - || zenity --warning --width 300 --text "Désolé une erreur est survenue..." && exit 1 + [ $? == 0 ] && zenity --warning --width 300 --text "OK! script de transfert ~/astroport/Add_${MEDIAKEY}_script.sh créé. Lancez le pour terminer l'ajout à Astroport" && exit 0 \ + || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi -- 2.39.2 From 1aee58a6d6909e0d4b01f509dc9f6092b66abf3a Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 29 Nov 2021 23:43:43 +0100 Subject: [PATCH 028/133] =?UTF-8?q?encode=20h265=20avant=20import=3F=20Opt?= =?UTF-8?q?ion=20de=20r=C3=A9duction=20de=20la=20taille=20du=20fichier=20v?= =?UTF-8?q?ideo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ajouter_video.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ajouter_video.sh b/ajouter_video.sh index 3b7c490..246dc58 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -537,6 +537,13 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N timestamp=$(date -u +%s%N | cut -b1-13) echo "MEDIAKEY=${MEDIAKEY} +echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" +read reponse +if [[ $reponse ]]; then + ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} -vcodec libx265 -crf 28 /tmp/output.mp4 + mv $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} /tmp + mv /tmp/output.mp4 $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} +fi ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS -- 2.39.2 From 8ac58e6369257f9df2dc732418d453c26b525ce8 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 30 Nov 2021 02:38:31 +0100 Subject: [PATCH 029/133] IPFSNODEID=$(ipfs --timeout=20s id -f='\n') --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 246dc58..38d4d7b 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -52,7 +52,7 @@ large=$((width-300)) haut=$((height-200)) ######################################################################## -IPFSNODEID=$(ipfs id -f='\n') +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') [[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)" [[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) -- 2.39.2 From 1d16d76db44d710a553db5e68ec7485555c2e162 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 30 Nov 2021 15:29:02 +0100 Subject: [PATCH 030/133] =?UTF-8?q?Cliquez=20sur=20OK,=20nous=20allons=20p?= =?UTF-8?q?r=C3=A9parer=20son=20script=20d'ajout=20=C3=A0=20Astroport...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 38d4d7b..97b8226 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -425,7 +425,7 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" mkdir -p ~/astroport/${CAT}/${MEDIAID}/ mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}" if [ $? == 0 ]; then - zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK 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 zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -" exit 1 -- 2.39.2 From 679b61f8c75bbbd27b4a0fff1449b94ab28e914c Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 30 Nov 2021 18:40:24 +0100 Subject: [PATCH 031/133] =?UTF-8?q?=C3=A9viter=20de=20surcharger=20/tmp=20?= =?UTF-8?q?avec=20YTEMP=3D"$HOME/astroport/tmp/$(date=20-u=20+%s%N=20|=20c?= =?UTF-8?q?ut=20-b1-13)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ajouter_video.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 97b8226..01b679b 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -130,7 +130,7 @@ YTURL="$URL" REVSOURCE="$(echo "$YTURL" | awk -F/ '{print $3}' | rev)_" # Create TEMP directory to copy $YID_$TITLE.$FILE_EXT -YTEMP="/tmp/$(date -u +%s%N | cut -b1-13)" +YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)" mkdir -p ${YTEMP} # youtube-dl $YTURL @@ -256,7 +256,7 @@ rm -Rf ${YTEMP} zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal' # 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} artist=$(zenity --entry --width 400 --title "Extraction MP3 depuis Youtube" --text "Artiste recherché ou Lien Youtube" --entry-text="") @@ -539,12 +539,12 @@ timestamp=$(date -u +%s%N | cut -b1-13) echo "MEDIAKEY=${MEDIAKEY} echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" read reponse -if [[ $reponse ]]; then - ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} -vcodec libx265 -crf 28 /tmp/output.mp4 - mv $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} /tmp - mv /tmp/output.mp4 $HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME} +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\" fi -~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" +~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\" rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS rm ~/astroport/Add_${MEDIAKEY}_script.sh -- 2.39.2 From e40d1eb7666c9a71c6b68c6cc1a123c314efa27d Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 1 Dec 2021 01:54:54 +0100 Subject: [PATCH 032/133] ipfs id timeout --- zen/new_file_in_astroport.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 509a5e3..12e9a8c 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -15,7 +15,8 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr start=`date +%s` 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='\n') +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not responding !?' && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) # ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN # Astropot/Kodi/Vstream source reads ${PREFIX}ASTRXBIAN from http://127.0.0.1:8181/.$IPFNODEID/ -- 2.39.2 From 7014112c36588d7c933871b58bf984767b16ece0 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 3 Dec 2021 23:39:06 +0100 Subject: [PATCH 033/133] on attend un peu plus la lecture de balise IPNS --- zen/gchange_INIT.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index d1a19f4..b32d031 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -156,7 +156,7 @@ ipfsnodeid=${IamINBOOTSTRAP##*/} ################## SEND ipfstryme MESSAGES to FRIENDS rm -f /tmp/friend_of_mine ## 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 ~/.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) echo "Reading stars.level from Stations IPNS Capsules." - starsin=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/stars.level) - starsout=$(ipfs --timeout=10s cat /ipns/$IPFSNODEID/.$IPFSNODEID/FRIENDS/$liking_me/stars.level) + starsin=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/FRIENDS/$G1PUB/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." ##### CHECKING IF WE LIKE EACH OTHER (AVOID LIKING MYSELF) -- 2.39.2 From f6016825d7dba6355ba1f9f29c141a4a886c5061 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 3 Dec 2021 23:59:57 +0100 Subject: [PATCH 034/133] IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) --- ajouter_video.sh | 2 +- cron_MINUTE.sh | 2 +- zen/bash_template.sh | 4 ++-- zen/create_subkeys_for_my_friends.sh | 2 +- zen/gchange_INIT.sh | 2 +- zen/gchange_IPFS_swarm.sh | 2 +- zen/ipfs_FRIENDS_refresh.sh | 2 +- zen/ipfs_P2P_forward.sh | 2 +- zen/ipfs_SWARM_refresh.sh | 2 +- zen/ipns_TAG_refresh.sh | 2 +- zen/ipns_self_publish.sh | 2 +- zen/new_file_in_astroport.sh | 2 +- zen/tools/add_externIP_to_ipfstryme.sh | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 01b679b..fa5941b 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -52,7 +52,7 @@ large=$((width-300)) haut=$((height-200)) ######################################################################## -IPFSNODEID=$(ipfs --timeout=20s id -f='\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/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 3f4f6bb..9f5de34 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -20,7 +20,7 @@ source $HOME/.profile #### CONTROL STATION IPFS DAEMON ## timeout is fixing ipfs minimum response time, before considering stuck process -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) howmany=$(cat /tmp/ipfs.timeout) if [[ ! $IPFSNODEID ]]; then ## wait a howmany timeout before restarting ipfs diff --git a/zen/bash_template.sh b/zen/bash_template.sh index 8dc21a2..a54db28 100755 --- a/zen/bash_template.sh +++ b/zen/bash_template.sh @@ -1,6 +1,6 @@ #!/bin/bash ######################################################################## -# Author: +# Author: # Version: 0.1 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## @@ -9,7 +9,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized 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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs id -f='\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/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) diff --git a/zen/create_subkeys_for_my_friends.sh b/zen/create_subkeys_for_my_friends.sh index c8ee27b..d5ab233 100755 --- a/zen/create_subkeys_for_my_friends.sh +++ b/zen/create_subkeys_for_my_friends.sh @@ -9,7 +9,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized 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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) ######################################################################## # SCAN AND MANAGE KEYS BETWEEN MOVIES & FRIENDS diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index b32d031..e8887a9 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -19,7 +19,7 @@ start=`date +%s` # INITIALISATION & CONTROL ######################################################################## 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='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 1608097..7c6a93f 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 # CLEAN "A_my_swarm.txt" and "A_swarm_map.txt" diff --git a/zen/ipfs_FRIENDS_refresh.sh b/zen/ipfs_FRIENDS_refresh.sh index dfd29f7..a485930 100755 --- a/zen/ipfs_FRIENDS_refresh.sh +++ b/zen/ipfs_FRIENDS_refresh.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## ######################################################################## diff --git a/zen/ipfs_P2P_forward.sh b/zen/ipfs_P2P_forward.sh index 40cc95e..184c456 100755 --- a/zen/ipfs_P2P_forward.sh +++ b/zen/ipfs_P2P_forward.sh @@ -9,7 +9,7 @@ MY_PATH="`dirname \"$0\"`" # relative 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" -IPFSNODEID=$(ipfs --timeout=5s id -f='\n') || er+=" ipfs id problem" +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) || er+=" ipfs id problem" [[ "$YOU" == "" || "$IPFSNODEID" == "" ]] && echo "ERROR : $er " && exit 1 ######################################################################## # TODO ESTABLISH A PORT FORWARD STRATEGY (depending on Node Flavour) diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index e868982..025c928 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## ######################################################################## diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index 4bd6574..46f9ff3 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -20,7 +20,7 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr ######################################################################## ######################################################################## -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## [[ ! -f ~/.zen/secret.dunikey ]] && exit 1 diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index cf7bb43..0c9074e 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -6,7 +6,7 @@ ME="${0##*/}" countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) [[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 ######################################################################## -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ $IPFSNODEID == "" ]] && echo "ipfs TIMEOUT" && exit 1 ######################################################################## diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 12e9a8c..f7dc423 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -15,7 +15,7 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr start=`date +%s` 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='\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) # ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN diff --git a/zen/tools/add_externIP_to_ipfstryme.sh b/zen/tools/add_externIP_to_ipfstryme.sh index a8dc5b5..5c280d4 100755 --- a/zen/tools/add_externIP_to_ipfstryme.sh +++ b/zen/tools/add_externIP_to_ipfstryme.sh @@ -9,7 +9,7 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" 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='\n') +IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) 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])/" ) -- 2.39.2 From b684115dd7701d920054653b9ad3bea3c410f4fd Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 9 Dec 2021 00:04:04 +0100 Subject: [PATCH 035/133] ffmpeg h265 add .mp4 extension to actual extension --- ajouter_video.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index fa5941b..9a9e64b 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -543,10 +543,14 @@ 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 + ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" fi -~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\" rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS +echo 'Si tout est OK, appuyez dur ENTER, sinon ESC' +read finish rm ~/astroport/Add_${MEDIAKEY}_script.sh " > ~/astroport/Add_${MEDIAKEY}_script.sh -- 2.39.2 From 192300bcb99b3fce4e2fa6a200cc0ef667381e9c Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 30 Dec 2021 19:26:16 +0100 Subject: [PATCH 036/133] install youtube-dl if missing --- ajouter_video.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ajouter_video.sh b/ajouter_video.sh index 9a9e64b..c79efb1 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -135,6 +135,10 @@ mkdir -p ${YTEMP} # youtube-dl $YTURL echo "VIDEO $YTURL" +if [[ ! -f /usr/local/bin/youtube-dl ]]; then + 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=720]/best' \ --no-playlist --write-info-json --write-annotations \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL -- 2.39.2 From 65b78e4f00c6c8f976ba4d53b198f13627d37ca2 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 30 Dec 2021 19:32:15 +0100 Subject: [PATCH 037/133] no ask to stop if inline URL=$1 provided --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index c79efb1..0897078 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -90,7 +90,7 @@ 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 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ?" --entry-text="OUI" NON) +[[ $YOU && ! $1 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ?" --entry-text="OUI" NON) ## DES/ACTIVATION ASTROPORT [[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) -- 2.39.2 From 906f76c204cb6ba373417c0494d3897ec8974fa5 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 16 Feb 2022 02:12:31 +0100 Subject: [PATCH 038/133] +ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080" --- .install/ipfs_alone.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index cf005d0..d058fe9 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -133,6 +133,7 @@ ipfs bootstrap rm --all ########################################### # 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" [[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs -- 2.39.2 From 0904157e3902aa11211c184d4f0cf92541f15039 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 16 Feb 2022 02:12:42 +0100 Subject: [PATCH 039/133] tmp file --- zen/ipns_TAG_refresh.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index 46f9ff3..4b1d4ec 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -116,7 +116,8 @@ do | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${G1PUB}/$G1PUB/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 -- 2.39.2 From 39a7afa9c8af4633053bc900666c0ed09a4a2c5e Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 25 Mar 2022 18:46:06 +0100 Subject: [PATCH 040/133] adding subs to video download. please test & report --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 0897078..72fa999 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -140,7 +140,7 @@ if [[ ! -f /usr/local/bin/youtube-dl ]]; then sudo chmod a+rx /usr/local/bin/youtube-dl fi /usr/local/bin/youtube-dl -f '[height=720]/best' \ ---no-playlist --write-info-json --write-annotations \ +--no-playlist --write-info-json --write-annotations --write-auto-subs --sub-lang "*" \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL # Get filename, extract ID, make destination dir and move copy. -- 2.39.2 From a6d2fa25e23477ed2b4ff626299d1bef32dc3b1f Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 25 Mar 2022 18:46:39 +0100 Subject: [PATCH 041/133] --write-auto-subs --sub-lang "*" --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 72fa999..7d9ee21 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -140,7 +140,7 @@ if [[ ! -f /usr/local/bin/youtube-dl ]]; then sudo chmod a+rx /usr/local/bin/youtube-dl fi /usr/local/bin/youtube-dl -f '[height=720]/best' \ ---no-playlist --write-info-json --write-annotations --write-auto-subs --sub-lang "*" \ +--no-playlist --write-info-json --write-annotations --write-auto-subs --sub-lang "*" \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL # Get filename, extract ID, make destination dir and move copy. -- 2.39.2 From 979294898a2b0ddb1e8011dcd3a4f487f76c9ac6 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 16 Apr 2022 01:04:51 +0200 Subject: [PATCH 042/133] =?UTF-8?q?controle=20du=20bootstrap=20au=20d?= =?UTF-8?q?=C3=A9marrage...=20=C3=A0=20am=C3=A9liorer...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- A_boostrap_public.txt | 5 +++++ ajouter_video.sh | 13 ++++++++++--- cron_MINUTE.sh | 6 ++++-- zen/new_file_in_astroport.sh | 4 ++-- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 A_boostrap_public.txt diff --git a/A_boostrap_public.txt b/A_boostrap_public.txt new file mode 100644 index 0000000..1bb5538 --- /dev/null +++ b/A_boostrap_public.txt @@ -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 diff --git a/ajouter_video.sh b/ajouter_video.sh index 7d9ee21..6b15805 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -90,11 +90,18 @@ 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 ?" --entry-text="OUI" NON) +[[ $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 -[[ $RUN == "OUI" ]] && REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP" +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 == "" ]] && exit 1 +[[ $YOU == "" ]] && echo "IPFS not running" && exit 1 ######################################################################## # CHOOSE CATEGORY (remove anime, not working!) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 9f5de34..e7a109d 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -185,12 +185,14 @@ fi if [[ $(($minute % 30)) == 0 ]]; then ########## NextCloud.SMS GUILDE STATION ############## - if [[ -e ~/.zen/SMS/ ]];then + if [[ -e /home/${YOU}/.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 ############## + ########## BUNKERBOX STATION ############## + # [[ $(cat /home/${YOU}/.zen/bunkerbox/qo-op 2>/dev/null) != "" && $(cat /home/${YOU}/.zen/bunkerbox/choice 2>/dev/null) == "qo-op" ]] && /home/${YOU}/workspace/bunkerbox/crowdbunker.sh & + fi # __ __ _____ ____ diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index f7dc423..efda565 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -315,8 +315,8 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${TITLE}/$TITLE/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIA + KEY}/index.html ## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html # https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/ -- 2.39.2 From d637dee3c76fb4eea5d525d877fc12ea4769bd3a Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 16 Apr 2022 01:07:20 +0200 Subject: [PATCH 043/133] =?UTF-8?q?Groupe=20Framagenda=20en=20cours=20de?= =?UTF-8?q?=20cr=C3=A9ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f12bfd..97c2b02 100644 --- a/README.md +++ b/README.md @@ -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)``` -### **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) --- -- 2.39.2 From 670cc64d3cb884e917968e70e5c2cd848e0987c2 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 16 Apr 2022 01:16:16 +0200 Subject: [PATCH 044/133] Contact sur https://Famagenda.org (astroport) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 97c2b02..b3a7401 100644 --- a/README.md +++ b/README.md @@ -185,18 +185,18 @@ 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. -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 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). -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``` -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 film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p;http://127.0.0.1:8181/ipfs/QmcXMAHbFH3gDwmxJRX7uh753oCbXAEajwQsAWFkvqbRY3/Frequencies.mp4 @@ -204,8 +204,8 @@ film;$TMDB;2013;Frequencies;;["Science fiction","Romance","Mystere"];$XZUID;480p ``` * ```~/.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}/index.html``` l'application par défaut de votre clef self est un TiddlyWiki +* ```~/.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 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. -- 2.39.2 From 07db104b03e1d47d7809d295d9a4216433611940 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 18 Apr 2022 16:09:28 +0200 Subject: [PATCH 045/133] changing ipfs gateway port to 8080 --- .../resources/sites/astroport.py | 2 +- .install/ipfs_alone.sh | 4 +++- .install/nvh/vhost.txt | 4 ++-- .install/nvh/vhost_php.txt | 4 ++-- .install/templates/nginx/astrxbian.conf | 4 ++-- .install/templates/nginx/jukebox.conf | 4 ++-- .install/templates/tiddlyone/index.html | 6 +++--- README.md | 2 +- actions/p4n.data_evolution.sh | 2 +- actions/p4n.swarmscraper.sh | 2 +- ajouter_video.sh | 2 +- install_www.sh | 2 +- nginx.conf | 4 ++-- www/boris/install.sh | 4 ++-- zen/gchange_INIT.sh | 2 +- zen/ipfs_SWARM_refresh.sh | 4 ++-- zen/ipns_TAG_refresh.sh | 10 +++++----- zen/ipns_self_publish.sh | 2 +- zen/manage_stargates.sh | 12 ++++++------ zen/new_file_in_astroport.sh | 16 ++++++++-------- zen/new_mp3_in_astroport.sh | 4 ++-- zen/refresh_ASTRXBIAN_index.sh | 2 +- zen/stream/process-stream.sh | 2 +- zen/tools/MEDIAKEY_dunikey_pass_QR.sh | 2 +- zen/tools/autoPINfriends.sh | 2 +- 25 files changed, 53 insertions(+), 51 deletions(-) diff --git a/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py b/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py index 1f89c63..b3ab66d 100644 --- a/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py +++ b/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py @@ -31,7 +31,7 @@ SITE_IDENTIFIER = 'astroport' SITE_NAME = 'ASTROPORT _PROFIL_ (_LOGIN_) (_MDP_)' 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' SETTING_PASTE_ID = SITE_IDENTIFIER + '_id_' diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index d058fe9..eb031cd 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -126,7 +126,9 @@ ipfs config --json Experimental.Libp2pStreamMounting true ipfs config --json Experimental.P2pHttpProxy true ipfs config --json Swarm.ConnMgr.LowWater 0 ipfs config --json Swarm.ConnMgr.HighWater 0 -######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### ipfs bootstrap rm --all ########################################### # BOOTSTRAP NODES ARE ADDED LATER diff --git a/.install/nvh/vhost.txt b/.install/nvh/vhost.txt index 0ee3770..2eb4b6d 100644 --- a/.install/nvh/vhost.txt +++ b/.install/nvh/vhost.txt @@ -18,13 +18,13 @@ server { } 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 X-Forwarded-For $remote_addr; } 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 X-Forwarded-For $remote_addr; } diff --git a/.install/nvh/vhost_php.txt b/.install/nvh/vhost_php.txt index fb94988..991bea3 100644 --- a/.install/nvh/vhost_php.txt +++ b/.install/nvh/vhost_php.txt @@ -28,13 +28,13 @@ server { } 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 X-Forwarded-For $remote_addr; } 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 X-Forwarded-For $remote_addr; } diff --git a/.install/templates/nginx/astrxbian.conf b/.install/templates/nginx/astrxbian.conf index 7bfba67..d650062 100644 --- a/.install/templates/nginx/astrxbian.conf +++ b/.install/templates/nginx/astrxbian.conf @@ -9,13 +9,13 @@ server { # IPFS GATEWAY PROXY 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 X-Forwarded-For $remote_addr; } 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 X-Forwarded-For $remote_addr; } diff --git a/.install/templates/nginx/jukebox.conf b/.install/templates/nginx/jukebox.conf index d28d429..94e0ce9 100644 --- a/.install/templates/nginx/jukebox.conf +++ b/.install/templates/nginx/jukebox.conf @@ -28,13 +28,13 @@ server { # IPFS GATEWAY PROXY 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 X-Forwarded-For $remote_addr; } 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 X-Forwarded-For $remote_addr; } diff --git a/.install/templates/tiddlyone/index.html b/.install/templates/tiddlyone/index.html index d427e5d..e8d7a2e 100644 --- a/.install/templates/tiddlyone/index.html +++ b/.install/templates/tiddlyone/index.html @@ -14247,9 +14247,9 @@ https://astroport.com
-
''[[Ouvrez mon WIKI|http://127.0.0.1:8181/ipns/_IPFSNODEID_/._IPFSNODEID_]]''
+
''[[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_/]]''
 
@@ -14265,7 +14265,7 @@ Chaque Station [[Astroport|Astroport]] possède le sien. Il est publié sur le r
 
 ```
 IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\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
diff --git a/README.md b/README.md
index b3a7401..891e7f4 100644
--- a/README.md
+++ b/README.md
@@ -199,7 +199,7 @@ Chaque noeud conserve la mémoire de sa bibliothèque au travers du fichier ```~
 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
-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
 
 ```
diff --git a/actions/p4n.data_evolution.sh b/actions/p4n.data_evolution.sh
index aa3da1e..20e95a5 100755
--- a/actions/p4n.data_evolution.sh
+++ b/actions/p4n.data_evolution.sh
@@ -41,7 +41,7 @@ fi
             echo "" >  ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
             # mv ./output.pdf  ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
             rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
-            echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg"
+            echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
             cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
 
     done
diff --git a/actions/p4n.swarmscraper.sh b/actions/p4n.swarmscraper.sh
index 9d92520..16a28ac 100755
--- a/actions/p4n.swarmscraper.sh
+++ b/actions/p4n.swarmscraper.sh
@@ -150,7 +150,7 @@ echo "SUB-SCRAPING lieu FROM $geodata"
             echo "" >  ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
             # mv ./output.pdf  ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
             rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
-            echo "NOW LIEU redirect to http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$lid.jpg"
+            echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
             rm ./$lid.jpg
             rm ./bulle.jpg
         fi
diff --git a/ajouter_video.sh b/ajouter_video.sh
index 6b15805..45ef817 100755
--- a/ajouter_video.sh
+++ b/ajouter_video.sh
@@ -581,7 +581,7 @@ MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY)
 #[ ! $2 ] && zenity --width=500 --height=500 --text-info \
 #       --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \
 #       --html \
-#       --url="http://127.0.0.1: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."
 
 ########################################################################
diff --git a/install_www.sh b/install_www.sh
index 1953868..e852761 100755
--- a/install_www.sh
+++ b/install_www.sh
@@ -9,7 +9,7 @@ fi
 sudo usermod -a -G "$USER" www-data
 sudo chmod g+rw /var/www/html
 
-## TODO ## INSTALLER SITE PROXY NGINX QUI REDIRIGE VERS https://127.0.0.1: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
 
 ## AJOUT ADDONS NAVIGATEUR https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts
diff --git a/nginx.conf b/nginx.conf
index f6ebade..2386738 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -25,13 +25,13 @@ server {
 
 
     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 X-Forwarded-For $remote_addr;
     }
 
     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 X-Forwarded-For $remote_addr;
     }
diff --git a/www/boris/install.sh b/www/boris/install.sh
index f0198b5..32d63c4 100755
--- a/www/boris/install.sh
+++ b/www/boris/install.sh
@@ -63,13 +63,13 @@ printf ";
     }
 
     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 X-Forwarded-For $remote_addr;
     }
 
     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 X-Forwarded-For $remote_addr;
     }
diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh
index e8887a9..b7ffe07 100755
--- a/zen/gchange_INIT.sh
+++ b/zen/gchange_INIT.sh
@@ -120,7 +120,7 @@ sed -i "s/_UPDATED_/$updated/g" $wiki
 
 ## 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"
-# sed -i "s/Personnalisez/Amis de/g" $wiki
+# sed -i "s/Personnalisez/Amis de/g" $wiki
 
 # https:\/\/www.gchange.fr\/#\/app\/records\/wallet?q=$G1PUB
 ########################################################################
diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh
index 025c928..7ad3069 100755
--- a/zen/ipfs_SWARM_refresh.sh
+++ b/zen/ipfs_SWARM_refresh.sh
@@ -282,7 +282,7 @@ AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid);
 
 for PREFIX in F S A Y
 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
 done
 
@@ -342,7 +342,7 @@ echo "
  • " >> ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/index.html done diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index 4b1d4ec..acf70c5 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -59,7 +59,7 @@ do # [[ ! $(echo "${mediakey}" | grep "TMDB_") ]] && continue ## REFRESH ONLY TMDB (level 1), youtube is level 0 IPNSLINK=$(ipfs key list -l | grep ${mediakey} | cut -d ' ' -f 1) [[ "${IPNSLINK}" == "" ]] && continue ## prevent empty IPNSLINK - echo "We are refreshing http://127.0.0.1:8181/ipns/${IPNSLINK}" + echo "We are refreshing http://127.0.0.1:8080/ipns/${IPNSLINK}" count=$((count+1)) && echo "$count) " FILE_NAME=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.ipfs.filename) TITLE=$(cat ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/.title) @@ -99,7 +99,7 @@ do ZENBALANCE=$(echo "100 * $BALANCE" | bc -l | cut -d '.' -f 1) 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) ### This index.html is ipns link root, 1st welcome page for MEDIAKEY -> *** Redirect to CONTRACTS or LOGIN processing HERE *** @@ -131,7 +131,7 @@ do ## THIS MAKES FRENCH COPY RIGHT LAW RESPECT ## LOCALHOST REDIRECT FOR INTERNAL KODI DEFCON 3 (swarm.key) ASTROPORT STATION MODE - # echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html + # echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html # echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${mediakey}/${G1PUB}/index.html ## DEMO PERIOD @@ -197,7 +197,7 @@ do echo "$id REFRESHED ${I} 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) @@ -242,7 +242,7 @@ for ipnslink in $(ls ~/.zen/PIN/*/IPNSLINK 2>/dev/null | shuf ); do echo "$id PIN PUBLISH REFRESHED /ipfs/$NEWIPFS 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} diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index 0c9074e..9242304 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -24,7 +24,7 @@ echo "Adding ~/.zen/ipfs to IPFS" NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS) echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)" # 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 ## # TIME=$(ipfs cat /ipns/${IPFSNODEID}/.${IPFSNODEID}/.timestamp) diff --git a/zen/manage_stargates.sh b/zen/manage_stargates.sh index 80495dc..7dca797 100755 --- a/zen/manage_stargates.sh +++ b/zen/manage_stargates.sh @@ -39,11 +39,11 @@ else fi echo "******************************************************************" -echo "STARGATE1 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/1/stargate)" -echo "STARGATE2 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/2/stargate)" -echo "STARGATE3 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/3/stargate)" -echo "STARGATE4 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/4/stargate)" -echo "STARGATE5 http://127.0.0.1:8181/ipns/$(cat ~/.zen/key/5/stargate)" +echo "STARGATE1 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/1/stargate)" +echo "STARGATE2 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/2/stargate)" +echo "STARGATE3 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/3/stargate)" +echo "STARGATE4 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/4/stargate)" +echo "STARGATE5 http://127.0.0.1:8080/ipns/$(cat ~/.zen/key/5/stargate)" echo "******************************************************************" ######################################################################## @@ -91,7 +91,7 @@ for friendgate in $(ls -d ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/); do ;; esac 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 "" done diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index efda565..c043d27 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -19,7 +19,7 @@ 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) # ~/.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 # https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films ######################################################################## @@ -283,7 +283,7 @@ rm /tmp/.ipfsid ## EXPLANATIONS ######################################################################## # 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) @@ -332,13 +332,13 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html -# echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html +# echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html ######################################################################## ## 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 +[[ $(which xclip) ]] && echo "http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c ######################################################################## ######################################################################## @@ -380,7 +380,7 @@ then ######################################################################## # CREATION DU FICHIER ${PREFIX}ASTRXBIAN FILE : Add Header [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN ]] \ - && echo "CAT;TMDB;YEAR;TITLE;SAISON;GENRES;GROUPES;RES;URLS=http://127.0.0.1:8181" > ~/.zen/ipfs/.${IPFSNODEID}/astroport/kodi/vstream/${PREFIX}ASTRXBIAN + && 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 if [[ -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ]] @@ -436,9 +436,9 @@ fi ~/.zen/astrXbian/zen/ipns_self_publish.sh ######################################################################## echo "DUNIKEY PASS $PASS" -echo "NEW $TYPE ($file) ADDED. http://127.0.0.1:8181/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" -echo "INDEX UPDATED : http://127.0.0.1:8181/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN" -echo "VIDEO IPNS LINK : http://127.0.0.1:8181/ipns/$KEY/$G1PUB/" +echo "NEW $TYPE ($file) ADDED. http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" +echo "INDEX UPDATED : http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/${PREFIX}ASTRXBIAN" +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. diff --git a/zen/new_mp3_in_astroport.sh b/zen/new_mp3_in_astroport.sh index bda9b9d..eaba28c 100755 --- a/zen/new_mp3_in_astroport.sh +++ b/zen/new_mp3_in_astroport.sh @@ -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 # IPNS index.html Redirect to ipfs streaming link (could be contract or anything else !!) -echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/index.html +echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${INDEXPREFIX}${REFERENCE}/${G1PUB}/index.html IPNSLINK=$(ipfs key list -l | grep ${INDEXPREFIX}${REFERENCE} | cut -d ' ' -f 1) echo " @@ -149,6 +149,6 @@ echo "${TITLE}" > ~/.zen/PIN/${IPFSREPFILEID}/${IPNS}/.title rm -Rf ${YTEMP} 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 diff --git a/zen/refresh_ASTRXBIAN_index.sh b/zen/refresh_ASTRXBIAN_index.sh index f34632f..6fa2497 100755 --- a/zen/refresh_ASTRXBIAN_index.sh +++ b/zen/refresh_ASTRXBIAN_index.sh @@ -15,7 +15,7 @@ export IPFSNODEID=$(ipfs id -f='\n') for PREFIX in F A S do 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 ######################################################################## diff --git a/zen/stream/process-stream.sh b/zen/stream/process-stream.sh index e71c60c..2b94208 100755 --- a/zen/stream/process-stream.sh +++ b/zen/stream/process-stream.sh @@ -2,7 +2,7 @@ HLS_TIME=40 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)" diff --git a/zen/tools/MEDIAKEY_dunikey_pass_QR.sh b/zen/tools/MEDIAKEY_dunikey_pass_QR.sh index 7ee1666..7ccd088 100755 --- a/zen/tools/MEDIAKEY_dunikey_pass_QR.sh +++ b/zen/tools/MEDIAKEY_dunikey_pass_QR.sh @@ -2,7 +2,7 @@ # ADD QR/sec CODE & DUNIKEY TO MEDIAKEY # Fabrique ou récupère un PASS pour fabriquer le QRCode "privé" sécurisé avec openssl # ~/.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); do diff --git a/zen/tools/autoPINfriends.sh b/zen/tools/autoPINfriends.sh index 616fb6b..8479332 100755 --- a/zen/tools/autoPINfriends.sh +++ b/zen/tools/autoPINfriends.sh @@ -79,7 +79,7 @@ do ############################################ PINNING NODE MAKES ALL HIS FRIENDS MOVIES AVAILABLE TO ALL ## TODO : DECIDE TO ACTIVATE THIS BEHAVIOUR OR NOT ? ## 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 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 -- 2.39.2 From b658923dd8fa37e508403bae8ace4b46a7f4df47 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 18 Apr 2022 17:25:04 +0200 Subject: [PATCH 046/133] multiple tiddlywiki templates to sed. INCLUDE tiddlyipfs git add .! --- .install/templates/tiddlyipfs/index.html | 18803 +++++++++++++++++++++ 1 file changed, 18803 insertions(+) create mode 100644 .install/templates/tiddlyipfs/index.html diff --git a/.install/templates/tiddlyipfs/index.html b/.install/templates/tiddlyipfs/index.html new file mode 100644 index 0000000..77097fd --- /dev/null +++ b/.install/templates/tiddlyipfs/index.html @@ -0,0 +1,18803 @@ + + + + + + + + + + + + + + + + + + + + +Mon TiddlyWiki — un carnet de notes web personnel et non linéaire + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + -- 2.39.2 From 899e66be1f4b578da561098e456ce45f4d5f068a Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 11:53:30 +0200 Subject: [PATCH 047/133] yt-dlp --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 77d9b09..8f2775e 100755 --- a/install.sh +++ b/install.sh @@ -21,7 +21,7 @@ for i in git fail2ban inotify-tools curl net-tools libsodium* python3-dev python done #sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack html2text ssmtp sudo -y -for i in build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox nmap httrack html2text ssmtp imagemagick ttf-mscorefonts-installer libcurl4-openssl-dev; do +for i in build-essential qrencode jq bc 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 if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then sudo apt install -y $i fi -- 2.39.2 From e336648c31d7411b4b5e03c7182339c4b32e0c38 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 13:02:21 +0200 Subject: [PATCH 048/133] NOW INSTALL yt-dlp AND LINK TO youtube-dl --- .install/youtube-dl.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.install/youtube-dl.sh b/.install/youtube-dl.sh index f828cef..20c8481 100755 --- a/.install/youtube-dl.sh +++ b/.install/youtube-dl.sh @@ -4,11 +4,19 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" ######## YOUTUBE-DL ########## -if [[ $(which youtube-dl) ]]; then - 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 +## NOW INSTALL yt-dlp AND LINK TO youtube-dl +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 +youtube-dl -U -- 2.39.2 From c499d93c29d22b2f26bf894dff5dfc565bd921ea Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 13:03:38 +0200 Subject: [PATCH 049/133] install ipfs with full API.HTTPHeaders.Access-Control --- .install/ipfs_alone.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index eb031cd..a1dd6d7 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -25,12 +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 ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers echo "ipfs bootstrap list: " && ipfs bootstrap list - echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!" - echo "Please RUN : sudo service ipfs stop" - exit 1 + echo "ipfs daemon already running...!" + exit 0 fi -[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1 +[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 0 echo -e "Astroport IPFS Layer installation..." @@ -128,7 +127,8 @@ ipfs config --json Swarm.ConnMgr.LowWater 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-Methods '["PUT", "GET", "POST"]' -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### +ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' +######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### ipfs bootstrap rm --all ########################################### # BOOTSTRAP NODES ARE ADDED LATER -- 2.39.2 From f5fb5cd4fc2a54055a0eceec14109aa9a3702bfd Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 13:11:11 +0200 Subject: [PATCH 050/133] Install and link youtube-dl with yt-dlp --- .install/youtube-dl.sh | 2 +- cron_MINUTE.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.install/youtube-dl.sh b/.install/youtube-dl.sh index 20c8481..72352cb 100755 --- a/.install/youtube-dl.sh +++ b/.install/youtube-dl.sh @@ -19,4 +19,4 @@ if [[ ! -f /usr/local/bin/yt-dlp ]]; then fi ## UPGRADE TO LATEST -youtube-dl -U +ls -al /usr/local/bin/youtube-dl diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index e7a109d..c501e20 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -294,12 +294,12 @@ echo ' # GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. LIBRE WE ARE. #################################################################### # 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 -U - ### 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. ################################################################## -- 2.39.2 From 22b006ea9ff361e08b023e7f483bc509c00929aa Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 16:10:31 +0200 Subject: [PATCH 051/133] add tiddler & www page pdf copy --- ajouter_video.sh | 28 ++++++++++++++++++++++------ zen/new_file_in_astroport.sh | 3 +-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 45ef817..df584ba 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -219,9 +219,10 @@ rm -Rf ${YTEMP} FILE_NAME="index.html" REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6" MEDIAID="$REVSOURCE" # MEDIAID=1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ - MEDIAKEY="PAGE_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ + MEDIAKEY="WWW_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_ FILE_PATH="$HOME/astroport/web/$MEDIAID"; mkdir -p $FILE_PATH + wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/${FILE_NAME} echo "web;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt @@ -237,17 +238,17 @@ rm -Rf ${YTEMP} ## record one page to PDF [[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1 - cd /tmp/ && rm output.pdf && chromium --headless --no-sandbox --print-to-pdf $URL + 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 FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)" MEDIAKEY="PAGE_${MEDIAID}" FILE_PATH="$HOME/astroport/page/$MEDIAID" - mkdir -p ${FILE_PATH} && mv -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 @@ -547,7 +548,20 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N [[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB" timestamp=$(date -u +%s%N | cut -b1-13) -echo "MEDIAKEY=${MEDIAKEY} + +## Creation json tiddler +echo '[ + { + "text": "", + "title": "'${TITLE}'", + "type": "video/mp4", + "tags": "$:/isAttachment $:/isIpfs", + "_canonical_uri": "/ipfs/_IPFS_" + } +] +' > ~/astroport/Add_${MEDIAKEY}_tittler.json + +[[ $CHOICE == "TMDB" ]] && echo "MEDIAKEY=${MEDIAKEY} echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" read reponse if [[ \$reponse ]]; then @@ -565,6 +579,8 @@ read finish rm ~/astroport/Add_${MEDIAKEY}_script.sh " > ~/astroport/Add_${MEDIAKEY}_script.sh + + chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh ## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index c043d27..c0186af 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -315,8 +315,7 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) | sed "s/\${XZUID}/$XZUID/g" \ | sed "s/\${G1PUB}/$G1PUB/g" \ | sed "s/\${TITLE}/$TITLE/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIA - KEY}/index.html + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html ## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html # https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/ -- 2.39.2 From 50583fc411d9fc739fedf82b1755ed94ee4198f8 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 17:15:18 +0200 Subject: [PATCH 052/133] PAGE is now recorded in Astroport as pdf + tiddler.json ready to load --- ajouter_video.sh | 30 +++++++++++------------------- zen/new_file_in_astroport.sh | 30 ++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index df584ba..a915204 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -234,7 +234,7 @@ rm -Rf ${YTEMP} # CASE ## PAGE page) - 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' ## 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 @@ -549,35 +549,27 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N timestamp=$(date -u +%s%N | cut -b1-13) -## Creation json tiddler -echo '[ - { - "text": "", - "title": "'${TITLE}'", - "type": "video/mp4", - "tags": "$:/isAttachment $:/isIpfs", - "_canonical_uri": "/ipfs/_IPFS_" - } -] -' > ~/astroport/Add_${MEDIAKEY}_tittler.json -[[ $CHOICE == "TMDB" ]] && echo "MEDIAKEY=${MEDIAKEY} -echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" +echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh +[[ $CHOICE == "TMDB" ]] && echo "\"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" 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 - ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" -fi -rm -f /tmp/\${MEDIAKEY}.pass +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 + +[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh + +echo "rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS echo 'Si tout est OK, appuyez dur ENTER, sinon ESC' read finish rm ~/astroport/Add_${MEDIAKEY}_script.sh -" > ~/astroport/Add_${MEDIAKEY}_script.sh +" >> ~/astroport/Add_${MEDIAKEY}_script.sh diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index c0186af..14984f3 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -51,9 +51,11 @@ TITLE="${file%.*}" # GET XZUID [[ -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 -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) }') +echo $CAT + PREFIX=$(echo "$TYPE" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, Y, M ou Y # File is placed in ROOT ~/astroport ? if [[ $PREFIX == "" ]] @@ -78,6 +80,12 @@ case ${CAT} in REFERENCE=$(echo "$path" | cut -d '/' -f 6 ) TITLE="${file%.*}" ;; + page) + ## DIFFERENT TREATMENT + INDEXPREFIX="PAGE_" + REFERENCE=$(echo "$path" | cut -d '/' -f 6 ) + TITLE="${file%.*}" + ;; mp3) ## DIFFERENT TREATMENT INDEXPREFIX="MP3_" @@ -361,10 +369,10 @@ IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) ######################################################################## # film/serie PUBLISH "ajouter_video.txt" for KODI ######################################################################## -if [[ "${CAT}" =~ ^(film|serie|youtube)$ ]] +if [[ "${CAT}" =~ ^(film|serie|youtube|page)$ ]] then ## 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}" != "youtube" && "${CAT}" != "page" ]] 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) @@ -397,12 +405,26 @@ then echo "$line" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ajouter_video.txt ## UPDATE SOURCE ajouter_video.txt FILE 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 ######################################################################## - 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 + +MIME=$(file --mime-type ${path}${file} | cut -d ' ' -f 2) +echo "## Creation json tiddler" +echo '[ + { + "text": "", + "title": "'${TITLE}'", + "type": "'$MIME'", + "tags": "$:/isAttachment $:/isIpfs", + "_canonical_uri": "/ipfs/'$IPFSREPFILEID'/'$URLENCODE_FILE_NAME'" + } +] +' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.tiddler.json + fi ######################################################################## -- 2.39.2 From d4e820b3939c7a93ef28e2ef4af4254a6d7dbaff Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 17:24:29 +0200 Subject: [PATCH 053/133] more detailed tiddler --- zen/new_file_in_astroport.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 14984f3..83b20ff 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -418,12 +418,15 @@ echo '[ { "text": "", "title": "'${TITLE}'", - "type": "'$MIME'", + "type": "'${MIME}'", + "cat": "'${CAT}'", + "mediakey": "'${MEDIAKEY}'", + "ipns": "'${IPNS}'", "tags": "$:/isAttachment $:/isIpfs", - "_canonical_uri": "/ipfs/'$IPFSREPFILEID'/'$URLENCODE_FILE_NAME'" + "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" } ] -' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.tiddler.json +' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json fi -- 2.39.2 From f2cd8ba18c936faedc72556c1e19587eebc8a6d5 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 17:55:49 +0200 Subject: [PATCH 054/133] remove -x debug mode --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index a915204..4491cbe 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash ######################################################################## # Author: Fred (support@qo-op.com) # Version: 0.1 -- 2.39.2 From ac39d2e24b2413c4d934220970a925471e0c118d Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 18:28:40 +0200 Subject: [PATCH 055/133] ~/astroport/${TYPE}/${MEDIAKEY}.dragdrop.json --- zen/new_file_in_astroport.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 83b20ff..e51efb1 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -412,7 +412,7 @@ then 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 -MIME=$(file --mime-type ${path}${file} | cut -d ' ' -f 2) +MIME=$(file --mime-type "${path}${file}" | cut -d ' ' -f 2) echo "## Creation json tiddler" echo '[ { @@ -426,7 +426,7 @@ echo '[ "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" } ] -' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json +' > ~/astroport/${TYPE}/${MEDIAKEY}.dragdrop.json fi -- 2.39.2 From c1e9e2a5c1a610b7f16a3e1d4189b35281e93808 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 19:08:36 +0200 Subject: [PATCH 056/133] getting back IPNS in case there is no peers in swarm --- ajouter_video.sh | 6 ++++-- zen/new_file_in_astroport.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 4491cbe..08b0765 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -560,7 +560,7 @@ if [[ \$reponse ]]; then ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\" 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 +echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" " >> ~/astroport/Add_${MEDIAKEY}_script.sh [[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh @@ -614,6 +614,8 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then - [ $? == 0 ] && zenity --warning --width 300 --text "OK! script de transfert ~/astroport/Add_${MEDIAKEY}_script.sh créé. Lancez le pour terminer l'ajout à Astroport" && exit 0 \ + [ $? == 0 ] && \ + zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh prêt. Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh || exit 0 \ || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index e51efb1..11213d3 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -360,7 +360,7 @@ NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 echo $NEWIPFS > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/.chain IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) -[[ "$IPNS" == "" ]] && echo "~~~ PROBLEM ~~~ ipfs name publish --quieter --key=${MEDIAKEY} $NEWIPFS" +[[ "$IPNS" == "" ]] && echo "~~~ PROBLEM ~~~ ipfs name publish --quieter --key=${MEDIAKEY} $NEWIPFS" && IPNS="$(ipfs key list -l | grep -w ${MEDIAKEY} | cut -f 1 -d ' ')" ######################################################################## ######################################################################## @@ -412,7 +412,10 @@ then 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 -MIME=$(file --mime-type "${path}${file}" | cut -d ' ' -f 2) + +MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ' ' -f 2) +echo "pause ${IPNS} ${MIME}" && read + echo "## Creation json tiddler" echo '[ { @@ -420,8 +423,10 @@ echo '[ "title": "'${TITLE}'", "type": "'${MIME}'", "cat": "'${CAT}'", + "file": "'${file}'", "mediakey": "'${MEDIAKEY}'", "ipns": "'${IPNS}'", + "tmdb": "'${REFERENCE}'", "tags": "$:/isAttachment $:/isIpfs", "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" } -- 2.39.2 From ae33326041023a640ec0a095cfacaff47457e207 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 19:11:50 +0200 Subject: [PATCH 057/133] IPNS="$(ipfs key list -l | grep -w ${MEDIAKEY} | cut -f 1 -d ' ')" --- zen/new_file_in_astroport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 11213d3..c2eaf5b 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -379,7 +379,7 @@ then echo $GOFFER > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad NEWIPFS=$(ipfs add -rHq ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/ | tail -n 1 ) IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) - + [[ "$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)" fi -- 2.39.2 From e683c731a86eb5511a28069f648b51234f31165c Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 19:14:16 +0200 Subject: [PATCH 058/133] remove pause debug --- zen/new_file_in_astroport.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index c2eaf5b..dba5af6 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -414,7 +414,6 @@ then MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ' ' -f 2) -echo "pause ${IPNS} ${MIME}" && read echo "## Creation json tiddler" echo '[ -- 2.39.2 From 63037a03667a96b6657139d8e7ff2d262db802cd Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 20:20:04 +0200 Subject: [PATCH 059/133] Copy les tiddler json vers Bureau/Journal --- ajouter_video.sh | 15 ++++++++++----- zen/new_file_in_astroport.sh | 7 ++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 08b0765..e669c85 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -211,8 +211,6 @@ rm -Rf ${YTEMP} # CASE ## WEB web) - zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal' - ## wget current URL -> index.html ## TEST ## TEST httrack ?? [[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1 echo "httrack --mirror $URL" @@ -223,10 +221,12 @@ rm -Rf ${YTEMP} FILE_PATH="$HOME/astroport/web/$MEDIAID"; 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 + zenity --warning --width ${large} --text "Vérifiez que la copie de votre site se trouve bien dans ${FILE_PATH}/" + ;; @@ -234,8 +234,6 @@ rm -Rf ${YTEMP} # CASE ## PAGE page) - zenity --warning --width 600 --text 'DEV . ZONE . Please Participate https://git.p2p.legal' - ## record one page to PDF [[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1 cd /tmp/ && rm -f output.pdf @@ -444,6 +442,7 @@ else fi FILE_NAME="${TITLE}.${FILE_EXT}" + ## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" 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 @@ -533,6 +532,12 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i 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 echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index dba5af6..6883b91 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -430,7 +430,11 @@ echo '[ "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" } ] -' > ~/astroport/${TYPE}/${MEDIAKEY}.dragdrop.json +' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json + +# COPY TO DESKTOP Journal +[[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/ +[[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/ fi @@ -471,4 +475,5 @@ echo "#### EXCECUTION TIME" end=`date +%s` echo Execution time was `expr $end - $start` seconds. echo "########################################################################" +zenity --warning --width 300 --text "Votre MEDIA a rejoint ASTROPORT en `expr $end - $start` secondes" exit 0 -- 2.39.2 From 33906a35d446befb411e7c3f222d55790363844d Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 20:32:37 +0200 Subject: [PATCH 060/133] Script was stuck running background with h265 conversion question. --- ajouter_video.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index e669c85..6c86457 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -556,9 +556,10 @@ timestamp=$(date -u +%s%N | cut -b1-13) echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh -[[ $CHOICE == "TMDB" ]] && echo "\"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER pour continuer sans...\" -read reponse -if [[ \$reponse ]]; then +[[ $CHOICE == "TMDB" ]] && 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\" @@ -621,6 +622,6 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then [ $? == 0 ] && \ zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh prêt. Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ - [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh || exit 0 \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "no" || exit 0 \ || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi -- 2.39.2 From c31099c7a61addcd05a6ad2affc922db2fe097a1 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 20:34:47 +0200 Subject: [PATCH 061/133] AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT --- ajouter_video.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 6c86457..5fa3aa9 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -555,8 +555,9 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N timestamp=$(date -u +%s%N | cut -b1-13) +## AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh -[[ $CHOICE == "TMDB" ]] && 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 ]] \&\& read reponse if [[ \! \$reponse ]]; then -- 2.39.2 From 2240e01373729a05dc5d13c562338077c43d05cf Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 22 Apr 2022 20:41:30 +0200 Subject: [PATCH 062/133] FILE_SIZE --- ajouter_video.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 5fa3aa9..9368de4 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -602,8 +602,8 @@ MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY) ######################################################################## echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY" ######################################################################## -FILE_SIZE=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.filesize) -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_BSIZE=$(du -b "$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}" | awk '{print $1}') +FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }') #G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) #if [[ $G1BALANCE -gt 0 ]]; then @@ -622,7 +622,7 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then [ $? == 0 ] && \ - zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh prêt. Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ + 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 "no" || exit 0 \ || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi -- 2.39.2 From cc549848adcbd37b8a817a5771fff730edc3781d Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 00:26:31 +0200 Subject: [PATCH 063/133] new tiddler json format --- zen/new_file_in_astroport.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 6883b91..bf5d62a 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -413,21 +413,23 @@ then 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 -MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ' ' -f 2) +MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) +# [[ echo "$MIME" | grep 'video' ]] && TEXT='' || TEXT='' echo "## Creation json tiddler" echo '[ { - "text": "", + "text": "'${TEXT}'", "title": "'${TITLE}'", "type": "'${MIME}'", "cat": "'${CAT}'", + "ipfsroot": "'${IPFSREPFILEID}'", "file": "'${file}'", "mediakey": "'${MEDIAKEY}'", "ipns": "'${IPNS}'", "tmdb": "'${REFERENCE}'", - "tags": "$:/isAttachment $:/isIpfs", - "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" + "tags": "$:/isAttachment $:/isIpfs '${CAT}'", + "_canonical_uri": "/ipfs/'${IPFSID}'" } ] ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json -- 2.39.2 From 21ca6b213c02973e66a81f2b03b019d2cfc23ccc Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 02:31:40 +0200 Subject: [PATCH 064/133] fixings --- ajouter_video.sh | 2 +- install.sh | 2 +- zen/new_file_in_astroport.sh | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 9368de4..09d1001 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -146,7 +146,7 @@ if [[ ! -f /usr/local/bin/youtube-dl ]]; then 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=720]/best' \ +/usr/local/bin/youtube-dl -f '[height=360]/best' \ --no-playlist --write-info-json --write-annotations --write-auto-subs --sub-lang "*" \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL diff --git a/install.sh b/install.sh index 8f2775e..ac803bb 100755 --- a/install.sh +++ b/install.sh @@ -21,7 +21,7 @@ for i in git fail2ban inotify-tools curl net-tools libsodium* python3-dev python done #sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils v4l-utils vlc mp3info musl-dev openssl* cargo detox httrack html2text ssmtp sudo -y -for i in build-essential qrencode jq bc gawk 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 +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 if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then sudo apt install -y $i fi diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index bf5d62a..53313d7 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -369,10 +369,10 @@ IPNS=$(ipfs name publish --quieter --key="${MEDIAKEY}" $NEWIPFS) ######################################################################## # film/serie PUBLISH "ajouter_video.txt" for KODI ######################################################################## -if [[ "${CAT}" =~ ^(film|serie|youtube|page)$ ]] +if [[ "${CAT}" =~ ^(film|serie|youtube|page|video)$ ]] then ## CREATE GCHANGE AD - if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad && "${CAT}" != "youtube" && "${CAT}" != "page" ]] + if [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.gchange.ad && ( "${CAT}" == "film" || "${CAT}" == "serie") ]] 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) @@ -414,7 +414,16 @@ then MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) -# [[ echo "$MIME" | grep 'video' ]] && TEXT='' || TEXT='' +if [[ $(echo "$MIME" | grep 'video') ]]; then + TEXT='

    '${TITLE}'

    ' + MIME="txt/html" + TAGS="${CAT}" + CANON='' +else + TEXT='' + TAGS='$:/isAttachment $:/isIpfs '${CAT} + CANON="/ipfs/"${IPFSID} +fi echo "## Creation json tiddler" echo '[ @@ -428,8 +437,8 @@ echo '[ "mediakey": "'${MEDIAKEY}'", "ipns": "'${IPNS}'", "tmdb": "'${REFERENCE}'", - "tags": "$:/isAttachment $:/isIpfs '${CAT}'", - "_canonical_uri": "/ipfs/'${IPFSID}'" + "tags": "'${TAGS}'", + "_canonical_uri": "'${CANON}'" } ] ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json -- 2.39.2 From f0abc89769d8ddcdd53ed6efe1e2fffc2f5bf557 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 02:43:04 +0200 Subject: [PATCH 065/133] subs error --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 09d1001..bb9a6b3 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -147,7 +147,7 @@ if [[ ! -f /usr/local/bin/youtube-dl ]]; then sudo chmod a+rx /usr/local/bin/youtube-dl fi /usr/local/bin/youtube-dl -f '[height=360]/best' \ ---no-playlist --write-info-json --write-annotations --write-auto-subs --sub-lang "*" \ +--no-playlist --write-info-json \ --no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL # Get filename, extract ID, make destination dir and move copy. -- 2.39.2 From ef25f477c07c1f9f329680461c487fbfcea15baa Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 03:41:20 +0200 Subject: [PATCH 066/133] video tag --- zen/new_file_in_astroport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 53313d7..ef6d00f 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -415,7 +415,7 @@ then MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) if [[ $(echo "$MIME" | grep 'video') ]]; then - TEXT='

    '${TITLE}'

    ' + TEXT="

    "${TITLE}"

    " MIME="txt/html" TAGS="${CAT}" CANON='' -- 2.39.2 From 19129c3bf10eca17fe3c092fbc7b83faa4bc7cff Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 03:47:27 +0200 Subject: [PATCH 067/133] tiddler astroport tag --- zen/new_file_in_astroport.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index ef6d00f..7b5ba67 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -417,11 +417,11 @@ MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d if [[ $(echo "$MIME" | grep 'video') ]]; then TEXT="

    "${TITLE}"

    " MIME="txt/html" - TAGS="${CAT}" + TAGS="${CAT} astroport" CANON='' else TEXT='' - TAGS='$:/isAttachment $:/isIpfs '${CAT} + TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} CANON="/ipfs/"${IPFSID} fi -- 2.39.2 From d2c3925455833533813879d8330cc53e6491788f Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 03:55:50 +0200 Subject: [PATCH 068/133] Add GENRE tag --- zen/new_file_in_astroport.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 7b5ba67..7aa273f 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -412,16 +412,16 @@ then 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 - +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) if [[ $(echo "$MIME" | grep 'video') ]]; then TEXT="

    "${TITLE}"

    " MIME="txt/html" - TAGS="${CAT} astroport" + TAGS="${CAT} astroport $GENRE" CANON='' else TEXT='' - TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} + TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE CANON="/ipfs/"${IPFSID} fi -- 2.39.2 From 616adfa6ecf6c918ebb3dd1630b1756836ab24ba Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 19:40:59 +0200 Subject: [PATCH 069/133] # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} & Clipboard paste Ctrl+V --- ajouter_video.sh | 6 ++--- zen/new_file_in_astroport.sh | 43 +++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index bb9a6b3..503de11 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -33,12 +33,12 @@ URL="$1" if [ $URL ]; then echo "URL: $URL" REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_" - [ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="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" CHOICE="$IMPORT" 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=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Cette source Web est à enregistrer comme " --entry-text="Page" WebSite) # REMOVE GtkDialog errors for zenity shopt -s expand_aliases @@ -623,6 +623,6 @@ cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then [ $? == 0 ] && \ 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 "no" || exit 0 \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "no"; zenity --question --width 300 --text "Collez le résultat dans votre Journal. FIN."; || exit 0 \ || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 fi diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 7aa273f..e28b7a3 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -344,9 +344,6 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) ## 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:8080/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME" | xclip -selection c - ######################################################################## ######################################################################## ## PUBLISH new IPNS @@ -412,21 +409,21 @@ then 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 -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) -if [[ $(echo "$MIME" | grep 'video') ]]; then - TEXT="

    "${TITLE}"

    " - MIME="txt/html" - TAGS="${CAT} astroport $GENRE" - CANON='' -else - TEXT='' - TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE - CANON="/ipfs/"${IPFSID} -fi + 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) + if [[ $(echo "$MIME" | grep 'video') ]]; then + TEXT="

    "${TITLE}"

    " + MIME="txt/html" + TAGS="${CAT} astroport $GENRE" + CANON='' + else + TEXT='' + TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE + CANON="/ipfs/"${IPFSID} + fi -echo "## Creation json tiddler" -echo '[ + echo "## Creation json tiddler" + echo '[ { "text": "'${TEXT}'", "title": "'${TITLE}'", @@ -443,12 +440,18 @@ echo '[ ] ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json -# COPY TO DESKTOP Journal -[[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/ -[[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/ + # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} + [[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json + [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json 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 ######################################################################## -- 2.39.2 From 76198f678f014725c1300fb33043ca06b738d094 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 21:23:13 +0200 Subject: [PATCH 070/133] =?UTF-8?q?capture=20votre=20=C3=A9cran=20comme=20?= =?UTF-8?q?vignette=20/ipfs/$SCREENDIR/screen.png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ajouter_video.sh | 17 +++++++++++------ zen/new_file_in_astroport.sh | 11 +++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 503de11..8d411af 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -56,8 +56,8 @@ 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/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) -# zenity --warning --width 300 --text "Ajoutez un MEDIA dans ASTROPORT" - +zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" +import -window root /tmp/screen.png ######################################################################## ## CADRE EXCEPTION COPIE PRIVE @@ -263,7 +263,7 @@ rm -Rf ${YTEMP} ######################################################################## 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 YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)" @@ -350,12 +350,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') ?" [ $? == 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 -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 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 +MEDIAID=$CMED MEDIAKEY="TMDB_$MEDIAID" # VIDEO TITLE @@ -434,6 +438,8 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" ################################### 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}/ + if [ $? == 0 ]; then zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..." else @@ -619,7 +625,6 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; echo "${MEDIAKEY} = RECORDED TO IPFS." cat /tmp/${MEDIAKEY}.log - if [ ! $2 ]; then [ $? == 0 ] && \ zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index e28b7a3..8850fa7 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -284,7 +284,10 @@ rm /tmp/.ipfsid ## ADD "ajouter_video.txt" and "video.json" will be SELF IPNS publish data ## ENCRYPT TO STOP CLEAR DATA LEAKING [[ -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ -[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ && 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}/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}/ ######################################################################## ######################################################################## @@ -413,7 +416,7 @@ then MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2) if [[ $(echo "$MIME" | grep 'video') ]]; then TEXT="

    "${TITLE}"

    " - MIME="txt/html" + MIME="text/vnd.tiddlywiki" TAGS="${CAT} astroport $GENRE" CANON='' else @@ -422,6 +425,9 @@ then CANON="/ipfs/"${IPFSID} fi + ## Add screen + SCREENDIR=$(ipfs add -wq "${path}screen.png" | tail -n 1) + echo "## Creation json tiddler" echo '[ { @@ -429,6 +435,7 @@ then "title": "'${TITLE}'", "type": "'${MIME}'", "cat": "'${CAT}'", + "poster": "'${SCREENDIR}/screen.png'", "ipfsroot": "'${IPFSREPFILEID}'", "file": "'${file}'", "mediakey": "'${MEDIAKEY}'", -- 2.39.2 From a016819b876103d98b9c85d44f693a94f93a2a00 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 23 Apr 2022 22:26:14 +0200 Subject: [PATCH 071/133] publish "mime": "'${REAL}'", --- zen/new_file_in_astroport.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 8850fa7..5f7a18d 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -414,6 +414,7 @@ then 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="

    "${TITLE}"

    " MIME="text/vnd.tiddlywiki" @@ -434,6 +435,7 @@ then "text": "'${TEXT}'", "title": "'${TITLE}'", "type": "'${MIME}'", + "mime": "'${REAL}'", "cat": "'${CAT}'", "poster": "'${SCREENDIR}/screen.png'", "ipfsroot": "'${IPFSREPFILEID}'", -- 2.39.2 From a18a8d220dbd3f1019df1b5c176554a427ab5409 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Apr 2022 16:37:49 +0200 Subject: [PATCH 072/133] separate .install/kodi_uqload_downloader.sh --- .install/kodi_uqload_downloader.sh | 28 ++++++++++++++++++++++++++++ ajouter_video.sh | 25 ------------------------- zen/ipfs_SWARM_refresh.sh | 3 ++- 3 files changed, 30 insertions(+), 26 deletions(-) create mode 100755 .install/kodi_uqload_downloader.sh diff --git a/.install/kodi_uqload_downloader.sh b/.install/kodi_uqload_downloader.sh new file mode 100755 index 0000000..fb0342a --- /dev/null +++ b/.install/kodi_uqload_downloader.sh @@ -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 diff --git a/ajouter_video.sh b/ajouter_video.sh index 8d411af..6f10383 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -501,31 +501,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 ######################################################################## diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 7ad3069..b109434 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -146,7 +146,8 @@ do if [[ ! $IsAlreadythere ]]; then 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[.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 ################################################################ echo "## REFRESH stargates keys from my friend" -- 2.39.2 From 2c19940ebb9e5c9c1e2063a467860a8f9815ea14 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Apr 2022 16:44:12 +0200 Subject: [PATCH 073/133] =?UTF-8?q?##=20Ajouter=20confirmation=20=C3=A0=20?= =?UTF-8?q?chaque=20nouvelle=20=C3=A9tape=20(+explications)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ac803bb..d943ac0 100755 --- a/install.sh +++ b/install.sh @@ -11,7 +11,8 @@ if [[ ! -f ~/.zen/secret.june ]]; then # Check requirements -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é" +echo "Appuyez sur ENTRER pour commencer."; read TEST; [[ "$TEST" != "" ]] && echo "SORTIE"; exit 0 ## Ajouter confirmation à chaque nouvelle étape (+explications) sudo apt-get update #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 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 -- 2.39.2 From cab9290bb9939b24b9c8a092f8e13da3f664fc05 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Apr 2022 17:22:32 +0200 Subject: [PATCH 074/133] work in progress --- install.sh | 83 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/install.sh b/install.sh index d943ac0..c27dd7f 100755 --- a/install.sh +++ b/install.sh @@ -3,58 +3,84 @@ # Version: 0.3 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## -{ +{MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + [ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 -# MAIN # +# MAIN # SI AUCUNE CLEF DE STATION... if [[ ! -f ~/.zen/secret.june ]]; then # Check requirements -echo "AstrXbian installateur pour distributions DEBIAN et dérivées : LinuxMint (https://www.linuxmint.com/) ou XBIAN (https://xbian.org) recommandé" +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 ; echo "Mise à jour des dépots de votre distribution..." sudo apt-get update -#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 + +[[ "$USER" != "xbian" ]] &&\ + for i in x11-utils xclip zenity handbrake*; do\ + [ $(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 if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" 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 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 if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" sudo apt install -y $i fi done +[[ ! $(which kodi) && "$USER" != "xbian" ]] &&\ + echo ">>> Installation Kodi + Vstream = VOTRE VIDEOTHEQUE ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ + sudo apt-get install kodi -y;\ + ${MY_PATH}/.install/kodi_uqload_downloader.sh + +echo "## INSTALLATION OpenCV = 'IA Amicale' " +sudo apt-get install python3-opencv -y + ## 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 -[[ ! $(which kodi) && "$USER" != "xbian" ]] && sudo apt-get install kodi -y -sudo apt-get install python3-opencv -y ## INSTALLATION IA par reconnaissance d'images -[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils xclip zenity handbrake* -y 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 + echo "########################################################################" + echo "## INSTALL PASSERELLE HTTP(S) #######################################"; echo ; 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 + echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" sudo apt install -y $i fi done +else + echo ">>> WARNING <<< Apache détecté - Vous devrez réaliser la configuration de votre passerelle par vous même..." fi -## INSTALL PYTHON CRYPTO LAYER -echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc +## GIVE ACCESS TO www-data group +sudo usermod -aG www-data $USER + +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 -if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER - echo "SOUHAITEZ VOUS AJOUTER UNE IMPRIMANTE A QR CODE? saisissez OUI, sinon tapez sur ENTREE" + +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 @@ -64,33 +90,32 @@ if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER 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 "=== Clonage git CODE astrXbian depuis https://git.p2p.legal" mkdir -p ~/.zen cd ~/.zen git clone https://git.p2p.legal/axiom-team/astrXbian.git ######################################################################## -echo "IMPORT configuration ASTROPORT dans ~/.kodi" +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 +[[ ! $(which ipfs) ]] && 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)" +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 ## #[....] 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 @@ -131,18 +156,20 @@ sudo chown -R $USER:$wwwuser ~/astroport/www sudo chmod -R g+rw ~/astroport/www ####################################################################### -## CREATE symlinks for ~/.zen/www/swarm & me +## CREATE symlinks for ~/.zen/www/swarm & me ## OLD PHP METHOD ## TO REMOVE... 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 -## https://darktrojan.github.io/openwith/webextension.html -# https://addons.mozilla.org/firefox/addon/open-with/ -# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno +echo "## INSTALL open_with_linux.py ## +## https://darktrojan.github.io/openwith/webextension.html" ~/.zen/astrXbian/open_with_linux.py install +echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !! +# https://addons.mozilla.org/firefox/addon/open-with/ +# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno" + if [[ "$USER" != "xbian" ]] then ## Desktop install -- 2.39.2 From b51899157bf365e30f48ae443d0f764e189230ac Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Apr 2022 18:27:28 +0200 Subject: [PATCH 075/133] error at the end --- ajouter_video.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 6f10383..ba2fbe6 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -555,7 +555,7 @@ echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${M echo "rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS echo 'Si tout est OK, appuyez dur ENTER, sinon ESC' -read finish +[[ \! \$1 ]] && read finish rm ~/astroport/Add_${MEDIAKEY}_script.sh " >> ~/astroport/Add_${MEDIAKEY}_script.sh @@ -597,12 +597,11 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; #fi ######################################################################## ######################################################################## -echo "${MEDIAKEY} = RECORDED TO IPFS." -cat /tmp/${MEDIAKEY}.log if [ ! $2 ]; then - [ $? == 0 ] && \ 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 "no"; zenity --question --width 300 --text "Collez le résultat dans votre Journal. FIN."; || exit 0 \ - || zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"; zenity --warning --width 300 --text "Collez le résultat dans votre Journal. FIN."; fi +[ $? != 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log"; exit 1 +echo "${MEDIAKEY} = RECORDED TO IPFS." +cat /tmp/${MEDIAKEY}.log -- 2.39.2 From 73d7c855526f0f089e596c4523167c4b9f2d3678 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Apr 2022 11:27:33 +0200 Subject: [PATCH 076/133] write ~/astroport/Add_${MEDIAKEY}_script.sh for later batch import --- ajouter_video.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index ba2fbe6..977e818 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -540,8 +540,8 @@ timestamp=$(date -u +%s%N | cut -b1-13) 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 +[[ ! \$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\" @@ -555,7 +555,7 @@ echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${M echo "rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS echo 'Si tout est OK, appuyez dur ENTER, sinon ESC' -[[ \! \$1 ]] && read finish +[[ ! \$1 ]] && read finish rm ~/astroport/Add_${MEDIAKEY}_script.sh " >> ~/astroport/Add_${MEDIAKEY}_script.sh -- 2.39.2 From 41782ddca52b88a1cb373a635c56c99989a8e2c2 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Apr 2022 13:30:08 +0200 Subject: [PATCH 077/133] nicotine-plus as soulseek network client --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index c27dd7f..72c0c98 100755 --- a/install.sh +++ b/install.sh @@ -78,6 +78,7 @@ echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo python3 -m pip install -U pip python3 -m pip install -U setuptools wheel python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy +python3 -m pip install -U nicotine-plus 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" -- 2.39.2 From 109199dbab20b31eea9d90404a817daed04ec7bc Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Apr 2022 22:14:04 +0200 Subject: [PATCH 078/133] check DISPLAY not an X11 export --- ajouter_video.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 977e818..b28221e 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -57,7 +57,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" -import -window root /tmp/screen.png +[[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png ######################################################################## ## CADRE EXCEPTION COPIE PRIVE -- 2.39.2 From f72f4269bb51c0791383e625c8668211524c174a Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 28 Apr 2022 01:27:45 +0200 Subject: [PATCH 079/133] screen.png --- ajouter_video.sh | 4 +++- zen/new_file_in_astroport.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index b28221e..63a934d 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -57,8 +57,10 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" +sleep 1 [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png + ######################################################################## ## CADRE EXCEPTION COPIE PRIVE # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ @@ -438,7 +440,7 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" ################################### 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}/ +mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/screen.png 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..." diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 5f7a18d..42c4b6f 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -427,7 +427,7 @@ then fi ## Add screen - SCREENDIR=$(ipfs add -wq "${path}screen.png" | tail -n 1) + SCREENDIR=$(ipfs add -wq "$HOME/astroport/${TYPE}/${REFERENCE}/screen.png" | tail -n 1) echo "## Creation json tiddler" echo '[ -- 2.39.2 From b0b924759217982344bcca2a202830bbdc620375 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 28 Apr 2022 20:26:19 +0200 Subject: [PATCH 080/133] NO _canonical_uri if empty --- zen/new_file_in_astroport.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 42c4b6f..154a60a 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -437,18 +437,24 @@ then "type": "'${MIME}'", "mime": "'${REAL}'", "cat": "'${CAT}'", - "poster": "'${SCREENDIR}/screen.png'", + "screenshot": "'${SCREENDIR}/screen.png'", "ipfsroot": "'${IPFSREPFILEID}'", "file": "'${file}'", "mediakey": "'${MEDIAKEY}'", "ipns": "'${IPNS}'", "tmdb": "'${REFERENCE}'", - "tags": "'${TAGS}'", + "tags": "'${TAGS}'" ' + [[ ${CANON} != "" ]] && echo ', "_canonical_uri": "'${CANON}'" } ] ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.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 ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json -- 2.39.2 From 0daaf2e86b48ca916e89cf4bfecd0b723a2d568c Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 28 Apr 2022 20:37:50 +0200 Subject: [PATCH 081/133] !missing json part --- zen/new_file_in_astroport.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 154a60a..2218e9a 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -443,12 +443,15 @@ then "mediakey": "'${MEDIAKEY}'", "ipns": "'${IPNS}'", "tmdb": "'${REFERENCE}'", - "tags": "'${TAGS}'" ' + "tags": "'${TAGS}'" ' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json + [[ ${CANON} != "" ]] && echo ', - "_canonical_uri": "'${CANON}'" + "_canonical_uri": "'${CANON}'"' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json + + echo ' } ] -' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json +' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json # Will be used by caroussel.html template # CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1) -- 2.39.2 From 8c3caeb4b799bcd9282e5bdff9cf0d0e6c226fcc Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 3 May 2022 16:45:52 +0200 Subject: [PATCH 082/133] Add visitor monitoring --- www/boris/inc/footer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/boris/inc/footer.php b/www/boris/inc/footer.php index 12c04fe..fc53e4e 100644 --- a/www/boris/inc/footer.php +++ b/www/boris/inc/footer.php @@ -9,5 +9,13 @@ ~/.zen/AstXbian/www/boris × Voir le code de la page

    + + + -- 2.39.2 From 1ec61da4ccb94684b78ea632b24972a5184ba92e Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 3 May 2022 23:15:00 +0200 Subject: [PATCH 083/133] www-data cannot use cli --- www/boris/conf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/boris/conf.php b/www/boris/conf.php index 4d067c4..7059942 100644 --- a/www/boris/conf.php +++ b/www/boris/conf.php @@ -12,7 +12,7 @@ define('SITENAME', 'Astroport "' . STATION_NAME . '"'); exec("/bin/bash -c './get_xzuid.sh'", $xzuid); 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)) { define('IPFS_NODE_ID', $output[0]); -- 2.39.2 From 39c625f3409042ba44d4c75febad385ea9190984 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 May 2022 03:29:21 +0200 Subject: [PATCH 084/133] MY_PATH error in VirtualBox --- install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 72c0c98..47833d0 100755 --- a/install.sh +++ b/install.sh @@ -3,8 +3,7 @@ # Version: 0.3 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## -{MY_PATH="`dirname \"$0\"`" # relative -MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +{ ME="${0##*/}" [ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 @@ -43,7 +42,7 @@ done [[ ! $(which kodi) && "$USER" != "xbian" ]] &&\ echo ">>> Installation Kodi + Vstream = VOTRE VIDEOTHEQUE ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ sudo apt-get install kodi -y;\ - ${MY_PATH}/.install/kodi_uqload_downloader.sh + ./.install/kodi_uqload_downloader.sh echo "## INSTALLATION OpenCV = 'IA Amicale' " sudo apt-get install python3-opencv -y -- 2.39.2 From 7f91392da54a3a4f2d636982b950a8035bcbe282 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 May 2022 03:31:08 +0200 Subject: [PATCH 085/133] unlock --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 47833d0..39903e7 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,8 @@ # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## { +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" [ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 @@ -14,7 +16,7 @@ then # Check requirements echo "AstrXbian installateur pour distributions DEBIAN et dérivées : LinuxMint (https://www.linuxmint.com/) ou XBIAN (https://xbian.org) recommandées" -echo "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..." sudo apt-get update @@ -42,7 +44,7 @@ done [[ ! $(which kodi) && "$USER" != "xbian" ]] &&\ echo ">>> Installation Kodi + Vstream = VOTRE VIDEOTHEQUE ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ sudo apt-get install kodi -y;\ - ./.install/kodi_uqload_downloader.sh + ${MY_PATH}/.install/kodi_uqload_downloader.sh echo "## INSTALLATION OpenCV = 'IA Amicale' " sudo apt-get install python3-opencv -y -- 2.39.2 From aabef16b808a710c7aed70ff751917c32d182c1d Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 May 2022 16:03:05 +0200 Subject: [PATCH 086/133] Now opens 'playerns' and Journal to ease 'qo-op' or 'moa' feed --- ajouter_video.sh | 4 +++- zen/new_file_in_astroport.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 63a934d..1eb9b8d 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -602,7 +602,9 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; if [ ! $2 ]; then zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ - [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"; zenity --warning --width 300 --text "Collez le résultat dans votre Journal. FIN."; + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"\ + && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ + && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" fi [ $? != 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log"; exit 1 echo "${MEDIAKEY} = RECORDED TO IPFS." diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 2218e9a..e4a4cdc 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -459,8 +459,8 @@ then # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} - [[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json - [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json + [[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json && xdg-open "~/Bureau/Journal/${TYPE}/" + [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json && xdg-open "~/Desktop/Journal/${TYPE}/" fi -- 2.39.2 From c691413f3e4cd41fc85abbf1fc725f88c4d0fd96 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 May 2022 18:06:40 +0200 Subject: [PATCH 087/133] TODO REMOVE update_bashrc.sh... Not so good idea since Astroport.One switch identities between captains --- .install/update_bashrc.sh | 22 ++++++++++++---------- ISOconfig.sh | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.install/update_bashrc.sh b/.install/update_bashrc.sh index 5ff85de..33c7ee1 100755 --- a/.install/update_bashrc.sh +++ b/.install/update_bashrc.sh @@ -6,6 +6,8 @@ ######################################################################## # update_bashrc.sh # Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc +## TODO REMOVE... Not so good idea since Astroport.One switch identities between captains + XZUID="$1" source ~/.bashrc @@ -17,10 +19,10 @@ newIPFSNODEID=$(ipfs id -f='\n') || er+=" ipfs id problem" if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then # UPDATE - sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc - sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc - sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc - + sed -i "s/YOU=$YOU/YOU=$newYOU/g" ~/.bashrc + sed -i "s/$G1PUB/$newG1PUB/g" ~/.bashrc + sed -i "s/$IPFSNODEID/$newIPFSNODEID/g" ~/.bashrc + if [[ $IPNSKEY == "_IPNSKEY_" ]]; then ipfs key rm xbian IPNSKEY=$(ipfs key gen xbian) @@ -28,12 +30,12 @@ if [[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]]; then fi else # CREATE - echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc - echo "export YOU=$newYOU" >> ~/.bashrc - echo "export G1PUB=$newG1PUB" >> ~/.bashrc - echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc - echo "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc - [[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc + echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc + echo "export YOU=$newYOU" >> ~/.bashrc + echo "export G1PUB=$newG1PUB" >> ~/.bashrc + echo "export IPFSNODEID=$newIPFSNODEID" >> ~/.bashrc + echo "export IPNSKEY=_IPNSKEY_" >> ~/.bashrc + [[ "$XZUID" != "" ]] && echo "export XZUID=$XZUID" >> ~/.bashrc fi source ~/.bashrc diff --git a/ISOconfig.sh b/ISOconfig.sh index a540b5e..9b0655e 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -165,9 +165,9 @@ echo ".... ACTUAL 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 #sudo mkdir /mnt/ramdisk -- 2.39.2 From 34f42406bbf25bb659eb530b65a51920e5f4805e Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 5 May 2022 23:33:03 +0200 Subject: [PATCH 088/133] =?UTF-8?q?=20nous=20capturons=20votre=20=C3=A9cra?= =?UTF-8?q?n=20comme=20vignette=20MEDIA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ajouter_video.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 1eb9b8d..7a5ef50 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -56,11 +56,6 @@ 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/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) -zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" -sleep 1 -[[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png - - ######################################################################## ## CADRE EXCEPTION COPIE PRIVE # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/ @@ -435,6 +430,14 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" # --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})" # [ $? == 1 ] && echo "ANNULATION." && exit 1 +######################################################################## +# Screen capture is used as thumbnail +######################################################################## +zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" +sleep 1 +[[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png + + ################################### ### MOVING FILE TO ~/astroport #### ################################### -- 2.39.2 From 22fe374bbd30c1b778cb9f426b38cf5a20be0ace Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 8 May 2022 21:25:15 +0200 Subject: [PATCH 089/133] oui --- .install/.kodi/userdata/guisettings.xml | 2 +- .install/ipfs_alone.sh | 3 +-- ISOconfig.sh | 2 +- ajouter_video.sh | 13 +++++++------ zen/new_file_in_astroport.sh | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.install/.kodi/userdata/guisettings.xml b/.install/.kodi/userdata/guisettings.xml index 3890d15..a3e467c 100644 --- a/.install/.kodi/userdata/guisettings.xml +++ b/.install/.kodi/userdata/guisettings.xml @@ -226,7 +226,7 @@ false true - 8181 + 8081 false xbmc webinterface.default diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index a1dd6d7..6bf7e50 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -133,8 +133,7 @@ ipfs bootstrap rm --all ########################################### # BOOTSTRAP NODES ARE ADDED LATER ########################################### -# AVOID CONFLICT WITH KODI REMOTE -# ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181" +# AVOID CONFLICT WITH KODI ./.install/.kodi/userdata/guisettings.xml ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080" [[ "$USER" != "xbian" ]] && sudo systemctl restart ipfs diff --git a/ISOconfig.sh b/ISOconfig.sh index 9b0655e..90b453e 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -281,7 +281,7 @@ do done # AVOID CONFLICT WITH KODI REMOTE -ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181" +ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8080" ######################################################################## # SUDO permissions diff --git a/ajouter_video.sh b/ajouter_video.sh index 7a5ef50..631bfc3 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -603,12 +603,13 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; ######################################################################## ######################################################################## -if [ ! $2 ]; then - zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ - [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"\ +zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \ && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ - && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" -fi -[ $? != 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log"; exit 1 + && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \ + && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \ + || ( zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 )\ + exit 0 + echo "${MEDIAKEY} = RECORDED TO IPFS." cat /tmp/${MEDIAKEY}.log diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index e4a4cdc..73605a5 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -421,13 +421,13 @@ then TAGS="${CAT} astroport $GENRE" CANON='' else - TEXT='' + TEXT='${MEDIAKEY}' TAGS='$:/isAttachment $:/isIpfs astroport '${CAT} $GENRE CANON="/ipfs/"${IPFSID} fi ## Add screen - SCREENDIR=$(ipfs add -wq "$HOME/astroport/${TYPE}/${REFERENCE}/screen.png" | tail -n 1) + SCREENDIR=$(ipfs add -wq "$HOME/astroport/${TYPE}/${REFERENCE}/${CAT}.png" | tail -n 1) echo "## Creation json tiddler" echo '[ -- 2.39.2 From b69bc7c2d42095c4190089f920486989806f4c78 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 14 May 2022 15:56:55 +0200 Subject: [PATCH 090/133] Add Astroport.ONE game into astrXbian --- ISOconfig.sh | 12 +++---- README.md | 10 +++--- ajouter_video.sh | 2 +- cron_MINUTE.sh | 40 ++++++++++++----------- install.sh | 47 ++++++++-------------------- ipfs4astroport.sh | 6 ++-- www/boris/conf.php | 4 +-- www/boris/get_xzuid.sh | 2 +- zen/bash_template.sh | 2 +- zen/gchange_INIT.sh | 6 ++-- zen/gchange_IPFS_swarm.sh | 2 +- zen/ipfs_FRIENDS_refresh.sh | 2 +- zen/ipfs_P2P_forward.sh | 2 +- zen/ipfs_SWARM_refresh.sh | 10 +++--- zen/ipns_TAG_refresh.sh | 2 +- zen/manage_stargates.sh | 2 +- zen/swarm_testing.sh | 2 +- zen/tools/ping_my_friends_on_ipfs.sh | 6 ++-- zen/wordpress_channel.sh | 4 +-- 19 files changed, 73 insertions(+), 90 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index 90b453e..3262ca3 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -9,7 +9,7 @@ IPFSNODEID=$(ipfs id -f='\n') isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) [[ ! ${IPFSNODEID} ]] && echo "IPFS MUST BE INSTALLED" && exit 1 ######################################################################## -# Create secret key files +# Create STATION IPFS/G1 IDENTITY & secret key files # ~/.zen/secret.june # ~/.zen/secret.dunikey # ~/.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) 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 -mkdir -p ~/.zen/astrXbian && cd ~/.zen/astrXbian && git pull || exit 1 +# MAJ astrXbian code +[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || ( echo "astrXbian ERROR" && exit 1 ) # CHECK IF CONFIG ALREADY DONE !! # ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync if [[ -f ~/.zen/ipfs.sync ]]; then 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 sleep 20 ~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt @@ -120,7 +120,7 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB # Give $XZUID to your (gchange friends) ######################################################################## echo "SETTING ASTRXBIAN PROFILE NAME = $XZUID" -echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player ######################################################################## echo "CREATING GCHANGE+ PROFILE" @@ -223,7 +223,7 @@ echo 'Installing Astroport cron_MINUTE' ######################################################################## #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" ######################################################################## #sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname diff --git a/README.md b/README.md index 891e7f4..b295778 100644 --- a/README.md +++ b/README.md @@ -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 # 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 -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 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 ); code=$(cat $CODE); IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode) - zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid); - # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) + zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player); + # zuid=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.player) g1name=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.gchange_title) # g1name=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) echo "---> $zuid / $g1name : $IPNSCODE" @@ -265,7 +265,7 @@ do done; # 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 ``` diff --git a/ajouter_video.sh b/ajouter_video.sh index 631bfc3..65c900d 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -54,7 +54,7 @@ haut=$((height-200)) ######################################################################## 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/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +[[ -f ~/.zen/ipfs/.$IPFSNODEID/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) ######################################################################## ## CADRE EXCEPTION COPIE PRIVE diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index c501e20..689210a 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -36,20 +36,33 @@ fi ## CONTROL IPFS IS RUNNING OR RESTART YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) if [[ ! ${YOU} ]]; then + + # Refresh Peering.Peers + ipfs config --json Peering.Peers '[]' + # DHT PUBSUB mode + ipfs config Pubsub.Router gossipsub + # MAXSTORAGE = 1/2 available + availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}') + diskSize="$((availableDiskSize / 2))" + ipfs config Datastore.StorageMax $diskSize + ## Activate Rapid "ipfs p2p" + ipfs config --json Experimental.Libp2pStreamMounting true + ipfs config --json Experimental.P2pHttpProxy true # control water levels for swarm ipfs config --json Swarm.ConnMgr.LowWater 50 ipfs config --json Swarm.ConnMgr.HighWater 100 + [ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && sudo service ipfs restart || sudo systemctl restart ipfs echo "ERROR! ipfs daemon was not running. RELAUNCHING." exit 1 fi ######################################################################## -# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE +# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE : TODO DEBUG KODI PLUGIN !!! [[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py ]] && [[ -f ~/.zen/astroport.py ]] && cp -f ~/.zen/astroport.py ~/.kodi/addons/plugin.video.vstream/resources/sites/ [[ ! -f ~/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ]] && cp ~/.zen/astrXbian/.install/.kodi/addons/plugin.video.vstream/resources/art/astroport.png ~/.kodi/addons/plugin.video.vstream/resources/art/ 2>/dev/null ######################################################################## -### NO IP GATEWAY : EXIT +### 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 ######################################################################## @@ -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); [[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt ## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt - # for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid; cat $line; done + # for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player; cat $line; done done fi ######################################################################## @@ -162,7 +175,7 @@ if [[ $(($runtime % 15)) == 0 ]]; then ## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE ## 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 [[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html @@ -183,18 +196,6 @@ if [[ $(($runtime % 15)) == 0 ]]; then fi -if [[ $(($minute % 30)) == 0 ]]; then - ########## NextCloud.SMS GUILDE STATION ############## - if [[ -e /home/${YOU}/.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 - ########## BUNKERBOX STATION ############## - # [[ $(cat /home/${YOU}/.zen/bunkerbox/qo-op 2>/dev/null) != "" && $(cat /home/${YOU}/.zen/bunkerbox/choice 2>/dev/null) == "qo-op" ]] && /home/${YOU}/workspace/bunkerbox/crowdbunker.sh & - -fi - # __ __ _____ ____ # __/ // /_/ ___/ ______ __________ ___ / __ \ # /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / / @@ -222,8 +223,8 @@ 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 fi # SYNC IPFS FRIENDS SWARM -if [[ $(($runtime % 25)) == 0 ]]; then - kill -9 $(ps auxf --sort=+utime | grep -w p4n.swarmscraper.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING p4n.swarmscraper.sh" +if [[ $(($runtime % 26)) == 0 ]]; then + kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh" killall chromium $MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt fi @@ -237,6 +238,8 @@ fi # /___/\___/_/ /_/ /_/ /_/ |_\____/ # # REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle + ### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive + ################################################ if [[ $(($runtime % 7)) == 0 ]]; then #### Refresh & publish MEDIAKEYs @@ -259,6 +262,7 @@ fi # # 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 +## TEST AUTOMATIC NEW FILE IMPORT. xbian only. if [[ "$USER" == "xbian" ]]; then [[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport # VERIFY LAUNCH inotifywait ?! diff --git a/install.sh b/install.sh index 39903e7..513f6c2 100755 --- a/install.sh +++ b/install.sh @@ -10,8 +10,12 @@ ME="${0##*/}" [ $(id -u) -eq 0 ] && echo "LANCEMENT root INTERDIT. Utilisez un simple utilisateur du groupe \"sudo\" SVP" && exit 1 + +######################################################################## +[[ ! $(which ipfs) ]] && echo "=== Vous devez avoir installé IPFS https://ipfs.io" && echo "Adaptez ce code à votre système ~/.zen/astrXbian/.install/ipfs_alone.sh" && exit 1 + # MAIN # SI AUCUNE CLEF DE STATION... -if [[ ! -f ~/.zen/secret.june ]]; +if [[ ! -f ~/.zen/secret.dunikey ]]; then # Check requirements @@ -46,7 +50,7 @@ done sudo apt-get install kodi -y;\ ${MY_PATH}/.install/kodi_uqload_downloader.sh -echo "## INSTALLATION OpenCV = 'IA Amicale' " +echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' " sudo apt-get install python3-opencv -y ## Correct PDF restrictions for imagemagick @@ -56,22 +60,6 @@ if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml fi -if [[ ! $(which apache2) ]]; then - echo "########################################################################" - echo "## INSTALL PASSERELLE HTTP(S) #######################################"; echo ; - 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 - echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - sudo apt install -y $i - fi - done -else - echo ">>> WARNING <<< Apache détecté - Vous devrez réaliser la configuration de votre passerelle par vous même..." -fi - -## GIVE ACCESS TO www-data group -sudo usermod -aG www-data $USER - echo "###########################" echo "## INSTALL PYTHON CRYPTO LAYER " echo "###########################" @@ -79,7 +67,7 @@ echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo python3 -m pip install -U pip python3 -m pip install -U setuptools wheel python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy -python3 -m pip install -U nicotine-plus +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" @@ -99,18 +87,17 @@ sudo ln -f -s /usr/bin/python3 /usr/bin/python ######################################################################## -echo "=== Clonage git CODE astrXbian depuis https://git.p2p.legal" +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 ######################################################################## echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ -######################################################################## -[[ ! $(which ipfs) ]] && echo "=== Installation de IPFS https://ipfs.io"; ~/.zen/astrXbian/.install/ipfs_alone.sh - ######################################################################## echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+" cd ~/.zen/astrXbian/zen/jaklis @@ -151,18 +138,10 @@ fi mkdir -p ~/astroport/film mkdir -p ~/astroport/serie mkdir -p ~/astroport/anime -echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${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 +echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt + ####################################################################### -## CREATE symlinks for ~/.zen/www/swarm & me ## OLD PHP METHOD ## TO REMOVE... -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 echo "## INSTALL open_with_linux.py ## ## https://darktrojan.github.io/openwith/webextension.html" @@ -196,7 +175,7 @@ fi # MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ## else -echo "Installation déjà faite !! +echo "Installation existante !! ======================== Astroport/KODI (Gchange) ======================== diff --git a/ipfs4astroport.sh b/ipfs4astroport.sh index 430c39f..215d8cb 100755 --- a/ipfs4astroport.sh +++ b/ipfs4astroport.sh @@ -176,9 +176,9 @@ mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB # Give $XZUID to your (gchange friends) ######################################################################## XZUID="$(hostname)-$RANDOM$RANDOM" -echo "SETTING _xbian.zuid PROFILE NAME = $XZUID" -echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid -echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/_xbian.zuid' +echo "SETTING .player PROFILE NAME = $XZUID" +echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player +echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player' ######################################################################## ######################################################################## diff --git a/www/boris/conf.php b/www/boris/conf.php index 7059942..47dc34b 100644 --- a/www/boris/conf.php +++ b/www/boris/conf.php @@ -4,7 +4,7 @@ if (!ini_get('display_errors')) { 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('THEME', 'astroport'); define('SITENAME', 'Astroport "' . STATION_NAME . '"'); @@ -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'); -// 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 = [ 'virgo', 'onelove', diff --git a/www/boris/get_xzuid.sh b/www/boris/get_xzuid.sh index 02bc224..fa2be8d 100755 --- a/www/boris/get_xzuid.sh +++ b/www/boris/get_xzuid.sh @@ -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 -cat /home/$YOU/.zen/ipfs/.12D*/_xbian.zuid +cat /home/$YOU/.zen/ipfs/.12D*/.player diff --git a/zen/bash_template.sh b/zen/bash_template.sh index a54db28..b239f48 100755 --- a/zen/bash_template.sh +++ b/zen/bash_template.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 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) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index b7ffe07..2747034 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -26,7 +26,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) [[ ! -f ~/.zen/secret.dunikey ]] && echo "Missing ~/.zen/secret.dunikey. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) [[ $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 @@ -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 # 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" updated="$(date +"%m-%d-%Y_%H:%M")" @@ -214,7 +214,7 @@ do ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) echo ${ipfsnodeid} > ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/ipfsnodeid ## 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} ## NOT USEFULL TRYING diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 7c6a93f..5c5783e 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -40,7 +40,7 @@ for g1friend in $(find ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/ -type d | rev | cut -d do ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend) echo "### $g1friend ipfs reading XID" - XID=$(ipfs --timeout=20s cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid) + 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 diff --git a/zen/ipfs_FRIENDS_refresh.sh b/zen/ipfs_FRIENDS_refresh.sh index a485930..1a0ffa0 100755 --- a/zen/ipfs_FRIENDS_refresh.sh +++ b/zen/ipfs_FRIENDS_refresh.sh @@ -43,7 +43,7 @@ do #echo "REFRESHING Friend /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/" #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" ls -d ~/.zen/ipfs_swarm/.$ipfsnodeid/FRIENDS/*/ 2>/dev/null | rev | cut -d '/' -f 2 | rev diff --git a/zen/ipfs_P2P_forward.sh b/zen/ipfs_P2P_forward.sh index 184c456..0165c3c 100755 --- a/zen/ipfs_P2P_forward.sh +++ b/zen/ipfs_P2P_forward.sh @@ -53,7 +53,7 @@ if [[ "$IPFSNODEID" == "12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN" ]] fi # Every Station publish SSH port "/x/ssh-$zuid" -zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" +zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)" if [[ $zuid ]] then if [[ ! $(cat ~/.ssh/authorized_keys | grep "fred@ONELOVE") ]] diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index b109434..302a857 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -67,7 +67,7 @@ do # ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend) ## $ipfsnodeid already Treated ? [[ "$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='' # [[ "$XID" == "" ]] && ipfs swarm disconnect /ipfs/$ipfsnodeid ## NOT COMPLIANT FRIEND STATION # [[ $(cat /tmp/treated.ipfs.swarm | grep "$ipfsnodeid") ]] && continue ## TODO ACTIVATE IN DEFCON 4 @@ -255,7 +255,7 @@ then ## DEFCON 3 echo "BLOB-Brain Friend RENEW /ipns/$ipfsnodeid TO ~/.zen/ipfs_swarm/" rm - Rf /home/$YOU/.zen/ipfs_swarm/$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); G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $g1pub) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1) @@ -279,7 +279,7 @@ fi echo "******************************************************************" echo "### REFRESH Film Serie Anime Youtube ${PREFIX}ASTRXBIAN ###" [[ ! -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 do @@ -304,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 ######################################################################## -zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)" +zuid="$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)" updated="$(date +"%Y-%m-%d_%H:%M")" echo "******************************************************************" @@ -328,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) echo "
  • - \"$(catdev/null)\" /> + \"$(catdev/null)\" />

    diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index acf70c5..181d39f 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -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 ]] && echo "IPFS NOT RUNNING. EXIT" && exit 1 ######################################################################## -XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid) +XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player) # 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 diff --git a/zen/manage_stargates.sh b/zen/manage_stargates.sh index 7dca797..987e681 100755 --- a/zen/manage_stargates.sh +++ b/zen/manage_stargates.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 IPFSNODEID=$(ipfs id -f='\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) ######################################################################## diff --git a/zen/swarm_testing.sh b/zen/swarm_testing.sh index 1519c00..0cf5274 100755 --- a/zen/swarm_testing.sh +++ b/zen/swarm_testing.sh @@ -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') if [ ! $TEST == 'null' ]; then 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" sleep 1 fi diff --git a/zen/tools/ping_my_friends_on_ipfs.sh b/zen/tools/ping_my_friends_on_ipfs.sh index e6e683c..5d78ad7 100755 --- a/zen/tools/ping_my_friends_on_ipfs.sh +++ b/zen/tools/ping_my_friends_on_ipfs.sh @@ -13,11 +13,11 @@ for ipfsid in $(cat ~/.zen/ipfs_swarm/.*/.ipfsnodeid); do echo "TESTING $ipfsid" ipfs -timeout=7s ping -n5 /p2p/$ipfsid 2>/dev/null | tail -n 1 if [ $? -eq 0 ]; then - zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/_xbian.zuid 2>/dev/null) || zuidonline="TIMEOUT" - [[ -f ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) || zuidoffline="UNKOWN" + zuidonline=$(ipfs -timeout=10s cat /ipns/$ipfsid/.$ipfsid/.player 2>/dev/null) || zuidonline="TIMEOUT" + [[ -f ~/.zen/ipfs_swarm/.$ipfsid/.player ]] && zuidoffline=$(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) || zuidoffline="UNKOWN" echo "Station $zuidonline [$zuidoffline] : OK" else - echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/_xbian.zuid) : DEAD" + echo "Station $(cat ~/.zen/ipfs_swarm/.$ipfsid/.player) : DEAD" fi echo "" fi diff --git a/zen/wordpress_channel.sh b/zen/wordpress_channel.sh index a0a31aa..0b678e0 100755 --- a/zen/wordpress_channel.sh +++ b/zen/wordpress_channel.sh @@ -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 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 IPFSNODEID=$(ipfs id -f='\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) channel="$1" && [[ "$channel" == "" ]] && channel="wordpress" @@ -44,7 +44,7 @@ do echo "$ipfnodesource wants to publish $mediakey" ## GET ipns link + title + xzuid 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" ) mynodename=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/G1SSB/_nodename) -- 2.39.2 From f49fbb18359e9f8847063a086a58eae95ce71610 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 28 May 2022 03:05:51 +0200 Subject: [PATCH 091/133] +IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID) --- cron_MINUTE.sh | 2 +- zen/gchange_INIT.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 689210a..8c81734 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -20,7 +20,7 @@ source $HOME/.profile #### CONTROL STATION IPFS DAEMON ## timeout is fixing ipfs minimum response time, before considering stuck process -IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) +IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID) howmany=$(cat /tmp/ipfs.timeout) if [[ ! $IPFSNODEID ]]; then ## wait a howmany timeout before restarting ipfs diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index 2747034..51f1940 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -41,7 +41,7 @@ cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr # ADD GCHANGE+ informations ######################################################################## 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 Gtitle=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange.json | jq -r '._source.title') -- 2.39.2 From fee79585237463f75b155a895e7b87862865ae1f Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 28 May 2022 04:09:00 +0200 Subject: [PATCH 092/133] better finishing delayed batch scripts --- ajouter_video.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 65c900d..dd8b5fa 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -559,9 +559,7 @@ echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${M echo "rm -f /tmp/\${MEDIAKEY}.pass rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS -echo 'Si tout est OK, appuyez dur ENTER, sinon ESC' -[[ ! \$1 ]] && read finish -rm ~/astroport/Add_${MEDIAKEY}_script.sh +mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh " >> ~/astroport/Add_${MEDIAKEY}_script.sh @@ -607,7 +605,7 @@ zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \ && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \ - && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \ + && 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... /tmp/${MEDIAKEY}.log" && exit 1 )\ exit 0 -- 2.39.2 From 1c3c68b1020bc9ac24fd85e0629bc3b1a5cc3985 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 28 May 2022 04:55:30 +0200 Subject: [PATCH 093/133] correct space in name error --- zen/new_file_in_astroport.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 73605a5..7dc0406 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -459,8 +459,8 @@ then # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} - [[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/${TYPE}/${TITLE}.dragdrop.json && xdg-open "~/Bureau/Journal/${TYPE}/" - [[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal/${TYPE} && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/${TYPE}/${TITLE}.dragdrop.json && xdg-open "~/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 ~/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}/" fi -- 2.39.2 From 77bd8fce3e91ac92671d0301f8688dc9bb3449cf Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 28 May 2022 17:46:25 +0200 Subject: [PATCH 094/133] system file for ipfs daemon --- .install/ipfs_alone.sh | 37 +------------------------------------ install.sh | 6 +++++- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index 6bf7e50..60ac522 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -29,9 +29,7 @@ if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | ta exit 0 fi -[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 0 - -echo -e "Astroport IPFS Layer installation..." +echo -e "Astroport activate IPFS Layer installation..." # CHECK node IP isLAN? myIP=$(hostname -I | awk '{print $1}') @@ -39,39 +37,6 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|( MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} == 'x86_64' ]; then - curl -s https://dist.ipfs.io/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 [[ $isLAN ]] && ipfs init -p lowpower \ || ipfs init -p server diff --git a/install.sh b/install.sh index 513f6c2..84af9a7 100755 --- a/install.sh +++ b/install.sh @@ -12,7 +12,7 @@ ME="${0##*/}" ######################################################################## -[[ ! $(which ipfs) ]] && echo "=== Vous devez avoir installé IPFS https://ipfs.io" && echo "Adaptez ce code à votre système ~/.zen/astrXbian/.install/ipfs_alone.sh" && 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... if [[ ! -f ~/.zen/secret.dunikey ]]; @@ -86,6 +86,10 @@ fi sudo ln -f -s /usr/bin/python3 /usr/bin/python +## Scripts pour systemd ou InitV (xbian) +echo "=== Activation SYSTEM IPFS" +~/.zen/astrXbian/.install/ipfs_alone.sh + ######################################################################## echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" mkdir -p ~/.zen -- 2.39.2 From 0da2b86a69a2947a8cd03399bfd4e6d3857cf51f Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 31 May 2022 18:01:22 +0200 Subject: [PATCH 095/133] git pull Astroport.ONE --- cron_MINUTE.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 8c81734..9d5e7bb 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -164,8 +164,11 @@ fi if [[ $(($runtime % 15)) == 0 ]]; then ########## DESYNCH SWARM NODE REQUESTS ################# + [[ -d ~/.zen/Astroport.ONE ]] && cd ~/.zen/Astroport.ONE && sleep $((1 + RANDOM % 12)) && git pull # git reset --hard - git pull + cd $MY_PATH + sleep $((1 + RANDOM % 3)) && git pull + [[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE" # if [[ $(diff ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml) ]]; then # cp ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml -- 2.39.2 From 4f45e0908e7f75c7542d3d30d4388dd37d94371f Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 1 Jun 2022 14:21:07 +0200 Subject: [PATCH 096/133] IPFS must be installed before astrXbian. Creating systemd startup scripts --- install.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 84af9a7..8537a53 100755 --- a/install.sh +++ b/install.sh @@ -66,7 +66,7 @@ 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 +python3 -m pip install -U cryptography Ed25519 base58 google protobuf protobuf-compiler duniterpy python3 -m pip install -U nicotine-plus silkaj if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI @@ -86,10 +86,6 @@ fi sudo ln -f -s /usr/bin/python3 /usr/bin/python -## Scripts pour systemd ou InitV (xbian) -echo "=== Activation SYSTEM IPFS" -~/.zen/astrXbian/.install/ipfs_alone.sh - ######################################################################## echo "=== Clonage git CODE 'astrXbian' + 'Astroport.ONE' depuis https://git.p2p.legal" mkdir -p ~/.zen @@ -98,6 +94,11 @@ 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 ~/ -- 2.39.2 From 1f52333d6cdf1d0c0324737544c00f209be49b19 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 1 Jun 2022 14:43:23 +0200 Subject: [PATCH 097/133] python crypto tools --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8537a53..d0bac96 100755 --- a/install.sh +++ b/install.sh @@ -66,7 +66,7 @@ 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 protobuf-compiler duniterpy +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 -- 2.39.2 From 5474cf1699bb68119b3c434bc543518719b0ae7b Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 1 Jun 2022 16:16:08 +0200 Subject: [PATCH 098/133] sudo brother_ql_print for ALL --- ISOconfig.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ISOconfig.sh b/ISOconfig.sh index 3262ca3..1a9d3d6 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -297,6 +297,9 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo ## USED FOR "systemctl restart ipfs" echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl') +## brother_ql_print +echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/brother_ql_print') + ## INSTALL TiddlyWiki [[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html -- 2.39.2 From 0462a8f6c3afd82cae74360bef654b318cbb1f2b Mon Sep 17 00:00:00 2001 From: support Date: Wed, 1 Jun 2022 22:43:10 +0200 Subject: [PATCH 099/133] Check .current player legal acceptance --- ajouter_video.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index dd8b5fa..1f28cb3 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -59,7 +59,7 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) ######################################################################## ## CADRE EXCEPTION COPIE PRIVE # 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 \ --title="Action conforme avec le Code de la propriété intellectuelle" \ --html \ @@ -69,12 +69,12 @@ zenity --width ${large} --height=${haut} --text-info \ case $? in 0) echo "AUTORISATION COPIE PRIVE ASTROPORT OK !" - echo "$G1PUB" > ~/.zen/legal + echo "$G1PUB" > ~/.zen/game/players/.current/legal # next step ;; 1) echo "Refus conditions" - rm -f ~/.zen/legal + rm -f ~/.zen/game/players/.current/legal exit 1 ;; -1) -- 2.39.2 From fd2d9bb0481bc81bd5562dc8e67b03190fd3f377 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 2 Jun 2022 17:46:14 +0200 Subject: [PATCH 100/133] =?UTF-8?q?Appuyez=20sur=20la=20touche=20ENTREE=20?= =?UTF-8?q?pour=20d=C3=A9marrer=20le=20mode=20Aventure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index d0bac96..2212164 100755 --- a/install.sh +++ b/install.sh @@ -160,10 +160,11 @@ if [[ "$USER" != "xbian" ]] then ## Desktop install 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)" + 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/astrXbian/ISOconfig.sh + ~/.zen/Astroport.ONE/adventure.sh + # ~/.zen/astrXbian/ISOconfig.sh else ## Rpi Xbian install. cat /etc/rc.local | grep -Ev "exit 0" > /tmp/new.rc.local ## REMOVE "exit 0" -- 2.39.2 From eeac0e27d2c13948b2354aabb576e92084b1e0c2 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 2 Jun 2022 17:46:45 +0200 Subject: [PATCH 101/133] KODI PLUGIN !!! TODO MAKE PLAYER ROTATION --- cron_MINUTE.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 9d5e7bb..84a2dae 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -57,7 +57,7 @@ if [[ ! ${YOU} ]]; then exit 1 fi ######################################################################## -# CORRECT VSTREAM ASTROPORT SITE/ART REMOVED AFTER PLUGIN UPDATE : TODO DEBUG KODI PLUGIN !!! +# 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/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 ######################################################################## -- 2.39.2 From a9d76db1a478791f89460952792e15dfd5d717ad Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 13 Jun 2022 17:23:06 +0200 Subject: [PATCH 102/133] protobuf downgrade !! F... Google. --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2212164..322c7bc 100755 --- a/install.sh +++ b/install.sh @@ -66,8 +66,10 @@ 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 cryptography Ed25519 base58 google duniterpy pynacl pgpy python3 -m pip install -U nicotine-plus silkaj +python3 -m pip install -U 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" -- 2.39.2 From 3825b1bebcf06f00be76c53868eb346e52afe61f Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 00:01:35 +0200 Subject: [PATCH 103/133] Add external call from 1234 port Welcome g1-compagnon API --- ajouter_video.sh | 44 ++++++++++++++++++------------------ zen/new_file_in_astroport.sh | 5 ++++ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 1f28cb3..4e3c332 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -543,27 +543,25 @@ timestamp=$(date -u +%s%N | cut -b1-13) ## AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS 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 +#[[ $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 echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" " >> ~/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 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 @@ -600,14 +598,16 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; #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 ?"; \ - [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \ - && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ - && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \ - && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \ - || ( zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 )\ - exit 0 - -echo "${MEDIAKEY} = RECORDED TO IPFS." -cat /tmp/${MEDIAKEY}.log +else + zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \ + [ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \ + && zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \ + && [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \ + && xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \ + || ( zenity --warning --width 300 --text "Désolé une erreur est survenue... cat /tmp/${MEDIAKEY}.log" && exit 1 )\ +fi +exit 0 diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 7dc0406..d2b9f4c 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -453,6 +453,11 @@ then ] ' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json + +## 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 "$(cat ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json)" + + # Will be used by caroussel.html template # CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1) -- 2.39.2 From efda32a4d53e1758b7771a5aac503fb34cc072fb Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 00:52:01 +0200 Subject: [PATCH 104/133] Activate g1-compagnon API (nc 1234 http port bash relay) --- cron_MINUTE.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 84a2dae..7b438b5 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -164,7 +164,15 @@ fi if [[ $(($runtime % 15)) == 0 ]]; then ########## 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 nc && killall instascan_login.sh && ~/.zen/Astroport.ONE/tools/instascan_login.sh & +[[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh & + # git reset --hard cd $MY_PATH sleep $((1 + RANDOM % 3)) && git pull -- 2.39.2 From 50cf9e0fcb54c77e643bd2181f2919d00aff9d0c Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 00:53:46 +0200 Subject: [PATCH 105/133] Send message to Gchange + tiddler.json Station publication --- zen/new_file_in_astroport.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index d2b9f4c..9a1f363 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -453,16 +453,15 @@ then ] ' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json +## Add tidller into Station Balise +cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/tiddler.json ## 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 "$(cat ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json)" - +~/.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 "~/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}/" -- 2.39.2 From 67e77f20e10ffb399085750e4b0ecd519783ccac Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 01:12:58 +0200 Subject: [PATCH 106/133] Convert symlink $(readlink ~/.zen/ipfs) --- zen/gchange_INIT.sh | 2 +- zen/ipns_self_publish.sh | 2 +- zen/zen_MAKE.sh | 256 +++++++++++++++++++-------------------- 3 files changed, 130 insertions(+), 130 deletions(-) diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index 51f1940..3c7b062 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -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 ]] && 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 Atitle="Station $YOU@$XZUID" diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index 9242304..363424c 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -20,7 +20,7 @@ echo "Adding ~/.zen/ipfs to IPFS" # then echo "$(date -u +%s%N | cut -b1-13)" > ~/.zen/ipfs/.${IPFSNODEID}/.timestamp echo $MIPFS > ~/.zen/ipfs/.${IPFSNODEID}/.chain - MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) + MIPFS=$(ipfs add -rHq $(readlink ~/.zen/ipfs) | tail -n 1) NODEIPNS=$(ipfs --timeout=180s name publish --quieter /ipfs/$MIPFS) echo "$NODEIPNS:TIME:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.timestamp):CHAIN:$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain)" # fi diff --git a/zen/zen_MAKE.sh b/zen/zen_MAKE.sh index 57e2edd..8b08cf1 100755 --- a/zen/zen_MAKE.sh +++ b/zen/zen_MAKE.sh @@ -41,37 +41,37 @@ IPFSNODEID=$(ipfs id -f='\n') G1PUB=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) echo "G1SSB Wallet: $G1PUB 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 ~~~~ -# _chain # ZenTag IPFS Hash -# _chain.n # Sequence Number -# _chain.nanodate # Current nanodate -# _chain.prev # Previous IPFS Hash -# _g1.node.creator # G1SSB wallet pubkey -# _tag.issuer # G1TX ISSUER pubkey -# _tag.zensource # G1TX HASH or SSB timestamp -# _ipfs.node.creatorcat # NODE IPFS ID -# _ipfs.publishkey.BB.aes # BB SYMcypher of IPNS publish key -# _ipfs.publishkey.crypt # G1SSB ASYMcypher of IPNS publish key -# _tag.BB.sha # BB sha256sum -# _tag.uid # ZenTag UID -# _tag.zen # ZentTag balance -# _ipns # /ipns/ address +# _chain # ZenTag IPFS Hash +# _chain.n # Sequence Number +# _chain.nanodate # Current nanodate +# _chain.prev # Previous IPFS Hash +# _g1.node.creator # G1SSB wallet pubkey +# _tag.issuer # G1TX ISSUER pubkey +# _tag.zensource # G1TX HASH or SSB timestamp +# _ipfs.node.creatorcat # NODE IPFS ID +# _ipfs.publishkey.BB.aes # BB SYMcypher of IPNS publish key +# _ipfs.publishkey.crypt # G1SSB ASYMcypher of IPNS publish key +# _tag.BB.sha # BB sha256sum +# _tag.uid # ZenTag UID +# _tag.zen # ZentTag balance +# _ipns # /ipns/ address # PASSENGER FILE (put to IPFS and cypher link in IPNS ZenTag) -# _passenger.filename # Passenger filename -# _passenger.ipfs.crypt # G1SSB cyphered IPFS Passenger link -# _passenger.read # Zen value asked for READING -# _passenger.park # Zen value paid for PARKING +# _passenger.filename # Passenger filename +# _passenger.ipfs.crypt # G1SSB cyphered IPFS Passenger link +# _passenger.read # Zen value asked for READING +# _passenger.park # Zen value paid for PARKING # 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 # TODO: Could be converted into yaml or json if you like... ######################################################################## @@ -85,39 +85,39 @@ if [[ "$METADATA" == "" ]]; then echo " # LOVE BANK - PrePaid Card ZenTag # FULLY BACKED ON IRL G1 LIBRE MONEY (https://cesium.app) -# ____ ____ _____ _____ _ _ -# / ___| _ \| ____| ____| \ | | _______ _ __ -# | | _| |_) | _| | _| | \| | |_ / _ \ '_ \ +# ____ ____ _____ _____ _ _ +# / ___| _ \| ____| ____| \ | | _______ _ __ +# | | _| |_) | _| | _| | \| | |_ / _ \ '_ \ # | |_| | _ <| |___| |___| |\ | / / __/ | | | # \____|_| \_\_____|_____|_| \_| /___\___|_| |_| -# +# " # 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 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 !!" else echo " - -_|_ o ._ _ _ _ _|_ _. ._ _ ._ - |_ | | | | (/_ _> |_ (_| | | | |_) - | + +_|_ o ._ _ _ _ _|_ _. ._ _ ._ + |_ | | | | (/_ _> |_ (_| | | | |_) + | SSB PASSENGER ~/.zen/miam/$ZENSOURCE " [[ ! -d ~/.zen/miam/$ZENSOURCE ]] && echo "ERROR# UNKNOWN ~/.zen/miam/$ZENSOURCE !!" && exit 1 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 !!" fi ######################################################################## -# CREATE ZEN TAG +# CREATE ZEN TAG ######################################################################## # 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 @@ -126,12 +126,12 @@ AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) # ZenTag Name SHA256 # TODO ACTIVATE SWARM UNICITY CHECK # Create Unique Zentag for all IPFS SWARM! while [[ $(grep -Rwl "$AA" ~/.zen/ipfs_swarm/.12D3KooW*/TAG/*/_tag.uid) ]]; do - AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g ) - AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) + AA=$(echo $($MY_PATH/tools/diceware.sh 6 | xargs) | sed s/\ /_/g ) + AAH=$(echo -n ${AA} | sha256sum | cut -d ' ' -f 1) done # 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); 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} # LOG echo " - _____ _____ _ ____ + _____ _____ _ ____ |__ /___ _ _|_ _|/ \ / ___| __/\__ / // _ \ °_ \| | / _ \| | _ \ / - / /| __/ | | | |/ ___ \ |_| | /_ _\ -/____\___|_| |_|_/_/ \_\____| \/ + / /| __/ | | | |/ ___ \ |_| | /_ _\ +/____\___|_| |_|_/_/ \_\____| \/ ******************************************************* -| $AA | $ZEN Zen +| $AA | $ZEN Zen ******************************************************* 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 "$ZENSOURCE" > ~/.zen/tag/${AAH}/_tag.zensource # ZENSOURCE 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 # ===================================== @@ -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) 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 echo "$BBH" > ~/.zen/tag/${AAH}/_tag.BB.sha # BB pgp symetric publishkey @@ -185,9 +185,9 @@ CYPHERING PUBLISH KEY __ _ _/_/ __/|_ __/|_ | | / / | / | / / / - / / /_ __| /_ __| / / -/ / |/ |/ _/_/ -|_| /_/ + / / /_ __| /_ __| / / +/ / |/ |/ _/_/ +|_| /_/ KEY : $BB BBH : $BBH @@ -196,61 +196,61 @@ BBH : $BBH # PASSENGER FILE is added to IPFS (then link is cyphered: NO!) # https://beechat.network/how-beechats-encryption-works/ # 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. # INCOME != MONEY FORGE (Realtive Moey Theory applies HERE) # CODE WILL BE CERTIFIED AS IPFS HASH. if [[ -f $PASSENGER ]]; then echo " - _ _ _ _ _ _ _ _ _ - / \ / \ / \ / \ / \ / \ / \ / \ / \ + _ _ _ _ _ _ _ _ _ + / \ / \ / \ / \ / \ / \ / \ / \ / \ ( p | a | s | s | e | n | g | e | r ) - \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ + \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ " - # 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 == "" ]] && 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) - [[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \ - && echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. $CHECKSWARM CANCEL" && exit 1 - # NO DUPLICATE + # 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 == "" ]] && 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) + [[ "$CHECKSWARM" != "" && "$ISSUERSWARM" == "$ISSUER" ]] && ipfs key rm $keyname && rm -Rf ~/.zen/tag/${AAH} \ + && echo "$ZENSOURCE ALREADY COPIED IN IPFS SWARM. $CHECKSWARM CANCEL" && exit 1 + # NO DUPLICATE - echo "ADDING TO IPFS.................$(date)" - # ADD PASSENGER TO IPFS # COULD BE SUPER LONG !!! - IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1) - # TODO COMPARE DISK WRITING SPEED AND AVAILABLE SPACE TO CHOOSE BEST IN SWARM - 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 + echo "ADDING TO IPFS.................$(date)" + # ADD PASSENGER TO IPFS # COULD BE SUPER LONG !!! + IPASSENGER=$(ipfs add -q "$PASSENGER" -w | tail -n 1) + # TODO COMPARE DISK WRITING SPEED AND AVAILABLE SPACE TO CHOOSE BEST IN SWARM + echo "$(date) ............... YES /ipfs/$IPASSENGER" - # G1SSB NODE ACCESS - $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 + echo "$IPASSENGER" > ~/.zen/tag/${AAH}/_passenger.ipfs + # GET FILE NAME + PASSENGERNAME=$(basename -- "$PASSENGER") + echo "$PASSENGERNAME" > ~/.zen/tag/${AAH}/_passenger.filename - # CLEAN CLEARTEXT IPFS link ? LATER MAYBE - rm ~/.zen/tag/${AAH}/_passenger.ipfs + # G1SSB NODE ACCESS + $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 - echo "$READ" > ~/.zen/tag/${AAH}/_passenger.read - echo "$PARK" > ~/.zen/tag/${AAH}/_passenger.park + # CLEAN CLEARTEXT IPFS link ? LATER MAYBE + rm ~/.zen/tag/${AAH}/_passenger.ipfs + + # ZEN ECONOMY: ZEN READ payment + PARK rental + echo "$READ" > ~/.zen/tag/${AAH}/_passenger.read + echo "$PARK" > ~/.zen/tag/${AAH}/_passenger.park echo " _passenger.filename : $PASSENGERNAME _passenger.ipfs : $IPASSENGER http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME -# #### ## ##### ###### ##### -# # # # # # # # # # -# # # # # # # ##### # # -# # # ###### # # # # # -# # # # # # # # # # -###### #### # # ##### ###### ##### +# #### ## ##### ###### ##### +# # # # # # # # # # +# # # # # # # ##### # # +# # # ###### # # # # # +# # # # # # # # # # +###### #### # # ##### ###### ##### ################################################################## # DECODE AND READ _passenger.ipfs with BB Passphrase @@ -273,12 +273,12 @@ echo #You must execute that code. # ..... TODO ...... # 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 # .... TODO .... -# Once contract is validated +# Once contract is validated # NodeN will be able to decrypt _passenger.ipfs.NodeN.crypt' exit 0 @@ -286,13 +286,13 @@ exit 0 EOF 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) 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 " - _|_ _.o._ + _|_ _.o._ (_| |(_||| | : $NANODATE J0=${J0} @@ -329,37 +329,37 @@ echo "${ISSUER}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.issuer echo "${J}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.ipns if [[ "${PASSENGERNAME}" != "" ]]; then - echo "${PASSENGERNAME}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.filename - # COPY METADATA!! TODO : Please Extend filesource FOR new metadata types. torrent ? - extractor=$(cat "$METADATA" | jq -r '.extractor') - - youtubeid=$(cat "$METADATA" | jq -r '.id') - fulltitle=$(cat "$METADATA" | jq -r '.fulltitle') - echo "$fulltitle" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.fulltitle -# description=$(cat "$METADATA" | jq -r '.description') - artist=$(cat "$METADATA" | jq -r '.artist') - album=$(cat "$METADATA" | jq -r '.album') - duration=$(cat "$METADATA" | jq -r '.duration') - upload_date=$(cat "$METADATA" | jq -r '.upload_date') - uploader_id=$(cat "$METADATA" | jq -r '.uploader_id') - - extractor=$(cat "$METADATA" | jq -r '.extractor') - [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json ]] \ - && cp -f "${METADATA}" /tmp/ - mv /tmp/${youtubeid}.info.json ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json + echo "${PASSENGERNAME}" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.filename + # COPY METADATA!! TODO : Please Extend filesource FOR new metadata types. torrent ? + extractor=$(cat "$METADATA" | jq -r '.extractor') + + youtubeid=$(cat "$METADATA" | jq -r '.id') + fulltitle=$(cat "$METADATA" | jq -r '.fulltitle') + echo "$fulltitle" > ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.fulltitle +# description=$(cat "$METADATA" | jq -r '.description') + artist=$(cat "$METADATA" | jq -r '.artist') + album=$(cat "$METADATA" | jq -r '.album') + duration=$(cat "$METADATA" | jq -r '.duration') + upload_date=$(cat "$METADATA" | jq -r '.upload_date') + uploader_id=$(cat "$METADATA" | jq -r '.uploader_id') + + extractor=$(cat "$METADATA" | jq -r '.extractor') + [[ ! -f ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json ]] \ + && cp -f "${METADATA}" /tmp/ + mv /tmp/${youtubeid}.info.json ~/.zen/ipfs/.$IPFSNODEID/TAG/${ZENSOURCE}/_tag.passenger.metadata.${extractor}.json fi 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) echo " - _ ____ + _ ____ (_)___ / __/____ / / __ \/ /_/ ___/ - / / /_/ / __(__ ) -/_/ .___/_/ /____/ - /_/ + / / /_/ / __(__ ) +/_/ .___/_/ /____/ + /_/ ipfs ls /ipfs/${I} 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 ######################################################################## echo " - _ _ _ _ _ _ -/ \|_) / / \| \|_ + _ _ _ _ _ _ +/ \|_) / / \| \|_ \_X| \ \_\_/|_/|_ ................................. " # 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}" ## TODO PROD REMOVE WRITE FILE -echo "QRCodes CREATED !! -See it : +echo "QRCodes CREATED !! +See it : xviewer ~/.zen/tag/${AAH}/_QRCODE.read.png & xviewer ~/.zen/tag/${AAH}/_QRCODE.write.png & @@ -397,7 +397,7 @@ ${AA} # SBOT PUBLISH ######################################################################## if [[ "${PASSENGERNAME}" != "" ]]; then - echo "$ISSUER" + echo "$ISSUER" msg="$(sbotc get '{"id":"'"$ISSUER"'"}')" # echo "$msg" | jq #DEBUG [[ $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_branch=$(printf %s "$msg" | jq -r .value.content.branch) [[ $msg_branch == "null" ]] && msg_branch=$ISSUER - - # ATTACH ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg - name="ssb_thumb.jpg" - id="$(sbotc blobs.add < ~/.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)" - + + # ATTACH ~/.zen/miam/$ZENSOURCE/ssb_thumb.jpg + name="ssb_thumb.jpg" + id="$(sbotc blobs.add < ~/.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)" + export MESSAGE=$(cat << EOF [![ssb_thumb.jpg](${id})](http://127.0.0.1:8080/ipfs/$IPASSENGER/$PASSENGERNAME) @@ -432,10 +432,10 @@ if [[ "${PASSENGERNAME}" != "" ]]; then #astroport EOF ) - + echo " - __ _ ____ -(_ |_)/ \| + __ _ ____ +(_ |_)/ \| __)|_)\_/| POST root: $msg_root -- 2.39.2 From 231c549788f128906de61443b3cc0692e211224a Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 02:01:39 +0200 Subject: [PATCH 107/133] $3 is Gchange G1PUB --- ajouter_video.sh | 6 +++--- cron_MINUTE.sh | 5 +++-- zen/new_file_in_astroport.sh | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 4e3c332..a08a316 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -526,7 +526,7 @@ MIME=$(file --mime-type $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} | ######################################################################## # 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 # LOG NOISE # [[ -f ~/astroport/${CAT}/${MEDIAID}/video.json ]] && cat ~/astroport/${CAT}/${MEDIAID}/video.json ######################################################################## @@ -541,7 +541,7 @@ echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_N 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 #[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\" #reponse=\$1 @@ -553,7 +553,7 @@ echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh # ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\" #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 +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 diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 7b438b5..8740d2e 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -170,8 +170,8 @@ if [[ $(($runtime % 15)) == 0 ]]; then ######################################################################## # 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 nc && killall instascan_login.sh && ~/.zen/Astroport.ONE/tools/instascan_login.sh & -[[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh & +[[ $instascan ]] && killall instascan_login.sh && killall nc && ~/.zen/Astroport.ONE/tools/instascan_login.sh >> /tmp/instascan.log & +[[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh >> /tmp/instascan.log & # git reset --hard cd $MY_PATH @@ -336,6 +336,7 @@ echo ' # New full test review in gchange_INIT.sh rm -f ~/.ipfs/test.disk + rm -f /tmp/instascan.log # LOG ROTATE WEEKLY [[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 9a1f363..507d43f 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -453,11 +453,11 @@ then ] ' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json -## Add tidller into Station Balise +echo "Add tidller into Station Balise" cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/tiddler.json -## 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 " +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) -- 2.39.2 From 93ba46433d1c13a4303c7ce904c077273cd31d92 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 02:04:16 +0200 Subject: [PATCH 108/133] is it correct now? --- zen/new_file_in_astroport.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 507d43f..ccfcd0b 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -463,8 +463,8 @@ echo "SEND TW json to GCHANGE (call from g1-compagnon" # 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 "~/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 ~/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 -- 2.39.2 From b6bf164b571cbf835da08d6f4b4fad09c7ffe5c8 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 04:08:54 +0200 Subject: [PATCH 109/133] screen.png correction --- zen/new_file_in_astroport.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index ccfcd0b..3fb243d 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -285,6 +285,7 @@ rm /tmp/.ipfsid ## 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}/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}/ -- 2.39.2 From de1cedf1573eb69c218ed8185c4409bee2cd25ee Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 04:09:21 +0200 Subject: [PATCH 110/133] Problem with instascan relaunching... --- cron_MINUTE.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 8740d2e..dc41313 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -170,8 +170,8 @@ if [[ $(($runtime % 15)) == 0 ]]; then ######################################################################## # 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 >> /tmp/instascan.log & -[[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh >> /tmp/instascan.log & +[[ $instascan ]] && killall instascan_login.sh && killall nc && ~/.zen/Astroport.ONE/tools/instascan_login.sh & +[[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh & # git reset --hard cd $MY_PATH -- 2.39.2 From c4d8eefd2bb2dcd71b59f4d35055c80611f599c2 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 04:10:50 +0200 Subject: [PATCH 111/133] INSTASCAN API --- cron_MINUTE.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index dc41313..8adc0cb 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -170,8 +170,8 @@ if [[ $(($runtime % 15)) == 0 ]]; then ######################################################################## # 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 & +[[ $instascan ]] && killall instascan_login.sh && killall nc # && ~/.zen/Astroport.ONE/tools/instascan_login.sh & +# [[ ! $instascan ]] && ~/.zen/Astroport.ONE/tools/instascan_login.sh & # git reset --hard cd $MY_PATH -- 2.39.2 From a67fb6486c01d49f0106ffb3f400a48145ed445a Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 14 Jun 2022 04:45:46 +0200 Subject: [PATCH 112/133] screen capture error was stopping import --- ajouter_video.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index a08a316..56cc3b7 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -433,18 +433,20 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]" ######################################################################## # Screen capture is used as thumbnail ######################################################################## -zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA" -sleep 1 -[[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]] && import -window root /tmp/screen.png - +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 #### ################################### 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 -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}" + if [ $? == 0 ]; then zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..." else -- 2.39.2 From efc542158c0b231a3bdf8361b0ea90accc9820c3 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 16 Jun 2022 00:35:53 +0200 Subject: [PATCH 113/133] Ask PIN to myself --- zen/new_file_in_astroport.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 3fb243d..210b9be 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -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" # .ipfsid.encrypt is searched by each Station running ./zen/tools/autoPINfriends.sh 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 ######################################################################## @@ -512,5 +519,5 @@ echo "#### EXCECUTION TIME" end=`date +%s` echo Execution time was `expr $end - $start` seconds. 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 -- 2.39.2 From b36cb9f7c43875938a1f1ee274c144b0ce5105cd Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Jun 2022 16:11:58 +0200 Subject: [PATCH 114/133] netcat-openbsd 1234 trick --- ajouter_video.sh | 36 ++++++++++++++++++++++++++++++++++-- install.sh | 2 +- zen/ipns_self_publish.sh | 13 ++++++++++--- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 56cc3b7..7cec7cd 100755 --- a/ajouter_video.sh +++ b/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 xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1 +# Check who is .current PLAYER +PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) +PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) +PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) +MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) +QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) + + URL="$1" if [ $URL ]; then echo "URL: $URL" @@ -38,7 +48,7 @@ if [ $URL ]; then CHOICE="$IMPORT" 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 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!) -[[ $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="Film" Serie Youtube Video Astronaute) [[ $CHOICE == "" ]] && exit 1 # LOWER CARACTERS @@ -117,6 +127,28 @@ PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A ######################################################################## case ${CAT} in ######################################################################## +# CASE ## ASTRONAUTE +# _ _ +# __ _ ___| |_ _ __ ___ _ __ __ _ _ _| |_ ___ +# / _` / __| __| '__/ _ \| '_ \ / _` | | | | __/ _ \ +# | (_| \__ \ |_| | | (_) | | | | (_| | |_| | || __/ +# \__,_|___/\__|_| \___/|_| |_|\__,_|\__,_|\__\___| +# +# +######################################################################## + astronaute) + +# INSTASCAN G1PUB CAPTURE +~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE" + +if [[ $CAPTAIN == $PLAYER ]]; then + zenity --warning --width 300 --text "Bienvenue $PLAYER" + +fi + + exit 0 + ;; +######################################################################## # CASE ## YOUTUBE # _ _ # _ _ ___ _ _| |_ _ _| |__ ___ diff --git a/install.sh b/install.sh index 322c7bc..5eb7636 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ sudo apt-get update 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 +for i in git fail2ban netcat-openbsd 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 echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" sudo apt install -y $i diff --git a/zen/ipns_self_publish.sh b/zen/ipns_self_publish.sh index 363424c..6610b76 100755 --- a/zen/ipns_self_publish.sh +++ b/zen/ipns_self_publish.sh @@ -6,13 +6,20 @@ ME="${0##*/}" countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) [[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 ######################################################################## -IPFSNODEID=$(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 ######################################################################## -echo "Adding ~/.zen/ipfs to IPFS" +echo "Adding ~/.zen/ipfs/ to IPFS" # MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) # OLDCHAIN=$(cat ~/.zen/ipfs/.${IPFSNODEID}/.chain) # echo "OLD: $OLDCHAIN != NEW:$MIPFS ?" -- 2.39.2 From b21b7e342681d18c388f0d74c438f3cf23eff728 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Jun 2022 16:19:03 +0200 Subject: [PATCH 115/133] netcat-traditional --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5eb7636..b661679 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ sudo apt-get update sudo apt install -y $i; done -for i in git fail2ban netcat-openbsd inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev; do +for i in git fail2ban netcat-traditional 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 echo ">>> Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" sudo apt install -y $i -- 2.39.2 From 251b5f24af874a7e3c790d506fca4bfe1bb2515c Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Jun 2022 17:04:22 +0200 Subject: [PATCH 116/133] New Bootstrap Station "cancer.copylaradio.com" (CAPTAIN = yan14tricot75 = GmUD53TFfEfb6NiVqYXwxMGbxpP9nKgHPgF4jex6FBvj) --- A_boostrap_nodes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/A_boostrap_nodes.txt b/A_boostrap_nodes.txt index 5a4c09a..6d0e93d 100644 --- a/A_boostrap_nodes.txt +++ b/A_boostrap_nodes.txt @@ -3,3 +3,5 @@ /ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN # aries.copylaradio.com (thuya83pk) = HbBJDXDrN8swxvMohMxmegYRyZ7m99jqgxwwN1gwxck2 /ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx +# cancer.copylaradio.com (yan14tricot75) = GmUD53TFfEfb6NiVqYXwxMGbxpP9nKgHPgF4jex6FBvj +/ip4/185.202.238.69/udp/4001/quic/p2p/12D3KooWRaqNpB2xr8w5WGDvU9HHj9MST9Rnp1kmMGc67e6z98ef -- 2.39.2 From 1f6aa0e23c410196a52bad019754e33eb1c1f131 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 22 Jun 2022 17:31:35 +0200 Subject: [PATCH 117/133] Refresh experimental Astronaut TW channels --- zen/ipns_MOA_publish.sh | 33 +++++++++++++++++++++++++++++++++ zen/ipns_PLAYER_publish.sh | 31 +++++++++++++++++++++++++++++++ zen/ipns_TW5_publish.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100755 zen/ipns_MOA_publish.sh create mode 100755 zen/ipns_PLAYER_publish.sh create mode 100755 zen/ipns_TW5_publish.sh diff --git a/zen/ipns_MOA_publish.sh b/zen/ipns_MOA_publish.sh new file mode 100755 index 0000000..efabde8 --- /dev/null +++ b/zen/ipns_MOA_publish.sh @@ -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" diff --git a/zen/ipns_PLAYER_publish.sh b/zen/ipns_PLAYER_publish.sh new file mode 100755 index 0000000..2a9f7b4 --- /dev/null +++ b/zen/ipns_PLAYER_publish.sh @@ -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" diff --git a/zen/ipns_TW5_publish.sh b/zen/ipns_TW5_publish.sh new file mode 100755 index 0000000..f94ef31 --- /dev/null +++ b/zen/ipns_TW5_publish.sh @@ -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" -- 2.39.2 From 1a1eda6f4ac89757da02d6018939162ca03aa6d8 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 23 Jun 2022 18:38:43 +0200 Subject: [PATCH 118/133] gchange+ synchro to check --- cron_MINUTE.sh | 4 +++- zen/gchange_IPFS_swarm.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 8adc0cb..157ce50 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -218,7 +218,9 @@ fi ## SYNC GCHANGE EVERY 12 hours runtime if [[ $(($runtime % 725)) == 0 || "$runtime" == "5" ]]; then kill -9 $(ps auxf --sort=+utime | grep -w gchange_INIT.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_INIT.sh" - $MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt +# $MY_PATH/zen/gchange_INIT.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.txt +# ~/.zen/Astroport.ONE/tools/Connect_PLAYER_To_Gchange.sh > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_INIT.tx +# TODO REWRITE GCHANGE SYNC. fi # If NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h) if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) && $runtime -gt 360 ]]; then diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 5c5783e..91cc935 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -1,6 +1,6 @@ #!/bin/bash ######################################################################## -# Author: Fred (support@qo-op.com) +# Author: Fred (support@qo-op.com) - Rewriter - Anonymous # Version: 2020.12.03 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## -- 2.39.2 From 3c9c5faedbea648dd333da174cba0b7263f72078 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 23 Jun 2022 19:15:46 +0200 Subject: [PATCH 119/133] Quicker autoPINfriends --- cron_MINUTE.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 157ce50..642a37e 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -240,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" killall chromium $MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt + $MY_PATH/zen/tools/autoPINfriends.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.autoPINfriends.txt fi - ################################################################## # # _________ ______ -- 2.39.2 From 03a032590b863d6e441509142048c84f6a3dc3b5 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 23 Jun 2022 19:26:55 +0200 Subject: [PATCH 120/133] AstroBlog first --- ajouter_video.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ajouter_video.sh b/ajouter_video.sh index 7cec7cd..2fc8646 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -112,7 +112,7 @@ YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail ######################################################################## # CHOOSE CATEGORY (remove anime, not working!) -[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre ajout" --entry-text="Film" Serie Youtube Video Astronaute) +[[ $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 # LOWER CARACTERS @@ -136,15 +136,16 @@ case ${CAT} in # # ######################################################################## - astronaute) + astroblog) -# INSTASCAN G1PUB CAPTURE -~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE" + # INSTASCAN G1PUB CAPTURE + ~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE" -if [[ $CAPTAIN == $PLAYER ]]; then - zenity --warning --width 300 --text "Bienvenue $PLAYER" + zenity --warning --width 300 --text "$PLAYER. Prêt à enregistrer votre video ?" + + ## RECORD WEBCAM VIDEO + ~/.zen/Astroport.ONE/tools/vlc_webcam.sh -fi exit 0 ;; -- 2.39.2 From a800da8a2124fe682a1380ae1fe397dc0a188557 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 26 Jun 2022 21:32:08 +0200 Subject: [PATCH 121/133] $3 is the G1PUB of the PLAYER --- ajouter_video.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ajouter_video.sh b/ajouter_video.sh index 2fc8646..238796a 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -588,6 +588,7 @@ echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh # ~/.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 -- 2.39.2 From f0036ca121ff14003b295dc71d2416ae86b47f92 Mon Sep 17 00:00:00 2001 From: Yann Autissier Date: Fri, 1 Jul 2022 19:25:45 +0200 Subject: [PATCH 122/133] fix install --- include.sh | 109 ++++++++++++++++++++++++++--------------------------- install.sh | 18 ++++++++- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/include.sh b/include.sh index c39653a..53c601c 100644 --- a/include.sh +++ b/include.sh @@ -1,11 +1,59 @@ #!/bin/bash [ "${DEBUG}" ] && set -x -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 "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..." +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 + git clone https://git.p2p.legal/axiom-team/astrXbian.git + git clone https://git.p2p.legal/qo-op/Astroport.ONE.git +} + +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() { + 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 [[ "$user" != "xbian" ]] &&\ @@ -72,57 +120,6 @@ check_requirements() { sudo ln -f -s /usr/bin/python3 /usr/bin/python } -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 - git clone https://git.p2p.legal/axiom-team/astrXbian.git - git clone https://git.p2p.legal/qo-op/Astroport.ONE.git -} - -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() { - echo "=== IMPORT configuration ASTROPORT dans ~/.kodi" - cp -Rf ~/.zen/astrXbian/.install/.kodi ~/ -} - 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 diff --git a/install.sh b/install.sh index 81f4c74..d56ec8d 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -. ./include.sh + ######################################################################## # Version: 0.5.0 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) @@ -9,14 +9,28 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +# INSTALLATION section of README does wget file install.sh and run it with bash +if [ -f ${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 +[[ ! $(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 "appuyez sur entrer pour commencer."; read test; [[ "$test" != "" ]] && echo "sortie" && exit 0 ## ajouter confirmation à chaque nouvelle étape (+explications) +echo + # Install requirements -check_requirements +install_requirements # Clone astrXbian and Astroport.One import_astrXbian -- 2.39.2 From c1eccdfe11008db4591b2b7c90b1a1ff7b89e186 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 3 Jul 2022 14:44:27 +0200 Subject: [PATCH 123/133] change CORS parameters depending on your allowed astroport domains --- .install/ipfs_alone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index 60ac522..2759362 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -90,7 +90,7 @@ ipfs config --json Experimental.Libp2pStreamMounting true ipfs config --json Experimental.P2pHttpProxy true ipfs config --json Swarm.ConnMgr.LowWater 0 ipfs config --json Swarm.ConnMgr.HighWater 0 -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' +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-Credentials '["true"]' ######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### -- 2.39.2 From 2431cb5369eadad2701cce5a14ce5a5f84250807 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 4 Jul 2022 15:18:54 +0200 Subject: [PATCH 124/133] ## Create TW5 index.html to give easy control access to MEDIAKEY and KEY owner --- zen/new_file_in_astroport.sh | 37 +++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 210b9be..ac0b6a8 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -276,7 +276,7 @@ echo "anonymous" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${PINnode # MEMORIZE my PIN mkdir -p ~/.zen/PIN/${IPFSREPFILEID}/ touch ~/.zen/PIN/${IPFSREPFILEID}/${G1PUB} -# echo "$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1)" > ~/.zen/PIN/${ipfsrepidfile}/IPNSLINK # NO!! Would let PINing nodes change index.html/// +# 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 @@ -316,6 +316,8 @@ rm /tmp/.ipfsid # one star level (no encrypt) # index.html is presenting Astroport/Kodi service then redirect to # $G1PUB/index.html contains redirection to ipfs link +## NEW RELEASE +## Create TW5 index.html to give easy control access to MEDIAKEY and KEY owner ######################################################################## ######################################################################## @@ -327,14 +329,31 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) # https://tube.copylaradio.com/ipns/$IPNSLINK #envsubst < ./www/boris/youtube_watch_step2.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - echo "=======> Mediakey Welcome index.html " - cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \ - | sed "s/\${IPNSLINK}/$IPNSLINK/g" \ - | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ - | sed "s/\${XZUID}/$XZUID/g" \ - | sed "s/\${G1PUB}/$G1PUB/g" \ - | sed "s/\${TITLE}/$TITLE/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html +# echo "=======> Mediakey Welcome index.html " +# cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \ +# | sed "s/\${IPNSLINK}/$IPNSLINK/g" \ +# | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ +# | sed "s/\${XZUID}/$XZUID/g" \ +# | sed "s/\${G1PUB}/$G1PUB/g" \ +# | sed "s/\${TITLE}/$TITLE/g" \ +# > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + +### PATCH TW5 + echo "=======> Mediakey TW5 /ipns/$KEY" + + cp ~/.zen/Astroport.ONE/templates/dreamcatcher.html ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + + sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~_TITRE_~${TITLE}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~_MOANS_~${MEDIAKEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + + # Configure IPNS publication key + sed -i "s~_MEDIAKEY_~${MEDIAKEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${KEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + +### PATCH TW5 ## SECOND REDIRECT PAGE ${MEDIAKEY}/${G1PUB}/index.html # https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/ -- 2.39.2 From 927f61b4d1cabc78824cab67bb3561bd0dd55ffa Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 4 Jul 2022 17:04:46 +0200 Subject: [PATCH 125/133] better TW5 integration, precharged to allow further control over MEDIAKEY --- zen/new_file_in_astroport.sh | 58 ++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index ac0b6a8..2040f52 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -329,29 +329,37 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) # https://tube.copylaradio.com/ipns/$IPNSLINK #envsubst < ./www/boris/youtube_watch_step2.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html -# echo "=======> Mediakey Welcome index.html " -# cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \ -# | sed "s/\${IPNSLINK}/$IPNSLINK/g" \ -# | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ -# | sed "s/\${XZUID}/$XZUID/g" \ -# | sed "s/\${G1PUB}/$G1PUB/g" \ -# | sed "s/\${TITLE}/$TITLE/g" \ -# > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + echo "=======> Mediakey Welcome index.html " + cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step2.html \ + | sed "s/\${IPNSLINK}/$IPNSLINK/g" \ + | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ + | sed "s/\${XZUID}/$XZUID/g" \ + | sed "s/\${G1PUB}/$G1PUB/g" \ + | sed "s/\${TITLE}/$TITLE/g" \ + > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html -### PATCH TW5 +### 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}/index.html + 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_~${IPFSROOT}~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~_PLAYER_~${PLAYER}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - sed -i "s~_TITRE_~${TITLE}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - sed -i "s~_MOANS_~${MEDIAKEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/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~_MEDIAKEY_~${MEDIAKEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html - sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${KEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html + sed -i "s~k2k4r8naeti1ny2hsk3a0ziwz22urwiu633hauluwopf4vwjk4x68qgk~${KEY}~g" ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html ### PATCH TW5 @@ -359,14 +367,14 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) # https://tube.copylaradio.com/ipns/$IPNSLINK/${G1PUB}/ #envsubst < ../www/boris/youtube_watch_step3.html > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html - echo "=======> Mediakey Contract index.html " - cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \ - | sed "s/\${TITLE}/$TITLE/g" \ - | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ - | sed "s/\${XZUID}/$XZUID/g" \ - | sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \ - | sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \ - > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html +# echo "=======> Mediakey Contract index.html " +# cat /home/$YOU/.zen/astrXbian/www/boris/youtube_watch_step3.html \ +# | sed "s/\${TITLE}/$TITLE/g" \ +# | sed "s/\${IPFSNODEID}/$IPFSNODEID/g" \ +# | sed "s/\${XZUID}/$XZUID/g" \ +# | sed "s/\${IPFSREPFILEID}/$IPFSREPFILEID/g" \ +# | sed "s/\${URLENCODE_FILE_NAME}/$URLENCODE_FILE_NAME/g" \ +# > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html # echo "" > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html -- 2.39.2 From 08a91c07b408fc0f850ee8dccd79be241113e922 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 5 Jul 2022 14:03:22 +0200 Subject: [PATCH 126/133] correction tw5 init --- zen/new_file_in_astroport.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index 2040f52..afc5320 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -349,8 +349,9 @@ IPNSLINK=$(ipfs key list -l | grep ${MEDIAKEY} | cut -d ' ' -f 1) 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_~${IPFSROOT}~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 -- 2.39.2 From 4eb521a8a95208100f40b04f580df8ff78f188ec Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 7 Jul 2022 13:11:30 +0200 Subject: [PATCH 127/133] add gpg --- include.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include.sh b/include.sh index 53c601c..4740fe6 100644 --- a/include.sh +++ b/include.sh @@ -63,7 +63,7 @@ install_requirements() { sudo apt install -y $i; done - for i in git fail2ban netcat-traditional inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel python3-dotenv mpack libssl-dev libffi-dev; do + for i in 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; do if [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" sudo apt install -y $i @@ -98,7 +98,7 @@ install_requirements() { 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 duniterpy pynacl pgpy + python3 -m pip install -U cryptography Ed25519 base58 google duniterpy pynacl pgpy gpg python3 -m pip install -U nicotine-plus silkaj python3 -m pip install -U protobuf==3.19.0 -- 2.39.2 From fb029124bc9a094ec757007645a1e43bcad75856 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 8 Jul 2022 17:07:00 +0200 Subject: [PATCH 128/133] TW5 evolution --- ISOconfig.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ISOconfig.sh b/ISOconfig.sh index 1a9d3d6..1257ead 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -302,6 +302,7 @@ echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/brother_ql_print" | (sudo su -c 'E ## 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/Astroport.ONE/templates/moawiki.html ]] && cp ~/.zen/Astroport.ONE/templates/moawiki.html ~/.zen/ipfs/.${IPFSNODEID}/index.html ######################################################################## -- 2.39.2 From 7aa0f81e1155ce8c291694339abcc7472a58077d Mon Sep 17 00:00:00 2001 From: Yann Autissier Date: Mon, 25 Jul 2022 19:27:19 +0200 Subject: [PATCH 129/133] fix install --- include.sh | 65 +++++++++++++++++++++++++++--------------------------- install.sh | 6 +++-- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include.sh b/include.sh index 4740fe6..e711d04 100644 --- a/include.sh +++ b/include.sh @@ -22,8 +22,12 @@ import_astrXbian() { mkdir -p ~/.zen cd ~/.zen # TODO INSTALL FROM IPFS / IPNS - git clone https://git.p2p.legal/axiom-team/astrXbian.git - git clone https://git.p2p.legal/qo-op/Astroport.ONE.git + [ ! -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() { @@ -48,6 +52,11 @@ import_jaklis() { } 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 ~/ } @@ -56,34 +65,24 @@ install_requirements() { echo "mise à jour des dépots de votre distribution..." sudo apt-get update - [[ "$user" != "xbian" ]] &&\ - for i in x11-utils xclip zenity handbrake*; do\ - [ $(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 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; do - if [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then - echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - sudo apt install -y $i - fi + 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 - 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 - if [ $(dpkg-query -w -f='${status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then - echo ">>> installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - sudo apt install -y $i - fi - done - - [[ ! $(which kodi) && "$user" != "xbian" ]] &&\ - echo ">>> installation kodi + vstream = votre videotheque ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";\ - sudo apt-get install kodi -y;\ - ${MY_PATH}/.install/kodi_uqload_downloader.sh - - echo "## INSTALLATION AstroGEEK OpenCV = 'Intelligence Amie' " - sudo apt-get install python3-opencv -y + [ -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" @@ -97,11 +96,11 @@ install_requirements() { 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 duniterpy pynacl pgpy gpg - python3 -m pip install -U nicotine-plus silkaj - python3 -m pip install -U protobuf==3.19.0 - + 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" diff --git a/install.sh b/install.sh index d56ec8d..20a7622 100755 --- a/install.sh +++ b/install.sh @@ -36,10 +36,10 @@ install_requirements import_astrXbian # Init ipfs -import_ipfs +# import_ipfs # Copy astroport config in kodi -import_kodi +# import_kodi # Jaklis setup import_jaklis @@ -122,3 +122,5 @@ https://astroport.com # MAIN # fi } + +~/.zen/astrXbian/zen/cron_VRFY.sh -- 2.39.2 From 7f9ab62be2fca6571d0b2e1673a82afb6e1b6ce4 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 22 Aug 2022 17:39:32 +0200 Subject: [PATCH 130/133] Adapt accepted CORS --- .install/ipfs_alone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index 2759362..f29f92c 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -90,7 +90,7 @@ ipfs config --json Experimental.Libp2pStreamMounting true ipfs config --json Experimental.P2pHttpProxy true ipfs config --json Swarm.ConnMgr.LowWater 0 ipfs config --json Swarm.ConnMgr.HighWater 0 -ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://astroport", "https://astroport.com", "https://qo-op.com", "https://tube.copylaradio.com" ]' +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"]' ######### CLEAN DEFAULT BOOTSTRAP TO STAY INVISIBLE ########### -- 2.39.2 From 7d48170705483779178a710602134fca491e61c1 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 22 Aug 2022 18:02:11 +0200 Subject: [PATCH 131/133] Adapt accepted CORS --- .install/ipfs_alone.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.install/ipfs_alone.sh b/.install/ipfs_alone.sh index f29f92c..db0bddf 100755 --- a/.install/ipfs_alone.sh +++ b/.install/ipfs_alone.sh @@ -93,6 +93,10 @@ 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 ########### ipfs bootstrap rm --all ########################################### -- 2.39.2 From 75b95617214e494e3598d05acdf4f3c4eeaa5fde Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 24 Aug 2022 16:29:54 +0200 Subject: [PATCH 132/133] ISOConfig put the right config to Station --- ISOconfig.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index 1257ead..76bf627 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -125,12 +125,12 @@ echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player ######################################################################## 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 ######################################################################## echo "CREATING CESIUM+ PROFILE" ######################################################################## -~/.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 ######################################################################## ### DELETE (see uninstall.sh) @@ -281,7 +281,7 @@ do done # AVOID CONFLICT WITH KODI REMOTE -ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8080" +ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080" ######################################################################## # SUDO permissions -- 2.39.2 From c763c25cdded30fb649a75be8442fd3824f3a704 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 24 Aug 2022 16:46:02 +0200 Subject: [PATCH 133/133] no cesium. too much timeout --- ISOconfig.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index 76bf627..c44ab98 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -128,10 +128,10 @@ echo "CREATING GCHANGE+ PROFILE" ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" set --name "Station $XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #GCHANGE+ [[ ! $? == 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.presles.fr" set --name "Station $XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+ -[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && exit 1 +# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.presles.fr" set --name "Station $XZUID" --avatar "/home/$USER/.zen/astrXbian/logo.png" #CESIUM+ +# [[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && exit 1 ######################################################################## ### DELETE (see uninstall.sh) # ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://g1.data.e-is.pro" erase -- 2.39.2