Compare commits

...

594 Commits

Author SHA1 Message Date
fred 37392870d9 Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2022-06-02 17:47:14 +02:00
fred eeac0e27d2 KODI PLUGIN !!! TODO MAKE PLAYER ROTATION 2022-06-02 17:46:45 +02:00
fred fd2d9bb048 Appuyez sur la touche ENTREE pour démarrer le mode Aventure 2022-06-02 17:46:14 +02:00
support 54a198c570 Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2022-06-01 22:44:11 +02:00
support 0462a8f6c3 Check .current player legal acceptance 2022-06-01 22:43:10 +02:00
fred 5474cf1699 sudo brother_ql_print for ALL 2022-06-01 16:16:08 +02:00
fred 1f52333d6c python crypto tools 2022-06-01 14:43:23 +02:00
fred 4f45e0908e IPFS must be installed before astrXbian. Creating systemd startup scripts 2022-06-01 14:21:07 +02:00
fred 0da2b86a69 git pull Astroport.ONE 2022-05-31 18:01:22 +02:00
fred 77bd8fce3e system file for ipfs daemon 2022-05-28 17:46:25 +02:00
fred 1c3c68b102 correct space in name error 2022-05-28 04:55:30 +02:00
fred fee7958523 better finishing delayed batch scripts 2022-05-28 04:09:00 +02:00
fred f49fbb1835 +IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID) 2022-05-28 03:05:51 +02:00
fred b69bc7c2d4 Add Astroport.ONE game into astrXbian 2022-05-14 15:56:55 +02:00
fred 22fe374bbd oui 2022-05-08 21:25:15 +02:00
fred 34f42406bb nous capturons votre écran comme vignette MEDIA 2022-05-05 23:33:03 +02:00
fred c691413f3e TODO REMOVE update_bashrc.sh... Not so good idea since Astroport.One switch identities between captains 2022-05-05 18:06:40 +02:00
fred aabef16b80 Now opens 'playerns' and Journal to ease 'qo-op' or 'moa' feed 2022-05-05 16:03:05 +02:00
fred 7f91392da5 unlock 2022-05-05 03:31:08 +02:00
fred 39c625f340 MY_PATH error in VirtualBox 2022-05-05 03:29:21 +02:00
fred 1ec61da4cc www-data cannot use cli 2022-05-03 23:15:00 +02:00
fred 8c3caeb4b7 Add visitor monitoring 2022-05-03 16:45:52 +02:00
fred 0daaf2e86b !missing json part 2022-04-28 20:37:50 +02:00
fred b0b9247592 NO _canonical_uri if empty 2022-04-28 20:26:19 +02:00
fred f72f4269bb screen.png 2022-04-28 01:27:45 +02:00
fred 109199dbab check DISPLAY not an X11 export 2022-04-26 22:14:04 +02:00
fred 41782ddca5 nicotine-plus as soulseek network client 2022-04-26 13:30:08 +02:00
fred 73d7c85552 write ~/astroport/Add_${MEDIAKEY}_script.sh for later batch import 2022-04-26 11:27:33 +02:00
fred b51899157b error at the end 2022-04-24 18:27:28 +02:00
fred cab9290bb9 work in progress 2022-04-24 17:22:32 +02:00
fred 2c19940ebb ## Ajouter confirmation à chaque nouvelle étape (+explications) 2022-04-24 16:44:12 +02:00
fred a18a8d220d separate .install/kodi_uqload_downloader.sh 2022-04-24 16:37:49 +02:00
fred a016819b87 publish "mime": "'${REAL}'", 2022-04-23 22:26:14 +02:00
fred 76198f678f capture votre écran comme vignette /ipfs/$SCREENDIR/screen.png 2022-04-23 21:23:13 +02:00
fred 616adfa6ec # COPY TIDDLER JSON TO DESKTOP Journal/${TYPE} & Clipboard paste Ctrl+V 2022-04-23 19:40:59 +02:00
fred d2c3925455 Add GENRE tag 2022-04-23 03:55:50 +02:00
fred 19129c3bf1 tiddler astroport tag 2022-04-23 03:47:27 +02:00
fred ef25f477c0 video tag 2022-04-23 03:41:20 +02:00
fred f0abc89769 subs error 2022-04-23 02:43:04 +02:00
fred 21ca6b213c fixings 2022-04-23 02:31:40 +02:00
fred cc549848ad new tiddler json format 2022-04-23 00:26:31 +02:00
fred 2240e01373 FILE_SIZE 2022-04-22 20:41:30 +02:00
fred c31099c7a6 AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT 2022-04-22 20:34:47 +02:00
fred 33906a35d4 Script was stuck running background with h265 conversion question. 2022-04-22 20:32:37 +02:00
fred 63037a0366 Copy les tiddler json vers Bureau/Journal 2022-04-22 20:20:04 +02:00
fred e683c731a8 remove pause debug 2022-04-22 19:14:16 +02:00
fred ae33326041 IPNS="$(ipfs key list -l | grep -w ${MEDIAKEY} | cut -f 1 -d ' ')" 2022-04-22 19:11:50 +02:00
fred c1e9e2a5c1 getting back IPNS in case there is no peers in swarm 2022-04-22 19:08:36 +02:00
fred ac39d2e24b ~/astroport/${TYPE}/${MEDIAKEY}.dragdrop.json 2022-04-22 18:28:40 +02:00
fred f2cd8ba18c remove -x debug mode 2022-04-22 17:55:49 +02:00
fred d4e820b393 more detailed tiddler 2022-04-22 17:24:29 +02:00
fred 50583fc411 PAGE is now recorded in Astroport as pdf + tiddler.json ready to load 2022-04-22 17:15:18 +02:00
fred 22b006ea9f add tiddler & www page pdf copy 2022-04-22 16:10:31 +02:00
fred f5fb5cd4fc Install and link youtube-dl with yt-dlp 2022-04-22 13:11:11 +02:00
fred c499d93c29 install ipfs with full API.HTTPHeaders.Access-Control 2022-04-22 13:03:38 +02:00
fred e336648c31 NOW INSTALL yt-dlp AND LINK TO youtube-dl 2022-04-22 13:02:21 +02:00
fred 899e66be1f yt-dlp 2022-04-22 11:53:30 +02:00
fred b658923dd8 multiple tiddlywiki templates to sed. INCLUDE tiddlyipfs git add .! 2022-04-18 17:25:04 +02:00
fred 07db104b03 changing ipfs gateway port to 8080 2022-04-18 16:09:28 +02:00
fred 670cc64d3c Contact sur https://Famagenda.org (astroport) 2022-04-16 01:16:16 +02:00
fred d637dee3c7 Groupe Framagenda en cours de création 2022-04-16 01:07:20 +02:00
fred 979294898a controle du bootstrap au démarrage... à améliorer... 2022-04-16 01:04:51 +02:00
fred a6d2fa25e2 --write-auto-subs --sub-lang "*" 2022-03-25 18:46:39 +01:00
fred 39a7afa9c8 adding subs to video download. please test & report 2022-03-25 18:46:06 +01:00
fred 0904157e39 tmp file 2022-02-16 02:12:42 +01:00
fred 906f76c204 +ipfs config Addresses.Gateway "/ip4/0.0.0.0/tcp/8080" 2022-02-16 02:12:31 +01:00
fred 65b78e4f00 no ask to stop if inline URL=$1 provided 2021-12-30 19:32:15 +01:00
fred 192300bcb9 install youtube-dl if missing 2021-12-30 19:26:16 +01:00
fred b684115dd7 ffmpeg h265 add .mp4 extension to actual extension 2021-12-09 00:04:04 +01:00
fred f6016825d7 IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) 2021-12-03 23:59:57 +01:00
fred 7014112c36 on attend un peu plus la lecture de balise IPNS 2021-12-03 23:39:06 +01:00
fred e40d1eb766 ipfs id timeout 2021-12-01 01:54:54 +01:00
fred 679b61f8c7 éviter de surcharger /tmp avec YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)" 2021-11-30 18:40:24 +01:00
fred 1d16d76db4 Cliquez sur OK, nous allons préparer son script d'ajout à Astroport... 2021-11-30 15:29:02 +01:00
fred 8ac58e6369 IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') 2021-11-30 02:38:31 +01:00
fred 1aee58a6d6 encode h265 avant import? Option de réduction de la taille du fichier video 2021-11-29 23:43:43 +01:00
fred 4e1c0c6cf5 IPFS add delayed in ~/astroport/Add_${MEDIAKEY}_script.sh 2021-11-29 16:37:02 +01:00
fred 1b91bab056 Astroport Desktop link 2021-11-02 17:53:04 +01:00
fred 284feb8e7b Demande activation/desactivation Astroport/CRON/ipfs 2021-10-31 22:33:05 +01:00
fred a540cea051 activate/desactivate astroport/cron/ipfs 2021-10-31 21:36:10 +01:00
fred 8db2ef9858 ASTROPORT START if no ipfs daemon is running 2021-10-31 21:30:13 +01:00
fred ea3e841fea swarm desync correction 2021-10-21 02:42:48 +02:00
fred 1cc72149ab Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-10-20 22:35:03 +02:00
poka 001ca73aa2 Mise à jour de 'zen/jaklis/.env' 2021-10-17 19:30:40 +02:00
qo-op 376dcb7125 Mise à jour de 'zen/ipfs_SWARM_refresh.sh' 2021-10-07 10:48:14 +02:00
fred 92dcc8ef67 get FRIEND list from my own balise 2021-10-07 10:08:24 +02:00
fred 68a0921760 deplace map dans ~/.zen 2021-09-29 22:48:34 +02:00
fred 02b22a5515 libre 2021-09-29 22:20:21 +02:00
fred 2d978f0aca delayed new_file_in_astroport put in ~/.astroport/nf_$timestamp_cmd.sh 2021-09-29 22:08:23 +02:00
fred 82ebf9b3b7 p4n scraping desactivation 2021-09-29 18:10:18 +02:00
fred 1cd6ef1336 NOUS RECRUTONS 2021-09-28 17:39:06 +02:00
qo-op 5047190c61 Merge pull request 'FIX slowness + lazy loading of images + modification of tags filter behavior' (#38) from BorisPaing/astrXbian_UX-et-webUI:boris into master
Reviewed-on: axiom-team/astrXbian#38
2021-09-25 17:02:45 +02:00
Boris 624de324ca [FIX] Fix slowness of webUI 2021-09-25 15:30:19 +02:00
Boris 1121d8c9fd [ENH] Change tag filtering behavior 2021-09-25 15:08:10 +02:00
Boris af8092e7d4 [ENH] Add lazy loading of images 2021-09-25 14:54:02 +02:00
fred 0a9151fad4 /G1SSB/_g1.astroport_title 2021-09-25 03:07:28 +02:00
fred 68b9fd99fc install multi CPU 2021-09-25 03:05:23 +02:00
fred 034e12fc70 alt=\"$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_xbian.zuid) 2>dev/null)\" /> 2021-09-25 03:05:07 +02:00
fred cc25371f36 REMOVE SWARM EMPTY DIRECTORIES 2021-09-25 02:33:59 +02:00
fred 1cf80f7d52 xbian first 2021-09-25 02:09:30 +02:00
fred e38b4c24c1 ipfs swarm sync only friends stations with existing ping.average.txt 2021-09-25 02:03:33 +02:00
fred 6b5f84a6a7 automatic install browser plugins... TODO 2021-09-25 01:55:22 +02:00
fred aeaa479375 ping $ 2021-09-25 00:40:17 +02:00
fred 2817b63402 CONTROL *ASTRXBIAN ACCESS RIGHTS 2021-09-24 14:33:33 +02:00
fred 536395d79d publish informations 2021-09-24 14:24:56 +02:00
fred 968980cd97 Compte Gchange $zuid 2021-09-23 06:37:02 +02:00
fred 3bc3d47253 360s timeout 2021-09-23 05:41:22 +02:00
fred 83b80b55b7 cleaning tmp files 2021-09-23 04:50:47 +02:00
fred 110949861a log and warn ~/.zen/PIN/${ipfsrepidfile}/IPNSLINK - activate PIN refresh (no index.html update !!) 2021-09-23 04:42:40 +02:00
fred 64492a3053 "$PINnode" != "$G1PUB" 2021-09-23 04:04:34 +02:00
fred c20da1a995 get starsin/starsout from IPNS & correct friend_of_mine_count 2021-09-23 03:55:36 +02:00
fred 4195c15b5d Serveur web existant sur port 80 2021-09-23 03:38:17 +02:00
fred 2e50939e86 ipfs swarm connect $line 2>&1>/dev/null && swarmping="OK" || swarmping="NOK" 2021-09-23 03:37:51 +02:00
fred 9ad325e3d5 [[ "$sping" == "OK" ]] maybe too restrictive 2021-09-23 03:30:14 +02:00
fred 8d92aa42b6 echo "#### EXCECUTION TIME" 2021-09-23 03:21:48 +02:00
fred 4cb5df1775 NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h) 2021-09-23 02:40:52 +02:00
fred f277c215d5 rm /config/ipfs/repo.lock 2021-09-23 02:14:19 +02:00
fred 1a1cfab4cc quicker ping 2021-09-23 01:01:57 +02:00
fred 0a96267577 libcurl4-openssl-dev 2021-09-23 00:58:05 +02:00
fred 9c8498e05b audit for ipfs restart cause 2021-09-23 00:57:30 +02:00
fred 52b616fb96 wait a howmany timeout before restarting ipfs 2021-09-22 23:38:04 +02:00
fred 09f5dae89a wait a howmany timeout before restarting ipfs 2021-09-22 23:35:37 +02:00
fred 6e77095ff5 LOG "IPFS NOT RUNNING $(date)" >> ~/.zen/restart.txt 2021-09-22 20:28:08 +02:00
qo-op 4552f89d93 Merge pull request '[FIX] Improvement of duplicate content detection and handling' (#36) from BorisPaing/astrXbian_UX-et-webUI:boris into master
Reviewed-on: axiom-team/astrXbian#36
2021-09-22 20:14:01 +02:00
Boris 23a6aad73c [FIX] Improvement of duplicate content detection and handling 2021-09-22 20:08:20 +02:00
fred 71b79cd842 30s timeout before restart 2021-09-22 12:26:24 +02:00
fred af51349bba # remove millisecond part 2021-09-21 21:32:07 +02:00
fred 80de5613a6 // TODO : dynamic finding FRIENDS xzuid with "cat /home/$YOU/.zen/ipfs_swarm/.*/_xbian.zuid" 2021-09-21 21:16:01 +02:00
fred 0a12355376 Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-21 20:40:52 +02:00
qo-op 517a71a892 Merge pull request '[FIX] Handle *ASTRXBIAN empty files (or when unable to read them)' (#35) from BorisPaing/astrXbian_UX-et-webUI:boris into master
Reviewed-on: axiom-team/astrXbian#35
2021-09-21 20:40:39 +02:00
fred a4c15dd74c correct *ASTRXBIAN file access 2021-09-21 20:38:33 +02:00
Boris f6c5b1fca1 [FIX] Handle *ASTRXBIAN empty files (or when unable to read them) 2021-09-21 20:35:02 +02:00
fred b2d2e095f5 remove entête line from *ASTRXBIAN 2021-09-21 20:29:47 +02:00
qo-op 48aaa661ea Merge pull request '[ENH] Add content filters (tags, station, and PIN status)' (#34) from BorisPaing/astrXbian_UX-et-webUI:boris into master
Reviewed-on: axiom-team/astrXbian#34
2021-09-21 19:31:22 +02:00
fred 81fb9e78cf missing loop increment on error 2021-09-21 18:56:54 +02:00
Boris 8085120871 [ENH] Add content filters (tags, station, and PIN status) 2021-09-21 18:48:38 +02:00
fred 9188290831 check_my_wallet.sh not working 2021-09-21 18:18:32 +02:00
fred d5ef6a13cc Add timestamp in YEAR field (ONLY film & serie contains YEAR) 2021-09-21 14:46:42 +02:00
fred f591f167c1 echo "Last Update : $(date -d @$TIMESTAMP)" 2021-09-21 13:03:08 +02:00
fred 9c8f268652 dynamic HOST 2021-09-21 03:19:28 +02:00
fred 769d7792c5 PDF restriction (missing sudo cp) 2021-09-21 02:52:59 +02:00
fred c6eff38460 simple ipfs add 2021-09-21 02:52:37 +02:00
fred a56adbc487 bug 2021-09-21 02:44:56 +02:00
fred 9734de08b5 Correct PDF restrictions for imagemagick 2021-09-21 02:42:55 +02:00
fred a3dfbe8bf5 $_SERVER['SERVER_NAME'] 2021-09-21 02:42:13 +02:00
fred 6702aba80e killing old same script... for a while... process are stuck 2021-09-21 01:38:38 +02:00
fred 450ac35d0e RUN INDEX DATA MIGRATION SCRIPT actions/p4n.data_evolution.sh & 2021-09-21 01:10:34 +02:00
fred db73d66cf1 loop increment 2021-09-21 00:57:08 +02:00
fred 1936c6f847 log ipfs add 2021-09-21 00:56:10 +02:00
fred 13820563c1 Youtube <=> URL="$1" no zenity if $2 not empty 2021-09-21 00:47:05 +02:00
fred e9c7219fd0 lieu jpg index.html redirection 2021-09-21 00:00:35 +02:00
fred 2a4eeb914a This spot.json is managed by $geosrc 2021-09-20 23:50:53 +02:00
fred 8661212506 p4n data index evolution pdf to index.html 2021-09-20 23:45:44 +02:00
fred d4b62d18d0 remove pdf after jpg + ipfs link into index.html convertion 2021-09-20 22:38:01 +02:00
fred 299e6d8362 empty IPFSREPFILEID = continue 2021-09-20 22:27:19 +02:00
fred 2c9b05e837 echo "Last Update : date -d @$TIMESTAMP" 2021-09-20 22:18:33 +02:00
fred 621da3e18c 10h = 36000000 ms 2021-09-20 22:04:51 +02:00
fred ff2b35dd30 refresh PIN every 12h 2021-09-20 22:02:44 +02:00
fred 1fd00748c1 missing XZUID 2021-09-20 21:18:30 +02:00
fred 2f30a168c5 YOU was missing 2021-09-20 20:53:53 +02:00
fred 0cf824a5f2 no debug 2021-09-20 20:52:00 +02:00
fred 0e1c331f72 KEY refresh index.html 2021-09-20 20:49:35 +02:00
fred 155d174e35 comment & log 2021-09-20 04:10:04 +02:00
fred e97b83848e php-fpm.sock; 2021-09-20 04:09:41 +02:00
fred b949ef6dbb timeout check 2021-09-20 03:16:14 +02:00
fred 1623b9a892 shutdown 2021-09-20 03:05:42 +02:00
fred ea1fd0a09d reshape 2021-09-20 03:05:04 +02:00
fred dba5dc516d convert -crop 1260x420+55+30 ./bulle.jpg ./$lid.jpg 2021-09-20 03:03:42 +02:00
fred 34e5862878 maximum 20s ipfs daemon response time OR restart 2021-09-20 02:53:47 +02:00
fred 4835b4831d We are legion 2021-09-20 02:48:58 +02:00
fred ea70e9fe3c youtube_watch_steps.... sed "s/\${IPFSNODEID}/$IPFSNODEID/g" 2021-09-19 21:41:32 +02:00
fred 9840c45a59 Addind Web(index.html) & Page(pdf) copy 2021-09-19 21:40:38 +02:00
fred 1845e377dd Templating KEY Welcome & G1PUB Contract pages 2021-09-19 20:44:15 +02:00
fred 731917b876 ONE BY ONE (cron_MINUTE.sh task every 7 mn) 2021-09-19 19:12:57 +02:00
fred ed8d25d01c IPFSNODEID 2021-09-19 19:08:49 +02:00
fred 64f9cce4f5 refreshed links 2021-09-19 19:02:42 +02:00
fred 8ba4d2df4d ## DO NOT REPUBLISH empty index.html 2021-09-19 18:57:38 +02:00
fred a877e12348 URLENCODE_FILE_NAME & IPFSREPFILEID are extracted from .ipfs.filelink.natools.encrypt 2021-09-19 13:59:24 +02:00
fred b3ca0400bb bug was blocking Bootstrap PIN refresh actions 2021-09-19 13:41:18 +02:00
fred e21fca1d07 convert http://astroport into / URL (keeps the actual http gateway in use) 2021-09-19 02:31:01 +02:00
fred 47671bbd21 LOG /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipns_TAG_refresh.txt 2021-09-19 02:19:01 +02:00
fred 5c193bfa86 more often ipns_TAG_refresh.sh IN one by one mode 2021-09-19 02:01:01 +02:00
fred d05c60d07d was missing REVSOURCE in MEDIAKEY name creation if desktop (NO $1) run 2021-09-19 01:34:34 +02:00
fred 294a6ae979 KEY refreshing based on TIMESTAMP 2021-09-19 01:29:33 +02:00
fred 7c71da2015 rm /tmp/${MEDIAKEY}.dunikey 2021-09-19 01:28:04 +02:00
fred 82f51a45ba restart ipfs daemon (if ~/.ipfs/config.new have changed) or "ipfs id" timeout 10s 2021-09-19 00:23:37 +02:00
fred 19892fa79c Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-19 00:04:51 +02:00
qo-op 32447b4255 Merge pull request 'ENH: harmonisation CSS et récupération des titres via video.json' (#33) from BorisPaing/astrXbian_UX-et-webUI:master into master
Reviewed-on: axiom-team/astrXbian#33
2021-09-19 00:04:35 +02:00
Boris 74e478feda ENH: titres récupérés depuis le json 2021-09-18 23:57:50 +02:00
fred 97ce9d0be6 put video.json to /ipns/$MEDIAKEY/ root 2021-09-18 20:57:28 +02:00
Boris b5f543220f Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-18 20:49:04 +02:00
fred c512d8aff3 Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-18 20:46:58 +02:00
fred 96c3941d4a Called from ./zen/gchange_INIT.sh 2021-09-18 20:46:48 +02:00
fred 9944323978 KEYFILE 2021-09-18 20:46:37 +02:00
fred c7dda18d0d GROUPES: Stocker la clef IPNS du MEDIAKEY. 2021-09-18 20:46:15 +02:00
fred 08ad5804e1 SUBNET 2021-09-18 20:45:58 +02:00
qo-op 0686095712 Merge pull request 'templatisation + minetest + ...' (#32) from BorisPaing/astrXbian_UX-et-webUI:master into master
Reviewed-on: axiom-team/astrXbian#32
2021-09-18 20:39:08 +02:00
fred e441068471 stargates are 5 shared ipns keys exchanged by friends related to stars.level 2021-09-18 16:13:19 +02:00
Boris 4d21e2062b [FIX] swarm_files.php display 2021-09-18 14:08:44 +02:00
Boris a40ac57327 FIX: templatisation/part2 2021-09-17 01:58:09 +02:00
Boris e1a5106c7b ENH: templatisation 2021-09-17 01:49:39 +02:00
Boris bd2c4d29f9 Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-16 23:45:24 +02:00
Boris 57c966a7ba DOC: README.md 2021-09-16 23:36:56 +02:00
Boris 32c31f90e9 [FIX] HTML/CSS : path to styles 2021-09-16 23:35:52 +02:00
fred 086011ae29 --no-playlist 2021-09-16 22:07:58 +02:00
fred e459f0e0b5 FIND AND CONNECT WITH YOUR FRIENDS 2021-09-14 20:14:11 +02:00
fred 4bfbcfa3b6 AJOUT DANS IPFS new_file_in_astroport.sh 2021-09-14 20:13:55 +02:00
fred 36ac42fb2c SUBNET 4001 port discovery for FOAF stargate replications 2021-09-14 20:13:21 +02:00
fred 2d6acc3735 rm -f /tmp/liking_me ## FILE WILL BE REFRESHED 2021-09-14 20:12:00 +02:00
fred e2e4c61aa5 30 mn swarm refresh 2021-09-14 18:38:33 +02:00
fred c4e2049bdc nmap 2021-09-14 17:01:42 +02:00
fred d0d553df3b geotag france 2021-09-13 22:54:33 +02:00
fred 6b01af45d1 prefered APN 2021-09-13 18:36:24 +02:00
fred 36daeb2077 ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) 2021-09-13 18:15:25 +02:00
fred 23d3bdeeee log 2021-09-13 18:14:11 +02:00
fred e88f343e7b various optimisations 2021-09-13 18:10:35 +02:00
fred 0fe77cef96 CLEAN RUN p4n.swarmscraper.sh 2021-09-13 03:42:03 +02:00
fred c0a02d90c7 reduce ping frequecy to every 4 mn 2021-09-13 03:20:42 +02:00
fred 18152cc009 protect from empty lid 2021-09-13 03:16:43 +02:00
fred 69f52be3b4 check XID from /ipns/ 2021-09-13 03:09:07 +02:00
fred d2c367c2f5 timeout chromium 2021-09-13 02:44:25 +02:00
fred 68561f1a6e --timeout 30000 2021-09-13 02:36:25 +02:00
fred 63bf1f227a RUN p4n scraper 2021-09-13 02:34:17 +02:00
fred a0577990b6 get screenshot.png 2021-09-13 02:29:23 +02:00
fred 50bfa20634 --disable-gpu 2021-09-13 02:27:10 +02:00
fred 47021af263 .$IPFSNODEID/x_ssh-$zuid.sh 2021-09-13 01:09:32 +02:00
fred 411e5931e6 imagemagick ttf-mscorefonts-installer 2021-09-13 01:02:40 +02:00
fred 8a54596433 363 mn ipfs restart (Peering.Peers reload), can be longer 2021-09-13 01:02:13 +02:00
fred 25275d3d1e actions/p4n.swarmscraper.sh 2021-09-13 00:53:49 +02:00
fred 31f16240ee remove older than 8 days swarm data 2021-09-12 23:52:09 +02:00
fred eea656361c getting p4n spots geodata 2021-09-12 19:27:12 +02:00
fred f67ff5b1d8 SYNC SWARM EVERY 21 minutes 2021-09-12 18:19:32 +02:00
fred 348fdc5bd1 astroport swarm easy pace 2021-09-12 18:18:46 +02:00
fred 12c933f532 makers 2021-09-12 17:10:11 +02:00
fred 50309d6833 ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/liking_me 2021-09-12 16:14:19 +02:00
fred 066804f31f wep 2021-09-12 03:04:08 +02:00
fred 30ee0565e8 ping average 2021-09-12 00:35:16 +02:00
fred c3860d80f3 trying to remove... 2021-09-11 02:10:19 +02:00
fred b6e73fded9 IsAlreadythere pb 2021-09-11 01:57:01 +02:00
fred e2dea7e5af peering peers only the one who sync 2021-09-11 01:44:15 +02:00
fred d74b7528b5 ~/.ipfs/config.new Peering.Peers & ipfs daemon restart 2021-09-11 01:35:24 +02:00
fred 57f1ba826a cat ~/.zen/A_peering_peers.txt 2021-09-11 00:08:13 +02:00
fred e3d1085191 ~/.ipfs/config 2021-09-10 01:08:35 +02:00
fred 703b30a9af ~/.ipfs/config.new 2021-09-10 00:15:39 +02:00
fred 85e241fd12 getting Peering.Peers from "ipfs_swarm" and restart ipfs every 6h 2021-09-10 00:07:56 +02:00
fred 4607e7ba3d ## REFRESH ONLY TMDB (level 1), youtube is level 0 2021-09-09 21:29:10 +02:00
fred f7a937b5b1 ## REFRESH ONLY TMDB (level 1), youtube is level 0 2021-09-09 21:27:23 +02:00
fred 980dc12b28 ## CORRECT SWARM FILE ACCESS RIGHTS to www-data 2021-09-08 14:58:40 +02:00
fred 7b38faf703 corrections 2021-09-07 14:03:39 +02:00
fred ee15961eec Remove MP3 option (need mazash infra to be activated) 2021-09-07 14:03:05 +02:00
fred 66585b1bf3 ping friends every 2 mn 2021-09-07 14:02:19 +02:00
fred 282359fb67 going to control Peering.Peers 2021-09-06 17:25:22 +02:00
fred fd47c1bb82 Prefer 4001 port addresses 2021-09-06 11:11:12 +02:00
fred 36f0fbaea2 get further. need more test 2021-09-06 02:19:30 +02:00
fred 1bf1651699 light install ipfs + astroport 2021-09-06 01:35:54 +02:00
fred e9d6159f8c schedule sync on start first 30 mn 2021-09-06 01:07:59 +02:00
fred cdfe5a0bcd Switch ASTROPORT ON / OFF 2021-09-06 01:04:57 +02:00
fred aa3a07e06a ## ACCESS TO www-data FOR www/boris ACCESS 2021-09-06 01:04:19 +02:00
fred a5d21041a1 RUN FROM ./zen/gchange_INIT.sh 2021-09-05 21:15:16 +02:00
fred 56f0ac5e43 TESSERACT 2021-09-05 21:06:39 +02:00
fred afec3684f8 correction 2021-09-04 23:31:39 +02:00
fred d46c623569 x_ssh-$zuid.sh 2021-09-04 23:30:09 +02:00
fred a07c63eafa ~/.zen/ipfs/.$IPFSNODEID/x_ssh-$zuid.sh asking for $PORT 2021-09-04 23:29:32 +02:00
fred b575ff7518 DEBUG 2021-09-04 23:09:29 +02:00
fred d4dadbbf10 Activate SWARM refresh every 20 mn 2021-09-04 22:36:48 +02:00
fred 6946a324bf WILL BE USING ipfs config Peering.Peers 2021-09-04 22:25:29 +02:00
fred 11c594285b STOP DEAD SWARM CONTROL 2021-09-04 22:24:59 +02:00
fred 1ebb9f17ee ## THIS PORT FORWARDING HUB COULD BE MADE MORE CONTROLABLE USING FRIENDSHIP LEVEL & IPFS BALISES 2021-09-04 20:37:26 +02:00
fred feaad9ba8f A_Station_ON doit être dans /tmp pour être effacé au démarrage!! Bad idea to change 2021-09-04 16:25:46 +02:00
fred 36e577dcc7 remove empty directory from ~/.zen/ipfs_swarm/.$ipfsnodeid/ FRIEND 2021-09-04 16:11:49 +02:00
fred e4a8ac945e lighter quicker DEFCON 5 mode 2021-09-04 16:01:37 +02:00
fred c00aaf3e7c echo missing 2021-09-04 14:46:36 +02:00
fred 56d9355e53 NOT FRIEND ## TODO : remove "ipfs pin" in "~/.zen/PIN/" 2021-09-04 14:46:10 +02:00
fred 83fbfeda10 ########## PIN MAKES YOU FASTRXBIAN DISTRIBUTOR 2021-09-04 14:45:42 +02:00
fred e78fa03480 MyCODE = $MyCODE CODE is published as everyday task 2021-09-04 02:17:41 +02:00
fred dbec0e3c15 // HOWTO PASS FILTER Query parameter to bash exec ? 2021-09-04 01:43:25 +02:00
fred 8d097d7a0c NO COMPATIBLE STATION 2021-09-04 00:39:33 +02:00
fred 6ac67826ab stars 2021-09-04 00:33:23 +02:00
fred 491ba1c0b3 mediaid could have _ 2021-09-04 00:11:51 +02:00
fred 91bc17d3cb indicate Source ipfsnodeid 2021-09-04 00:04:27 +02:00
fred 4f5d80cf2d CONTINUE 2021-09-04 00:01:03 +02:00
fred 46d1989cd5 log removal 2021-09-03 23:59:33 +02:00
fred 4775e2afb2 remove empty directories from swarm 2021-09-03 23:55:26 +02:00
fred dd33937301 PIN memorize ipfsfilelink instead of ipfsid 2021-09-03 23:55:08 +02:00
fred e913299a15 $zuid FRIENDS 2021-09-03 20:38:29 +02:00
fred fb5e341092 Show when FRIENDS WIKI page is updated TITLE = $zuid $updated FRIENDS (${IPFSNODEID}) 2021-09-03 20:31:57 +02:00
fred 1d505b8d8b transition to ipfs backend 2021-09-03 17:59:15 +02:00
fred 2aff2ff612 <title>WIKI des Amis de $zuid = ${IPFSNODEID}</title> 2021-09-03 17:58:48 +02:00
fred 9be700d3b0 new cron timing 2021-09-02 22:49:43 +02:00
fred 77b477ec6b cleaning old files and dir from ipfs_swarm 2021-09-02 22:42:57 +02:00
fred d926f2818a add URL support 2021-09-02 22:42:34 +02:00
fred 001a3b90f5 tube.copylaradio.com and gchange link 2021-09-02 15:00:55 +02:00
fred 01968baab4 reset ~/.zen/A_peering_peers.txt 2021-09-02 14:45:49 +02:00
fred 4f9dadbc77 better 2021-09-02 14:37:02 +02:00
fred e036175b32 fixing 2021-09-02 14:36:35 +02:00
fred c3a0dafb10 Copy Video is coming from "Open With" 2021-09-02 14:20:25 +02:00
Boris daff2d8b2c ENH: Ajout service systemd 2021-09-02 12:32:02 +02:00
fred baf5498d21 Now script can be run with "Open With" navigator plugin to copy while surfing 2021-09-02 02:09:46 +02:00
fred 60572c7f02 space cleaning 2021-09-02 01:41:21 +02:00
fred db88990004 LowWater & HighWater = 0 now, will use "Peers.Peering" 2021-09-02 01:40:04 +02:00
fred 47f127f6cc reading from IPNS capsules = lower gchange usage 2021-09-02 01:21:54 +02:00
Boris 4fd2655c4d ENH: Remplacement du mod startanode par un monde fixe (point de spawn identique pour tous) 2021-09-01 19:40:04 +02:00
Boris 5cf75a496d Merge branch 'master' of https://git.p2p.legal/axiom-team/astrXbian 2021-09-01 18:49:07 +02:00
fred b8da081575 keep default 8080 for http gateway port 2021-09-01 15:28:43 +02:00
fred 362f53660a INSTALL ipfs 0.9.1 2021-09-01 15:19:03 +02:00
Boris e9bda280dd ENH: Ajout scripts de configuration de serveur Minetest 2021-08-31 00:41:31 +02:00
Boris 062ae4dbb2 ENH: add Nginx conf for Astroport 2021-08-30 10:27:17 +02:00
Boris 892641bfac [FIX] strip HOST in urls 2021-08-30 10:18:37 +02:00
Boris 840bdedc2d [ENH] Placeholder logo Astroport en attendant d'avoir les posters des films 2021-08-27 20:04:29 +02:00
Boris efeb57a165 [ENH] Cohérence style pour étapes 2 et 3 + changement du fonctionnement du tunnel de paiement (bouton au lieu de QR code) 2021-08-27 19:47:18 +02:00
Boris b991c34fdd [ENH] Ajout dans l'interface "à la Youtube" de tous types de contenus (Films, séries, etc.) 2021-08-27 19:16:12 +02:00
Boris 1324ab8978 [ENH] style Astroport, nom des stations et lien contrat IPNS sur l'image 2021-08-26 21:45:11 +02:00
Boris 7c8ee0cb02 test Git 2 2021-08-26 20:30:21 +02:00
fred 3d396ca948 timeout 60s 2021-08-26 16:44:45 +02:00
fred 59a6f86c10 higher timeout 2021-08-26 16:41:38 +02:00
fred 1b7405c343 https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz 2021-08-26 15:14:21 +02:00
fred 69a88219a1 elif [ ${MACHINE_TYPE} == 'aarch64' ]; then 2021-08-25 10:32:53 +02:00
fred 7a5bad7365 write updated date in tiddlywiki 2021-08-25 02:32:12 +02:00
fred 455ef72bd9 Gardez ou modifiez ce Pseudo? $XZUID 2021-08-24 15:34:30 +02:00
fred 5a4c220eff shuffle FRIENDS 2021-08-17 02:29:15 +02:00
fred 85f8995d33 small bug 2021-08-16 21:06:42 +02:00
fred 0f42fa4ea2 www/boris 2021-08-16 21:04:35 +02:00
fred f161227613 bad space 2021-08-16 21:02:44 +02:00
fred f3eb0254cc missing if 2021-08-16 12:37:11 +02:00
fred b6f4e73fa3 forward /x/ssh-$zuid 2021-08-16 02:55:16 +02:00
fred f36f676fbd install better 2021-08-15 20:05:53 +02:00
fred dc0b959c34 ipns publish timeout problem try lower resolution 2021-08-12 12:29:39 +02:00
fred 48fab00d25 25 frames / second 2021-08-12 12:17:40 +02:00
fred 799763eb86 TIMESTAMP 2021-08-12 11:45:22 +02:00
fred 42c5292f53 find a way to 5001 2021-08-12 11:42:27 +02:00
fred 6969e456c6 IPFSNODEID 2021-08-12 11:32:19 +02:00
fred 6b4651d4c5 INSTALL open_with_linux.py 2021-08-12 11:25:39 +02:00
fred 2daacdecba autre façon 2021-08-12 11:00:01 +02:00
fred 141a61ff65 dsq 2021-08-12 10:53:57 +02:00
fred 2b2d36e7dc new 2021-08-12 10:49:35 +02:00
fred 03baf6261e Accélérez l'extinction des datacenters 2021-08-12 10:15:30 +02:00
fred fb25761233 www2mediakey EXCHANGE ZONEs ~/astroport/www/{audio video site} - recorded with youtube-dl sendto plugin 2021-08-12 02:55:40 +02:00
fred 8ac274bc96 Suivez en direct l'extinction des datacenters 2021-08-12 02:44:01 +02:00
fred c9e1f064c1 text is subtitle for link, can match sms guilde. 2021-08-12 02:30:12 +02:00
fred 515ccd467c vhost template for http/php/astroport gateway bootstrap 2021-08-12 02:11:16 +02:00
fred 9d525d5119 With second parameter ~/.zen/astrXbian/actions/view_counter_increment_or_allow.sh $MEDIAKEYIPNS $G1PUB activates API access 2021-08-12 02:09:36 +02:00
fred 71b8b6bbc6 use ressources from ipfs 2021-08-12 02:05:32 +02:00
fred 9571211ba6 Learning how to make WWW/IPFS interface & API 2021-08-12 00:18:21 +02:00
fred b8acf6f8ec Améliorez le code de la page 2021-08-11 23:54:18 +02:00
fred f06bac4086 réflexion et proposition de solutions 2021-08-11 23:50:16 +02:00
fred 98783b035f 1ere analyse 2021-08-11 23:27:50 +02:00
fred 4abc7ddd69 YOU can be used after ISOConfig has run 2021-08-11 23:09:30 +02:00
fred 83f5d36a00 tool creating nginx proxy with local port, then it could be ipfs p2p teleported 2021-08-11 21:20:05 +02:00
fred 5c3a7c17b7 we are home 2021-08-11 20:32:01 +02:00
fred 472b4eee90 /home/$YOU/astroport/www 2021-08-11 20:30:53 +02:00
fred 4bfccb9ae6 1 DON = Merci 2021-08-11 20:06:18 +02:00
fred b07878a5ea wwwuser 2021-08-11 19:56:54 +02:00
fred 3af02837fd mieux dit 2021-08-11 18:15:35 +02:00
fred 4ff9bc19fa PREPARE www EXCHANGE ZONE .$IPFSNODEID/astroport/www 2021-08-11 18:15:20 +02:00
fred b7be699ba9 DONS%20POUR%20DONS 2021-08-11 07:40:59 +02:00
fred 1518e4d12a correct links 2021-08-11 07:29:27 +02:00
fred dcafdcabb9 Voici les dons reçus par le Media (${mediakey}). Ce média vous plait? Ajoutez le votre... 2021-08-11 06:35:02 +02:00
fred cc8bdb49af use ipfs ipns links 2021-08-11 06:33:37 +02:00
fred 6922fd0405 mediakey 2021-08-11 06:28:47 +02:00
fred e9e18be68c better 2021-08-11 06:26:14 +02:00
fred 6b8d69a442 start converting links to ipfs 2021-08-11 06:12:43 +02:00
fred c8ad2b8fe5 /ipfs/QmPC5MTqt4do7emMUV4z7feYbjSGoX4kdDYVKB6jU3rEKk/crowdbunker.css 2021-08-11 06:10:33 +02:00
fred 07ce024721 <link rel='stylesheet' href='crowdbunker.css' type='text/css' /> ipfs have problem txt/plain publish 2021-08-11 05:55:37 +02:00
fred 6baca10d69 get css from ipfs 2021-08-11 05:52:53 +02:00
fred e9383cd41c Conservez OFFLINE & stylesheet from ipfs address !! 2021-08-11 05:47:19 +02:00
fred d9c554ca67 "SEND ". $phone ." message : ".$link 2021-08-11 05:30:02 +02:00
fred 880d5c109e Swarm.ConnMgr.LowWater & HighWater 2021-08-11 05:28:21 +02:00
fred 0462b11d42 reduice water levels for swarm 2021-08-11 05:27:37 +02:00
fred 8333454ed9 ajax phone 2021-08-11 05:07:26 +02:00
fred 30e5978a47 adding phone 2021-08-11 05:00:57 +02:00
fred 7950ef6835 adding qo-op blob, pacman, GUILDES function 2021-08-11 04:39:38 +02:00
fred b69319b407 Adding G1BILLET to gateway default web service 2021-08-11 04:27:53 +02:00
fred d123d11e85 log correction 2021-08-11 04:10:30 +02:00
fred 5cd58ce56f fixing & enhancements 2021-08-11 04:08:10 +02:00
fred 1d819f5ffa $2 creates /${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipns.mediakey.encrypt 2021-08-11 01:07:27 +02:00
fred 3b1eae8aea Le Zen est un Token de la G1 (1G1 = 100ZEN) 2021-08-11 01:05:52 +02:00
fred f8dcef2625 TODO WRITE SEND .ipns.mediakey.encrypt like in ./zen/tools/MEDIAKEY_dunikey_pass_QR.sh or ./zen/tools/autoPINfriends.sh 2021-08-11 00:35:42 +02:00
fred 7bf9245347 it asks for key or count views & publish 2021-08-11 00:31:38 +02:00
fred 88a63ef16a better stronger 2021-08-11 00:08:27 +02:00
fred 0b8af7a8f6 missing js lib 2021-08-10 14:36:35 +02:00
fred cea9463a88 index.html et FRIENDS/index.html du WIKI des Amis 2021-08-10 03:47:31 +02:00
fred c7fd3520d8 missing leading / 2021-08-10 03:03:11 +02:00
fred 21f3af382e missing leading / 2021-08-10 03:02:56 +02:00
fred 36859a7061 humm 2021-08-10 02:52:45 +02:00
fred eb5440a01e MYG1PUB 2021-08-10 02:51:20 +02:00
fred cde143018a G1PUB=$(cat /home/$YOU/.zen/ipfs/.*/G1SSB/_g1.pubkey) 2021-08-10 02:49:52 +02:00
fred 98a6f31894 log 2021-08-10 02:46:03 +02:00
fred ccc0862600 +source /home/$YOU/.bashrc 2021-08-10 02:44:32 +02:00
fred 301096c2ea do it like that 2021-08-10 02:41:03 +02:00
fred 69d0e924e9 get node G1 wallet amount 2021-08-10 02:30:49 +02:00
fred 933684ca65 general get_astrxbian_index.sh 2021-08-10 02:06:59 +02:00
fred 894a847242 remove ];; mean no ipns link 2021-08-10 02:06:10 +02:00
fred b686fd1b6a + joli 2021-08-10 01:56:59 +02:00
fred 23ef2010dd entête 2021-08-10 01:55:40 +02:00
fred 5bd535c1df utilisez les même passe phrases 2021-08-10 01:54:31 +02:00
fred 81e013a8fa utilisez les même passe phrases 2021-08-10 01:54:01 +02:00
fred ec5dda0ea2 démo de lecture vidéo dans 10s 2021-08-10 01:36:34 +02:00
fred ac9900db7a cesium.app 2021-08-10 01:22:27 +02:00
fred a91293e93b evolving 2021-08-10 01:16:42 +02:00
fred 12dac2ba1c insert instascan in MEDIAKEY index.html 2021-08-10 01:16:12 +02:00
fred 34976d2df4 more div 2021-08-10 00:56:06 +02:00
fred d405b90deb links 2021-08-10 00:53:27 +02:00
fred f0d2fc35ad show JUNE 2021-08-10 00:49:15 +02:00
fred 14d2974c1a CREATE IPFSNODEID G1PUB QR CODE 2021-08-10 00:02:28 +02:00
fred 2e9c723f7d code cleaning 2021-08-09 23:43:08 +02:00
fred fc716098e1 g1scan 2021-08-09 23:35:33 +02:00
fred 2bbc5cd43c add instascan QR code Reader 2021-08-09 22:42:33 +02:00
fred 6b422d79cc Films page 2021-08-09 22:36:25 +02:00
fred cee575eac1 Scan QR Code JS 2021-08-09 22:06:43 +02:00
fred 68d83fe184 MIPFS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1) 2021-08-09 20:50:41 +02:00
fred 22d217c457 better log 2021-08-09 20:44:56 +02:00
fred 2571508f76 run on primary numbers interval 2021-08-06 22:49:22 +02:00
fred 12a85be444 gchange_INIT.sh should change Wiki... not sure it is done well 2021-08-06 17:28:00 +02:00
fred db0ca70a63 No timeout on "ipfs add" before publish, or get rubbish 2021-08-06 15:52:07 +02:00
fred 3f40eb11d9 tailing space prevent good zuid replace 2021-08-06 15:45:21 +02:00
fred 9d740d7029 prevent loop from empty $mediakey 2021-08-06 15:08:26 +02:00
fred 09430a4a5c new SWARM sync pace 2021-08-06 12:57:54 +02:00
fred c1b1054b8d SCAN my FRIENDS 2021-08-06 12:32:21 +02:00
fred d37edbb1de BOOTSTRAP : PIN & COPY IPNS MEDIAKEY 2021-08-06 12:25:05 +02:00
fred 6bb241d33a ipfs ping loop on FRIENDS 2021-08-06 12:24:24 +02:00
fred 7b6fbd1f9e timeout for Friend REFRESH 90s 2021-08-06 03:50:38 +02:00
fred 6f942555e1 ping my friend OR continue 2021-08-06 03:50:09 +02:00
fred 5de882b65f Accelerating swarm INIT & REFRESH rate (20 & 12 mn) 2021-08-06 03:23:26 +02:00
fred 8fd13c049b Ouvrir navigateur en option 2021-08-06 02:47:07 +02:00
fred 3af578d0ff extend timeout 2021-08-06 01:49:34 +02:00
fred 2af462cec4 create _xbian.zuid 2021-08-06 01:45:34 +02:00
fred b93c95fbde ping friends every 4 minutes 2021-08-06 00:36:11 +02:00
fred 5c1566bceb can run multiple times 2021-08-06 00:31:52 +02:00
fred fdc1eab051 runtime=${runtime#-} VALEUR ABSOLUE 2021-08-06 00:30:58 +02:00
fred 8cc76f220b even better 2021-08-06 00:26:23 +02:00
fred 64d208039f better like that 2021-08-06 00:25:58 +02:00
fred 6499e31241 /home/$YOU/.zen/A_Station_ON 2021-08-06 00:15:58 +02:00
fred 704febd7d3 set better timeout 2021-08-06 00:10:11 +02:00
fred ebd47017c3 DEFCON3 takes too much time with fail2ban. DEFCON5. ping & FRIENDS swarm sync more regularly 2021-08-05 23:57:29 +02:00
fred 25b414c69c prevent running more than once 2021-08-05 23:47:37 +02:00
fred 9394661d51 3 mn timeout 2021-08-05 23:36:50 +02:00
fred 4f4b458c94 rewriting 2021-08-05 23:36:40 +02:00
fred 5d68a278dc add PREFIX input param 2021-08-05 04:09:54 +02:00
fred 7cd0312096 () 2021-08-05 04:09:35 +02:00
fred dbf02f0138 larger timeout 2021-08-05 02:35:27 +02:00
fred 7179705469 TilldyWIKI ONE 2021-08-04 10:37:45 +02:00
fred 85cfebc753 CLEANING PARASITE BAD FILES 2021-08-04 03:44:55 +02:00
fred 91e38627f2 Customisation TiddlyWiki 2021-08-04 01:38:47 +02:00
fred 699c9906d2 Customisation TiddlyWiki / Gchange 2021-08-04 01:35:39 +02:00
fred 8e19278f4f Actions script 4 Stations 2021-08-02 08:31:16 +02:00
fred d3aed161e9 increase ipfs_swarm sync to 30s 2021-08-02 08:20:00 +02:00
fred 1946884a28 ## TIMEOUT... uncomment in DEFCON3 only 2021-08-02 08:14:38 +02:00
fred 7f889e0616 bug 2021-08-02 08:10:14 +02:00
fred 7584c7a964 missing fi for DEFCON3 2021-08-02 08:07:21 +02:00
fred a12aa92f61 DEFCON3 code 2021-08-02 08:05:02 +02:00
fred 05da7e35c0 DEFCON3 pre CODE 2021-08-02 06:28:47 +02:00
fred 2c2c9aaf02 SMSAPP runs on taurus 2021-08-01 20:44:29 +02:00
fred 9d216f6550 ${zuid} != "" 2021-07-31 12:33:25 +02:00
fred c082c352a0 call me zuid 2021-07-31 12:25:22 +02:00
fred 8874f3e59a N est le nombre de relations 5* 2021-07-31 04:09:42 +02:00
fred b30065881a ***** Convert $liking_me to ipfsnodeid ***** 2021-07-31 03:24:18 +02:00
qo-op ced573bd20 sudo ln -f -s /usr/bin/python3 /usr/bin/python 2021-07-20 20:04:25 +02:00
qo-op b943e742eb ## python -> python3 link 2021-07-20 20:03:52 +02:00
qo-op 816c670df7 youtube-dl install 2021-07-20 19:53:35 +02:00
qo-op a1bb173ed9 install try wget then pip 2021-07-20 19:37:11 +02:00
qo-op 3bd360d736 1st bootstrap creates ~/.ipfs/swarm.key.defcon3 2021-07-20 19:31:59 +02:00
qo-op 33a02c838e apt remove youtube-dl 2021-07-20 19:30:43 +02:00
qo-op 9bde50fc1e gchange / ipfs synchro after reboot 2021-07-20 19:27:07 +02:00
qo-op fbf929a9ab gchange / ipfs synchro made later 2021-07-20 19:26:15 +02:00
qo-op c8ac1d7175 bad exit BUG !! 2021-07-20 19:10:06 +02:00
qo-op c7de80a518 add ipfs ping control 2021-07-19 15:14:40 +02:00
qo-op a93967f374 Création et maintien du tunnel SSH entre taurus et oasis (régler la fréquence dans cron_MINUTE.sh) 2021-07-19 15:10:10 +02:00
qo-op 92d94c37de 30 sec timeout ipfs_swarm synchro 2021-07-16 03:10:56 +02:00
qo-op 611239022e /home/${YOU} 2021-07-16 01:50:35 +02:00
qo-op 7387b42b9b / missing 2021-07-13 23:10:53 +02:00
qo-op 27bd1b665a $videoEco = 'https://'. HOST. 'ipns/' . $h; 2021-07-13 23:07:20 +02:00
qo-op 511d44d441 <a href="'. $video['eco'] .'"> 2021-07-13 23:06:33 +02:00
qo-op 211a37b863 Now Video title link to Astroport IPNS MEDIAKEY pages 2021-07-13 23:01:08 +02:00
qo-op 98e4e2860c NextCloud.SMS GUILDE STATION 2021-07-13 14:54:22 +02:00
qo-op 6ecc0bb3fe touch it 2021-07-12 23:46:30 +02:00
qo-op 01de385c8a _SEND2GUILDE.sh "BIODYN" 2021-07-12 20:53:51 +02:00
qo-op 1ac5edcb6c ipns mediakey publishing 2021-07-12 04:25:44 +02:00
qo-op 102aedd677 bio-dynamie/sms_send_tosend.sh 2021-07-12 03:47:00 +02:00
qo-op b1e04d5a44 Trying new way of MEDIAKEY bootstrap IPNS echo. 2021-07-12 03:46:39 +02:00
qo-op 9e8db774b0 MEDIAPUBKEY 2021-07-11 00:02:52 +02:00
qo-op 50f91f62c7 timeout ipfs 2021-07-10 14:04:16 +02:00
qo-op 7002c6f76a ipfs id timeout 20s 2021-07-10 13:29:15 +02:00
qo-op c0ab229794 correct ipfs restart for xbian 2021-07-10 13:22:49 +02:00
qo-op bb870496ce Activation SMS BIODYN 5h30 2021-07-09 23:36:20 +02:00
qo-op 5e918a4eff ACTIVATION NextCloud.SMS - STATION - https://taurus.copylaradio.com - AVATAR : https://qo-op.com 2021-07-09 16:31:11 +02:00
qo-op 722cc48a4b [Inscrivez vous à notre mailing list](https://oasis.astroport.com/appel-aux-anarchitectes/) 2021-07-08 14:21:08 +02:00
qo-op a13890d197 MAJ 2021-07-08 13:34:32 +02:00
qo-op 81f15a501b video 2021-07-08 07:23:04 +02:00
qo-op c3d7706bc9 verify ipfs is running & responding 2021-07-08 07:22:56 +02:00
qo-op 67650ff228 ENHANCE SWARM CONNECTIVITY 2021-07-07 23:26:17 +02:00
qo-op e89cecb7cc jaklis UPGRADE ACTIVATE AND REMOVE 2021-07-07 23:20:21 +02:00
qo-op 1d92f5d238 cosmetics 2021-07-07 23:14:53 +02:00
qo-op 74fab27619 debug & secure 2021-07-07 22:44:32 +02:00
qo-op 92d16456ce correct fake error 2021-07-07 20:13:19 +02:00
qo-op abae7f54a8 Ce media possède un G1 portefeuille avec lequel il paye son hébergement. 2021-07-07 17:42:39 +02:00
qo-op d4a0439040 lien station 2021-07-07 17:38:49 +02:00
qo-op 353cf70457 better install, need adapt with php-fpm.sock 2021-07-07 05:04:39 +02:00
qo-op f167d5842b ipfs daemon was not running. RELAUNCHING. 2021-07-06 22:48:47 +02:00
qo-op bb16183a11 03:03 ipfs restart 2021-07-06 22:47:41 +02:00
qo-op fa6e18b53c detect ipfs is killed 2021-07-06 22:45:51 +02:00
qo-op abe0b7547c Accelérez le réseau... Lancez la lecture depuis votre Station Astroport 2021-07-06 21:55:17 +02:00
qo-op 7074e8ae1c zou 2021-07-06 19:30:48 +02:00
qo-op b41efb8551 g1barre up 2021-07-06 17:59:09 +02:00
qo-op e5958a8a46 $TUBELINK link on $MIMETYPE 2021-07-06 17:55:31 +02:00
qo-op 9643e0c5d7 best title 2021-07-06 04:20:43 +02:00
qo-op da287a1257 LOCALHOST LINK MADE FOR ASTROPORT STATIONS 2021-07-06 03:42:43 +02:00
qo-op 3b6ee36729 ${MEDIAKEY}/index.html ET ${MEDIAKEY}/${G1PUB}/index.html 2021-07-06 02:06:49 +02:00
qo-op 585f4041e8 plus joli, meilleure UX 2021-07-06 02:00:52 +02:00
qo-op 804f3a07e6 ## GIVE ACCESS TO www-data group 2021-07-05 19:29:13 +02:00
qo-op 421610cf3e ${MEDIAKEY} 2021-07-05 16:05:54 +02:00
qo-op b42d33c49a remove price (to make variable & calculate) 2021-07-03 17:19:52 +02:00
qo-op a5da4df3d6 correct CHOICE bug 2021-07-03 16:29:45 +02:00
qo-op b106651814 FILE_SIZE 2021-07-03 16:19:56 +02:00
qo-op 1f39150af9 FILE_SIZE 2021-07-03 16:11:15 +02:00
qo-op e1b1f99602 gitignore 2021-07-02 00:52:34 +02:00
qo-op 9f72d38ea3 default CD/DVD category 2021-07-02 00:51:15 +02:00
qo-op d6816f1e26 corrections 2021-07-01 23:50:02 +02:00
qo-op a079c69e54 ZENBALANCE for ${CHOICE}_${TMDB} , WALLET $MEDIAPUBKEY 2021-07-01 20:55:29 +02:00
qo-op 9c02c2c54b ZENBALANCE 2021-07-01 17:48:31 +02:00
qo-op be577eff43 mediakeyfile=$($MY_PATH/tools/give_me_keystore_filename.py $mediakey) 2021-07-01 17:07:23 +02:00
qo-op ddb5599832 correct BAD ~/.zen/ipfs/.${IPFSNODEID}/KEY/MEDIAPUBKEY 2021-07-01 17:00:04 +02:00
qo-op 52f87a06ca ## jaklis UPGRADE setup (TEMP) REMOVE 2021-07-01 01:35:11 +02:00
qo-op 623310dd54 new jaklis release, payment activation 2021-07-01 00:47:13 +02:00
qo-op b09790cfbe search is usefull for code retro-engineering 2021-06-30 23:57:09 +02:00
qo-op ad4d8b2ac8 print ${MEDIAPUBKEY} 2021-06-30 23:55:18 +02:00
qo-op b7cf186d63 Affiche MEDIAPUBKEY et G1BARRE pour encourager le DON 2021-06-30 23:51:51 +02:00
qo-op 83195a1d13 STATION ONLINE or OFFLINE 2021-06-29 03:08:47 +02:00
qo-op 448ef8a395 better PASS randomness 2021-06-29 02:46:45 +02:00
qo-op 10775a8d9b Fabrique ou récupère un PASS pour fabriquer le QRCode "privé" sécurisé avec openssl associé à chaque MEDIAKEY 2021-06-29 02:16:58 +02:00
qo-op d5feff7d4f Now PIN MEDIAKEY is re-published by bootstrap (avoid DHT emptyness when station is OFF) 2021-06-29 02:16:03 +02:00
qo-op c98a5bc7b6 Fabrique ou récupère un PASS pour fabriquer le QRCode "privé" sécurisé avec openssl pour chaque MEDIAKEY 2021-06-29 02:01:54 +02:00
qo-op df8f9a6b3e index.html 2021-06-29 00:11:45 +02:00
qo-op 75f494466c .$ipfsnodeid/_xbian.zuid || echo "NO ZUID" 2021-06-28 23:55:57 +02:00
qo-op 8953488cb8 ipfs FRIENDS refresh 2021-06-21 10:00:47 +02:00
qo-op 3abb4f3cf0 ipfs_FRIENDS_refresh.sh 2021-06-21 09:57:46 +02:00
qo-op f23a7ef1f1 https://CopyLaRadio.com 2021-06-21 09:20:42 +02:00
qo-op 3f8274524e MEDIAKEY 2021-06-21 09:16:06 +02:00
qo-op c6a23c9082 CHOICE="TMDB" (film ou serie) 2021-06-21 09:11:23 +02:00
qo-op 67151f2203 1 Zen / Mo / Bootstrap 2021-06-21 00:54:42 +02:00
qo-op 88a65c6257 better looking welcome page 2021-06-21 00:48:15 +02:00
qo-op 09309de134 better looking welcome redirection page 2021-06-21 00:44:18 +02:00
qo-op 787080be0b FILETYPE & MIMETYPE 2021-06-21 00:41:21 +02:00
qo-op 0d96e261fc ## ADD CHAIN BLOCK ZERO 2021-06-20 23:45:00 +02:00
qo-op 302bb50b8d <h1 class='video-title'>$TITLE ($MIMETYPE)</h1> 2021-06-18 01:35:18 +02:00
qo-op 7e33af98dd create PASS + DUNIKEY + QR + QRsec from 'ipfs key list' in KEY/MEDIAKEY 2021-06-18 00:37:23 +02:00
qo-op 6685a1e25c <br> 2021-06-17 23:49:53 +02:00
qo-op 8e8e5c64bf video/x-matroska 2021-06-17 23:49:12 +02:00
qo-op 27f780425a KEYFILE debug 2021-06-17 23:41:27 +02:00
qo-op 4ab8b91342 ## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS 2021-06-17 22:55:59 +02:00
qo-op bbf8c3a14b ${mediakey} 2021-06-17 22:38:04 +02:00
qo-op ba4734a23e some nice python slice cooked by @tuxmain gives the power to find & exchange kestore files 2021-06-17 22:34:42 +02:00
qo-op 7fcaf6f771 CHOICE 2021-06-17 22:29:10 +02:00
qo-op 0837ca1585 DESCRIPTION 2021-06-17 22:25:59 +02:00
qo-op 8d50302432 Lancement de la video dans 10 secondes uniquement pour les stations Astroport... 2021-06-17 22:22:06 +02:00
qo-op f589593a9f Les dons au portefeuille du Media (${id}) rapportent à son Auteur, et payent son hébergement. 2021-06-17 21:40:35 +02:00
qo-op d4915d4174 Les dons au portefeuille du Media rapportent à son Auteur, et payent l'hébergement. 2021-06-17 21:39:14 +02:00
qo-op 1d120e287f TUBELINK: OK - kestore KEYFILE : BUG 2021-06-17 19:41:02 +02:00
qo-op 36696f231f MEDIAKEY=${INDEXPREFIX}${REFERENCE} + encode for G1PUB 2021-06-17 19:15:50 +02:00
qo-op 899cf88a7e CHOICE upper 2021-06-17 18:27:01 +02:00
qo-op 4c9d07d24c create json debug 2021-06-17 17:52:42 +02:00
qo-op a106e74466 API video {timestamp, ipfs, ipns, titre, sous-titres, hashag, ipfstag} 2021-06-17 17:04:45 +02:00
qo-op a246c41aff video ## video_timestamp INDEX 2021-06-17 17:01:55 +02:00
qo-op 6d1cc8f3bb IMPORT video_???? simple json. 2021-06-17 15:49:44 +02:00
qo-op a546356d41 QR code size 2021-06-17 15:48:45 +02:00
qo-op d5096d2cde DUNIKEY PASS $PASS 2021-06-17 14:49:28 +02:00
qo-op b65d38fd84 qr code width + s 2021-06-16 22:55:19 +02:00
qo-op 6a256e648b sudo fail2ban-client set recidive bantime 36000 # 10 Hours bantime 2021-06-16 22:44:09 +02:00
qo-op 69466de916 COPY LOCALHOST IPFS URL TO CLIPBOARD 2021-06-16 22:23:06 +02:00
qo-op 8b2a570cb7 xclip 2021-06-16 21:59:06 +02:00
qo-op 4377b054ba SCAN SWARM HOW TO 2021-06-16 02:45:18 +02:00
qo-op ce4fd1bead LECTURE LOCALHOST 2021-06-16 02:44:57 +02:00
qo-op 97f9f3511b remove autoplay 2021-06-16 02:41:21 +02:00
qo-op 9f4b2763f1 protect ipfs timeout 2021-06-16 01:24:02 +02:00
qo-op 6af6406b2e writing in code comments. please read 2021-06-16 01:21:56 +02:00
qo-op cd53eeed62 FRIENDS IPFS PINGing 2021-06-16 01:06:01 +02:00
qo-op c7e24e631f Faites un DON au Media (${id}) ou son Auteur 2021-06-16 00:41:24 +02:00
qo-op 1121a39ee0 PINGing FRIENDS 2021-06-16 00:37:09 +02:00
qo-op 940e558851 Every 12h runtime restarting IPFS daemon 2021-06-15 21:12:52 +02:00
qo-op 38da96b4b6 COMMENT MyCODE calculation (speed up) 2021-06-15 20:23:07 +02:00
qo-op 84a8035fda NICE FINAL STREAMING PAGE 2021-06-15 20:16:52 +02:00
qo-op 010a0c334c CORRECT M$ SPECIFIC BULLSHIT [[ "$MIMETYPE" == "video/avi" ]] && MIMETYPE="video/x-msvideo" 2021-06-15 19:08:20 +02:00
qo-op a3ddcc2796 OPEN VIDEO CLUB TO PUBLIC VIEWERS 2021-06-15 19:01:58 +02:00
qo-op ba34632ec4 Mediakey Wallet QR Code link 2021-06-15 17:51:58 +02:00
qo-op c91bda6f17 if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER 2021-06-15 17:51:12 +02:00
qo-op f7ee0690da show MEDIAKEY QR Code 2021-06-15 10:35:52 +02:00
qo-op 5e12cf1123 Activation debug (-x) 2021-06-15 10:18:17 +02:00
qo-op c239360d09 Affichage QR code du wallet du MEDIAKEY dans GCHANGE 2021-06-15 10:12:34 +02:00
qo-op 9defaec2e1 CREATE/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png with MEDIAKEY G1PubKey 2021-06-14 16:59:35 +02:00
qo-op 1ef4032893 CORRECT ISSUE : axiom-team/astrXbian#25 2021-06-14 16:35:38 +02:00
qo-op 58771c0b59 Impossible de déplacer votre fichier vers ~/astroport 2021-06-14 14:17:42 +02:00
qo-op 5a0264eacf install html2text 2021-06-14 11:20:52 +02:00
qo-op f428ee6d61 remove anime NOT WORKING 2021-06-14 11:20:34 +02:00
qo-op 7619af9b69 Pubsec (sec) = seed(32 char)+pubkey revealed with base58 -d 2021-06-09 00:39:20 +02:00
qo-op f6773bbe7f natools.py can convert IPNS keystore file MEDIAKEY into .dunikey file 2021-06-09 00:37:04 +02:00
300 changed files with 95821 additions and 1251 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
__pycache__
www/boris/me
www/boris/swarm

View File

@ -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_'

View File

@ -226,7 +226,7 @@
<setting id="services.useairplaypassword" default="true">false</setting>
<setting id="services.webserver">true</setting>
<setting id="services.webserverpassword" default="true"></setting>
<setting id="services.webserverport">8181</setting>
<setting id="services.webserverport">8081</setting>
<setting id="services.webserverssl" default="true">false</setting>
<setting id="services.webserverusername">xbmc</setting>
<setting id="services.webskin" default="true">webinterface.default</setting>

View File

@ -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

View File

@ -17,22 +17,19 @@ sudo true
## Error funciton
err() {
echo -e "ERREUR: $1"
exit 1
echo -e "ERREUR: $1"
exit 1
}
# CHECK if daemon is already running
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
echo "ipfs bootstrap list: " && ipfs bootstrap list
echo "Please RUN : sudo service ipfs stop"
exit 1
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
echo "ipfs bootstrap list: " && ipfs bootstrap list
echo "ipfs daemon already running...!"
exit 0
fi
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1
echo -e "Astroport IPFS Layer installation..."
echo -e "Astroport activate IPFS Layer installation..."
# CHECK node IP isLAN?
myIP=$(hostname -I | awk '{print $1}')
@ -40,36 +37,18 @@ isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
else
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue."
fi
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err "Install ipfs-update"
cd $MY_PATH
echo "INSTALL ipfs 0.7.0 >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo ipfs-update install 0.7.0 || err "Install IPFS"
# INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server
## Special Xbian init.d config
## Special Xbian init.d config
if [[ "$USER" == "xbian" ]]; then
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
sudo chmod 755 /etc/init.d/ipfs
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
sudo cp ~/.zen/astrXbian/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
sudo chmod 755 /etc/init.d/ipfs
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
else
## DEBIAN
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
## DEBIAN
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
cat > /tmp/ipfs.service <<EOF
[Unit]
Description=IPFS daemon
@ -86,12 +65,12 @@ CPUQuota=60%
WantedBy=multi-user.target
EOF
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
sudo systemctl daemon-reload
sudo systemctl enable ipfs
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
sudo systemctl daemon-reload
sudo systemctl enable ipfs
fi
@ -109,14 +88,18 @@ ipfs config Datastore.StorageMax $diskSize
## Activate Rapid "ipfs p2p"
ipfs config --json Experimental.Libp2pStreamMounting true
ipfs config --json Experimental.P2pHttpProxy true
ipfs config --json Swarm.ConnMgr.LowWater 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 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

View File

@ -0,0 +1,28 @@
#!/bin/bash
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
######## YOUTUBE-DL ##########
## NOW INSTALL yt-dlp AND LINK TO youtube-dl
# _ _ _
#| | _____ __| (_)
#| |/ / _ \ / _` | |
#| < (_) | (_| | |
#|_|\_\___/ \__,_|_|
# COPY UQLOAD LINKS DETECTED IN KODI LOG
##############################################
### TODO INSTALL FROM START and AUTO SCRAPE KODI LOG
##############################################
if [[ ! -f $HOME/.local/bin/uqload_downloader ]]; then
cd /tmp
git clone https://github.com/papiche/uqload_downloader.git
cd uqload_downloader/cli
./download_from_kodi_log.sh
[[ -f $HOME/.local/bin/uqload_downloader ]] && zenity --warning --width ${large} --text "INSTALLATION download_from_kodi_log.sh OK"
cp download_from_kodi_log.sh $HOME/.local/bin/
else
## UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh
zenity --warning --width ${large} --text "UTILISEZ download_from_kodi_log.sh en ligne de commande..."
exit 0
fi

11
.install/nvh/README.md Normal file
View File

@ -0,0 +1,11 @@
# Create custom Nginx reverse proxy easily
Create a reverse proxy for domain tata.toto.com go to port 80 of device 192.168.1.27, with auto-https and 443 redirection:
`./nvh.sh tata.toto.com 192.168.1.27 80 ssl=1`
Create a reverse proxy for my service on localhost on port 10010, no https:
`./nvh.sh mylocalservice.fr 127.0.0.1 10010`
TODO: Add option to configure a webserver, and option for php-fpm7.4 server
enjoy

116
.install/nvh/nvh.sh Executable file
View File

@ -0,0 +1,116 @@
#/bin/bash
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
bold=`tput bold`
blue=`tput setaf 4`
reset=`tput sgr0`
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
sslRedir="$MY_PATH/ssl-bloc-redirect.txt"
tplVHost="$MY_PATH/templates/vhost.txt"
###
# Get Arguments
###
args="$@"
domain="$1"
ip="$2"
port="$3"
parseArgs(){
i=0
for cmd in $args; do
arg[$i]=$cmd
[[ ${arg[$i]} =~ "domain=" ]] && domain=$(echo ${arg[$i]} | grep "\<domain=" | awk -F '=' '{ print $2 }')
[[ ${arg[$i]} =~ "ip=" ]] && ip=$(echo ${arg[$i]} | grep "\<ip=" | awk -F '=' '{ print $2 }')
[[ ${arg[$i]} =~ "port=" ]] && port=$(echo ${arg[$i]} | grep "\<port=" | awk -F '=' '{ print $2 }')
[[ ${arg[$i]} =~ "ssl=" ]] && ssl=$(echo ${arg[$i]} | grep "\<ssl=" | awk -F '=' '{ print $2 }')
((i++))
done
}
parseArgs
newVHost="/etc/nginx/conf.d/$domain.conf"
[[ $ip == "local" ]] && ip="127.0.0.1"
addSSL(){
echo "${yellow}Création du certificat SSL pour $domain...${reset}"
sudo /usr/bin/certbot --nginx certonly -d $domain && echo "${green}Le certificat de $domain a bien été déployé${reset}" || echo "${red}Une erreur s'est produite lors de la création du certificat SSL${reset}"
sudo sed -i -e 's/listen 80;/listen 443 ssl;/' $newVHost
sudo sed -i -e '/includes\/errors.conf/i \\ listen [::]:443 ssl;\n include includes/ssl.conf;' $newVHost
sudo sed -i -e '/error_log/i \\ ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;\n' $newVHost
sudo cat $sslRedir | sudo tee -a $newVHost > /dev/null
sudo sed -i -e 's/$domain/'"$domain"'/g' $newVHost
}
if [[ -e $newVHost ]]; then
echo "${yellow}Le virtualhost existe déjà${reset}"
if [[ -z $(grep "ssl_certificate_key" $newVHost) ]]; then
echo "Certificat SSL non présent"
if [[ $ssl =~ ^(1|true|oui)$ ]]; then
echo "Installation du certificat SSL ..."
addSSL
sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}"
exit 0
else
echo "${yellow}Aucune action n'a été effectué${reset}"
exit 0
fi
else
echo "${yellow}Le SSL est déjà configuré sur le VHost${reset}"
exit 0
fi
fi
create_vhost(){
echo "${yellow}Génération du nouveau VirtualHost...${reset}"
sudo cp $tplVHost $newVHost
sudo sed -i -e 's/$_DOMAIN/'"$domain"'/g' $newVHost
sudo sed -i -e 's/$_IP/'"$ip"'/g' $newVHost
sudo sed -i -e 's/$_PORT/'"$port"'/g' $newVHost
if [[ $ssl =~ ^(1|true|oui)$ ]]; then
printf "${yellow}Configuration SSL du VHost...${reset}"
addSSL && echo "${green}OK${reset}" || echo "${red}KO${reset}"
else
echo "${yellow}Aucune configuration SSL ne sera effectué.${reset}"
fi
sudo service nginx reload && echo "${green}Le domaine $domain à bien été créé et configuré =)${reset}" || echo "${red}Impossible de recharger nginx${reset}"
}
echo "Nous allons créer le domaine ${blue}$domain ${reset}qui sera lié au port ${blue}$port ${reset}de l'IP ${blue}$ip.${reset}"
if [[ $p2vmProvided != 1 ]]; then
read -p "${bold}Confirmez-vous cette action ?${reset} (${green}y${reset} ou ${red}n${reset}) : " yn
case $yn in
[Yy]* ) create_vhost break;;
[Nn]* ) echo "${red}Fermeture du script${reset}" && exit;;
* ) echo "Merci de sélectionner yes ou no";;
esac
else
create_vhost
fi
## 1ere analyse
# A priori utiliser avec domain=$IPFSNODEID ip=local port=10101 ssl=no
# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs p2p listen /x/10101 /ip4/127.0.0.1/tcp/10101
# Chaque station publie ses services/API sur un port numéroté /x/10101 relayé en 127.0.0.1/tcp/20101
# Elle publie cette information aux bootstrap (gateway) qui prennent en charge le relai https "ipfs p2p"
# [[ ! $(ipfs p2p ls | grep '/x/10101') ]] && ipfs --timeout=5s ping -n 1 /p2p/$IPFSNODEID && ipfs p2p forward /x/10101 /ip4/127.0.0.1/tcp/20101 /p2p/$IPFSNODEID
# A l'autre boût on sort domain=tata.toto.com ip=local port=20101 ssl=yes
## PAR défaut tous publient ~/.zen/astrXbian/www/boris sur leur port 80 / 443 (pour éxécuter l'API PHP)
# Ca ressemble au fonctionnement du ln -s ;)
# ipfs p2p ln -s /p2p/$IPFSNODEID/tcp/10101 /ip4/127.0.0.1/tcp/20101
## Dédier Le canal star1 pour le flux m3u8 webcam activable.
# Utiliser les canaux stars pour publier ses ports à ceux de ses amis du niveau choisi.
# Publier en json !
exit 0

View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name $domain;
include includes/letsencrypt.conf;
if ($host = $domain) {
return 301 https://$host$request_uri;
}
return 404;
}

35
.install/nvh/vhost.txt Normal file
View File

@ -0,0 +1,35 @@
upstream $domain {
server 192.168.9.$ipvm:$port; #Production
#server 192.168.9.9; #Redirection maintenance
}
server {
server_name $domain;
listen 80;
include includes/errors.conf;
location / {
proxy_pass http://$domain;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
}
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipns {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
error_log /var/log/nginx/$domain_error.log;
access_log /var/log/nginx/$domain_access.log;
}

View File

@ -0,0 +1,45 @@
upstream $domain {
server 192.168.9.$ipvm:$port; #Production
#server 192.168.9.9; #Redirection maintenance
}
server {
server_name $domain;
listen 80;
include includes/errors.conf;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files \$uri \$uri/ =404;
}
index index.php;
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php-fpm.sock; # Faites le ln -s qui va bien
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
}
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipns {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
error_log /var/log/nginx/$domain_error.log;
access_log /var/log/nginx/$domain_access.log;
}

View File

@ -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;
}

View File

@ -13,7 +13,7 @@ server {
index index.php index.html index.htm;
location ~ \.php {
try_files $uri index.php =404;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
@ -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;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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='<id>\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

BIN
.install/youtube-dl Executable file

Binary file not shown.

View File

@ -1,8 +1,22 @@
#!/bin/bash
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
######## YOUTUBE-DL ##########
if [[ ! $(which youtube-dl) ]]; then
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || exit 1
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $USER /usr/local/bin/youtube-dl
## 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
ls -al /usr/local/bin/youtube-dl

5
A_boostrap_public.txt Normal file
View File

@ -0,0 +1,5 @@
/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb
/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt
/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ

2
DEFCON
View File

@ -1 +1 @@
4
5

View File

@ -9,7 +9,7 @@ IPFSNODEID=$(ipfs id -f='<id>\n')
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
[[ ! ${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
@ -23,16 +23,16 @@ rm -f /tmp/A_booting_log.txt
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "CONNEXION OK" || exit 1
## TEST BOOTSTRAP IP CONNECTIVITY
IPTEST=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | cut -d '/' -f 3 | shuf | head -n 1)
ping -q -w 1 -c 1 $IPTEST 2>&1>/dev/null && echo "CONNEXION BOOTSTRAP OK" || echo "VERIFIER CONNEXION INTERNET" && exit 1
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
@ -47,13 +47,14 @@ fi
echo "CREATING Gchange credentials"
########################################################################
salt="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
salto="$salt"
[[ $salt == "" ]] && echo "ERROR" && exit 1
pepper="$(~/.zen/astrXbian/zen/tools/diceware.sh 3 | xargs)"
XZUID=$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)${RANDOM:0:2}$(~/.zen/astrXbian/zen/tools/diceware.sh 1 | xargs)
[[ "$USER" != "xbian" ]] && echo "Modifier identifiant (passphrase 1)? $salt" && read salty && [[ $salty ]] && salt="$salty"
[[ "$USER" != "xbian" ]] && echo "Modifier mot de passe (passphrase 2)? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery"
# [[ "$USER" != "xbian" ]] && echo "Modifier Pseudo? $XZUID" && read XZUIDy && [[ $XZUIDy ]] && XZUID="$XZUIDy"
[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet identifiant (passphrase 1)? $salt" && read salty && [[ $salty ]] && salt="$salty"
[[ "$USER" != "xbian" ]] && echo "Gardez ou modifiez cet mot de passe (passphrase 2)? $pepper" && read peppery && [[ $peppery ]] && pepper="$peppery"
[[ "$USER" != "xbian" && "$salt" != "$salto" ]] && echo "Gardez ou modifiez ce Pseudo? $XZUID" && read XZUIDy && [[ $XZUIDy ]] && XZUID="$XZUIDy"
g1_salt="$salt"
g1_pepper="$pepper"
@ -119,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"
@ -164,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
@ -215,21 +216,15 @@ if [[ $bootnode != "" ]]; then
fi
done
########################################################################
echo "Synchronize GCHANGE+ with IPFS SWARM"
########################################################################
~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
########################################################################
echo 'Installing Astroport cron_MINUTE'
########################################################################
~/.zen/astrXbian/zen/cron_VRFY.sh
########################################################################
#echo "CHANGE hostname"
#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey"
#echo "CHANGE hostname"
#myname=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
#echo "$(hostname). Changez votre HOSTNAME ($myname)?" && read mynamey && [[ $mynamey ]] && myname="$mynamey"
########################################################################
#sudo sed -i "s/$(hostname)/$myname/g" /etc/hostname
#sudo sed -i "s/$(hostname)/$myname/g" /etc/hosts
@ -246,7 +241,7 @@ sudo chattr -i /etc/resolv.conf
sudo cat > /tmp/resolv.conf <<EOF
domain home
search home
nameserver 80.67.169.12
nameserver 80.67.169.12
nameserver 80.67.169.40
nameserver 94.247.43.254
nameserver 2001:67c:13e4:1::37
@ -286,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
@ -302,10 +297,19 @@ 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
########################################################################
# echo "Synchronize GCHANGE+ with IPFS SWARM"
########################################################################
# ~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh
# ~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
########################################################################
# echo 'ONLY XBIAN REBOOT NOW...' else SHOW CONFIG
########################################################################

137
README.md
View File

@ -1,9 +1,84 @@
# ASTROPORT/KODI (astrXbian)
# Astroport répare ton internet
## Tout ce qui t'emmerde dans internet
Youtube :
- les suggestions te font perdre un temps fou, mais regarder toutes ces vidéos ne t'apportent que rarement de la valeur, car elle te font tourner en boucle sur du contenu toujours similaire
- le contenu qui diverge de la norme se retrouve censuré. Ça ne dérange pas trop tant que tu es toi-même dans la norme, mais que se passe-t-il lorsque ta pensée devient minoritaire ? Tu ne peux plus partager ton opinion.
- tu es obligé de passer par la page d'accueil pour effectuer une recherche
- tu crées des playlists pour organiser toi-même le contenu, mais parfois une vidéo est supprimé, sans que Youtube te laisse même le titre de la vidéo
- les commentaires, t'exposent souvent à toute la haine d'inconnus, et sont souvent source de désespoir
Facebook :
- le contenu qui remonte est le contenu le plus consensuel : la photo de profil à 50 likes de Cindy
- tu te tapes une pub tous les 4-5 posts
9gag :
- tu y viens pour rire un peu, mais tu te retrouve face à beaucoup de posts à caractère politique, anxiogène ou source de colère
- l'humour des autres n'est pas forcément le tiens, et le contenu qui t'es proposé ne te fait pas forcément marrer
Netflix :
- un peu de contenu intéressant, mais il est noyé dans un océan de médiocrité
- tu n'as accès à rien si tu n'es pas connecté
Spotify :
- l'interface devient de plus en plus source de nuisances, en te proposant de recommander Spotify à des amis par exemple
## Astroport libère ton internet
Astroport remplace tous ces services, en apportant quelques degrés de liberté en plus :
Dans Astroport, le contenu n'est pas filtré par des algorithme, mais par les choix que tu fais de te nourir du contenu partagé par tel ou tel ami.
Si le contenu est trop abondant, tu peux choisir un algorithme pour le filtrer, mais tu restes toujours maître de la façon dont les choses te sont présentées ; tu peux choisir ton interface parmi une quantité d'interfaces déjà codées, ou coder ta propre interface.
Un contenu taggué comme "drôle" a plus de chances de l'être, car il t'es apporté par tes amis, et entre amis, on partage souvent le même sens de l'humour.
## C'est le moment idéal pour libérer internet
Le déploiement massif de la fibre nous fournit la possibilité de revenir au "vrai" internet : un internet pair-à-pair.
Du l'ADSL, avec son débit asymétrique (80ko/s en débit ascendant, en upload), on passe avec la fibre à 80Mo/s.
Il devient donc possible de regarder une vidéo en streaming directement depuis chez ses amis, plutôt que de la récupérer depuis un datacenter inconnu localisé à 400km.
L'apparition et la popularisation des Raspberry Pi rend possible à chacun de se créer son propre petit datacenter de 1 To pour mettre à la disposition de ses amis toute sa vidéothèque. Le Raspberry Pi peut rester allumer en permanence sans faire exploser ta facture électrique ni causer de catastrophe environnementale, puisqu'il a une puissance de l'ordre de 15W. Astroport peut aussi tourner sur un vieux PC de 2005 dont on pensait ne plus jamais pouvoir faire quoi que ce soit.
La France est par ailleurs le terrain idéal pour expérimenter cette façon de partager du contenu, grâce au droit à la copie privée, qui nous autorise à garder pour soi un contenu diffusé par d'autres (à l'époque : enregistrer sur K7 un contenu diffusé à la radio).
## Comment Astroport libère l'internet
Astroport utilise IPFS pour stocker les fichiers.
Ces fichiers sont partagés uniquement avec les gens que vous avez explicitement choisis, et vous recevez du contenu uniquement des personnes en qui vous avez confiance. Cette identification des "amis" se fait pour l'instant via Gchange, mais cela pourrait évoluer.
Les vidéos peuvent être affichées dans différentes interfaces. Astroport en propose pour l'instant deux :
1. Une interface web, personnalisable à loisir grâce aux thèmes
2. Kodi, qui peut s'installer sur une Android TV
## Un modèle économique pour les créateurs et le partage pair-à-pair
À chaque fichier, Astroport associe un porte-monnaie de monnaie libre G1.
Lors de la consultation d'un fichier, un peu de monnaie libre G1 est transmise au noeud qui sert le fichier (vous ou un ami, par exemple), et la monnaie récoltée sera à terme partagée entre le noeud et le créateur du contenu.
Le modèle pair-à-pair, en diminuant les coûts de diffusion, permet d'augmenter la part récupérée par le créateur.
D'un point de vue écologique, le modèle pair-à-pair diminue aussi l'électricité consommée, car le terminal de consultation devient aussi serveur de fichiers, et fait ainsi d'une pierre deux coups. S'ils souhaitent rejoindre ce modèle, les créateurs ne seront plus obligés d'utiliser les datacenters de Netflix pour diffuser leur contenu.
Grâce aux contrats, même Netflix pourra choisir de fermer ses datacenter, pour proposer à tout un chacun de participer à la diffusion de son catalogue, et le rémuner en conséquence.
**Découvrez l'[Internet des gens](https://astroport.com)**
astrXbian est une première façon de programmer Astroport en le connectant avec KODI.
Utilisé de cette façon, il constitue un **Vidéo Club "pair à pair" entre amis**
Utilisé de cette façon, il constitue un **Vidéo Club "pair à pair" entre amis**
Il permet de mettre en partage vos copies privées dans votre essaim au travers du média-center KODI.
Vos relations Gchange s'appliquent comme relations (A-B(-C)) (ami (d'amis)) de votre essaim IPFS et de toutes données à échanger selon le nombre d'étoiles envoyées.
@ -17,12 +92,15 @@ Il contrôle son réseau IPFS en fonction des "étoiles" transmisent par Gchange
ASTROPORT, automate cellulaire sécurisé, prend en compte vos relations pour ouvrir des canaux de partage selon 5 niveaux de confiance.
Ces "stargate" permettent de créer des espaces numériques public ou privés tout en contrôlant l'étendue du partage.
---
---
## INSTALLATION (Debian/Ubuntu/Mint ou Xbian)
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
### **IMPORTANT** Restez en contact avec l'équipe de développement!! [Groupe Framagenda en cours de création](https://framagenda.org/apps/contacts/circle/vUAH4ggf7DyfznqN9bJDHu3nitjL7K6)
---
## [INSTALLATION sur RaspberryPi (Xbian)](https://www.copylaradio.com/en_US/blog/blog-1/post/astrxbian-20)
@ -52,7 +130,7 @@ Cela tombe bien, parce que tout utilisateur averti de son ordinateur se doit de
Il s'agit des logiciels ipfs et de diverses couches cryptographiques compatible avec toute application du système hote pour en partager les données avec les amis de son essaim
cette distribution permet de facilement relier nos ordinateurs en cloud sans datacenter.
**Ouvrez un terminal puis copiez/collez cette ligne de commande**:
**Ouvrez un terminal puis copiez/collez cette ligne de commande**:
```bash <(wget -qO- https://git.p2p.legal/axiom-team/astrXbian/raw/branch/master/install.sh)```
@ -91,7 +169,7 @@ Ensemble transformons le monde numérique pour qu'il devienne LIBRE P2P et LEGAL
## Installation Image pour Rpi4
Nous avons préparé une image système pré-installée
Nous avons préparé une image système pré-installée
[TELECHARGER IMAGE POUR RPI](https://qo-op.com/astrXbian_2021_03_10.img)
- Copier l'image sur une carte micro-SD. Utiliser un RaspberryPi4 (2 ou 4Go) est recommandé!
@ -103,31 +181,31 @@ NB: Les films placés dans ~/astroport/film/$TMDBID/ sont automatiquement transf
-- Automate Astroport/KODI en demonstration pour Xbian.org --
## PRINCIPE DE FONCTIONNEMENT
## PRINCIPE DE FONCTIONNEMENT ([index des PAD astroport](https://pad.p2p.legal/s/astroport-index))
> 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
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
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
```
* ```~/.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.
@ -142,7 +220,7 @@ L'essaim se restructure toutes les minutes (code: ```cron_MINUTE.sh```) et activ
Chaque station fabrique 5 clefs qui sont envoyées à tous ses amis en fonction des étoiles attribuées.
Ces "stargate" partagés sur le même espace IPNS sont signés par chaque participant qui le modifie construisant une blockchain (sauvegarde).
En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procédure envoi des messages aux 2 signatures et invite à résoudre de façon manuelle le problème.
En cas de conflit (quand le swarm est trop grand ou désynchronisé), une procédure envoi des messages aux 2 signatures et invite à résoudre de façon manuelle le problème.
# Magic commands
@ -151,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
# Noms des stations astroport de son swarm
for peer in $(ipfs swarm peers); do ipfsnodeid=${peer##*/}; echo "$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/G1SSB/_g1.gchange_title) => $(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/_xbian.zuid)"; done
# 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/.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
@ -172,12 +250,12 @@ ipfs ls /ipns/k51qzi5uqu5dk1nt1pfbtgfis4bep8pcip78w30xykhgba7y7wk0xyu8nwci5m
MYCODE=$(cat ~/.zen/ipfs_swarm/.$IPFSNODEID/.mycode);
for CODE in $(ls ~/.zen/ipfs_swarm/.12D*/.mycode);
do
echo
echo
ipfsnodeid=$(echo $CODE | cut -d '.' -f 3 | cut -d '/' -f 1 );
code=$(cat $CODE);
IPNSCODE=$(ipfs cat /ipns/$ipfsnodeid/.$ipfsnodeid/.mycode)
zuid=$(cat ~/.zen/ipfs_swarm/.$ipfsnodeid/_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"
@ -187,14 +265,14 @@ 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
```
# ANNEXES
## PRESENTATIONS VIDEO
### [Fred présente Astroport à la Ressourcerie](https://tube.p2p.legal/videos/watch/7ff4a8c9-7fb7-44ef-a1ee-bdf8ecc74cfe)
### [Première visite de Astroport/KODI](https://tube.p2p.legal/videos/watch/d74631e9-b1bd-43f4-9db7-5effca1ef46a)
@ -242,16 +320,13 @@ https://astroport.com
# Surcouche logicielle P2P à Debian (Essaim IPFS/Gchange+) + Interface média center KODI / IPFS
---
# OFFRES ENMPLOIS
Deux offres d'emplois ala TroporstA (only real GNU understand)
https://forum.monnaie-libre.fr/t/offres-emplois/16903?u=qoop
# NOUS RECRUTONS
**Et oui, on peut gagner jusqu'à 3 DU en sélectionnant, traduisant, les sources du Web qui vous plaisent !!**
**Activation de la Zen Economie Astroport.**
Pour rejoindre l'Astrocrew: Installez AstrXbian TestNET apprenez à programmer de votre automate cellulaire (BASH + multilanguage).
Des offres d'emploi et de stage en pagaille: visitez https://www.copylaradio.com/makers
- 1 DU par compte ouvert sur https://oasis.astroport.com
- 2 DU par article autour du DIY Raspberry Pi sur https://copylaradio.com (+ 1 DU pour l'ouverture du compte)
A la clef un concours des meilleurs articles par activation de la Zen Economie sur Astroport.
Pour rejoindre l'Astrocrew installez AstrXbian TestNET en cour s de développement et devenez programmateur de cette automate cellulaire (BASH + multilanguage).
Le nouveau JEu du LOVE peut commencer.

15
actions/check_my_wallet.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
MYG1PUB=$(cat /home/$YOU/.zen/ipfs/.*/G1SSB/_g1.pubkey)
MYIPFSNODEID=$(cat /home/$YOU/.zen/ipfs/.*/.ipfsnodeid)
[[ $MYG1PUB == "" ]] && echo "$MYIPFSNODEID MISSING $MYG1PUB" && exit 1
echo $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $MYG1PUB)
exit 0

49
actions/p4n.data_evolution.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ "$IPFSNODEID" == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1
###### MOVE MAP FROM SELF IPNS INDEX
if [ ! -d ~/.zen/ipfs/map ]; then
mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map ~/.zen/
else
exit 0
fi
## TODO CREATE SPECIAL IPNS KEY FOR SHARING
##############################################################"
## DO NOT RECORD output.pdf, bu convert to jpg and link throug index.html REDIRECT
##############################################################"
for pdflink in $(ls ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/*/bulle.pdf); do
lid=$(echo $pdflink | cut -d '/' -f 11)
## PDF convert and crop to JPG / ipfs add / index.html for redirect
convert -density 200 -quality 80 $pdflink /tmp/bulle.jpg
convert -crop 1260x420+55+30 /tmp/bulle.jpg /tmp/$lid.jpg
IPFS=$(ipfs add -wq "/tmp/$lid.jpg") ## Add $lid.pdf to IPFS
IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) ## Get repertory ipfs link
[[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && exit 1
## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=/ipfs/$IPFSREPFILEID/$lid.jpg\"></head></html>" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
# mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
done
exit 0

169
actions/p4n.swarmscraper.sh Executable file
View File

@ -0,0 +1,169 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n' 2>/dev/null) && [[ $IPFSNODEID == "" ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
[ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport ] && echo 'ASTROPORT NOT READY' && exit 1
## INSTALL MISSING PACKAGES
if [[ -f /etc/sudoers.d/apt ]]; then
for i in chromium nmap httrack imagemagick; do
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
sudo apt install -y $i
fi
done
else
echo "No sudo access for apt install... Please correct situation"
echo "PUT : $USER ALL=(ALL) NOPASSWD:/usr/bin/apt INTO /etc/sudoers.d/apt (use sudo visudo)"
exit 1
fi
##############################################################"
## Backing up europa p4n collected spots from collective intelligence ##
# SWARM is collectively PLAYing bataille navale
# Randomly get geaodata in south europe
# FOCUS on SOUTH EUROPE
# LON = -10 to 30
# LAT = 35 to 60
# https://fr.mapsofworld.com/lat_long/europe.html
##############################################################"
# initial first spot.
lon=0
lat=40
try=1
# Randomly choose spot from in RANGE $lat.$lon
while [[ $(ls ~/.zen/ipfs_swarm/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null) ]]; do
echo "astroport/$lat.$lon geodata already swarm captured. CONTINUE"
FLOOR=-5; #-10;
CEILING=10; #30
RANGE=$(($CEILING-$FLOOR+1));
RESULT=$RANDOM;
let "RESULT %= $RANGE";
lon=$(($RESULT+$FLOOR));
#echo $lon
FLOOR=40; #35;
CEILING=50; #60;
RANGE=$(($CEILING-$FLOOR+1));
RESULT=$RANDOM;
let "RESULT %= $RANGE";
lat=$(($RESULT+$FLOOR));
#echo $lat
try=$(($try+1));
[ $try -eq 99 ] && break ## tirages aléatoire maximum
done
##############################################################"
## $lat.$lon GEODATA NOT SCRAPED YET ?
##############################################################"
if [ ! -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/ ]; then
### ADD Spot randomness
# Fuzzle geoloc
one=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12)
latitude="$lat.$one"
two=$(echo "000$RANDOM$RANDOM$RANDOM" | cut -b1-12)
longitude="$lon.$two"
### SCRAPE P4N
## curl spot.json into /astroport/map/$lat.$lon/p4n/spot.json
echo "GETTING /astroport/map/$lat.$lon/p4n/spot.json"
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/
echo "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude"
curl -s "https://www.park4night.com/services/V3/getLieuxAroundMeLite.php?latitude=$latitude&longitude=$longitude" -o ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json
echo "SAVED ~/.zen/ipfs/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json"
## TODO REFRESH OLD spot.json
fi
##############################################################"
## GEODATA. continue. Let's extract lieu pdf from my spot
##############################################################"
geosrc=$(ls ~/.zen/{ipfs,ipfs_swarm}/.*/astroport/map/$lat.$lon/p4n/spot.json 2>/dev/null)
geodata=$(echo "$geosrc" | tail -n 1)
ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2)
if [[ "$ipfsnodeid" != "$IPFSNODEID" ]]; then
echo "This spot.json is managed by
$geosrc"
echo "getting geodata from one of mine"
geodata=$(ls ~/.zen/ipfs/.*/astroport/map/*.*/p4n/spot.json | shuf | tail -n 1)
fi
[[ $geodata ]] && ipfsnodeid=$(echo "$geodata" | cut -d '/' -f 6 | cut -d '.' -f 2) || exit 1
## SUB-SCRAPE SOME of my p4n/spot.json RANDOM "lieu"
echo "SUB-SCRAPING lieu FROM $geodata"
loop=1
while [ $loop -lt 21 ]; do
#{"id":"208264","latitude":"40.730727","longitude":"0.367303","hauteur_limite":"0.00","publique":"1","top_liste":"0","code":"APN","validation_admin":"1","distance":"97.341"}
# flatten json
lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
## GET RANDOM LIEU ID AND TRY MORE TO GET ( prefered APN)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[[ "$code" != "APN" ]] && [ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[ -d ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid ] && lieu=$(cat $geodata | jq -r '.lieux[] | "\(.id),\(.latitude),\(.longitude),\(.hauteur_limite),\(.publique),\(.top_liste),\(.code),\(.validation_admin),\(.distance)"' | shuf | tail -n 1)
lid=$(echo "$lieu" | cut -d ',' -f 1); code=$(echo "$lieu" | cut -d ',' -f 7)
[[ "$lid" == "" ]] && echo "ERROR LIEU NO ID. CONTINUE" && loop=$(($loop+1)) && continue
mkdir -p /tmp/$lid && cd /tmp/$lid
echo "Downloading https://www.park4night.com/?page=lieu&id=$lid&bulle=YES"
mkdir -p ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code
echo "id,latitude,longitude,hauteur_limite,publique,top_liste,code,validation_admin,distance" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
echo "$lieu" >> ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
cat ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/$code/lieu.txt
# Get 1st copy bulle.pdf... Now converting to index.html redirect to $lid.jpg
[ -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ] && mv ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf ./output.pdf && echo "ancien fichier bulle.pdf"
[ ! -f ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html ] && echo "running chromium... " && chromium --timeout=10000 --headless --no-sandbox --disable-gpu --print-to-pdf=output.pdf "https://www.park4night.com/?page=lieu&id=$lid&bulle=YES" 2>/dev/null
[ ! -f ./output.pdf ] && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && echo "## CHROMIUM TIMEOUT, CANCEL MISSION" && loop=$(($loop+1)) && continue
## PDF convert and crop to JPG / ipfs add / index.html for redirect
if [ -f ./output.pdf ]; then
convert -density 200 -quality 80 ./output.pdf ./bulle.jpg
convert -crop 1260x420+55+30 ./bulle.jpg ./$lid.jpg
IPFS=$(ipfs add -wq "./$lid.jpg") && echo "## Added $lid.pdf to IPFS: $IPFS"
IPFSREPFILEID=$(echo $IPFS | cut -d ' ' -f 2) && echo "## Repertory $IPFSREPFILEID"
[[ "$IPFSREPFILEID" == "" ]] && echo "IPFS ADD TROUBLE. CONTINUE" && rm -Rf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid && rm -Rf /tmp/$lid && loop=$(($loop+1)) && continue
## Create index.html with Redirect to /ipfs/$IPFSREPFILEID/$lid.jpg
echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=/ipfs/$IPFSREPFILEID/$lid.jpg\"></head></html>" > ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/index.html
# mv ./output.pdf ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf
rm ~/.zen/ipfs/.$IPFSNODEID/astroport/map/p4n/lieu/$lid/bulle.pdf 2>/dev/null
echo "NOW LIEU redirect to http://127.0.0.1:8080/ipfs/$IPFSREPFILEID/$lid.jpg"
rm ./$lid.jpg
rm ./bulle.jpg
fi
cd -
sleep $((1 + RANDOM % 2))
rm -Rf /tmp/$lid
loop=$(($loop+1));
done
## CHECK SWARM GEODATA MAP
# ls -d ~/.zen/ipfs_swarm/.*/astroport/map/*/ | rev | cut -d '/' -f 2 | rev | sort
## NB OF lieu: ls -d ~/.zen/ipfs_swarm/.*/astroport/map/p4n/lieu/*/ | rev | cut -d '/' -f 2 | rev | sort | wc
# ipfs cat /ipns/$IPFSNODEID/.$IPFSNODEID/astroport/map/$lat.$lon/p4n/spot.json | jq
exit 0

View File

@ -0,0 +1,78 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l)
[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "NO ~/.zen/secret.dunikey EXIT" && exit 1
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n') && [[ ! $IPFSNODEID ]] && echo 'NO IPFS RUNNING. EXIT' && exit 1
MEDIAKEYIPNS="$1"&& [[ ! $MEDIAKEYIPNS ]] && echo 'NO MEDIAKEY. Enter ipns/??? value. EXIT' && exit 1
OPENACCES="$2" && [[ ! $OPENACCES ]] && echo 'OPEN ACCES TO "$2=$G1PUB"'
tempdir=$(mktemp -d)
cd $tempdir
## GET CURRENT DHT PROPAGATED VERSION
ipfs --timeout=10s get --output="$tempdir" /ipns/$MEDIAKEYIPNS
[[ ! $? == 0 ]] && echo "CANNOT GET MEDIAKEY" && exit 1
## DO I OWN THE KEY, OR SHOUD I REQUEST IT
MEDIAKEY=$(cat ./*/.id | tail -n 1)
[[ ! $MEDIAKEY ]] && echo "MISSING MATCHING MEDIAKEY ID" && exit 1
if [[ ! $(ipfs key list -l | grep $MEDIAKEY) ]]; then
## SEND A MESSAGE ASKING FOR THE KEY (I am a bootstrap or http gateway)
for sharedowners in $(ls -d */ | cut -d '/' -f 1); do
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d "$sharedowners" -t "MEDIAKEY ask for sharing contract" -m "I was wishing to increment $MEDIAKEY views, but not in your contracts yet. Please run ~/.zen/astrXbian/actions/view_counter_increment_or_allow.sh $MEDIAKEYIPNS $G1PUB to activate."
done
exit 1
fi
## INCREMENT COUNTER
## GO INTO $G1PUB EXCHANGE SPACE
[[ ! -d ./$G1PUB ]] && echo "MISSING RELATION WITH $G1PUB. EXIT" && exit 1
cd $G1PUB
count=$(cat .views.counter 2>/dev/null) || count=0
echo $((count+1)) > .views.counter
if [[ $OPENACCES ]]; then
echo "Creating ${OPENACCES}/.ipns.mediakey.encrypt and .ipfsid.encrypt"
## CREATE OFFICIAL RELATION DETECTED BY autoPINfriends.sh with ~/.zen/ipfs_swarm/.12D*/KEY/*/*/${G1PUB}/.ipfsid.encrypt
mkdir -p /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/
key2send=$(/home/$YOU/.zen/astrXbian/zen/tools/give_me_keystore_filename.py $MEDIAKEY)
/home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i /home/$YOU/.ipfs/keystore/$key2send -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipns.mediakey.encrypt
/home/$YOU/.zen/astrXbian/zen/tools/natools.py decrypt -f pubsec -k "/home/$YOU/.zen/secret.dunikey" -i "/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/.ipfsid.encrypt" -o "./ipfsid_$MEDIAKEY.txt"
/home/$YOU/.zen/astrXbian/zen/tools/natools.py encrypt -p ${OPENACCES} -i ./ipfsid_$MEDIAKEY.txt -o /home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/${OPENACCES}/.ipfsid.encrypt
## Ask PIN to Bootstraps executed through autoPINfriends.sh
rm ./ipfsid_$MEDIAKEY.txt
## TODO COULD SEND JUNE FOR THAT?
syncronizedir="/home/$YOU/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}"
else
syncronizedir="$tempdir"
fi
echo "WE ARE in $syncronizedir"
cd $syncronizedir
## PUBLISH NEW STATE
I=$(ipfs add -qrH $syncronizedir | tail -n 1)
echo "CHAIN: $I"
echo "$(date -u +%s%N | cut -b1-13)" > .timestamp
echo $I > .chain
I=$(ipfs add -qrH $syncronizedir | tail -n 1)
echo "${MEDIAKEY} NAME PUBLISHING "
# MEDIAKEY IPNS name publish
J=$(ipfs --timeout=180s name publish --quieter -k ${MEDIAKEY} /ipfs/${I})
echo "$MEDIAKEY VIEW COUNTER UPDATED in https://tube.copylaradio.com/ipns/$J/$G1PUB/.views.counter"

View File

@ -6,27 +6,40 @@
########################################################################
# SCRIPT INTERACTIF POUR AJOUTER UN FICHIER à ASTROPORT/KODI
#
# 1. CAT: film, serie, anime
# 1. CAT: film, serie
# 2. TMDB: ID de la fiche sur https://www.themoviedb.org/
# 3. TITLE: Titre de la vidéo
# 4. YEAR: Année de la vidéo
# 5. RES: Résolution 1080p, 4K, SD, 720, HD
# 6. SAISON: Pour les séries et animes, c'est le numéro de saison.
# 6. SAISON: Pour les séries, c'est le numéro de saison.
# Pour un film, le champ SAISON est utilisé pour renseigner la Saga
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
# 8. GROUPES: Permet de regrouper des films. (choix multiple)
#
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
# 8. GROUPES: Stocker la clef IPNS du MEDIAKEY.
#
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
########################################################################
[[ $(which ipfs) == "" ]] && echo "ERREUR! Installez ipfs" && echo "wget https://git.p2p.legal/axiom-team/astrXbian/raw/master/.install/ipfs_alone.sh -O /tmp/ipfs_install.sh && chmod +x /tmp/ipfs_install.sh && /tmp/ipfs_install.sh" && exit 1
[[ $(which zenity) == "" ]] && echo "ERREUR! Installez zenity" && echo "sudo apt install zenity" && exit 1
[[ $(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
URL="$1"
if [ $URL ]; then
echo "URL: $URL"
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Video" MP3 Web) || IMPORT="Youtube"
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
CHOICE="$IMPORT"
fi
[[ $CHOICE == "Web" ]] && CHOICE=$(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
alias zenity='zenity 2> >(grep -v GtkDialog >&2)'
@ -39,14 +52,14 @@ large=$((width-300))
haut=$((height-200))
########################################################################
IPFSNODEID=$(ipfs id -f='<id>\n')
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title) || XZUID=$(cat /etc/hostname)
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && AXID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
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/.player ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/.player)
zenity --warning --width 300 --text "Ajoutez une vidéo à ASTROPORT/KODI"
## CADRE EXCEPTION COPIE PRIVE # https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
if [[ ! -f ~/.zen/legal ]]; then
########################################################################
## CADRE EXCEPTION COPIE PRIVE
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
if [[ ! -f ~/.zen/game/players/.current/legal ]]; then
zenity --width ${large} --height=${haut} --text-info \
--title="Action conforme avec le Code de la propriété intellectuelle" \
--html \
@ -56,52 +69,86 @@ zenity --width ${large} --height=${haut} --text-info \
case $? in
0)
echo "AUTORISATION COPIE PRIVE ASTROPORT OK !"
echo "$G1PUB" > ~/.zen/legal
# next step
;;
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)
echo "Erreur."
exit 1
;;
;;
esac
fi
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) && [[ $RUN == "" || $RUN == "NON" ]] && exit 1
[[ $YOU && ! $1 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ? Non, vous voulez ajouter un Media?" --entry-text="OUI" NON)
## DES/ACTIVATION ASTROPORT
if [[ $RUN == "OUI" ]]; then
STRAP=$(ipfs bootstrap)
BOOT=$(zenity --entry --width 300 --title="Catégorie" --text="$STRAP Changez de Bootstrap" --entry-text="Aucun" astrXbian Public)
[[ $BOOT == "Aucun" ]] && ipfs bootstrap rm --all
[[ $BOOT == "astrXbian" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
[[ $BOOT == "Public" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_public.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
REP=$(~/.zen/astrXbian/zen/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP"
fi
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $YOU == "" ]] && echo "IPFS not running" && exit 1
########################################################################
# CHOOSE CATEGORY (remove anime, not working!)
CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre vidéo" --entry-text="Film" Anime Serie KODI Youtube MP3)
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Film" Serie Youtube Video)
[[ $CHOICE == "" ]] && exit 1
# LOWER CARACTERS
CAT=$(echo "${CHOICE}" | awk '{print tolower($0)}')
PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ...
# UPPER CARACTERS
CHOICE=$(echo "${CAT}" | awk '{print toupper($0)}')
PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A, Y, M ... P W
[[ $PREFIX == "" ]] && exit 1
########################################################################
########################################################################
case ${CAT} in
########################################################################
# CASE ## YOUTUBE
# _ _
# _ _ ___ _ _| |_ _ _| |__ ___
#| | | |/ _ \| | | | __| | | | '_ \ / _ \
#| |_| | (_) | |_| | |_| |_| | |_) | __/
# \__, |\___/ \__,_|\__|\__,_|_.__/ \___|
# |___/
########################################################################
youtube)
youtube)
zenity --warning --width ${large} --text 'ATTENTION ZONE EN TRAVAUX!!! ANNULER OU PROGRAMMEZ ASTROPORT'
YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
YTURL="$URL"
[[ $YTURL == "" ]] && YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
[[ $YTURL == "" ]] && exit 1
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
echo "VIDEO $YTURL"
/usr/local/bin/youtube-dl -f '[height=720]/best' \
--write-info-json --write-annotations \
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=360]/best' \
--no-playlist --write-info-json \
--no-mtime -o "${YTEMP}/%(id)s&%(title)s.%(ext)s" $YTURL
# Get filename, extract ID, make destination dir and move copy.
YFILE=$(ls -t ${YTEMP} | head -n 1)
YFILE=$(ls -S ${YTEMP} | head -n 1)
FILE_NAME="$(basename "${YFILE}")"
FILE_EXT="${FILE_NAME##*.}"
@ -110,12 +157,12 @@ JSON_FILE=$(echo ${FILE_NAME} | sed "s/${FILE_EXT}/json/g")
YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1)
YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g' ) # Remove YoutubeID_ and (what is in perentheses)
[[ $(which detox) ]] && YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)
TMDB="${YID}"
MEDIAID="$REVSOURCE${YID}"
TITLE="${YNAME%.*}"
MEDIAKEY="YOUTUBE_${MEDIAID}"
## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE
GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
[ ! $2 ] && GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
--text="Choisissez le(s) genre(s) d'information(s) contenue(s) dans cette vidéo \"${TITLE}\" publiée sur OASIS" \
--column="Use" \
--column="Feature" \
@ -132,11 +179,11 @@ GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut} \
FALSE Humain \
FALSE Animal \
TRUE Eveil \
TRUE ${AXID// /-})
TRUE ${XZUID// /-}) || GENRES="${XZUID// /-}"
# FORMAT GENRES genre1|genre2|genre3
FILE_PATH="$HOME/astroport/youtube/$YID"
FILE_PATH="$HOME/astroport/youtube/$MEDIAID"
mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/
# rename FILE_NAME to YNAME (URL clean)
mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
@ -144,30 +191,79 @@ mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
jsonfile=$(ls ${FILE_PATH}/*.json)
mv "${jsonfile}" "${FILE_PATH}/video.json"
GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY
FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2)
RES=${FILE_RES%?}0p
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" and video.json
## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" and video.json
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "youtube;${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
echo "youtube;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
rm -Rf ${YTEMP}
;;
;;
########################################################################
# CASE ## WEB
web)
## wget current URL -> index.html ## TEST ## TEST httrack ??
[[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1
echo "httrack --mirror $URL"
FILE_NAME="index.html"
REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6"
MEDIAID="$REVSOURCE" # MEDIAID=1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
MEDIAKEY="WWW_${MEDIAID}" # MEDIAKEY=PAGE_1252ff59950395070a0cc56bb058cbb1ccfd2f8d8a32476acaf472f62b14d97d_
FILE_PATH="$HOME/astroport/web/$MEDIAID";
mkdir -p $FILE_PATH
wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/
echo "web;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
zenity --warning --width ${large} --text "Vérifiez que la copie de votre site se trouve bien dans ${FILE_PATH}/"
;;
########################################################################
# CASE ## PAGE
page)
## record one page to PDF
[[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
cd /tmp/ && rm -f output.pdf
chromium --headless --no-sandbox --print-to-pdf $URL
TITLE=$(zenity --entry --width 480 --title "Titre" --text "Quel nom de fichier à donner à cette page ? " --entry-text="${URL}")
[[ $TITLE == "" ]] && exit 1
FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better
MEDIAID="$REVSOURCE$(echo "${TITLE}" | detox --inline)"
MEDIAKEY="PAGE_${MEDIAID}"
FILE_PATH="$HOME/astroport/page/$MEDIAID"
mkdir -p ${FILE_PATH} && mv output.pdf ${FILE_PATH}/${FILE_NAME}
echo "page;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
;;
########################################################################
# CASE ## MP3
# _____
# _ __ ___ _ __|___ /
#| '_ ` _ \| '_ \ |_ \
#| | | | | | |_) |__) |
#|_| |_| |_| .__/____/
# |_|
########################################################################
mp3)
mp3)
zenity --warning --width ${large} --text 'ATTENTION ZONE EN TRAVAUX!!! ANNULER OU PROGRAMMEZ ASTROPORT'
zenity --warning --width 600 --text 'DEV 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="")
@ -178,12 +274,12 @@ length=${#artist}
islink=$(echo "$artist" | grep "http")
if [[ ! $islink && $length != 11 ]]
then
# Ask for song name
song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="")
[[ $song == "" ]] && exit 1
# Ask for song name
song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="")
[[ $song == "" ]] && exit 1
else
song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist")
[[ "$song" == "$artist" ]] && song=""
song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist")
[[ "$song" == "$artist" ]] && song=""
fi
# Download mp3 from 1st youtube search video result (--write-info-json)
@ -200,7 +296,7 @@ FILE_EXT="${FILE_NAME##*.}"
YID=$(echo "${FILE_NAME}" | cut -d "&" -f 1)
YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | sed "s/[(][^)]*[)]//g" | sed -e 's/[^A-Za-z0-9._-]/_/g' | sed -e 's/__/_/g') # Remove YoutubeID_ and (what is in perentheses)
[[ $(which detox) ]] && YNAME=$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)
[[ $(which detox) ]] && YNAME="$(echo "${FILE_NAME}" | cut -d "&" -f 2- | detox --inline)"
[[ ! $islink && "$song" != "" ]] && FILE_PATH="$HOME/astroport/$CAT/$artist/_o-o_" \
|| FILE_PATH="$HOME/astroport/$CAT/${YID}"
@ -209,27 +305,33 @@ mkdir -p "${FILE_PATH}" && mv -f ${YTEMP}/* "${FILE_PATH}/"
# Remove "&" from FILE_NAME rename to YNAME
mv "${FILE_PATH}/${FILE_NAME}" "${FILE_PATH}/${YNAME}" && FILE_NAME="${YNAME}"
TMDB="${YID}"
MEDIAID="${YID}"
TITLE="${YNAME%.*}"
GENRES="[\"$AXID\"]"
GENRES="[\"$XZUID\"]"
GROUPES="_IPNSKEY_" # USE GROUPS TO RECORD IPNS MEDIAKEY
MEDIAKEY="MP3_$MEDIAID"
rm -Rf ${YTEMP}
# zenity --warning --width ${large} --text "MP3 copié"
echo "~/.zen/astrXbian/zen/new_mp3_in_astroport.sh \"${FILE_PATH}/\" \"${FILE_NAME}\""
~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1
~/.zen/astrXbian/zen/new_mp3_in_astroport.sh "${FILE_PATH}/" "${FILE_NAME}" > /tmp/${CHOICE}_${MEDIAID}.log 2>&1
cat /tmp/${CAT}_${TMDB}.log
cat /tmp/${CHOICE}_${MEDIAID}.log
exit 0
;;
;;
########################################################################
# CASE ## film serie anime
# __ _ _
# / _(_) |_ __ ___
#| |_| | | '_ ` _ \
#| _| | | | | | | |
#|_| |_|_|_| |_| |_| THE MOVIE DATABASE INDEX
#
########################################################################
film | serie | anime)
film | serie)
# SELECT FILE TO ADD TO ASTROPORT/KODI
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
echo "${FILE}"
@ -242,16 +344,20 @@ FILE_EXT="${FILE_NAME##*.}"
FILE_TITLE="${FILE_NAME%.*}"
# OPEN default browser and search TMDB
zenity --question --width 300 --text "IMPORTANT! Nous allons ouvrir le site themoviedb pour y récuperer le numéro d'identification de votre vidéo"
[ $? == 1 ] && exit 1
xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
zenity --question --width 300 --text "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?"
[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
TMDB=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Exemple: 301528 (à extraire du lien https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
[[ $TMDB == "" ]] && exit 1
if ! [[ "$TMDB" =~ ^[0-9]+$ ]]
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
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
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
@ -267,7 +373,7 @@ RES=${FILE_RES%?}0p # Rounding. Replace last digit with 0
#RES=$(zenity --entry --width 300 --title="Résolution" --text="Résolution de la vidéo" --entry-text="${FILE_RES}" SD HD 4K 360p 480p 720p 1080p)
# VIDEO SEASON or SAGA
[[ "${CAT}" == "serie" || "${CAT}" == "anime" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
# VIDEO GENRES
@ -314,70 +420,194 @@ FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
FALSE Telefilm\
FALSE Thriller\
FALSE Western\
TRUE ${AXID// /-})
TRUE ${XZUID// /-})
# FORMAT GENRES ["genre1","genre2"]
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
# VIDEO GROUP
# GROUPES=$(zenity --entry --width 300 --title "Groupe" --text "Associez la vidéo à un groupe (optionnel). Exemple: PIXAR" --entry-text="${AXID}")
GROUPES="_IPNSKEY_" # USE GROUPES TO RECORD MEDIAKEY
# DEBUG VERIFICATION
# zenity --question --width ${large} --title "EMBARQUEMENT ASTROPORT! OK?"\
# --text "${FILE_NAME} (${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})"
# --text "${FILE_NAME} (${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES})"
# [ $? == 1 ] && echo "ANNULATION." && exit 1
### OK MOVING FILE TO ASTROPORT ####
mkdir -p ~/astroport/${CAT}/${TMDB}/
########################################################################
# 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
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT}" && zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..."
###################################
### MOVING FILE TO ~/astroport ####
###################################
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
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..."
else
zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -"
exit 1
fi
FILE_NAME="${TITLE}.${FILE_EXT}"
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt"
## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt"
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
;;
;;
# _ _
#__ _(_) __| | ___ ___
#\ \ / / |/ _` |/ _ \/ _ \
# \ V /| | (_| | __/ (_) |
# \_/ |_|\__,_|\___|\___/
# TIMESTAMP INDEX
video)
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Inscrivez-vous sur https://git.p2p.legal'
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
# SELECT FILE TO ADD TO ASTROPORT/KODI
FILE=$(zenity --file-selection --title="Sélectionner le fichier vidéo à ajouter")
echo "${FILE}"
[[ $FILE == "" ]] && exit 1
# Remove file extension to get file name => STITLE
FILE_PATH="$(dirname "${FILE}")"
FILE_NAME="$(basename "${FILE}")"
FILE_EXT="${FILE_NAME##*.}"
FILE_TITLE="${FILE_NAME%.*}"
# VIDEO TITLE
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
[[ $TITLE == "" ]] && exit 1
TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;)
OUTPUT=$(zenity --forms --width ${large} --title="METADATA" --text="Ajouter des métadonnées" --separator=";" --add-entry="Sous titres" --add-entry="Hashtag(s)")
[[ $? != 0 ]] && echo "FAIL" && exit 1
DESCRIPTION=$(awk -F ';' '{print $1}' <<<$OUTPUT)
HASHTAG=$(awk -F ';' '{print $2}' <<<$OUTPUT)
## video_timestamp INDEX
MEDIAID="$(date -u +%s%N | cut -b1-13)"
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
MEDIAKEY="VIDEO_${MEDIAID}"
## CREATE SIMPLE JSON
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"htag":$htag}' > ~/astroport/${CAT}/${MEDIAID}/video.json
## MOVE FILE TO IMPORT ZONE
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
FILE_NAME="${TITLE}.${FILE_EXT}"
;;
kodi)
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
## CREATE NEW SHORTCUT
zenity --warning --width ${large} --text "UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh en ligne de commande !!"
exit 0
fi
;;
########################################################################
# CASE ## DEFAULT
########################################################################
*)
zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT"
exit 1
;;
*)
zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT"
exit 1
;;
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}/${TMDB}/\" \"${FILE_NAME}\""
cat ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\""
[[ -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
########################################################################
~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${TMDB}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1
## CREATION DU FICHIER ajouter_video.txt OK
########################################################################
### AJOUT DANS IPFS #######################################################
########################################################################
####################################new_file_in_astroport.sh##################
########################################################################
[[ "$CAT" == "film" || "$CAT" == "serie" ]] && CHOICE="TMDB"
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
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
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${MEDIAID}/" "${FILE_NAME}" > /tmp/${MEDIAKEY}.log 2>&1
# [ ! $? == 0 ] && zenity --warning --width 300 --text "Désolé une erreur est survenue... Signalez ce log /tmp/${MEDIAKEY}.log sur https://git.p2p.legal/axiom-team/astrXbian" && exit 1
########################################################################
########################################################################
[ $? == 0 ] && zenity --warning --width 300 --text "OK! Votre vidéo a été transférée dans Astroport (/tmp/${CAT}_${TMDB}.log)" && exit 0 \
|| zenity --warning --width ${large} --height=${haut} --text "Désolé une erreur est survenue... LOG: cat /tmp/${CAT}_${TMDB}.log" && exit 1
########################################################################
########################################################################
########################################################################
MEDIAPUBKEY=$(cat $HOME/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/MEDIAPUBKEY)
#[ ! $2 ] && zenity --width=500 --height=500 --text-info \
# --title="QR CODE MEDIA ${MEDIAKEY} (PASS=$(cat /tmp/${MEDIAKEY}.pass))" \
# --html \
# --url="http://127.0.0.1:8080/ipns/${IPFSNODEID}/.${IPFSNODEID}/KEY/${MEDIAKEY}/QR.png" \
# --checkbox="Je m'engage à respecter les auteurs et promet d'offrir la Monnaie Libre collectée à qui de droit."
########################################################################
echo "# ZENBALANCE for ${MEDIAKEY} , WALLET $MEDIAPUBKEY"
########################################################################
FILE_BSIZE=$(du -b "$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}" | awk '{print $1}')
FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } printf "%.2f %s", $1, v[s] }')
#G1BALANCE=$(~/.zen/astrXbian/zen/jaklis/jaklis.py balance -p $G1PUB) && [[ "$G1BALANCE" == "null" ]] && G1BALANCE=0 || G1BALANCE=$(echo "$G1BALANCE" | cut -d '.' -f 1)
#if [[ $G1BALANCE -gt 0 ]]; then
# [ ! $2 ] && G1AMOUNT=$(zenity --entry --width 400 --title "VIRER DE LA MONNAIE LIBRE AU MEDIAKEY (MAX $G1BALANCE)" --text "Combien de JUNE (G1) souhaitez-vous offrir à ce MEDIA ($FILE_SIZE)" --entry-text="")
# [[ ! "$G1AMOUNT" =~ ^[0-9]+$ ]] && G1AMOUNT=0
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey pay -p ${MEDIAPUBKEY} -a $G1AMOUNT -c "#ASTROPORT:${MEDIAKEY} DON"
# ZENBALANCE=$(echo "100 * $G1AMOUNT" | bc -l | cut -d '.' -f 1)
#else
ZENBALANCE=0
#fi
########################################################################
########################################################################
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

View File

@ -18,16 +18,51 @@ source $HOME/.profile
[[ ! $(echo $PATH | grep "$HOME/.local/bin") ]] && export PATH="$PATH:$HOME/.local/bin"
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
#### INIT STATION PARAMETERS
[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs id -f='<id>\n')
#### CONTROL STATION IPFS DAEMON
## timeout is fixing ipfs minimum response time, before considering stuck process
IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID)
howmany=$(cat /tmp/ipfs.timeout)
if [[ ! $IPFSNODEID ]]; then
## wait a howmany timeout before restarting ipfs
howmany=$((howmany + 1)) && echo $howmany > /tmp/ipfs.timeout
[ $howmany -gt 3 ] && [[ "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo service ipfs restart && exit 1
[ $howmany -gt 3 ] && [[ -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING $(date)" && rm /tmp/ipfs.timeout && rm /config/ipfs/repo.lock && sudo systemctl restart ipfs
rm ~/.zen/restart.txt
exit 1
else
echo 0 > /tmp/ipfs.timeout
fi
## CONTROL IPFS IS RUNNING OR RESTART
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
if [[ ! ${YOU} ]]; then
# 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 !!! 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/
[[ ! -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
########################################################################
@ -41,10 +76,10 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
# _ _____ ____ _ _______ ________ ____
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
########################################################################
# 'figlet' was used for labeling code trunks
########################################################################
@ -80,96 +115,159 @@ else
total_old_minutes=$((10#$old_hour*60 + 10#$old_min))
total_minutes=$((10#$hour*60 + 10#$min))
runtime=$((total_minutes - total_old_minutes))
runtime=${runtime#-}
fi
# RUN TIME $runtime
echo "RUNTIME $runtime mn ($timebar)"
if [[ $(($runtime % 4)) == 0 ]]; then
## PING ALL MY FRIENDS TO ENHANCE SWARM CONNECTIVITY
echo "## FRIENDS IPFS PINGing"
for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do
[[ $g1pub ]] && latency=$(ipfs ping --timeout=1s -n 1 /p2p/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null | grep "Average" | cut -d ':' -f 2);
[[ $latency ]] && echo $latency > ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/$g1pub/ping.average.txt
## AVERAGE PING cat ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt
# for line in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/*/ping.average.txt); do g1friend=$(echo $line | cut -d '/' -f 8); ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1friend); cat ~/.zen/ipfs_swarm/.$ipfsnodeid/.player; cat $line; done
done
fi
########################################################################
# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use.
## CHECK & (RE)ACTIVATE ipfs p2p tunnels
########################################################################
# NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com)
~/.zen/astrXbian/zen/ipfs_P2P_forward.sh
########## SUPPORT : OPEN OR CLOSE SSH ACCESS #################
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH
########################################################################
# DEFCON
########################################################################
# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use.
[[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario
## DEFCON SYSTEM ACTIVATED
# _ ____
# / | | ___| _ __ ___ _ __
# | | |___ \ | '_ ` _ \| '_ \
# | | ___) | | | | | | | | | |
# |_| |____/ |_| |_| |_|_| |_|
#
########################################################################
# SMARM SYNCRONISATION
# SMARM MAINTENANCE / 15 mn
########################################################################
# ____ _______ __ __
# / __ \/ ____/ | / / ____ ___ ____ ____/ /__
# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \
# / /_/ / /___ | |/ / / / / / / / /_/ / /_/ / __/
# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/
#
# astrXbian TestNET
# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID
########################################################################
# ACTIVATE 15-17 MN "git pull" update
if [[ $(($minute % 15)) == 0 ]]; then
# ACTIVATE 15 MN "git pull" update
if [[ $(($runtime % 15)) == 0 ]]; then
########## DESYNCH SWARM NODE REQUESTS #################
sleep $((1 + RANDOM % 120))
[[ -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
# echo "MAJ Vstream settings"
# fi
# CLEAN AND REMOVE BAD DIRECTORIES
## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE
## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd -
# CLEAN AND REMOVE BAD DIRECTORIES should be in .$IPFSNODEID to avoid Station collision.
## BYPASS index.html DELETION
[[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html
[[ -d ~/.zen/ipfs/astroport ]] && rm -Rf ~/.zen/ipfs/astroport
[[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport
[[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian
[[ -d ~/.zen/ipfs_swarm/xbian ]] && rm -Rf ~/.zen/ipfs_swarm/xbian
[[ -d ~/.zen/ipfs/PIN ]] && rm -Rf ~/.zen/ipfs/PIN
[[ -d ~/.zen/ipfs_swarm/PIN ]] && rm -Rf ~/.zen/ipfs_swarm/PIN
## CLEANING OLD BAD FILES
rm ~/.zen/ipfs/*
## CLEANING PARASITE BAD FILES
rm -Rf ~/.zen/ipfs/*
rm ~/.zen/ipfs/.*
rm ~/.zen/ipfs_swarm/*
rm -Rf ~/.zen/ipfs_swarm/*
rm ~/.zen/ipfs_swarm/.*
## RESTORE index.html from /tmp/ipfsindex.html
[[ -f /tmp/ipfsindex.html ]] && mv /tmp/ipfsindex.html ~/.zen/ipfs/index.html
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
if [[ ! $isIPFSRunning ]]; then
[[ -f /etc/sudoers.d/systemctl && -f ~/.zen/ipfs/.$IPFSNODEID/.switch ]] && sudo systemctl restart ipfs
echo "ERROR! ipfs daemon is not running. EXIT"
exit 1
fi
## (RE)ACTIVATE ipfs p2p tunnels
# NextCloud FROM taurus TO oasis (https://taurus.copylaradio.com)
$MY_PATH/zen/ipfs_P2P_forward.sh
########## CHATON : OPEN OR CLOSE SSH ACCESS #################
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" != "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # CLOSE-SSH
fi
# __ __ _____ ____
# __ __ _____ ____
# __/ // /_/ ___/ ______ __________ ___ / __ \
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync
#
#
##################################################################
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
# SYNC GCHANGE EVERY 1 hour runtime
[[ $(($runtime % 60)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
## 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
fi
# If NEW ~/.ipfs/config.new => restarting IPFS daemon (not too often as 6h)
if [[ -f ~/.ipfs/config.new && $(diff ~/.ipfs/config.new ~/.ipfs/config) && $runtime -gt 360 ]]; then
echo "onheure=$heure; onminute=$minute; ontimebar=$timebar" > /tmp/A_Station_ON
cp ~/.ipfs/config.new ~/.ipfs/config
[[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && exit 0
[[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0
fi
# QUICK SYNC SWARM EVERY 20 minutes +/- 1 minute
# [[ $(($runtime % 20)) == 0 ]] && $MY_PATH/zen/ipfs_SWARM_refresh.sh "quick" &
## RESHAPE IPFS FRIENDS SWARM
if [[ $(($runtime % 370)) == 0 || "$runtime" == "10" ]]; then
kill -9 $(ps auxf --sort=+utime | grep -w gchange_IPFS_swarm.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING gchange_IPFS_swarm.sh"
$MY_PATH/zen/gchange_IPFS_swarm.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.gchange_IPFS_swarm.txt
fi
# SYNC IPFS FRIENDS SWARM
if [[ $(($runtime % 26)) == 0 ]]; then
kill -9 $(ps auxf --sort=+utime | grep -w ipfs_SWARM_refresh.sh | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}') && echo "KILLING ipfs_SWARM_refresh.sh"
killall chromium
$MY_PATH/zen/ipfs_SWARM_refresh.sh 2>&1 > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipfs_SWARM_refresh.txt
fi
# ACTIVATE ~/astroport directory monitoring
##################################################################
#
# _________ ______
# ____ ___ ____ /_ __/ | / ____/
# /_ / / _ \/ __ \ / / / /| |/ / __
# / /_/ __/ / / / / / / ___ / /_/ /
# /___/\___/_/ /_/ /_/ /_/ |_\____/
#
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
### IMPORTANT !!!!!!! IMPORTANT !!!!!! Maintains MEDIAKEY alive
################################################
if [[ $(($runtime % 7)) == 0 ]]; then
#### Refresh & publish MEDIAKEYs
$MY_PATH/zen/ipns_TAG_refresh.sh > /home/${YOU}/.zen/ipfs/.${IPFSNODEID}/.log.ipns_TAG_refresh.txt
## REINIT dead swarm STATIONS
rm -f ~/.zen/A_dead_swarm.txt
fi
## TODO ACTIVATE/DESACTIVATE LOG
########################################################################
# ACTIVATE ~/astroport directory monitoring (xbian only)
########################################################################
###
# _ _
# __ _| |__ (_) __ _ _ __
# \ \/ / '_ \| |/ _` | '_ \
# _ _
# __ _| |__ (_) __ _ _ __
# \ \/ / '_ \| |/ _` | '_ \
# > <| |_) | | (_| | | | |
# /_/\_\_.__/|_|\__,_|_| |_| inotifywait
#
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
#
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
# Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS
## TEST AUTOMATIC NEW FILE IMPORT. xbian only.
if [[ "$USER" == "xbian" ]]; then
[[ ! -e /home/$USER/astroport ]] && mkdir -p /home/$USER/astroport
[[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport
# VERIFY LAUNCH inotifywait ?!
inotifywaitRunning=$(ps auxf --sort=+utime | grep -w inotifywait | grep -w astroport | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
if [[ "$inotifywaitRunning" != "xbian" ]]
@ -180,64 +278,46 @@ fi
##########################################################
##################################################################
#
# _________ ______
# ____ ___ ____ /_ __/ | / ____/
# /_ / / _ \/ __ \ / / / /| |/ / __
# / /_/ __/ / / / / / / ___ / /_/ /
# /___/\___/_/ /_/ /_/ /_/ |_\____/
#
# REFRESHing MEDIAKEY ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || $(($runtime % 720)) == 0 ]]; then
# Restarting IPFS daemon
[[ -f /etc/sudoers.d/systemctl || "$USER" == "xbian" ]] && sudo systemctl restart ipfs
#### timebar DESYNC
sleep $((12 + RANDOM % 5))
#### Refresh & publish MEDIAKEYs
$MY_PATH/zen/ipns_TAG_refresh.sh
## REINIT dead swarm
rm -f ~/.zen/A_dead_swarm.txt
fi
##################################################################
##################################################################
# MIDNIGHT:01 : CLEANING & UPDATE
# 5 mn / 24h REBOOT & MIDNIGHT:01 : CLEANING & UPDATE
##################################################################
##################################################################
if [[ "$timebar" == "00:01" || "$runtime" == "5" || $(($runtime % 1380)) == 0 ]]; then
if [[ "$timebar" == "00:01" || "$runtime" == "30" || $(($runtime % 1380)) == 0 ]]; then
echo '
# ____ ____ ____ ___
# / __ \/ __ \ _ / __ < /
# / / / / / / / (_) / / / / /
# / /_/ / /_/ / _ / /_/ / /
# \____/\____/ (_) \____/_/
#
# / / / / / / / (_) / / / / /
# / /_/ / /_/ / _ / /_/ / /
# \____/\____/ (_) \____/_/
#
# MAINTENANCE
'
sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated...
sleep $((1 + RANDOM % 12)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !!
### PEACE & LOVE software is processing... We are HyperWeb people here.
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.
# 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 &
## LET IT A WHILE FOR ALL SWARM EXECUTE ACTION... AND REMOVE.
##################################################################
if [[ $dayoftheweek == 1 ]]; then
# EVERY MONDAY
# _____ __ __ ___
# _____ __ __ ___
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
# /____/
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
# /____/
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
availableDiskSize="$(($availableDiskSize * 1024))"
@ -245,37 +325,52 @@ echo '
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
echo "StorageMax = $diskSize"
# New full test review in gchange_INIT.sh
rm -f ~/.ipfs/test.disk
# LOG ROTATE
[[ -f /tmp/astroport.log ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
# LOG ROTATE WEEKLY
[[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
fi
##################################################################
## CHECK STARTGATE LEVEL KEYS
# _ open _
# ___| |_ __ _ _ __ __ _ __ _| |_ ___
# _ open _
# ___| |_ __ _ _ __ __ _ __ _| |_ ___
#/ __| __/ _` | '__/ _` |/ _` | __/ _ \
#\__ \ || (_| | | | (_| | (_| | || __/
#|___/\__\__,_|_| \__, |\__,_|\__\___|
# |___/
# |___/
# IPNS KEYS used to publish with star friends (creates 5 levels of streaming / file sharing)
# RESET
# RESET
ipfs key rm star_1; ipfs key rm star_2; ipfs key rm star_3; ipfs key rm star_4; ipfs key rm star_5
rm -Rf ~/.zen/key/
# RENEW & SEND STARS TO FRIENDS ~/.zen/astrXbian/zen/manage_stargates.sh
$MY_PATH/zen/manage_stargates.sh
########################################################################
# ACTIVATE TO CONTROL SWARM STATION SAME CODE VERSION
########################################################################
## myCODE is a SECURITY about code SIMILARITY
## EACH NODE CAN CHECK IF ANOTHER HAS SAME IPFS CODE HASH
MyCODE=$(ipfs add -rq --ignore="__pycache__" ~/.zen/astrXbian/ | tail -n 1)
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/.mycode ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode
[[ "$(cat ~/.zen/ipfs/.${IPFSNODEID}/.mycode)" != "$MyCODE" ]] && echo $MyCODE > ~/.zen/ipfs/.${IPFSNODEID}/.mycode
echo "MyCODE = $MyCODE CODE is ready to be published"
########################################################################
# MEAN CONTROL SWARM STATION HAVE SAME CODE VERSION
########################################################################
fi
### DISAPEAR ONE HOUR FROM IPFS SWARM ZOMBIES > 300 peers in swarm
#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then
#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then
#if [[ "$timebar" == "04:05" ]]; then
# ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR
## SWITCHING ON
# echo "1" > ~/.zen/ipfs/.$IPFSNODEID/.switch
#fi
#fi
## BETTER ACTIVATING DEFCON 3 / swarm.key MODE

View File

@ -2,7 +2,7 @@
* https://git.p2p.legal/axiom-team/astrXbian
* https://oasis.astroport.com
* https://colibris-wiki.org/astroport
* https://colibris-wiki.org/astroport
# Liens annexes
@ -23,7 +23,7 @@
# jaklis : commandes de messaging / like
```
## GET ALERT MESSAGES
## GET ALERT MESSAGES
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" read -n300 -j | jq -r --arg friendKEY "$G1PUB" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ALERT")' | jq -r '.id'
## SEND MONITORING MESSAGE TO onelove
@ -32,3 +32,15 @@
## LINKING ME PEOPLE
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer'
```
# EXEMPLES DE COMMANDES BALISES
```
## CHECK SWARM STATIONS TIMESTAMPS
for g1id in $(ls ~/.zen/ipfs/.$IPFSNODEID/FRIENDS); do echo $g1id; [[ "$g1id" == "index.html" ]] && continue; ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1id); ts=$(ipfs --timeout=10s cat /ipns/$ipfsnodeid/.$ipfsnodeid/.timestamp); echo $(date -ud @$ts); done
for ts in $(cat ~/.zen/ipfs_swarm/.*/.timestamp); do echo $(date -ud @$ts); done
```

View File

@ -4,49 +4,113 @@
# 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 #
if [[ ! -f ~/.zen/secret.june ]];
########################################################################
[[ ! $(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 ]];
then
# Check requirements
echo "AstrXbian installateur pour XBIAN (https://xbian.org) et ditributions DEBIAN et dérivées (https://www.linuxmint.com/)"
echo "AstrXbian installateur pour distributions DEBIAN et dérivées : LinuxMint (https://www.linuxmint.com/) ou XBIAN (https://xbian.org) recommandées"
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
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
[[ "$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
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
[[ "$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
## Correct PDF restrictions for imagemagick
echo "# Correction des droits export PDF imagemagick"
if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then
cat /etc/ImageMagick-6/policy.xml | grep -Ev PDF > /tmp/policy.xml
sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml
fi
echo "###########################"
echo "## INSTALL PYTHON CRYPTO LAYER "
echo "###########################"
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && source ~/.bashrc; echo ">>> PATH=$PATH"
python3 -m pip install -U pip
python3 -m pip install -U setuptools wheel
python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy
python3 -m pip install -U cryptography Ed25519 base58 google protobuf duniterpy pynacl pgpy
python3 -m pip install -U nicotine-plus silkaj
if [[ "$USER" == "pi" ]]; then ## PROPOSE QR_CODE PRINTER SUR RPI
echo "Ambassade? Souhaitez vous ajouter imprimante 'brother_ql'? Saisissez OUI, sinon laissez vide et tapez sur ENTRER"
read saisie
if [[ $saisie != "" ]]; then
sudo apt install printer-driver-all cups -y
sudo pip3 install brother_ql
sudo cupsctl --remote-admin
sudo usermod -aG lpadmin pi
sudo usermod -a -G gammu pi
fi
fi
# python3 -m pip install -U silkaj
## python -> python3 link
sudo ln -f -s /usr/bin/python3 /usr/bin/python
########################################################################
echo "Clonage git 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 ~/
########################################################################
echo "Installation de IPFS https://ipfs.io"
## Scripts pour systemd ou InitV (xbian)
echo "=== Activation SYSTEM IPFS"
~/.zen/astrXbian/.install/ipfs_alone.sh
########################################################################
echo "Configuration jaklis: Centre de communication GCHANGE+"
echo "=== IMPORT configuration ASTROPORT dans ~/.kodi"
cp -Rf ~/.zen/astrXbian/.install/.kodi ~/
########################################################################
echo "=== Configuration jaklis: Centre de communication CESIUM+ GCHANGE+"
cd ~/.zen/astrXbian/zen/jaklis
./setup.sh
########################################################################
echo "Sécurisation DEFCON SUDOERS FAIL2BAN"
## XBIAN fail2ban ERROR correction ##
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
# NODE activates fail2ban IN zen/ipfs_SWARM_refresh.sh
@ -68,7 +132,7 @@ then
cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs
cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs
cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs
# Disable xbian-config auto launch
echo 0 > ~/.xbian-config-start
@ -79,17 +143,30 @@ fi
mkdir -p ~/astroport/film
mkdir -p ~/astroport/serie
mkdir -p ~/astroport/anime
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/astroport/ajouter_video.modele.txt
#######################################################################
echo "## INSTALL open_with_linux.py ##
## https://darktrojan.github.io/openwith/webextension.html"
~/.zen/astrXbian/open_with_linux.py install
echo ">>> INFO : Ajoutez l'extension 'OpenWith' à votre navigateur !!
# https://addons.mozilla.org/firefox/addon/open-with/
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno"
if [[ "$USER" != "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"
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.
## 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
@ -104,11 +181,11 @@ fi
# MAIN # -f ~/.zen/secret.june (ISOConfig déjà lancé) ##
else
echo "Installation déjà faite !!
echo "Installation existante !!
========================
Astroport/KODI (Gchange)
========================
Connectez-vous sur https://gchange.fr avec vos identifiants
Connectez-vous sur https://gchange.fr avec vos identifiants
$(cat ~/.zen/secret.june)

View File

@ -1,14 +1,19 @@
#!/bin/bash
echo "Installation Astroport/RompR et activation du mode JUKEBOX mp3"
if [[ "$jukebox" == "oui" ]] then
sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
if [[ "$jukebox" == "oui" ]] then
sudo apt-get install mariadb-server nginx libnginx-mod-rtmp lsof python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
fi
# Add user to be able to modify nginx directories
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
# OpenWith #
# https://chrome.google.com/webstore/detail/open-with/cogjlncmljjnjpbgppagklanlcbchlno
# https://addons.mozilla.org/firefox/downloads/file/3831723/open_with-7.2.6-fx.xpi

257
ipfs4astroport.sh Executable file
View File

@ -0,0 +1,257 @@
#!/bin/bash
########################################################################
{ # this ensures the entire script is downloaded #
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# CHECK not root user !!
if [ "$EUID" -eq 0 ]
then echo -e "DO NOT EXECUTE AS root. Choose a user for your Astroport Station (we like pi)"
exit 1
else echo -e "OK $USER, let's go!";
fi
echo "Hello,
This script (you could read and modify as it is open source software) is about to transform your computer into an astroport station.
This process involve different upgrades to be made on your system.
1. install IPFS, the interplanetary file system (https://ipfs.io)
2. install python cryptographic libraries to run natools, your key wizard companion
3. download 'astroport' code release you have choosen.
~/.zen directory and datastructure will emerge
~/.zen/ipfs & ~/.zen/ipfs_swarm contains all meshed media index from you and your friends.
ASTROPORT is activated by cron every minute it maintains the connection with your friends.
It is the vessel that gives you avvess to your p2p AVATAR.
You carry and share your data around your friends through a confidence network
established through 1 to 5 'hearts' exchanged, opening 5 stargates where any can push/pull data.
TODO
Just indicate which is the directory assigned to each star.
Then any of your friends from such star level can replicate (modify) those data with you.
Your station is publishing its index every time it changes and every 6 hours for all MEDIAKEY from PIN station.
Following that principle add new directory into ~/.zen/ipfs and index any dataset, it will be published on your IPFS semaphore.
Now you need to enter your password to obtain sudo access.
Please.
"
# Ask user password on start
sudo true
## Error funciton
err() {
echo -e "ERREUR: $1"
exit 1
}
# CHECK if daemon is already running
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
echo "ipfs bootstrap list: " && ipfs bootstrap list
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
echo "Please RUN : sudo service ipfs stop"
exit 1
fi
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script EXIT" && exit 1
echo -e "Check and install python curl, git and tools."
[[ $(which pip3) ]] && python3 -m pip install -U pip && python3 -m pip install -U wheel cryptography Ed25519 base58 google protobuf duniterpy==0.62.0 termcolor python-dotenv gql==3.0.0a5 requests pybase64 || (echo "python3 pip3 is missing on your device. EXIT" && exit 1)
[[ ! $(which curl) ]] && sudo apt-get install curl -y
[[ ! $(which git) ]] && sudo apt-get install git -y
[[ ! -d ~/.zen ]] && mkdir ~/.zen
# CHECK node IP isLAN?
myIP=$(hostname -I | awk '{print $1}')
echo "Your IP is $myIP"
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ $isLAN ]] && echo "You are located in a LAN" || echo "You have a public IP address"
MACHINE_TYPE=`uname -m`
echo "You are running $MACHINE_TYPE CPU"
echo "Downloading ipfs binaries"
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
elif [ ${MACHINE_TYPE} == 'aarch64' ]; then
curl -s https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-arm64.tar.gz -o /tmp/ipfs_aarch64_v0.9.1.tar.gz
else
echo "Your $MACHINE_TYPE is not supported yet... Please add an issue." && exit 1
fi
if [ -f $MY_PATH/ipfs-update.tar.gz ]; then
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err "Install ipfs-update"
cd $MY_PATH
echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo ipfs-update install 0.9.1 || err "Install IPFS"
else
## TERRAPI4 aarch64 install ipfs_aarch64_v0.9.1
echo "INSTALL ipfs 0.9.1 >>>>>>>>>>>>>>>>>>>>>>>>>> arm64"
sudo tar -xvzf /tmp/ipfs_aarch64_v0.9.1.tar.gz -C /usr/src/ || err "Untar ipfs_aarch64"
rm /tmp/ipfs_aarch64_v0.9.1.tar.gz
cd /usr/src/go-ipfs/
sudo ./install.sh || err "Install ipfs_aarch64"
cd $MY_PATH
fi
# INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server
## Special Xbian init.d config
## DEBIAN SYSTEMCTL
echo "SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>> ON"
cat > /tmp/ipfs.service <<EOF
[Unit]
Description=IPFS daemon
After=network.target
[Service]
User=_USER_
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
Restart=on-failure
CPUAccounting=true
CPUQuota=60%
[Install]
WantedBy=multi-user.target
EOF
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
echo "Activating ipfs daemon >>>>>>>>>>>>>>>>>> "
# echo "Vous pouvez régler la ressouce CPU maximum (60%)?" && read cpuy
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
sudo systemctl daemon-reload
sudo systemctl enable ipfs
###########################################
echo "# ACTIVATE IPFS OPTIONS: #swarm0 INIT"
###########################################
### IMPORTANT !!!!!!! IMPORTANT !!!!!!
###########################################
# DHT PUBSUB mode
ipfs config Pubsub.Router gossipsub
# MAXSTORAGE = 1/2 available
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
## Activate Rapid "ipfs p2p"
ipfs config --json Experimental.Libp2pStreamMounting true
ipfs config --json Experimental.P2pHttpProxy true
ipfs config --json Swarm.ConnMgr.LowWater 50
ipfs config --json Swarm.ConnMgr.HighWater 100
## Install gateway on 8181 port
ipfs config Addresses.Gateway "/ip4/127.0.0.1/tcp/8181"
########################################################################
# GET IPFS KEYS & CONVERSIONS
########################################################################
IPFSNODEID=$(ipfs config Identity.PeerID)
## TODO convert to secret.dunikey
########################################################################
echo "CREATION IDENTITE BALISE IPFS ~/.zen/ipfs/.${IPFSNODEID} /G1SSB"
########################################################################
rm -Rf ~/.zen/ipfs
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
########################################################################
# Give $XZUID to your (gchange friends)
########################################################################
XZUID="$(hostname)-$RANDOM$RANDOM"
echo "SETTING .player PROFILE NAME = $XZUID"
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/.player
echo 'balise /ipns/$IPFSNODEID/.$IPFSNODEID/.player'
########################################################################
########################################################################
echo "Getting tryme.addr & .mycode from OASIS
-- Change oasis address to fork your Astroport Code Universe --"
########################################################################
ipfs bootstrap rm --all
OASIS=12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
# aries=12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
for bootnode in $(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/tryme.addr)
do
## ADD $bootnode TO BOOTSTRAP
ipfs bootstrap add $bootnode
done
codesign=$(curl -s https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/.mycode)
## ADD NETWORK EXPLORATION FROM LIKES
########################################################################
echo "RESTARTING ipfs"
########################################################################
sudo service ipfs restart
echo ".... WAIT for SWARM to connect ..."
sleep 10
echo ".... ACTUAL SWARM PEERS ..."
ipfs swarm peers
echo "IPFS DONE
====================
Station Astroport INSTALL
Activation ~/.zen/astrXbian/zen/cron_VRFY.sh
Récupération CODE /ipfs/$codesign
"
## GETTING SAME SOURCE CODE AS OASIS
mkdir -p /home/$USER/.zen/astrXbian/
ipfs get --output=/home/$USER/.zen/astrXbian/ /ipfs/$codesign
## Make scripts executable
find /home/$USER/.zen/astrXbian/ -name "*.sh" -exec chmod u+x '{}' \;
find /home/$USER/.zen/astrXbian/ -name "*.py" -exec chmod u+x '{}' \;
########################################################################
echo "# Setting $USER SUDO permissions ON fail2ban mount umount apt-get apt systemctl"
########################################################################
## USED FOR fail2ban-client (DEFCON)
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
## USED FOR RAMDISK (video live streaming)
echo "$USER ALL=(ALL) NOPASSWD:/bin/mount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/mount')
echo "$USER ALL=(ALL) NOPASSWD:/bin/umount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/umount')
## USED FOR SYSTEM UPGRADE
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt-get')
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt')
## USED FOR "systemctl restart ipfs"
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
## TODO G1SSB CONFIG
echo "## INSTALL TiddlyWiki /ipns/${IPFSNODEID}/.${IPFSNODEID}/index.html"
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/index.html ]] && mkdir -p ~/.zen/ipfs/.${IPFSNODEID} && cp ~/.zen/astrXbian/.install/templates/tiddlywiki/index.html ~/.zen/ipfs/.${IPFSNODEID}/index.html
echo "Congratulation ! You are part of the astroport interplanetary fleet.
New. Activate your station offline storage.
Install ipfs companion : https://docs.ipfs.io/install/ipfs-companion/
FR : https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/
"
echo "FIND AND CONNECT WITH YOUR FRIENDS
https://tube.copylaradio.com/ipns/$OASIS/.$OASIS/"
## OPEN https://translate.google.com/translate?sl=auto&tl=fr&u=https://docs.ipfs.io/install/ipfs-companion/
} # this ensures the entire script is downloaded #
# IPFS CONFIG documentation: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm

1
minetest/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
minetest.conf

BIN
minetest/map.sqlite Normal file

Binary file not shown.

View File

@ -0,0 +1,107 @@
enable_damage = false
enable_pvp = false
creative_mode = true
enable_build_where_you_stand = true
# Controls length of day/night cycle.
# Examples:
# 72 = 20min, 360 = 4min, 1 = 24hour, 0 = day/night/whatever stays unchanged.
# type: int
time_speed = 1
# Name of map generator to be used when creating a new world.
# Creating a world in the main menu will override this.
# Current mapgens in a highly unstable state:
# - The optional floatlands of v7 (disabled by default).
# type: enum values: v7, valleys, carpathian, v5, flat, fractal, singlenode, v6
# mg_name = v7
mg_name = singlenode
# singlenode = que de l'air ; le mod "startanode" permet d'ajouter un cube au spawn
# Player is able to fly without being affected by gravity.
# This requires the "fly" privilege on the server.
# type: bool
free_move = true
# Fast movement (via the "special" key).
# This requires the "fast" privilege on the server.
# type: bool
fast_move = false
# The privileges that new users automatically get.
# See /privs in game for a full list on your server and mod configuration.
# type: string
default_privs = interact, shout, fly, fast
# Privileges that players with basic_privs can grant
# type: string
basic_privs = interact, shout, fly, fast
# Where the map generator stops.
# Please note:
# - Limited to 31000 (setting above has no effect)
# - The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks).
# - Those groups have an offset of -32, -32 nodes from the origin.
# - Only groups which are within the map_generation_limit are generated
# type: int min: 0 max: 31000
#mapgen_limit = 216
mapgen_limit = 31000
# If this is set, players will always (re)spawn at the given position.
# type: string
static_spawnpoint = (0, 0, 0)
# magpen flags
mg_flags = trees,decorations
# mapgen v6
mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes,noflat,trees
mgv6_freq_desert = 0.05
mgv6_freq_beach = 0.95
# Humidity variation for biomes.
# type: noise_params_2d
mgv6_np_humidity = {
offset = 0.5,
scale = 0.5,
spread = (2, 3, 2),
seed = 72384,
octaves = 3,
persistence = 0.50,
lacunarity = 2.0,
flags = eased
}
# Defines tree areas and tree density.
# type: noise_params_2d
mgv6_np_trees = {
offset = 0,
scale = 1,
spread = (2, 3, 2),
seed = 2,
octaves = 4,
persistence = 0.66,
lacunarity = 2.0,
flags = eased
}
# Defines areas with sandy beaches.
# type: noise_params_2d
mgv6_np_beach = {
offset = 0,
scale = 1,
spread = (50, 50, 50),
seed = 59420,
octaves = 3,
persistence = 0.50,
lacunarity = 2.0,
flags = eased
}
secure.trusted_mods = wiki

259
minetest/recreate_world.sh Executable file
View File

@ -0,0 +1,259 @@
#!/bin/sh
MINETEST_PATH=/home/pi/.minetest
WORLD_NAME=astroport
WORLD_PATH=$MINETEST_PATH/worlds/$WORLD_NAME
rm -rf $WORLD_PATH
mkdir $WORLD_PATH
cp map.sqlite $WORLD_PATH/
echo "
gameid = minetest
auth_backend = sqlite3
player_backend = sqlite3
backend = sqlite3
" > $WORLD_PATH/world.mt
cd ~/.zen/astrXbian/minetest
cat ./minetest-common.conf > /home/pi/.minetest/worlds/astroport/minetest.conf
echo "
server_name = Astroport "$XZUID"
# Message of the day displayed to players connecting.
# type: string
motd = Bienvenue sur l'Astroport \""$XZUID"\". Un petit cube auto-hébergé par son heureux propriétaire.
server_description = Astroport
# Domain name of server, to be displayed in the serverlist.
# type: string
#server_address = astroport.com
# Homepage of server, to be displayed in the serverlist.
# type: string
#server_url = https://astroport.com
# Automatically report to the serverlist.
# type: bool
server_announce = false
# Network port to listen (UDP).
# This value will be overridden when starting from the main menu.
# type: int
port = 30001
# The network interface that the server listens on.
# type: string
# bind_address =
" >> /home/pi/.minetest/worlds/astroport/minetest.conf
#########################################################################################
#
# SystemD
#
#########################################################################################
MINETEST_LOG_FILE=/var/log/minetest/minetest-astroport.log
sudo touch $MINETEST_LOG_FILE
sudo chown pi:games $MINETEST_LOG_FILE
chmod 664 $MINETEST_LOG_FILE
echo "
[Unit]
Description=Minetest multiplayer server minetest.conf server config
Documentation=man:minetestserver(6)
After=network.target
RequiresMountsFor=/var/games/minetest-server
[Service]
Restart=on-failure
User=pi
Group=games
ExecStart=/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf --logfile /var/log/minetest/minetest-astroport.log
StandardOutput=null
[Install]
WantedBy=multi-user.target
" >> $WORLD_PATH/systemd.service
sudo systemctl enable $WORLD_PATH/systemd.service
sudo systemctl start astroport-minetest.service
#########################################################################################
#
# MODS
#
#########################################################################################
mkdir $WORLD_PATH/worldmods
if [ ! -d $MINETEST_PATH/mods ]; then
mkdir $MINETEST_PATH/mods
fi
# ## mg - Experimental Mapgen for Minetest
#
# if [ ! -d $MINETEST_PATH/mods/mg-master ]; then
#
# if [ ! -f $MINETEST_PATH/mods/mg.zip ]; then
# wget https://github.com/minetest-mods/mg/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mg.zip
# fi
#
# unzip $MINETEST_PATH/mods/mg.zip -d $MINETEST_PATH/mods
# fi
#
# cp -r $MINETEST_PATH/mods/mg-master $WORLD_PATH/worldmods
## startanode
#
# if [ ! -d $MINETEST_PATH/mods/startanode-master ]; then
#
# if [ ! -f $MINETEST_PATH/mods/startanode.zip ]; then
# wget https://github.com/minetest-mods/startanode/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/startanode.zip
# fi
#
# unzip $MINETEST_PATH/mods/startanode.zip -d $MINETEST_PATH/mods
# fi
#
# cp -r $MINETEST_PATH/mods/startanode-master $WORLD_PATH/worldmods
## Spawnbuilder
#
# spawnBuilderLocation=`find $MINETEST_PATH/mods -type d -name spawnbuilder`
# if [ -z $spawnBuilderLocation ]; then
#
# if [ ! -f $MINETEST_PATH/mods/spawnbuilder.zip ]; then
# wget https://repo.or.cz/minetest_spawnbuilder.git/snapshot/1.1.0.zip -O $MINETEST_PATH/mods/spawnbuilder.zip
# fi
#
# unzip $MINETEST_PATH/mods/spawnbuilder.zip -d $MINETEST_PATH/mods/spawnbuilder/
# fi
#
# mkdir $WORLD_PATH/worldmods/spawnbuilder
# cp -r $MINETEST_PATH/mods/spawnbuilder/minetest_spawnbuilder-*/* $WORLD_PATH/worldmods/spawnbuilder
#
# echo "
# #Side length of the surface area of the spawn platform
# #If the number is odd, the platform will be centered at spawn.
# #Using a width lower than 3 is not recommended.
# spawnbuilder_width (Spawn platform width) int 5 1
# " > $WORLD_PATH/worldmods/spawnbuilder/mod.conf
## Unified inventory mod
if [ ! -d $MINETEST_PATH/mods/unified_inventory-master ]; then
if [ ! -f $MINETEST_PATH/mods/unified_inventory.zip ]; then
wget https://github.com/minetest-mods/unified_inventory/archive/master.zip -O $MINETEST_PATH/mods/unified_inventory.zip
fi
unzip $MINETEST_PATH/mods/unified_inventory.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/unified_inventory-master $WORLD_PATH/worldmods
## Spawn mod
if [ ! -d $MINETEST_PATH/mods/spawn_command-master ]; then
if [ ! -f $MINETEST_PATH/mods/spawn_command.zip ]; then
wget https://github.com/minetest-mods/spawn_command/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/spawn_command.zip
fi
unzip $MINETEST_PATH/mods/spawn_command.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/spawn_command-master $WORLD_PATH/worldmods
## Jukebok mod
if [ ! -d $MINETEST_PATH/mods/jukebox-master ]; then
if [ ! -f $MINETEST_PATH/mods/jukebox.zip ]; then
wget https://github.com/minetest-mods/jukebox/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/jukebox.zip
fi
unzip $MINETEST_PATH/mods/jukebox.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/jukebox-master $WORLD_PATH/worldmods
## xdecor mod
if [ ! -d $MINETEST_PATH/mods/xdecor-master ]; then
if [ ! -f $MINETEST_PATH/mods/xdecor.zip ]; then
wget https://github.com/minetest-mods/xdecor/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/xdecor.zip
fi
unzip $MINETEST_PATH/mods/xdecor.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/xdecor-master $WORLD_PATH/worldmods
## Display modpack
if [ ! -d $MINETEST_PATH/mods/display_modpack-master ]; then
if [ ! -f $MINETEST_PATH/mods/display_modpack.zip ]; then
wget https://github.com/pyrollo/display_modpack/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/display_modpack.zip
fi
unzip $MINETEST_PATH/mods/display_modpack.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/display_modpack-master $WORLD_PATH/worldmods
## Letters
if [ ! -d $MINETEST_PATH/mods/letters-master ]; then
if [ ! -f $MINETEST_PATH/mods/letters.zip ]; then
wget https://github.com/minetest-mods/letters/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/letters.zip
fi
unzip $MINETEST_PATH/mods/letters.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/letters-master $WORLD_PATH/worldmods
## mydoors
if [ ! -d $MINETEST_PATH/mods/mydoors-master ]; then
if [ ! -f $MINETEST_PATH/mods/mydoors.zip ]; then
wget https://github.com/minetest-mods/mydoors/archive/refs/heads/master.zip -O $MINETEST_PATH/mods/mydoors.zip
fi
unzip $MINETEST_PATH/mods/mydoors.zip -d $MINETEST_PATH/mods
fi
cp -r $MINETEST_PATH/mods/mydoors-master $WORLD_PATH/worldmods

3
minetest/start_server.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf

39
nginx.conf Normal file
View File

@ -0,0 +1,39 @@
server {
root /home/pi/.zen/astrXbian/www/boris;
listen 80 default_server;
server_name _;
# This section can be copied into an existing default setup
location / {
allow all;
index index.php index.html index.htm;
location ~ \.php {
try_files $uri index.php =404;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 1800;
}
error_page 404 = /error/404.html;
try_files $uri $uri/ =404;
location ~ /albumart/* {
expires -1s;
}
}
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipns {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}

184
open_with_linux.py Executable file
View File

@ -0,0 +1,184 @@
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import json
import struct
import subprocess
VERSION = '7.1b2'
try:
sys.stdin.buffer
# Python 3.x version
# Read a message from stdin and decode it.
def getMessage():
rawLength = sys.stdin.buffer.read(4)
if len(rawLength) == 0:
sys.exit(0)
messageLength = struct.unpack('@I', rawLength)[0]
message = sys.stdin.buffer.read(messageLength).decode('utf-8')
return json.loads(message)
# Send an encoded message to stdout
def sendMessage(messageContent):
encodedContent = json.dumps(messageContent).encode('utf-8')
encodedLength = struct.pack('@I', len(encodedContent))
sys.stdout.buffer.write(encodedLength)
sys.stdout.buffer.write(encodedContent)
sys.stdout.buffer.flush()
except AttributeError:
# Python 2.x version (if sys.stdin.buffer is not defined)
# Read a message from stdin and decode it.
def getMessage():
rawLength = sys.stdin.read(4)
if len(rawLength) == 0:
sys.exit(0)
messageLength = struct.unpack('@I', rawLength)[0]
message = sys.stdin.read(messageLength)
return json.loads(message)
# Send an encoded message to stdout
def sendMessage(messageContent):
encodedContent = json.dumps(messageContent)
encodedLength = struct.pack('@I', len(encodedContent))
sys.stdout.write(encodedLength)
sys.stdout.write(encodedContent)
sys.stdout.flush()
def install():
home_path = os.getenv('HOME')
manifest = {
'name': 'open_with',
'description': 'Open With native host',
'path': os.path.realpath(__file__),
'type': 'stdio',
}
locations = {
'chrome': os.path.join(home_path, '.config', 'google-chrome', 'NativeMessagingHosts'),
'chromium': os.path.join(home_path, '.config', 'chromium', 'NativeMessagingHosts'),
'firefox': os.path.join(home_path, '.mozilla', 'native-messaging-hosts'),
}
filename = 'open_with.json'
for browser, location in locations.items():
if os.path.exists(os.path.dirname(location)):
if not os.path.exists(location):
os.mkdir(location)
browser_manifest = manifest.copy()
if browser == 'firefox':
browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net']
else:
browser_manifest['allowed_origins'] = [
'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', # Chrome
'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', # Opera
]
with open(os.path.join(location, filename), 'w') as file:
file.write(
json.dumps(browser_manifest, indent=2, separators=(',', ': '), sort_keys=True).replace(' ', '\t') + '\n'
)
def _read_desktop_file(path):
with open(path, 'r') as desktop_file:
current_section = None
name = None
command = None
for line in desktop_file:
if line[0] == '[':
current_section = line[1:-2]
if current_section != 'Desktop Entry':
continue
if line.startswith('Name='):
name = line[5:].strip()
elif line.startswith('Exec='):
command = line[5:].strip()
return {
'name': name,
'command': command
}
def find_browsers():
apps = [
'Chrome',
'Chromium',
'chromium-browser',
'firefox',
'Firefox',
'Google Chrome',
'google-chrome',
'opera',
'Opera',
'SeaMonkey',
'seamonkey',
]
paths = [
os.path.join(os.getenv('HOME'), '.local/share/applications'),
'/usr/local/share/applications',
'/usr/share/applications'
]
suffix = '.desktop'
results = []
for p in paths:
for a in apps:
fp = os.path.join(p, a) + suffix
if os.path.exists(fp):
results.append(_read_desktop_file(fp))
return results
def listen():
receivedMessage = getMessage()
if receivedMessage == 'ping':
sendMessage({
'version': VERSION,
'file': os.path.realpath(__file__)
})
elif receivedMessage == 'find':
sendMessage(find_browsers())
else:
for k, v in os.environ.items():
if k.startswith('MOZ_'):
try:
os.unsetenv(k)
except:
os.environ[k] = ''
devnull = open(os.devnull, 'w')
subprocess.Popen(receivedMessage, stdout=devnull, stderr=devnull)
sendMessage(None)
if __name__ == '__main__':
if len(sys.argv) == 2:
if sys.argv[1] == 'install':
install()
sys.exit(0)
elif sys.argv[1] == 'find_browsers':
print(find_browsers())
sys.exit(0)
allowed_extensions = [
'openwith@darktrojan.net',
'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/',
'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/',
]
for ae in allowed_extensions:
if ae in sys.argv:
listen()
sys.exit(0)
print('Open With native helper, version %s.' % VERSION)

16
search Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
clear
echo "------------------------------------------------------------------------------"
if [ "$1" == "" ]; then
echo " Nothing to search for!"
else
echo " Searching for "$1" recursively. Please Wait..."
echo "------------------------------------------------------------------------------"
grep -h -r --exclude=B00 -H --colour=always "$1" ./
fi
echo "------------------------------------------------------------------------------"
if [ "$2" != "" ]; then
echo " To replace \"$1\" whith \"$2\", please run"
echo " grep -rl '$1' ./ | xargs sed -i 's/$1/$2/g'"
fi
## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS

35
www/boris/ajax.php Normal file
View File

@ -0,0 +1,35 @@
<?php
$headers = "From: support@qo-op.com"; // Who should it come from?
$to = "support@qo-op.com"; // Your email address
$subject = "Astroport qo-op BLOB";
$arguments = getopt("l:p:"); // php ajax.php -l "https://myserve.com/link.html"
if (isset($_REQUEST['link'])) $link = $_REQUEST['link']; else $link = urldecode($arguments['l']);
if (isset($_REQUEST['phone'])) $phone = $_REQUEST['phone']; else $phone = urldecode($arguments['p']);
$message = "Proposition de ". $phone ." message : ".$link;
$TIMESTAMP=system("date -u +%s%N | cut -b1-13", $retval);
print_r($TIMESTAMP);
$YOU=system("ps u -C ipfs | tail -n 1 | cut -f 1 -d ' '", $retval);
print_r($YOU);
//$IPFSNODEID=curl_exec("http://127.0.0.1:5001/ipns/");
//print_r($IPFSNODEID);
// WRITE MESSAGE LOCALY
$myfile = fopen("/home/".$YOU."/astroport/www/".$TIMESTAMP.".newfile.txt", "w") or die("Unable to open file!");
fwrite($myfile, $message);
fclose($myfile);
// WRITE MESSAGE TO IPFS
//$myfile = fopen("/home/".$YOU."/.zen/ipfs/.$IPFSNODEID/astroport/www/newfile.txt", "w") or die("Unable to open file!");
//fwrite($myfile, $message);
//fclose($myfile);
error_log("SEND ". $phone ." message : ".$link );
mail($to, $subject, $message, $headers);
echo "OK";
?>

41
www/boris/ajaxform.js Normal file
View File

@ -0,0 +1,41 @@
jQuery(document).ready(function () {
var host = window.location.hostname;
$('#nodename').html(host);
$("#formphone").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
console.log("button PHONE clicked");
$("#phoneresultat").html("<p><h3>ensuite patiente un peu... ce monde est Zen.<h3>" +
"<h5>Tu recevras une clef pour te libérer des services privés du vieux monde.</h5></p>" +
"<script type='text/javascript'>var _mtm = _mtm || []; _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src='https://piwik.p2p.legal/js/container_XDhfGZPj.js'; s.parentNode.insertBefore(g,s); </script>");
// declare these vars
var phone = jQuery("#phone");
var parrain = jQuery("#parrain");
var naissance = jQuery("#naissance");
var data = '';
// ajax call to ajax.php
jQuery.getJSON("http://"+host+":10099/sms_loveland.php", {
phone: phone.val(), parrain: parrain.val(), naissance: naissance.val()
}, function (data) {
$("#phoneresultat").html("<p>Votre inscription en prise en compte...</p>");
});
});
$("#formlink").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
console.log("button LINK clicked");
$("#linkresultat").html("<p><h3>Merci! nous envoyons votre message à la GUILDE</h3></p>");
// declare these vars
var link = jQuery("#link");
var phone = jQuery("#phone");
var data = '';
// ajax call to ajax.php
jQuery.getJSON("ajax.php", {
link: link.val(), phone: phone.val()
}, function (data) {
$("#linkresultat").html("<p><h3>Astroport vous remercie pour votre nourriture médiatique</h3></p>");
});
});
});

View File

@ -0,0 +1,3 @@
#!/bin/bash
../../ajouter_video.sh $1 1

13
www/boris/check_entrance.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
########################################################################
# Author: Astrocrew
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
G1KEY="$1"
[[ $G1KEY == "" ]] && echo "PUB KEY MISSINF" && exit 1
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
## CHECK IF NODE HAS SEND A PAYMENT TO $G1KEY (TODO CHECK ALL BOOTSTRAPS)
~/.zen/astrXbian/zen/jaklis/jaklis.py history -p $G1KEY | grep $G1KEY

View File

@ -1,20 +1,51 @@
<?php
define('HOST', 'tube.copylaradio.com');
if (!ini_get('display_errors')) {
ini_set('display_errors', '1');
}
define('STATION_NAME', exec('cat ../../../ipfs/.12D*/.player'));
define('HOST', 'astroport');
define('THEME', 'astroport');
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' 2>/dev/null", $output);
if (isset($output)) {
define('IPFS_NODE_ID', $output[0]);
}
define('IPFS_API_PORT', 5001);
define('IPFS_HOST', '127.0.0.1');
define('TAGLINE', 'Bienvenue <strong>chez vous</strong>');
/*
Youtube Thumbnails
maxresdefault Full resolution image matching the uploaded. This image will not always exist.
sddefault 640x480
hqdefault 480x360 Large Preview
mqdefault 320x180 Large Preview
default 120x 90 Large Preview
0 480x360 Large Preview
1 120x 90 First small thumbnail
2 120x 90 Second small thumbnail
3 120x 90 Third small thumbnail
maxresdefault Full resolution image matching the uploaded. This image will not always exist.
sddefault 640x480
hqdefault 480x360 Large Preview
mqdefault 320x180 Large Preview
default 120x 90 Large Preview
0 480x360 Large Preview
1 120x 90 First small thumbnail
2 120x 90 Second small thumbnail
3 120x 90 Third small thumbnail
*/
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/.*/.player"
$stations = [
'virgo',
'onelove',
'Rea-3E',
'foot1060'
];

View File

@ -1,104 +0,0 @@
:root {
--pink: hsl(338.5, 72.8%, 36.1%);
--canard: hsl(200.8, 100%, 9.6%);
}
body {
background: #121212;
color: white;
margin: 0;
padding: 0;
font-family: Roboto,sans-serif;
}
header {
background: var(--canard);
overflow: hidden;
margin-bottom: 2rem;
}
header * {
font-size: 1.5rem;
padding: 0.5rem;
margin: 0;
color: var(--pink);
text-decoration: none;
}
header span {
color: white;
}
main {
width: 80%;
margin: auto;
}
#videosList {
display: grid;
grid-gap: 1rem 1rem;
grid-auto-flow: row;
grid-template-columns: 322px 322px 322px;
list-style: none;
margin: 0;
padding: 0;
}
#videosList li {
background: var(--canard);
border-color: var(--pink);
border-radius: 0.25rem;
border-width: 1px;
border-style: solid;
overflow: hidden;
}
#videosList .video-title {
padding: 0.5rem 1rem;
}
.video-title,
.video-title a,
.video-title a:visited {
color: white;
font-weight: bold;
text-decoration: none;
}
article {
border-radius: 0.25rem;
background: hsl(200.8, 100%, 9.6%);
width: 58.3%;
margin: auto;
overflow: hidden;
}
article video {
width: 100%;
max-height: 50vh;
background: black;
}
article .video-title {
font-weight: bold;
padding: 1rem 1rem;
font-size: 1.25rem;
margin: 0;
}

1
www/boris/crowdbunker.css Symbolic link
View File

@ -0,0 +1 @@
styles/crowdbunker/style.css

424
www/boris/css/flipclock.css Normal file
View File

@ -0,0 +1,424 @@
/* Get the bourbon mixin from http://bourbon.io */
/* Reset */
.flip-clock-wrapper * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
}
.clock{
zoom: 0.7;
-moz-transform: scale(0.7)
}
.flip-clock-wrapper a {
cursor: pointer;
text-decoration: none;
color: #ccc; }
.flip-clock-wrapper a:hover {
color: #fff; }
.flip-clock-wrapper ul {
list-style: none; }
.flip-clock-wrapper.clearfix:before,
.flip-clock-wrapper.clearfix:after {
content: " ";
display: table; }
.flip-clock-wrapper.clearfix:after {
clear: both; }
.flip-clock-wrapper.clearfix {
*zoom: 1; }
/* Main */
.flip-clock-wrapper {
font: normal 11px "Helvetica Neue", Helvetica, sans-serif;
-webkit-user-select: none; }
.flip-clock-meridium {
background: none !important;
box-shadow: 0 0 0 !important;
font-size: 36px !important; }
.flip-clock-meridium a { color: #313333; }
.flip-clock-wrapper {
text-align: center;
position: relative;
width: 100%;
margin: 1em;
}
.flip-clock-wrapper:before,
.flip-clock-wrapper:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.flip-clock-wrapper:after {
clear: both;
}
/* Skeleton */
.flip-clock-wrapper ul {
position: relative;
float: left;
margin: 5px;
width: 60px;
height: 90px;
font-size: 80px;
font-weight: bold;
line-height: 87px;
border-radius: 6px;
background: #000;
}
.flip-clock-wrapper ul li {
z-index: 1;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
line-height: 87px;
text-decoration: none !important;
}
.flip-clock-wrapper ul li:first-child {
z-index: 2; }
.flip-clock-wrapper ul li a {
display: block;
height: 100%;
-webkit-perspective: 200px;
-moz-perspective: 200px;
perspective: 200px;
margin: 0 !important;
overflow: visible !important;
cursor: default !important; }
.flip-clock-wrapper ul li a div {
z-index: 1;
position: absolute;
left: 0;
width: 100%;
height: 50%;
font-size: 80px;
overflow: hidden;
outline: 1px solid transparent; }
.flip-clock-wrapper ul li a div .shadow {
position: absolute;
width: 100%;
height: 100%;
z-index: 2; }
.flip-clock-wrapper ul li a div.up {
-webkit-transform-origin: 50% 100%;
-moz-transform-origin: 50% 100%;
-ms-transform-origin: 50% 100%;
-o-transform-origin: 50% 100%;
transform-origin: 50% 100%;
top: 0; }
.flip-clock-wrapper ul li a div.up:after {
content: "";
position: absolute;
top: 44px;
left: 0;
z-index: 5;
width: 100%;
height: 3px;
background-color: #000;
background-color: rgba(0, 0, 0, 0.4); }
.flip-clock-wrapper ul li a div.down {
-webkit-transform-origin: 50% 0;
-moz-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
-o-transform-origin: 50% 0;
transform-origin: 50% 0;
bottom: 0;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.flip-clock-wrapper ul li a div div.inn {
position: absolute;
left: 0;
z-index: 1;
width: 100%;
height: 200%;
color: #ccc;
text-shadow: 0 1px 2px #000;
text-align: center;
background-color: #333;
border-radius: 6px;
font-size: 70px; }
.flip-clock-wrapper ul li a div.up div.inn {
top: 0; }
.flip-clock-wrapper ul li a div.down div.inn {
bottom: 0; }
/* PLAY */
.flip-clock-wrapper ul.play li.flip-clock-before {
z-index: 3; }
.flip-clock-wrapper .flip { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }
.flip-clock-wrapper ul.play li.flip-clock-active {
-webkit-animation: asd 0.01s 0.49s linear both;
-moz-animation: asd 0.01s 0.49s linear both;
animation: asd 0.01s 0.49s linear both;
z-index: 5; }
.flip-clock-divider {
float: left;
display: inline-block;
position: relative;
width: 20px;
height: 100px; }
.flip-clock-divider:first-child {
width: 0; }
.flip-clock-dot {
display: block;
background: #323434;
width: 10px;
height: 10px;
position: absolute;
border-radius: 50%;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
left: 5px; }
.flip-clock-divider .flip-clock-label {
position: absolute;
top: -1.5em;
right: -86px;
color: black;
text-shadow: none; }
.flip-clock-divider.minutes .flip-clock-label {
right: -88px; }
.flip-clock-divider.seconds .flip-clock-label {
right: -91px; }
.flip-clock-dot.top {
top: 30px; }
.flip-clock-dot.bottom {
bottom: 30px; }
@-webkit-keyframes asd {
0% {
z-index: 2; }
100% {
z-index: 4; } }
@-moz-keyframes asd {
0% {
z-index: 2; }
100% {
z-index: 4; } }
@-o-keyframes asd {
0% {
z-index: 2; }
100% {
z-index: 4; } }
@keyframes asd {
0% {
z-index: 2; }
100% {
z-index: 4; } }
.flip-clock-wrapper ul.play li.flip-clock-active .down {
z-index: 2;
-webkit-animation: turn 0.5s 0.5s linear both;
-moz-animation: turn 0.5s 0.5s linear both;
animation: turn 0.5s 0.5s linear both; }
@-webkit-keyframes turn {
0% {
-webkit-transform: rotateX(90deg); }
100% {
-webkit-transform: rotateX(0deg); } }
@-moz-keyframes turn {
0% {
-moz-transform: rotateX(90deg); }
100% {
-moz-transform: rotateX(0deg); } }
@-o-keyframes turn {
0% {
-o-transform: rotateX(90deg); }
100% {
-o-transform: rotateX(0deg); } }
@keyframes turn {
0% {
transform: rotateX(90deg); }
100% {
transform: rotateX(0deg); } }
.flip-clock-wrapper ul.play li.flip-clock-before .up {
z-index: 2;
-webkit-animation: turn2 0.5s linear both;
-moz-animation: turn2 0.5s linear both;
animation: turn2 0.5s linear both; }
@-webkit-keyframes turn2 {
0% {
-webkit-transform: rotateX(0deg); }
100% {
-webkit-transform: rotateX(-90deg); } }
@-moz-keyframes turn2 {
0% {
-moz-transform: rotateX(0deg); }
100% {
-moz-transform: rotateX(-90deg); } }
@-o-keyframes turn2 {
0% {
-o-transform: rotateX(0deg); }
100% {
-o-transform: rotateX(-90deg); } }
@keyframes turn2 {
0% {
transform: rotateX(0deg); }
100% {
transform: rotateX(-90deg); } }
.flip-clock-wrapper ul li.flip-clock-active {
z-index: 3; }
/* SHADOW */
.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow {
background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
-webkit-animation: show 0.5s linear both;
-moz-animation: show 0.5s linear both;
animation: show 0.5s linear both; }
.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow {
background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, black));
background: linear, top, rgba(0, 0, 0, 0.1) 0%, black 100%;
background: -o-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: -ms-linear-gradient(top, rgba(0, 0, 0, 0.1) 0%, black 100%);
background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, black 100%;
-webkit-animation: hide 0.5s 0.3s linear both;
-moz-animation: hide 0.5s 0.3s linear both;
animation: hide 0.5s 0.3s linear both; }
/*DOWN*/
.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow {
background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
-webkit-animation: show 0.5s linear both;
-moz-animation: show 0.5s linear both;
animation: show 0.5s linear both; }
.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow {
background: -moz-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, black), color-stop(100%, rgba(0, 0, 0, 0.1)));
background: linear, top, black 0%, rgba(0, 0, 0, 0.1) 100%;
background: -o-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: -ms-linear-gradient(top, black 0%, rgba(0, 0, 0, 0.1) 100%);
background: linear, to bottom, black 0%, rgba(0, 0, 0, 0.1) 100%;
-webkit-animation: hide 0.5s 0.3s linear both;
-moz-animation: hide 0.5s 0.3s linear both;
animation: hide 0.5s 0.2s linear both; }
@-webkit-keyframes show {
0% {
opacity: 0; }
100% {
opacity: 1; } }
@-moz-keyframes show {
0% {
opacity: 0; }
100% {
opacity: 1; } }
@-o-keyframes show {
0% {
opacity: 0; }
100% {
opacity: 1; } }
@keyframes show {
0% {
opacity: 0; }
100% {
opacity: 1; } }
@-webkit-keyframes hide {
0% {
opacity: 1; }
100% {
opacity: 0; } }
@-moz-keyframes hide {
0% {
opacity: 1; }
100% {
opacity: 0; } }
@-o-keyframes hide {
0% {
opacity: 1; }
100% {
opacity: 0; } }
@keyframes hide {
0% {
opacity: 1; }
100% {
opacity: 0; } }

View File

@ -0,0 +1,162 @@
body {
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 700;
}
header.masthead {
position: relative;
background-color: #343a40;
background: url("../img/bg-masthead.jpg") no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
padding-top: 8rem;
padding-bottom: 8rem;
}
header.masthead .overlay {
position: absolute;
background-color: #212529;
height: 100%;
width: 100%;
top: 0;
left: 0;
opacity: 0.3;
}
header.masthead h1 {
font-size: 2rem;
}
@media (min-width: 768px) {
header.masthead {
padding-top: 12rem;
padding-bottom: 12rem;
}
header.masthead h1 {
font-size: 3rem;
}
}
section.map {
position: relative;
background-color: #343a40;
background: url("../img/Feedless.jpg") no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
padding-top: 18rem;
padding-bottom: 18rem;
}
section.map .overlay {
position: absolute;
background-color: #212529;
height: 100%;
width: 100%;
top: 0;
left: 0;
opacity: 0.3;
}
section.map h1 {
font-size: 15rem;
}
@media (min-width: 768px) {
section.map {
padding-top: 28rem;
padding-bottom: 28rem;
}
section.map h1 {
font-size: 15rem;
}
}
.showcase .showcase-text {
padding: 3rem;
}
.showcase .showcase-img {
min-height: 30rem;
background-size: cover;
}
@media (min-width: 768px) {
.showcase .showcase-text {
padding: 7rem;
}
}
.features-icons {
padding-top: 7rem;
padding-bottom: 7rem;
}
.features-icons .features-icons-item {
max-width: 20rem;
}
.features-icons .features-icons-item .features-icons-icon {
height: 7rem;
}
.features-icons .features-icons-item .features-icons-icon i {
font-size: 4.5rem;
}
.features-icons .features-icons-item:hover .features-icons-icon i {
font-size: 5rem;
}
.testimonials {
padding-top: 7rem;
padding-bottom: 7rem;
}
.testimonials .testimonial-item {
max-width: 18rem;
}
.testimonials .testimonial-item img {
max-width: 12rem;
box-shadow: 0px 5px 5px 0px #adb5bd;
}
.call-to-action {
position: relative;
background-color: #343a40;
background: url("../img/bg-masthead.jpg") no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
padding-top: 7rem;
padding-bottom: 7rem;
}
.call-to-action .overlay {
position: absolute;
background-color: #212529;
height: 100%;
width: 100%;
top: 0;
left: 0;
opacity: 0.3;
}
footer.footer {
padding-top: 4rem;
padding-bottom: 4rem;
}

1
www/boris/css/landing-page.min.css vendored Normal file
View File

@ -0,0 +1 @@
body{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{font-family:Lato,'Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:700}header.masthead{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;padding-top:8rem;padding-bottom:8rem}header.masthead .overlay{position:absolute;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}header.masthead h1{font-size:2rem}@media (min-width:768px){header.masthead{padding-top:12rem;padding-bottom:12rem}header.masthead h1{font-size:3rem}}.showcase .showcase-text{padding:3rem}.showcase .showcase-img{min-height:30rem;background-size:cover}@media (min-width:768px){.showcase .showcase-text{padding:7rem}}.features-icons{padding-top:7rem;padding-bottom:7rem}.features-icons .features-icons-item{max-width:20rem}.features-icons .features-icons-item .features-icons-icon{height:7rem}.features-icons .features-icons-item .features-icons-icon i{font-size:4.5rem}.features-icons .features-icons-item:hover .features-icons-icon i{font-size:5rem}.testimonials{padding-top:7rem;padding-bottom:7rem}.testimonials .testimonial-item{max-width:18rem}.testimonials .testimonial-item img{max-width:12rem;box-shadow:0 5px 5px 0 #adb5bd}.call-to-action{position:relative;background-color:#343a40;background:url(../img/bg-masthead.jpg) no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;padding-top:7rem;padding-bottom:7rem}.call-to-action .overlay{position:absolute;background-color:#212529;height:100%;width:100%;top:0;left:0;opacity:.3}footer.footer{padding-top:4rem;padding-bottom:4rem}

BIN
www/boris/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

106
www/boris/film.php Normal file
View File

@ -0,0 +1,106 @@
<?php
require_once('conf.php');
require_once('functions.php');
$videosList = array();
// HOWTO PASS Query parameters to exec ?
exec("/bin/bash -c './get_astrxbian_index.sh F'", $videos);
// exec("/bin/bash -c './check_my_wallet.sh'", $gg1);
$videos = array_reverse($videos);
// ## film;MDan5TDuT-0;;Le Manuel de Survie en Dictature v1.1 au format papier;;["onelove"];k51qzi5uqu5dl0hnglpzumjezep2avacrtbx7i15v91elcxac4cpd8290kl1hq;720p;/ipfs/QmZp63RXhLm6QASmw1t2R8fu5waSJFmyW7cmdVNxyuJXzg/MDan5TDuT-0_Le%20Manuel%20de%20Survie%20en%20Dictature%20v1.1%20au%20format%20papier.mp4
foreach ($videos as $v) {
list($a, $youtubeID, $c, $videoName, $e, $src, $h, $quality, $videoURI) = explode(";", $v);
$videoURL = 'https://'. $_SERVER['SERVER_NAME']. $videoURI;
$videoEco = 'https://'. $_SERVER['SERVER_NAME']. '/ipns/' . $h;
$mimeType = guessTypeFromFilename($videoURI);
if ($mimeType == 'video/mp4') {
$videosList[] = [
'mime' => $mimeType,
'url' => $videoURL,
'eco' => $videoEco,
'uri' => $videoURI,
'mediakeyipns' => $h,
'name' => $videoName,
'youtubeID' => $youtubeID
];
}
}
?><!DOCTYPE html>
<html>
<head>
<title>Astro CLUB </title>
<link rel="stylesheet" href="/ipfs/QmPC5MTqt4do7emMUV4z7feYbjSGoX4kdDYVKB6jU3rEKk/crowdbunker.css" type="text/css" />
<link rel="icon" type="image/png" href="./astrocrowdbunker.png" />
</head>
<body>
<header>
<h1>
<a href="https://copylaradio.com"><span>Astroport</span> CopyLaRadio <span>Video CLUB Libre entre Amis</span></a>
</h1>
</header>
<main>
<div data-v-6d6cec84=""><div two-line="" class="v-banner v-sheet theme--dark v-banner--has-icon"><div class="v-banner__wrapper"><div class="v-banner__content">
<div class="v-banner__actions">
<a href="https://gchange.fr">
<button type="button" class="ml-0 v-btn v-btn--text theme--dark v-size--default primary--text"><span class="v-btn__content">Rendez-vous sur Gchange</span>
</a>
<br><br>
<a href="https://cesium.app">Ouvrez un simple portefeuille Cesium</a>
<br>(utilisez les même passe phrases)
</button>
</div>
<div class="v-banner__text"> Astroport protège votre <b>liberté numérique.</b>
C'est un centre d'hébergement qui partage ses données entre amis exclusivement hébergée par vos soins!
<br>Toute contribution y est rétribuée dans la première Monnaie Libre G1.
Utilisez vos Junes pour faire des dons à vos medias favoris pour payer leur hébergement et remercier leur auteur.<br><br>
</div>
</div><div role="dialog" class="v-dialog__container"><!----></div></div>
<?php
echo '<ul id="videosList">';
foreach ($videosList as $video) {
echo '<li>';
// $href = 'youtube_watch.php?uri='. $video['uri'] . '&amp;name='. urlencode($video['name']) .'&mime='. $video['mime'];
echo '
<a href="'. $video['eco'] .'">
<img src="'. sprintf(MEDIAQR, $video['mediakeyipns']) . '" alt="'. $video['name'] . '" />
</a>
<p class="video-title">
<a href="'. $video['eco'] .'">
' . $video['name'] . '
</a>
</p>';
echo '</li>';
}
echo '</ul>';
?>
</main>
</body>
</html>

View File

@ -64,3 +64,179 @@ function guessTypeFromFilename ($filename) {
return $type;
}
function astroport_urlencode ($str) {
$str = str_replace('%', '%25', $str);
$str = str_replace('#', '%23', $str);
$str = str_replace('\'', '%27', $str);
$str = str_replace('"', '%22', $str);
return $str;
}
function quickfix_getYoutubeIdFromIpfsFileName ($name) {
return substr($name, 0, 11);
}
function quickfix_getVideoNameFromIpfsFileName ($name) {
//$name = substr($name, 12);
$name = substr($name, 0, strrpos($name, '.'));
return $name;
}
function formatDuration ($seconds) {
$h = floor($seconds / 3600);
$h_r = $seconds % 3600;
$m = floor($h_r / 60);
$s = $h_r % 60;
if ($h != 0) {
return sprintf("%s:%s:%s", $h, str_pad($m, 2, '0', STR_PAD_LEFT), str_pad($s, 2, '0', STR_PAD_LEFT));
} else {
return sprintf("%s:%s", $m, str_pad($s, 2, '0', STR_PAD_LEFT));
}
}
function getVideoJson ($ipnsHash) {
$indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/index.html');
if (empty($indexHTML)) {
return [];
} else {
// $indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipfsNodeId . '/.' . $ipfsNodeId . '/KEY/');
$re = '!/ipns/[^/]+/([^/]+)/!isU';
preg_match($re, $indexHTML, $matches);
$ipnsHiddenHash = $matches[1];
$indexHTML = @file_get_contents('http://' . HOST . '/ipns/' . $ipnsHash . '/' . $ipnsHiddenHash . '/video.json');
if (empty($indexHTML)) {
return [];
} else {
return json_decode($indexHTML);
}
}
}
function getTagsListFromTagStr ($str) {
if (substr($str, 0, 1) == "[") {
$str = substr($str, 1);
$str = substr($str, 0, -1);
preg_match_all('/"([^"]+)"/isU', $str, $matches, PREG_PATTERN_ORDER);
$tags = $matches[1];
} else {
$tags = explode('|', $str);
}
if ((count($tags) == 1) and empty($tags[0])) {
return array();
} else {
return $tags;
}
}
function separateTags ($tags, $stations) {
return [
array_diff($tags, $stations),
array_intersect($tags, $stations)
];
}
function isStation ($tag) {
global $stations;
return in_array($tag, $stations);
}
function buildRequestedURI ($uri, $params, $escapeHTML = false) {
$URL = $uri;
$first = true;
foreach ($params as $k => $v) {
if ($first) {
$URL .= '?';
$first = false;
} else {
if ($escapeHTML) {
$URL .= '&amp;';
} else {
$URL .= '&';
}
}
$URL .= $k . '=' . htmlspecialchars($v);
}
return $URL;
}
function handleVideoID ($videoID) {
preg_match('/^((?P<ndd>([a-zA-Z0-9-]+\.)?[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)_)?(?P<id>.+)$/is', $videoID, $matches);
$ndd = empty($matches['ndd']) ? 'www.youtube.com' : strrev($matches['ndd']);
$id = $matches['id'];
return [
$ndd,
$id
];
}
function canReadVideoFormat ($mimeType) {
return ($mimeType == 'video/mp4');
}
function in_array_column($text, $column, $array)
{
if (!empty($array) && is_array($array))
{
for ($i=0; $i < count($array); $i++)
{
if ($array[$i][$column]==$text || strcmp($array[$i][$column],$text)==0) return true;
}
}
return false;
}

36
www/boris/g1scan.html Normal file
View File

@ -0,0 +1,36 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>G1 scan</title>
<link rel="icon" type="image/png" href="./favicon.png">
<link rel="stylesheet" href="/ipfs/QmdzGWGMPmPV8AuJwgFDgumFDvTZYD4NxDF6uqAvYueSaY/style.css">
<script type="text/javascript" src="/ipfs/QmdNDuKV3kVS8kpexJsL8BEvdmWinEFuVwC3DA4GupK8A3/adapter.js"></script>
<script type="text/javascript" src="/ipfs/QmZbfka7x13VKA5pA5tudVXRAoPuoMDSXibGWeTrFmos7p/vue.js"></script>
<script type="text/javascript" src="/ipfs/QmcmuVxnsxpupW5Es7ipgdK6KrG8SCgqFXMKeaBsHyJQct/instascan.js"></script>
</head>
<body>
<a href="https://git.p2p.legal/axiom-team/astrXbian"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1" src="/ipfs/QmZu52buoFWv6KaAciUze9oYDNM4nmd6ofLFMwG9MZoh2b/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875.png" alt="Fork me on GitHub"></a>
<div id="app">
<div class="sidebar">
<section class="cameras">
<h2>Cameras</h2>
<ul><!----> <li><span title="(unknown)" class="active">(unknown)</span> <!----></li></ul>
</section>
<section class="scans">
<h2>Scans</h2>
<ul><li class="empty">No scans yet</li></ul>
<ul></ul>
</section>
</div>
<div class="preview-container">
<video id="preview" autoplay="autoplay" style="transform: scaleX(-1);" class="active"></video>
</div>
</div>
<section class="scans">
<h2>Scans</h2>
<!----> <ul><li title="scanresult" class="scanresult"></li></ul>
</section>
<script type="text/javascript" src="/ipfsQmSV6wt8Tm9b3dBQSx6kGfKUuLPU25odd1P2DvyQuG7qob/app.js"></script>
</body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,36 @@
var app = new Vue({
el: '#app',
data: {
scanner: null,
activeCameraId: null,
cameras: [],
scans: []
},
mounted: function () {
var self = this;
self.scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5 });
self.scanner.addListener('scan', function (content, image) {
self.scans.unshift({ date: +(Date.now()), content: content });
});
Instascan.Camera.getCameras().then(function (cameras) {
self.cameras = cameras;
if (cameras.length > 0) {
self.activeCameraId = cameras[0].id;
self.scanner.start(cameras[0]);
} else {
console.error('No cameras found.');
}
}).catch(function (e) {
console.error(e);
});
},
methods: {
formatName: function (name) {
return name || '(unknown)';
},
selectCamera: function (camera) {
this.activeCameraId = camera.id;
this.scanner.start(camera);
}
}
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,77 @@
body, html {
padding: 0;
margin: 0;
font-family: 'Helvetica Neue', 'Calibri', Arial, sans-serif;
height: 100%;
}
#app {
background: #263238;
display: flex;
align-items: stretch;
justify-content: stretch;
height: 100%;
}
.sidebar {
background: #eceff1;
min-width: 250px;
display: flex;
flex-direction: column;
justify-content: flex-start;
overflow: auto;
}
.sidebar h2 {
font-weight: normal;
font-size: 1.0rem;
background: #607d8b;
color: #fff;
padding: 10px;
margin: 0;
}
.sidebar ul {
margin: 0;
padding: 0;
list-style-type: none;
}
.sidebar li {
line-height: 175%;
white-space: nowrap;
overflow: hidden;
text-wrap: none;
text-overflow: ellipsis;
}
.cameras ul {
padding: 15px 20px;
}
.cameras .active {
font-weight: bold;
color: #009900;
}
.cameras a {
color: #555;
text-decoration: none;
cursor: pointer;
}
.cameras a:hover {
text-decoration: underline;
}
.scans li {
padding: 10px 20px;
border-bottom: 1px solid #ccc;
}
.scans-enter-active {
transition: background 3s;
}
.scans-enter {
background: yellow;
}
.empty {
font-style: italic;
}
.preview-container {
flex-direction: column;
align-items: center;
justify-content: center;
display: flex;
width: 100%;
overflow: hidden;
}

File diff suppressed because one or more lines are too long

7
www/boris/get_PIN.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
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
ls /home/$YOU/.zen/PIN | cat

View File

@ -0,0 +1,21 @@
#!/bin/bash
########################################################################
# Author:
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
PREFIX="$1"
[[ $PREFIX == "" ]] && PREFIX="*"
FILTER="$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
if [[ ! $FILTER ]]; then
# We use `grep -Ev "];;` to filter out videos without an ipns link
MY_VIDEOS=`cat /home/$YOU/.zen/ipfs/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep -Ev "CAT;TMDB;"`
SWARM_VIDEOS=`cat /home/$YOU/.zen/ipfs_swarm/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep -Ev "CAT;TMDB;"`
(echo "$SWARM_VIDEOS" && echo "$MY_VIDEOS") | tac
else
MY_VIDEOS=`cat /home/$YOU/.zen/ipfs/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep -Ev "CAT;TMDB;" | grep "$FILTER"`
SWARM_VIDEOS=`cat /home/$YOU/.zen/ipfs_swarm/.*/astroport/kodi/vstream/${PREFIX}ASTRXBIAN | grep -Ev "];;" | grep -Ev "CAT;TMDB;" | grep "$FILTER"`
(echo "$SWARM_VIDEOS" && echo "$MY_VIDEOS") | tac
fi

5
www/boris/get_ipfs_node_id.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
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
IPFSNODEID=$(ipfs --timeout=20s id -f='<id>\n')
echo -n $IPFSNODEID

6
www/boris/get_xzuid.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
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*/.player

View File

@ -1,9 +1,6 @@
#!/bin/bash
########################################################################
# Author:
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
cat /home/$YOU/.zen/{ipfs,ipfs_swarm}/.*/astroport/kodi/vstream/YASTRXBIAN | sort | uniq | tail -n +2
cat /home/$YOU/.zen/ipfs*/.*/astroport/kodi/vstream/YASTRXBIAN | sort | uniq | tail -n +2

BIN
www/boris/img/LivingTV.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

21
www/boris/inc/footer.php Normal file
View File

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

66
www/boris/inc/header.php Normal file
View File

@ -0,0 +1,66 @@
<?php
require_once('conf.php');
$bodyClasses = isset($bodyClasses) ? $bodyClasses : '';
$bodyClasses .= $home ? 'home' : '';
?><!DOCTYPE html>
<html>
<head>
<title>Astroport "<?php echo STATION_NAME; ?>"</title>
<link rel="stylesheet" href="styles/<?php echo THEME; ?>/style.css" type="text/css" />
<link rel="icon" type="image/png" href="./styles/<?php echo THEME; ?>/logo.png" />
<script type="text/javascript" src="/lib/lazyImg.min.js"></script>
</head>
<body class="<?php echo $bodyClasses; ?>">
<header>
<?php $elt = isset($home) ? 'h1' : 'h6'; ?>
<<?php echo $elt; ?>>
<a href="youtube.php">Astroport "<span><?php echo STATION_NAME; ?></span>"</a>
</<?php echo $elt; ?>>
<p class="usp">
<?php echo TAGLINE; ?>
</p>
<form method="post" action="" class="add-video">
<label for="youtube_url">Sauvegarder une vidéo Youtube&nbsp;:</label>
<?php
if (!isset($_POST['youtube_url'])) {
$out = '';
$placeholder = 'https://www.youtube.com/watch?v=ASywAfBAVrQ';
} else {
$out = '
<p class="confirmation">Votre vidéo est en cours de téléchargement…</p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$.ajax({
method: "POST",
url: "youtube_add_video_aux.php",
data: { youtube_url: "'. $_POST['youtube_url'] .'" }
})
.done(function( response ) {
console.log(response);
});
</script>';
$placeholder = htmlspecialchars($_POST['youtube_url']);
}
?>
<input type="text" name="youtube_url" placeholder="<?php echo $placeholder; ?>" size="45" />
<input type="submit" value="Mon précieux !" />
<?php
echo $out;
?>
</form>
</header>
<main>

147
www/boris/index.html Normal file
View File

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="fred" >
<title>qo-op - CLOUD ESCAPE GAME - Nation Extraterrestre - MadeInZion </title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<!-- Custom styles for this template -->
<link href="css/landing-page.css" rel="stylesheet">
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="ajaxform.js"></script>
<!-- Typed text animation -->
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11"></script>
<!-- Clock -->
<link rel="stylesheet" href="./css/flipclock.css">
<script src="./vendor/flipclock/flipclock.js"></script>
</head>
<body>
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="btn btn-lg btn-primary" href="https://onenation.xyz/fr/" target="onenation">Manifeste</a>
<a class="btn btn-lg btn-primary" href="https://oasis.astroport.com/declaration-dindependance/" target="oasis">Sauveraineté</a>
<a class="btn btn-lg btn-primary" href="https://carte.monnaie-libre.fr/" target="carte">Carte</a>
</div>
</nav>
<!-- Masthead -->
<header class="masthead text-white text-center">
<div class="overlay">
<div class="row">
Mise en place du JEu, lancement officiel dans
<br><div class="clock" style="margin:2em;"></div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xl-9 mx-auto">
<br><h3>Accélérez l'extinction des datacenters<br>
Extrayez vos données du <a href="https://www.copylaradio.com/blog/blog-1/post/cloud-escape-game-31" target="copylaradio" >Grand Méchant Cloud</a></h3>
</div>
</div>
<div class="col-md-20 col-lg-12 col-xl-7 mx-auto">
<form id="formlink">
<div class="form-row">
<div class="col-12 col-md-12 mb-2 mb-md-0">
<input id="link" type="link" class="form-control form-control-lg" placeholder="GUILDE message à propager (texte et lien pour youtube-dl)">
</div>
<div class="col-12 col-md-12">
<input id="phone" type="phone" class="form-control form-control-lg" placeholder="indiquez votre numéro de portable ( + Scan G1 clef )">
</div>
<br>
<br>
<div class="col-12 col-md-12" id="linkresultat">
<button type="submit" class="btn btn-block btn-lg btn-primary">Donnez au BLOB, au centuple il vous rendra!</button>
</div>
</div>
</form>
<div >
</div>
</div>
<div class="row">
<div class="col-xl-9 mx-auto">
<h3><div id="typed-strings">
<p>Obtenez <strong>une identité interplanétaire</strong>^2000, émise par MadeInZion !^4000</p>
<p>Explorez <strong><em><u>un autre monde</u>. Pair à pair, libre et légal.</em></strong>^3000</p>
<p>Un Monde <strong><em>où nos enfants,</em></strong> peuvent réaliser leur rêves...^5000</p>
<p>Une <strong>Terre de Jardins Forêts.</strong>^3000 Où nous plantons nos graines.^3000</p>
<p>Un <strong>"Internet des gens"</strong> !^3000 P2P, garant absolu de nos Libertés !^3000</p>
<p>Bienvenue <strong><em><u>qo-op</u></em></strong>^3000 dans votre "Nation Virturéelle".</p>
</div>
<span id="typed"></span></h3>
</div>
</div>
</header>
<div class="row">
<div class="col-xl-9 mx-auto">
<h1>Votre <a href="https://oasis.astroport.com/lancement-des-guildes/" target="avatar">AVATAR</a> adhère au "contrat social" MadeInZion!<br>Plus d'infos, appelez Fred au <a href="https://taurus.copylaradio.com" target="taurus">06 47 68 36 46</a></h1><br>
</div>
</div>
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="btn btn-lg btn-primary" href="https://gchange.fr" target="starwars">Gchange</a>
<a class="btn btn-lg btn-primary" href="https://qo-op.com/obsninja/?quality=2" target="obsninja">VISIO</a>
<a class="btn btn-lg btn-primary" href="/ipns/k51qzi5uqu5dkq9fvpb4sczfk8lgoiyznxitbugrgrsacaihgub2gwt26qfk0q/" target="belleverte">La Belle Verte</a>
</div>
</nav>
<script type="text/javascript">
var clock;
$(document).ready(function() {
// Grab the current date
var currentDate = new Date();
// Set some date in the future.
var futureDate = new Date(2021, 9, 21, 20, 12);
// Calculate the difference in seconds between the future and current date
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
// Instantiate a coutdown FlipClock
clock = $('.clock').FlipClock(diff, {
clockFace: 'DailyCounter',
language: 'fr',
countdown: true
});
});
</script>
<script>
var typed = new Typed('#typed', {
stringsElement: '#typed-strings',
smartBackspace: true,
backDelay: 700,
loop: false,
typeSpeed: 40
});
</script>
</body>
</html>

View File

@ -12,7 +12,7 @@ G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PU
IPFSNODEID=$(ipfs id -f='<id>\n')
[[ $(which apache2) ]] && echo "Apache est installé. Le plugin nécessite nginx. EXIT" && exit 1
[[ $(netstat -tan | grep ':10111 ') ]] && echo "Serveur web existant sur port 10111. Installation manuelle recommandée... EXIT" && exit 1
[[ $(netstat -tan | grep ':80 ') ]] && echo "Serveur web existant sur port 80. Installation manuelle recommandée... EXIT" && exit 1
########################################################################
## INSTALL nginx + php + mariadb + ...
@ -21,51 +21,63 @@ sudo apt-get install mariadb-server nginx python3-certbot-nginx certbot ssl-cert
#######################################################################
## CREATE symlinks for ~/.zen/www/swarm & me
mkdir -p ~/.zen/www/boris && cd ~/.zen/www/boris
mkdir -p ~/.zen/astrXbian/www/boris && cd ~/.zen/astrXbian/www/boris
ln -s ../ipfs_swarm swarm
ln -s ../ipfs me
########################################################################
## ACTIVATE sites-available/astroport
cd /etc/nginx/sites-enabled
sudo ln -s ../sites-available/astroport astroport
########################################################################
## CREATE site config file
printf "
server {
listen 10111 default_server;
listen [::]:10111 default_server;
listen 10111 default_server;
listen [::]:10111 default_server;
root " | sudo tee /etc/nginx/sites-available/astroport
root " | sudo tee /etc/nginx/sites-available/tube.copylaradio.com
printf ~/.zen/www/boris | sudo tee -a /etc/nginx/sites-available/astroport
printf root /home/$YOU/.zen/astrXbian/www/boris | sudo tee -a /etc/nginx/sites-available/tube.copylaradio.com
printf ";
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
server_name tube.copylaradio.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files \$uri \$uri/ =404;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files \$uri \$uri/ =404;
}
index index.php;
index index.php;
# pass PHP scripts to FastCGI server
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
}
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipns {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
}
}
" | sudo tee -a /etc/nginx/sites-available/astroport
" | sudo tee -a /etc/nginx/sites-available/tube.copylaradio.com
########################################################################
## ACTIVATE sites-available/tube.copylaradio.com
cd /etc/nginx/sites-enabled
sudo ln -s ../sites-available/tube.copylaradio.com tube.copylaradio.com

1
www/boris/lib/lazyImg.min.js vendored Normal file
View File

@ -0,0 +1 @@
var lazyImg={};!function(){lazyImg.image="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEA",lazyImg.custom_offset=100,lazyImg.view_elements=[],lazyImg.viewportHeight=lazyImg.viewportWidth=0,lazyImg.body=lazyImg.docEl=null,lazyImg.initVar=function(){lazyImg.viewportHeight=window.innerHeight,lazyImg.viewportWidth=window.innerWidth,lazyImg.body=document.body,lazyImg.docEl=document.documentElement},lazyImg.setConfig=function(a,b){lazyImg.image=a||lazyImg.image,lazyImg.custom_offset=b||lazyImg.custom_offset},lazyImg.reveal=function(){for(var a=window.scrollTop||lazyImg.docEl.scrollTop||lazyImg.body.scrollTop,b=window.scrollLeft||lazyImg.docEl.scrollLeft||lazyImg.body.scrollLeft,c=lazyImg.docEl.clientTop||lazyImg.body.clientTop||0,d=lazyImg.docEl.clientLeft||lazyImg.body.clientLeft||0,e=0;e<lazyImg.view_elements.length;e++){var f=lazyImg.view_elements[e],g=f.getBoundingClientRect(),h=Math.round(g.top+a-c),i=Math.round(g.bottom+a-c),j=Math.round(g.left+b-d);i>a-lazyImg.custom_offset&&h<a+lazyImg.viewportHeight+lazyImg.custom_offset&&j>b-lazyImg.custom_offset&&j<b+lazyImg.viewportWidth+lazyImg.custom_offset&&(f.src=f.getAttribute("data-lazyimg-src"),f.srcset=f.getAttribute("data-lazyimg-srcset"),f.removeAttribute("data-lazyimg-loading"),f.removeAttribute("data-lazyimg-src"),f.removeAttribute("data-lazyimg-srcset"),lazyImg.view_elements.splice(e,1),e--)}0==lazyImg.view_elements.length&&lazyImg.removeListener()},lazyImg.list_maker=function(){for(var a=document.querySelectorAll("img:not([data-lazyimg-list])"),b=0;b<a.length;b++){var c=a[b];lazyImg.view_elements.push(c),c.setAttribute("data-lazyimg-list","true"),c.setAttribute("data-lazyimg-loading","true"),c.setAttribute("data-lazyimg-src",c.src),c.setAttribute("data-lazyimg-srcset",c.srcset),c.src=lazyImg.image,c.srcset=""}},lazyImg.throttle=function(a,b){var c=!1;return function(){c||(a.call(),c=!0,setTimeout(function(){c=!1},b))}},lazyImg.listener=function(){lazyImg.initVar(),lazyImg.reveal()},lazyImg.throttleListener=lazyImg.throttle(lazyImg.listener,100),lazyImg.removeListener=function(){window.removeEventListener("scroll",lazyImg.throttleListener),window.removeEventListener("resize",lazyImg.throttleListener)},lazyImg.activeListener=function(){window.addEventListener("scroll",lazyImg.throttleListener,!1),window.addEventListener("resize",lazyImg.throttleListener,!1)},lazyImg.activeListener(),lazyImg.intervalObject=setInterval(function(){lazyImg.list_maker()},20),window.addEventListener("load",function(){clearInterval(lazyImg.intervalObject),lazyImg.list_maker(),lazyImg.activeListener(),lazyImg.initVar(),lazyImg.reveal()},!1)}();

18
www/boris/menu.php Normal file
View File

@ -0,0 +1,18 @@
<?php
require_once('conf.php');
require_once('functions.php');
// require('php-ipfs-api/vendor/autoload.php');
// use Cloutier\PhpIpfsApi\IPFS;
// $ipfs = new IPFS("astroport", "8181", IPFS_API_PORT);
// echo 'IPFS id : ' . $ipfs->id() . '<br />';
$videosList = array();
exec("/bin/bash -c './get_astrxbian_index.sh'", $videos);
// exec("/bin/bash -c './get_youtube_videos.sh'", $videos);
// echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN");
// echo shell_exec('whoami'); // Pour savoir quel utilisateur système exécute les scripts PHP
$videos = array_reverse($videos);

View File

@ -0,0 +1,10 @@
The MIT License (MIT)
Copyright (c) 2015-2016 Vincent Cloutier
Copyright (c) 2016 S3r3nity Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,113 @@
IPFS API wrapper library in PHP
======================================
![](https://ipfs.io/ipfs/QmQJ68PFMDdAsgCZvA1UVzzn18asVcf7HVvCDgpjiSCAse)
> A client library for the IPFS API.
Good news everyone! [S3r3nity](http://www.s3r3nity.com/) is sponsoring the development of this library.
They will be using it inside one of their (unannounced) projects and its maintainer is hired
to implement all the missing api calls (including the new file api) before the end of September 2016.
**Warning:** Changes will be made from user's suggestions and this warning will be removed when everything is stable.
First stable release is scheduled for the end of September 2016.
# Usage
## Installing
This library requires the cURL module:
```bash
$ sudo apt-get install php5-curl
$ composer require cloutier/php-ipfs-api
$ composer install
```
```PHP
use Cloutier\PhpIpfsApi\IPFS;
// connect to ipfs daemon API server
$ipfs = new IPFS("localhost", "8080", "5001"); // leaving out the arguments will default to these values
```
## API
#### add
Adds content to IPFS.
**Usage**
```PHP
$hash = $ipfs->add("Hello world");
```
#### cat
Retrieves the contents of a single hash.
**Usage**
```PHP
$ipfs->cat($hash);
```
#### ls
Gets the node structure of a hash.
**Usage**
```PHP
$obj = $ipfs->ls($hash);
foreach ($obj as $e) {
echo $e['Hash'];
echo $e['Size'];
echo $e['Name'];
}
```
#### Object size
Returns object size.
**Usage**
```PHP
$size = $ipfs->size($hash);
```
#### Pin
Pin or unpin a hash.
**Usage**
```PHP
$ipfs->pinAdd($hash);
$ipfs->pinRm($hash);
```
#### Pin
Get information about your ipfs node.
**Usage**
```PHP
print_r($ipfs->id());
```
# License
The MIT License (MIT)
Copyright (c) 2015-2016 Vincent Cloutier
Copyright (c) 2016 S3r3nity Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,25 @@
{
"name": "cloutier/php-ipfs-api",
"type": "library",
"description": "A client library for the IPFS API",
"keywords": ["ipfs"],
"homepage": "https://github.com/cloutier/php-ipfs-api",
"license": "MIT",
"authors": [
{
"name": "Vincent Cloutier",
"email": "vincent@cloutier.co",
"homepage": "http://vincent.cloutier.co",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"autoload": {
"psr-4": {
"Cloutier\\PhpIpfsApi\\": "src/"
}
}
}

21
www/boris/php-ipfs-api/composer.lock generated Normal file
View File

@ -0,0 +1,21 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1128371a4702e5be4d07d705b7c25765",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
}

View File

@ -0,0 +1,129 @@
<?php
/*
This code is licensed under the MIT license.
See the LICENSE file for more information.
*/
namespace Cloutier\PhpIpfsApi;
class IPFS {
private $gatewayIP;
private $gatewayPort;
private $gatewayApiPort;
function __construct($ip = "localhost", $port = "8080", $apiPort = "5001") {
$this->gatewayIP = $ip;
$this->gatewayPort = $port;
$this->gatewayApiPort = $apiPort;
}
public function cat ($hash) {
$ip = $this->gatewayIP;
$port = $this->gatewayPort;
return $this->curl("http://$ip:$port/ipfs/$hash");
}
public function add ($content) {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$req = $this->curl("http://$ip:$port/api/v0/add?stream-channels=true", $content);
$req = json_decode($req, TRUE);
return $req['Hash'];
}
public function ls ($hash) {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/ls/$hash");
$data = json_decode($response, TRUE);
return $data['Objects'][0]['Links'];
}
public function size ($hash) {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/object/stat/$hash");
$data = json_decode($response, TRUE);
return $data['CumulativeSize'];
}
public function pinAdd ($hash) {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/pin/add/$hash");
$data = json_decode($response, TRUE);
return $data;
}
public function pinRm ($hash) {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/pin/rm/$hash");
$data = json_decode($response, TRUE);
return $data;
}
public function version () {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/version");
$data = json_decode($response, TRUE);
return $data['Version'];
}
public function id () {
$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;
$response = $this->curl("http://$ip:$port/api/v0/id");
$data = json_decode($response, TRUE);
return $data;
}
private function curl ($url, $data = "") {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
if ($data != "") {
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data; boundary=a831rwxi1a3gzaorw1w2z49dlsor'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type: application/octet-stream\r\nContent-Disposition: file; \r\n\r\n" . $data . "\r\n--a831rwxi1a3gzaorw1w2z49dlsor");
}
$output = curl_exec($ch);
if ($output == FALSE) {
//todo: when ipfs doesn't answer
}
curl_close($ch);
return $output;
}
}

View File

@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitfb20af428fb50fc34b2be451caca0aba::getLoader();

View File

@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

View File

@ -0,0 +1,19 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,9 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@ -0,0 +1,10 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Cloutier\\PhpIpfsApi\\' => array($baseDir . '/src'),
);

View File

@ -0,0 +1,55 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitfb20af428fb50fc34b2be451caca0aba
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitfb20af428fb50fc34b2be451caca0aba', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitfb20af428fb50fc34b2be451caca0aba', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfb20af428fb50fc34b2be451caca0aba::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}

Some files were not shown because too many files have changed in this diff Show More