Compare commits

...

2065 Commits

Author SHA1 Message Date
fred 96cd96a789 PUBLISH UPlanet ${myUPLANET} UMAP to G1PODs 2024-05-15 01:58:00 +02:00
fred 4da568195b init function do not exit 2024-05-15 01:24:02 +02:00
fred 7913f3b436 Docker Selection 2024-05-15 00:38:04 +02:00
fred 604a159712 small fix 2024-05-13 19:38:12 +02:00
fred 5a08a1563d MULTIPASS : HackerSpace Diplomatic Passport CCbySA / Mitch Altman / Matthew Borgatti / Frederic Renault 2024-05-10 16:00:48 +02:00
fred e678d62f06 A4 print size 2024-05-10 14:52:45 +02:00
fred 946ccd826a ${HOME}/.zen/game/MY_boostrap_nodes.txt CONTROL WALLET ${UPLANETNAME} ~/.zen/ipfs/swarm.key 2024-05-09 18:05:21 +02:00
fred da9f8bb55d ./ 2024-05-09 16:06:02 +02:00
fred 1b491454c2 making private swarm Astroport.ONE code mutation 2024-05-09 16:02:12 +02:00
fred fa96adf059 /TWz direct SECTOR ipfs link 2024-05-08 12:21:39 +02:00
fred 594b8328c2 ../tools/ 2024-05-07 17:37:31 +02:00
fred 26d52c2722 REGISTER UPlanet SECTOR to G1PODs 2024-05-06 13:09:43 +02:00
fred 26a5217682 SIGNALING GPOD UPlanet SECTOR 2024-05-05 21:09:03 +02:00
fred 2d635c0528 import_tiddler.sh SECTORTW_NEWS.json 2024-05-05 18:23:09 +02:00
fred 8e32370ef5 get TW 2024-05-04 21:18:16 +02:00
fred 9a9f2382e5 useless alert 2024-05-04 12:50:35 +02:00
fred 2c958a6f76 Mistake 2024-05-04 01:14:43 +02:00
fred a5953940e8 patch 2024-05-03 15:53:28 +02:00
fred 91e06a1395 ${SHARE} G1. 2024-05-03 15:46:24 +02:00
fred 57ba0be37c UPLANET:PALPAY 2024-05-03 15:39:25 +02:00
fred 5cc2302be7 ! LOCAL => ipfs cat /ipfs/EXTERNAL TW 2024-05-03 15:05:37 +02:00
fred 207577868e _SALT_ / _PEPPER_ 2024-05-03 12:37:42 +02:00
fred a366a1fcb8 filter .git & apply .gitignore rules 2024-05-01 18:17:43 +02:00
fred 8bd4b9743b crack it 2024-05-01 18:00:56 +02:00
fred cc16986393 get from secret........... 2024-05-01 13:25:37 +02:00
fred 165742b78e strict YESTERDATE memory 2024-04-26 01:30:28 +02:00
fred a22517e71d Applying private swarm to Node 2024-04-25 19:34:55 +02:00
fred 7a9609aa2c weeep 2024-04-25 19:33:06 +02:00
fred 31d9ae87b7 import_tiddler.sh "TWpath/index.html" "TIDpath/tiddler.json" 2024-04-25 13:52:57 +02:00
fred ecfa63be83 12:01 2024-04-25 12:01:12 +02:00
fred f70e612bcf CURRENT can ForkUPlanetZERO by creating a Tiddler with that tag... then a key exchange is made with friends and if more than N foreign Astroports presidents make the same... .ipfs/swarm.key is activated... 2024-04-25 01:59:48 +02:00
fred 4ba06a8be1 # CURRENT #################### _ForkUPlanetZERO ? 2024-04-25 01:56:32 +02:00
fred 2c26bdd2d8 president=_CURRENT_ 2024-04-25 01:24:24 +02:00
fred 517f384181 00:52 2024-04-25 00:52:41 +02:00
fred 275604a4e5 => shuf DATA SHAKER 2024-04-24 17:47:33 +02:00
fred d51002338c STOP GCHANGE SWARM SHARING --- too big data --- 2024-04-24 17:30:18 +02:00
fred bf10b85b0f jaklis is available system wide with linked .env (GVA server error switching) 2024-04-24 17:12:57 +02:00
fred b053de0b68 "~/.zen/MY_boostrap_nodes.txt" contains "ZenStation" WoT nodes 2024-04-24 17:02:51 +02:00
fred 02a9302237 Problem with tiddlywiki command break 2024-04-24 16:46:08 +02:00
fred ceeb79bdf6 CopierYoutube "voeu" = CopierYoutube "tag" ASTROBOT action 2024-04-24 16:43:05 +02:00
fred d397e94ec2 more is better but less is best 2024-04-24 16:26:20 +02:00
fred 48df6ceb7a switch gva server on ERROR 2024-04-24 14:45:25 +02:00
fred 28c074ebcc producing ~/.zen/tmp/${IPFSNODEID}/myIPFS.txt for becoming bootstrap 2024-04-24 03:25:51 +02:00
fred a9fbd36db7 EXTRA && MESH : meshtastic + LoRA + MQTT && MONITORING node_exporter + prometheus + grafana 2024-04-24 01:00:31 +02:00
fred bdbd11eaaa this is better 2024-04-24 00:54:41 +02:00
fred cbd6d189ca Install Component - TODO - stop using curl, use 'ipfs get' instead 2024-04-23 17:25:17 +02:00
fred a64fe3524b make G1 payments (GVA balance on failure) 2024-04-23 12:48:48 +02:00
fred 0617e8084f Changing GVA SERVER in tools/jaklis/.env 2024-04-23 12:47:48 +02:00
fred 3a48aab030 Changing GVA SERVER in tools/jaklis/.env 2024-04-23 12:46:57 +02:00
fred f44755117d GVA server loadbalancing activated 2024-04-23 12:26:20 +02:00
fred 065d8e854c Is used for GVA load balancing 2024-04-23 12:05:31 +02:00
fred 1217b669f2 git rm --cached tools/jaklis/.env 2024-04-23 12:04:00 +02:00
fred a102147949 ignore python cache & tools/jaklis/.env 2024-04-23 11:58:05 +02:00
fred 5b3edd97e2 Thanks for contributions on [Swarm BUDGET](https://opencollective.com/monnaie-libre#category-BUDGET) 2024-04-23 03:28:49 +02:00
fred 6e44b2710b paint shop 2024-04-23 03:19:28 +02:00
fred 58395d1f3e <<< (◕‿‿◕) <<< 2024-04-23 02:30:36 +02:00
fred a486cb29e5 show previous block 2024-04-23 02:26:20 +02:00
fred 82ddec38d9 set Zine language 2024-04-23 02:05:31 +02:00
fred 9063d416a0 IMPORT MAILJET INTO IF $4=TW 2024-04-23 01:42:18 +02:00
fred 15724ce9a2 Web2.0 Tube -> Web3 Source 2024-04-23 01:19:31 +02:00
fred cf8187e597 keep youtube link for "youtuber" views 2024-04-23 01:14:43 +02:00
fred f6154003bd UI 2024-04-23 01:03:08 +02:00
fred ceee8c8f18 possible PATCH 1234 : send & forget mode 2024-04-23 00:59:42 +02:00
fred e9d0be5ecf # correct 1st run DHCP latency 2024-04-23 00:32:30 +02:00
fred d15d5ca9c1 connect wish to / 2024-04-23 00:23:43 +02:00
fred 59c72f73ea # ASTROBOT SUBKEY PROGRAM : [G1]CopierYoutube "tag" 2024-04-22 21:52:11 +02:00
fred 3bdd48a2c4 mp3 path error correction 2024-04-22 21:41:27 +02:00
fred 147215cc55 TW in IPFS acts as a distributed object storage database. 2024-04-22 20:10:43 +02:00
fred 1ef36f23c5 debug 2024-04-22 19:47:52 +02:00
fred 98d8b88c7d Version: 1.0 2024-04-22 19:45:26 +02:00
fred cffbb9c700 email style 2024-04-22 19:43:11 +02:00
fred b2834b0bc1 adapt fine tuning 2024-04-22 19:17:32 +02:00
fred 7b94539e24 provide elemental TW interactions 2024-04-21 22:58:19 +02:00
fred b36cc445e1 provide elemental TW interactions 2024-04-21 22:55:49 +02:00
fred 2b93275ec4 look for SECTORTW_NEWS.json update 2024-04-21 22:20:51 +02:00
fred 175ed36609 ptach 2024-04-21 21:44:05 +02:00
fred 5e96fe2353 place docker-compose.yml templates and configure manualy through nginx-proxy-manager OR use seedbox 2024-04-21 21:28:56 +02:00
fred ab2dec9762 bug 2 2024-04-21 21:27:15 +02:00
fred a0bafae461 bug 2024-04-21 21:17:42 +02:00
fred 8c7c098eec stonger UPLANET security applied to derivated keys 2024-04-21 16:43:23 +02:00
fred fbe7aa2b10 tldr + mosquitto + promoetheus + meshtastic ... Soon added 2024-04-21 14:04:39 +02:00
fred 1645c082c8 install in $HOME/.local/bin/jaklis/ (with .env for duniter load balancing) 2024-04-21 14:03:59 +02:00
fred 121b6f9fad || { } or command must be a function 2024-04-20 23:09:15 +02:00
fred f933ac1069 FOLDER="/MP4" or /MP3 2024-04-20 22:43:18 +02:00
fred 84184acfd4 Convert yt-dlp copied video link to mp4 or mp3 for browser compatibility 2024-04-20 22:30:22 +02:00
fred 6fb0996f89 UPGRADE v1.0 : CopierYoutube & MP3 tag detection make video link copied & converted to mp3 2024-04-20 22:27:36 +02:00
fred 70c209682e new earth CID 2024-04-20 00:42:21 +02:00
fred d53fa8d0e8 make it clear and simple 2024-04-19 23:09:50 +02:00
fred 75a8bc54b3 UMAP is bigger, wait for 360s for getting memory slot # TODO verifiy it is from yesterday before applying 2024-04-18 16:40:58 +02:00
fred dfc7339015 Use ~/.zen/tmp/coucou/ # TODO : RECUP ANNONCES Gchange ADD TO TW + email tiddler 2024-04-18 16:25:02 +02:00
fred 7b1076250c xargs instead of awk to remove leading spaces 2024-04-17 16:10:44 +02:00
fred 4c18df9c9f Routing.AcceleratedDHTClient true 2024-04-17 15:26:57 +02:00
fred 3e3ac3d9da # ♥BOX READY ### PLEASE CREATE PLAYER 2024-04-17 02:13:08 +02:00
fred 9551c5bcb4 ADDING seedbox :: add extra docker services 2024-04-17 01:42:47 +02:00
fred e7998f7bf8 take care of prometheus & node_exporter 2024-04-16 23:58:37 +02:00
fred 54d4837fd6 ${#ZENSTATIONS[@]} 2024-04-16 22:24:38 +02:00
fred 974d506af5 _..._
.'     '.      _
     /    .-""-\   _/ \
   .-|   /:.   |  |   |
   |  \  |:.   /.-'-./
   | .-'-;:__.'    =/
   .'=  A=|STRO _.='
  /   _.  |    ;
 ;-.-'|    \   |
/   | \    _\  _\
\__/'._;.  ==' ==\
         \    \   |
         /    /   /
         /-._/-._/
  MIZ    \   `\  \
          `-._/._/
2024-04-16 19:26:42 +02:00
fred 9de45bd4c5 Make Duniter server load balancing 2024-04-16 19:19:26 +02:00
fred 12f6a50596 --enable-namesys-pubsub removed if !isLAN 2024-04-16 17:11:20 +02:00
fred 7046274894 lowpower already makes node dht-client AND server drops LAN requests 2024-04-16 17:08:56 +02:00
fred 07f3ab165f Last line is the selected one 2024-04-16 16:12:40 +02:00
fred 05c171dd97 silkaj money history CHECK 1ST UPlanet Wallet TX in INCOMING PAYMENTS 2024-04-16 04:14:17 +02:00
fred 36b000426b get "onchain" duniter GVA node 2024-04-16 03:54:56 +02:00
fred 47764387cc z \ 2024-04-15 11:51:33 +02:00
fred f530cf8cdd | xargs 2024-04-14 17:37:53 +02:00
fred a9a7f23a3b MONITORING LAYER : prometheus node_exporter + DRAGONS prometheus/grafana platform 2024-04-14 16:31:55 +02:00
fred 1d4527c72e UPlanet ZINE - a Web3 journal to print, cut, fold, share... make knowledge a common good 2024-04-14 15:09:46 +02:00
fred b331dcc990 w 2024-04-13 01:54:02 +02:00
fred e8b2cdf6f4 www3 2024-04-13 01:51:47 +02:00
fred 8ff8ab1fe9 Web3, derivated keys & /ASTROBOT/_ "subchains" 2024-04-12 23:30:30 +02:00
fred 8ebbe138ac Welcome to Web3. Welcome to Astroport. 2024-04-12 23:26:54 +02:00
papiche 39bb53897d
Merge pull request #102 from Fabien-Vidor/master
Create ipfs_id.txt
2024-04-12 17:23:14 +02:00
fred 0beafcc374 No more SecureBytes 2024-04-12 12:37:22 +02:00
fred dc169aa474 remove securebytes dependancy 2024-04-12 12:22:24 +02:00
papiche 5e409f3680
Merge pull request #97 from Willd27/master
Transfert python and ipfs ID
2024-04-12 10:53:01 +02:00
papiche 2b495af068
Merge pull request #98 from gaetancorin/master
add ipfs public_key
2024-04-12 10:52:31 +02:00
papiche 6fbd7eb1df
Merge pull request #99 from Jean-bouger/master
add ipfs_id
2024-04-12 10:52:18 +02:00
papiche fc6c31d626
Merge pull request #100 from lou0608/master
ipfs_lou
2024-04-12 10:52:04 +02:00
fred 591526c734 Blockchain 3 2024-04-12 10:41:35 +02:00
fred 08603176f2 Print swarm data 2024-04-12 00:43:16 +02:00
fred fd390d80f0 correct visio room name 2024-04-11 21:08:08 +02:00
fred bf8d36fd44 des trucs en plus 2024-04-11 21:01:09 +02:00
fred 3eddcad0eb pffff 2024-04-10 16:55:07 +02:00
fred 855d2877f5 Zen Station Control Center 2024-04-10 02:23:35 +02:00
fred 0f75a07103 debug 2024-04-09 21:31:30 +02:00
fred 04cfc8bdc8 ipfs can run on PiZero W (armv6) Pi3 (armv7) to Pi5 (arm64) and amd64 2024-04-09 20:45:40 +02:00
fred 9a3b7b5931 TW 🔌📺 2024-04-09 18:16:36 +02:00
fred 527c09838a UPname =title 2024-04-09 02:52:14 +02:00
fred a39a0cd272 mmm 2024-04-09 02:50:16 +02:00
fred 523f068a30 make UPLANET.refresh happens before PLAYER.refresh 2024-04-08 16:03:47 +02:00
fred 1e5e9a2194 \\// 2024-04-07 20:50:38 +02:00
fred 5cf9f0b6cb ~ ♥ ~ ZEN ~ 2024-04-06 16:14:19 +02:00
fred 0dc2498ae6 https://forum.duniter.org/t/impossible-de-resynchroniser-un-noeud-v1-1-9-dev-apres-perte-de-synchro/12149/ 2024-04-06 15:24:12 +02:00
fred ddb4a14502 LOWMODE Station must refresh ~/.zen/tmp/swarm before running 20h12 processing 2024-04-06 12:50:13 +02:00
fred c925b1a701 fixing sync for "off/on" Station 2024-04-06 12:14:34 +02:00
fred 7a87f96907 players/ 2024-04-05 21:29:40 +02:00
fred b273422f0d UPlanet Zine & more 2024-04-04 13:56:48 +02:00
fred f9814e1cb4 default 'fr' 2024-04-04 13:53:37 +02:00
fred 5152d4ccf7 extract zone TW(s) & MAPNS 2024-04-02 14:43:45 +02:00
fred 7b32f25da3 make UMAP(s) & TW(s) listing on UPlanet 2024-04-02 12:46:14 +02:00
fred 1186c77d55 ipfs (cat/get) --progress=false 2024-04-02 11:49:53 +02:00
fred 21f745c418 --progress="false" 2024-04-02 11:42:03 +02:00
fred e1069d26f1 new OSM2IPFS earth UI 2024-04-02 00:12:28 +02:00
fred b24354a416 TW5 (unpin previous) + ZenStation link 2024-04-01 23:51:41 +02:00
fred d0db377309 [days[-1]] 2024-04-01 22:50:41 +02:00
fred 71d24341b3 Choose your docker https://forum.duniter.org/t/appel-a-lancer-des-noeuds-wotwizard/10754/54 2024-04-01 17:25:35 +02:00
fred 102c3b362d G1PalPay - scan incoming TX for N1Prog & emails + scan modified tiddlers 2024-04-01 02:36:46 +02:00
fred 3e684587df EXTRACT [days:modified[-1]] TIDDLERS 2024-04-01 01:27:41 +02:00
fred 42164bda55 --progress="false" TODO check from Boostrap 2024-04-01 00:51:40 +02:00
fred 308a60b2e4 TODO: SECURITY PATCH : check payment emitter is from BOOSTRAP 2024-04-01 00:50:16 +02:00
fred 0914213adb /UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON} 2024-04-01 00:42:49 +02:00
fred 4eeb9dd5ef nope 2024-03-31 22:27:06 +02:00
fred a8d3ed8b05 pffff 2024-03-31 21:51:01 +02:00
fred 06348bb089 les (tiddler 'email') de leurs PLAYERs 2024-03-31 20:56:44 +02:00
fred a9dc335427 Tiddler GAME_It_s_Too_Raw IPFS Capsule 2024-03-31 20:15:58 +02:00
fred d65ed3a5b6 echo "(⌐■_■) /UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}" 2024-03-31 19:43:49 +02:00
fred 84da189bde gone insert mailjet into INDEX with IFRAME.json... Add more /UPlanetDAY Zine 2024-03-31 18:55:38 +02:00
fred 12e4b7ceea ForkUPlanetZERO wish & tag -> PLAYERPUB self crypt ${WISHNAME}.${UPNAME}.swarm.key.enc | base16 2024-03-31 17:28:56 +02:00
fred 767b29c5fa UPLANET CONTEXT - look inside code - 2024-03-31 17:19:32 +02:00
fred eb8aa0a940 send zine2 2024-03-31 14:45:27 +02:00
fred a443f0ff5b refresh ~/.zen/tmp/$IPFSNODEID after 20H12 2024-03-31 14:39:50 +02:00
fred 5f33de4791 DAY2 Zine 2024-03-31 03:48:47 +02:00
fred 09bc666616 s~_NUMBER_~${#PLAYERONE[@]}~g && s~_DAO_~${LANG}~g #MadeInZion 2024-03-31 03:44:13 +02:00
fred 0655b4d758 New ZERO is infinite 2024-03-30 19:46:35 +01:00
fred 5a10e1bbe3 AMZQR 2024-03-30 17:44:23 +01:00
fred e9265a043b [[ ${ZCHAIN} != "" ]] && ipfs pin rm ${ZCHAIN} - ZCHAIN kept in UPlanet:12345 substructure 2024-03-30 17:02:51 +01:00
fred db67b64364 reduce data pin trails 2024-03-30 17:00:22 +01:00
fred 9f51fdf40e optimizing "ipfs pin rm" to reduce storage leaking 2024-03-30 16:57:03 +01:00
fred 953029af4b s~_PLAYER_~${PLAYER}~g 2024-03-30 14:53:34 +01:00
fred 54ffc346ce (<< sat < (qo-op) > map >>) 2024-03-30 14:31:11 +01:00
fred be3d9531e8 MULTIPASS DID fine tune 2024-03-30 14:25:53 +01:00
fred 24e3c0f8b3 closing path loops 2024-03-30 14:04:23 +01:00
fred 09c961f05a UPlanet RETRY 2024-03-30 13:42:22 +01:00
fred aa819977e6 replug SALT & PEPPER & PLAYER 2024-03-30 13:30:37 +01:00
fred 9b1549f689 First ♥ UPlanet . Zen Fork private 2024-03-30 13:06:56 +01:00
fred b89bc01ada ${#unique_combined[@]} UMAPS 2024-03-30 12:50:37 +01:00
fred 7fd87cdf1c MULTIZONE scan for TW & ZONEIPNS 2024-03-30 12:42:08 +01:00
fred f23fd79c00 REMOVE TMP BUT KEEP swarm, flashmem and coucou 2024-03-30 12:33:00 +01:00
fred 7d8a9b3d7f Zone debug 2024-03-30 12:27:40 +01:00
fred 9164b6a265 <h2><button class="print-button">🖨️Print</button> <a href='https://qo-op.com'>MULTIPASS</a> ☼☼☼☼☼</h2> 2024-03-30 11:50:37 +01:00
fred 16ad9eb9e3 Distributed N1/N2 network exploration game 2024-03-30 11:45:21 +01:00
fred 3888414580 UPlanet AstroID + ZenCard = MULTIPASS 2024-03-30 11:37:05 +01:00
fred 9527d5e5f5 MULTIPASS 2024-03-30 11:35:18 +01:00
fred b97a869f39 G1PalPay powa 2024-03-30 00:32:09 +01:00
fred 3896be3845 CASE = UMAP 2024-03-30 00:11:48 +01:00
fred 751ed3158a es UPlanet Zine 2024-03-29 23:52:38 +01:00
fred a69e38bd53 ~/.zen 2024-03-29 23:37:04 +01:00
fred 5ae650718a hummm 2024-03-29 23:29:31 +01:00
fred c476d7d3d7 #PLAYER.unplug# EXPLAIN WHY ! 2024-03-29 23:21:46 +01:00
fred b2d9d27647 3 days AstroID still - OUT 2024-03-29 23:18:52 +01:00
fred b6f92ed4dc \\ \ / // 2024-03-29 23:07:43 +01:00
fred de6c7543c5 # SEND 10 ZEN TO EACH SIGNATURE 2024-03-29 22:34:44 +01:00
fred 8a3f78f36e * FRIEND 2024-03-29 21:30:27 +01:00
fred 673d2fbf62 some colors 2024-03-29 18:23:04 +01:00
fred 278cd4e730 Remove form - inform 2024-03-29 18:20:26 +01:00
fred c7b01acb65 Exporting ${PLAYER} TW [days:created[-360]tag[G1Voeu]]" must renew wish to maintain 2024-03-29 14:58:03 +01:00
fred 7c81362146 /ASTROBOT/G1${WISHNAME}.sh 4th param : ${PLAYER}.g1voeu.json 2024-03-29 14:39:53 +01:00
fred 0a7a90401b Read comments 2024-03-29 14:27:50 +01:00
fred 7fb9188076 rotate UPlanet Picture based on lang origin slice 2024-03-29 12:59:04 +01:00
fred 29e6bb6203 ##UPlanetZine::/ipfs/QmUjgQYK74UgRoyLFfmR2LMX7rd6vNxmtWeUtRxjemELuZ - chained release - 2024-03-29 12:47:34 +01:00
fred a0046d31e0 Make a Compass to show direction to closest GeoKeys 2024-03-29 12:37:46 +01:00
fred 5e9cebfbac UPlanet Zine 2024-03-29 12:32:30 +01:00
fred 862d6562bf ${VAL} is lang 2024-03-29 12:12:05 +01:00
fred a132d32b9e UPlanetZINE fr 2024-03-28 21:33:18 +01:00
fred 659c7aeee7 UPlanetZine::QmRGrZLDrGmA7f87fU9bb4CMHSb6ztL8iB9DG2tvxy9B73 - chained release - 2024-03-28 21:11:15 +01:00
fred d25d25dd30 ##UPlanetZine::QmRGrZLDrGmA7f87fU9bb4CMHSb6ztL8iB9DG2tvxy9B73 - chained release - 2024-03-28 21:02:26 +01:00
fred 99f62a58c4 UPlanetZine.html "UPlanet DID it or NOT" 2024-03-28 20:43:58 +01:00
fred 77f298ed11 TW favicon & Tiddler Commander 2024-03-28 18:32:46 +01:00
fred 2bcaaf95bc UPlanet Zine generator & UPlanet swarm.key forge wish 2024-03-28 18:32:03 +01:00
fred c50afc49b6 AGENT=$(echo "$REQ" | grep '^User-Agent:') ### TODO : BAN LESS THAN 3 SEC REQUEST 2024-03-27 23:12:27 +01:00
fred 5ffc1954af ${PLAYER} G1${WISHNAME} Ŋ1 FLUX $(myIpfsGw)${IPNS_VOEUNS} 2024-03-27 16:12:41 +01:00
fred f83435cd39 keep /UPLANET cache 2024-03-27 15:58:39 +01:00
fred 48d925fd52 getUMAP_ENV from swarm or self 2024-03-27 15:51:04 +01:00
fred 7df2748b83 ## LAST LINE EXPORT 2024-03-27 12:31:25 +01:00
fred adcb6ee8fc ipfs get --progress=false 2024-03-27 12:11:37 +01:00
fred 52b7d6f841 variable renaming 2024-03-27 11:15:55 +01:00
fred fe206e1565 SECLAT SLAT REGLAT RLAT 2024-03-27 11:10:34 +01:00
fred 0bb1684190 --progress=false : do not log progress 2024-03-27 10:06:29 +01:00
fred 59204dc421 $(myIpfsGw) 2024-03-26 12:35:08 +01:00
fred 03845c69a6 ~/.zen/tmp/${MOATS}/backup.json 2024-03-26 02:38:31 +01:00
fred bbbc4174f6 Upgrade TW to latest version when moving PLAYER 2024-03-26 02:33:10 +01:00
fred 62aa6cd563 old TW unbreak 2024-03-26 02:08:21 +01:00
fred 9429c9c472 ( ) & ! 2024-03-26 01:31:30 +01:00
fred 42f6fdc39f donot unplug CURRENT 2024-03-26 01:19:52 +01:00
fred b3d66ffd58 stop using UPLANETNAME, get values from Dragons 2024-03-26 00:38:42 +01:00
fred 026b97c908 stop if /tmp/20h12.log is more than 23h old 2024-03-26 00:24:51 +01:00
fred e52490638f Minimal env : USER;PATH 2024-03-25 21:05:42 +01:00
fred d6d4e55689 ipfs pin rm ${EMAILZ} 2024-03-25 01:27:54 +01:00
fred 1ae58895f3 UPlanet _EMAIL_ to DID 2024-03-24 09:44:59 +01:00
fred 4abd3ec77d # TODO : CHECK RX coming from UPlanet Wallet (TW5 & AstroID) 2024-03-24 08:22:11 +01:00
fred e2a30e747d You have a DID on UPlanet - TODO - Stop API access after 20H12 2024-03-23 18:52:13 +01:00
fred 43534ef24e #~ choose salt pepper with variable words count 2024-03-23 16:17:18 +01:00
fred f88d5ea7a9 AstroID & ZenCard registration email : DID + paper wallet 2024-03-23 15:48:08 +01:00
fred 4d94dec156 ## DO NOT pin ASTROID cid 2024-03-23 14:38:33 +01:00
fred 365a9df5d6 better log 2024-03-23 01:27:49 +01:00
fred cb30d0f773 VISIO COPYME 2024-03-23 01:19:53 +01:00
fred ae344dd369 VISIO OUT 2024-03-23 01:18:44 +01:00
fred 3efdfd297b TW5 update 2024-03-23 00:56:13 +01:00
Fabien-Vidor d06b418ca8 Create ipfs_id.txt 2024-03-22 16:31:57 +01:00
papiche 6e602a7754
Merge pull request #96 from NathanPzi/master
LACHAINE
2024-03-22 16:31:43 +01:00
lou0608 7e54ba5d22 ipfs_lou 2024-03-22 16:28:34 +01:00
fred fdc6a4c5fd reset log file 2024-03-22 16:26:39 +01:00
Jean-bouger 0daca449ff
Merge branch 'papiche:master' into master 2024-03-22 16:13:49 +01:00
Jean-bouger ff981d9c41
add ipfs_id 2024-03-22 16:13:29 +01:00
gaetancorin 681c438485 add ipfs public_key 2024-03-22 16:12:56 +01:00
Willd27 1cd026dd50 Add ipfs ID 2024-03-22 16:11:52 +01:00
Nathan Piazzi 34a549d3d1
Create ipfs_id 2024-03-22 16:11:11 +01:00
Nathan Piazzi 26ceac3c50
Delete tools/venv directory 2024-03-22 15:56:20 +01:00
fred ce6b8de059 IPFSNODEID 2024-03-22 15:53:07 +01:00
papiche 8c9379a53b
Merge pull request #95 from anatolethien/master
ipfs_id value
2024-03-22 15:52:00 +01:00
anatolethien 4b04a7ca6b
ipfs_id value 2024-03-22 15:47:27 +01:00
Willd27 bf951f8a2e Add SImple Transfert 2024-03-22 08:45:33 +01:00
Nathan Piazzi d23c1fdbae
Delete venv directory 2024-03-22 08:41:47 +01:00
fred 8a231fd284 br 2024-03-21 17:40:32 +01:00
fred a059c53bbe EMAIL QR PASS 2024-03-21 17:38:51 +01:00
fred fe5c337881 sandbox. maybe a little bit usefull. or not 2024-03-21 13:09:16 +01:00
fred a8b6f46a14 STOP SWARM SYNC 1H BEFORE 20H12 2024-03-21 13:06:12 +01:00
fred 50ebc469ab crochet or not crochet 2024-03-21 12:31:25 +01:00
fred 50e8a17a51 languaged Help link + PLAYER nicer 2024-03-20 23:48:54 +01:00
fred 8925e199d4 yep 2024-03-20 22:57:52 +01:00
fred 727e67ab23 Can get "DEMAINDATENSs" from TODATE UMAPNS in flashmem & SWARM cache ;) 2024-03-20 16:30:41 +01:00
fred 06024545c8 # SEARCH for TODATENS in SWARM then LOCAL 2024-03-20 11:35:31 +01:00
fred 78a540fd4c ~/.zen/tmp/${MOATS} 2024-03-20 00:07:45 +01:00
fred 8dc4956ab1 fx 2024-03-19 23:37:47 +01:00
fred 288c909a43 flashmem fixing 2024-03-19 22:55:37 +01:00
fred 01746aa91a pfff 2024-03-19 22:42:05 +01:00
fred 9882b99f47 _ASTRONAUTENS_~/ipns/${ASTRONAUTENS} 2024-03-19 22:34:22 +01:00
fred 0b54a92801 _PLAYER_ "TW5" hosted by Astroport(s) on UPlanet 2024-03-19 18:57:15 +01:00
fred cdbc3d162f UPLANET C/S UPLANETNAME 2024-03-19 17:55:25 +01:00
fred 2b290452f9 ipfs --timeout 180s get -o ~/.zen/tmp/flashmem/tw/$tw/index.html /ipns/$tw 2024-03-19 15:06:04 +01:00
fred 636a920160 LAT=$(makecoord ${ZLAT}) LON=$(makecoord ${ZLON}) 2024-03-19 15:01:15 +01:00
fred 5fc35a7880 remove UPLANETNAME need for PLAYER.refresh (step 1) 2024-03-19 14:57:36 +01:00
fred 2abd32a8ad some cleaning 2024-03-19 12:20:26 +01:00
fred 8cb7ce12c5 myUPLANET 2024-03-18 18:54:57 +01:00
fred 99dead74f9 correct GPS tiddler 2024-03-18 14:43:03 +01:00
fred 30a9274005 today debug done 2024-03-18 13:52:53 +01:00
fred c024c745ef debug 2024-03-18 13:41:05 +01:00
fred ab541d2206 mieux 2024-03-18 13:34:20 +01:00
fred 1b8c2e9924 boostrap refill 2024-03-17 19:32:52 +01:00
fred 9afcb013bd + == ++ 2024-03-17 18:08:41 +01:00
fred cf8f3f06ab VISIO.json 2024-03-17 14:37:51 +01:00
fred aac9cd6340 +++ 2024-03-17 14:23:38 +01:00
fred d32b9938ab empty AstroID 2024-03-17 13:55:02 +01:00
fred eb07ce7e86 debug 2024-03-17 12:24:02 +01:00
fred 59b12d4aae POK 2024-03-16 19:59:50 +01:00
fred 81e65cd97b better TW UX 2024-03-16 17:13:33 +01:00
fred c81436b83a _UPLAYERSTIDS_ in _SECTOR_ TW 2024-03-16 17:11:04 +01:00
fred 63f71ddec9 [[ ${CURRENT} == "" ]] 2024-03-16 15:39:44 +01:00
fred b2a03f0f4e _*_ TW _*_*_ 2024-03-16 15:36:19 +01:00
fred 9bd0f2a816 PLAYER : 21 ZEN & GEOKEY : 101 ZEN 2024-03-16 15:05:39 +01:00
fred 74d505759f Prendre conscience que la direction du vecteur force "monnaie" entraîne tous les autres phénomènes à être dirigés dans une certaine direction. Ce n'est pas hors sujet ! 2024-03-16 13:46:01 +01:00
fred ffe82a6119 GEOKEYS_refresh.sh 2024-03-16 10:59:34 +01:00
fred 1afb1faa9e GEOKEYS_refresh.sh 2024-03-16 10:59:18 +01:00
fred 893295807f correct it 2024-03-15 23:03:51 +01:00
fred 68ba56f8fe only RX-INPUT 2024-03-15 22:32:13 +01:00
fred cfffdd4667 📞✆ ⚘ 2024-03-15 22:06:07 +01:00
fred f45cb14b24 even better 2024-03-15 21:59:19 +01:00
fred 81add31667 better integration 2024-03-15 21:49:26 +01:00
fred 9c16c0064a add to sidebar 2024-03-15 20:56:30 +01:00
fred b23920381a Bro. 2024-03-15 20:30:53 +01:00
fred 2e1c414fb6 coming soon 2024-03-15 20:23:58 +01:00
fred e644780bfe !externalTiddler[yes] 2024-03-15 17:07:53 +01:00
fred e27182ea46 VISIT 2024-03-15 17:02:07 +01:00
fred 5acc7a44c3 $:/moa picture ## lightbeams replacement 2024-03-15 16:47:28 +01:00
fred 195ce6f0f6 email 2 YOUSER 2024-03-15 14:28:36 +01:00
fred 425fcec892 $(date) stamping 2024-03-15 14:25:21 +01:00
fred deb589c922 TW5 2024-03-15 13:34:20 +01:00
fred 20b54192b1 ipfs --timeout 180s name publishing 2024-03-15 13:04:12 +01:00
fred cd16642363 delay _12345 process 2024-03-15 10:50:46 +01:00
fred eca57a149f "tags": "load-external" filtering. Silent RSS YOUSER=$($MY_PATH/../tools/clyuseryomail.sh "${PLAYER}") gives 1 Zen to UMAP 2024-03-14 17:43:31 +01:00
fred 308e24699c disable autoload by default, remove TAG : $:/tags/load-external-content 2024-03-14 16:45:53 +01:00
fred 98ad6ffec2 correct autoload filter & produce "ipfs" UPLANET/.../TW redirect 2024-03-14 15:42:25 +01:00
fred ca2c8d0a76 todo: check g1pub is from "boostrap list" 2024-03-13 23:12:44 +01:00
fred 32e4ca89a2 case is stiuck 2024-03-13 22:38:12 +01:00
fred 79bdced18c UPPERCASE title = not loaded externaly 2024-03-13 19:12:03 +01:00
fred c5977abff0 plus bo 2024-03-13 19:03:12 +01:00
fred 2f8b7f17d6 PHONE = email_domain_tld 2024-03-13 18:39:18 +01:00
fred 5ad1eee561 ${PLAYER/@/\.} = ipns & webrtc phone address 2024-03-13 18:35:44 +01:00
fred 4a952f84f4 Add Personnal PhoneBooth SideBar tiddler 2024-03-13 17:51:53 +01:00
fred 24a2af152e $:/tags/SideBar 2024-03-13 17:28:50 +01:00
fred 818bcdd00b External Loading -UPPERCASE -is_volatile : avoid tiddlers collision 2024-03-13 16:05:48 +01:00
fred 6fb3ca8325 autoload ?? + manual 2024-03-13 16:00:33 +01:00
fred 711eb86f67 SECOND=${SECOND#0} 2024-03-13 14:17:35 +01:00
fred 153caaa7d2 ${FPLAYER^^} 2024-03-13 14:14:34 +01:00
fred 4bfdb4af73 DELAY 12345 ASTROPORT DURING 20H12 UPDATE 2024-03-13 00:46:36 +01:00
fred bf6cffebc2 Loop through each *.rss.json {data: } 2024-03-12 23:17:09 +01:00
fred 2d26e82a3f AstroID /ipfs/bafybeifbebc3ewnzrzbm44arddedbralegnxklhua5d5ymzaqtf2kaub7i 2024-03-12 18:32:47 +01:00
fred 3205aadd7f little bugs 2024-03-12 18:32:25 +01:00
fred 1623f95012 $CLYUSER$YOMAIN 2024-03-12 17:53:57 +01:00
fred fec61bf5a5 far better now 2024-03-12 17:00:51 +01:00
fred 66811e7a0a _____TW</button 2024-03-12 15:38:01 +01:00
fred 9cad79fdae The 1st {{Astroport|astronautens}} TWs in Web3 2024-03-12 15:21:39 +01:00
fred 6e2636d7d9 TW5 = "Windows 95" for Web3 !! 2024-03-12 14:48:31 +01:00
fred fd52a7e0fb informative UKey redirect links 2024-03-12 11:54:46 +01:00
fred e3b5332aec SECLAT="${LAT::-1}" SECLON="${LON::-1}" 2024-03-12 00:40:23 +01:00
fred 2a61784d3c SECTOR better 32.34 just remove last char => 32.1 1st decimal only 2024-03-11 17:59:36 +01:00
fred ff35d8c5cb up 2024-03-11 10:39:50 +01:00
fred 3e51735bce diff 2024-03-10 21:15:39 +01:00
fred 80b395d74e twuplanet.html model for all 2024-03-10 17:41:28 +01:00
fred 3da38260e6 deser_i_alizer 2024-03-10 16:01:16 +01:00
fred a51542a1e1 "modified": "_MOATS_", 2024-03-10 15:24:31 +01:00
fred 9569832e75 /${SECTOR}/TWz 2024-03-10 14:15:50 +01:00
fred 66adbb3f79 fplayer FPLAYER tiddlers control PLAYER TW autoload TWz 2024-03-10 14:14:03 +01:00
fred 60279e7621 correct world.js 2024-03-10 11:40:45 +01:00
fred 11b776dab3 -e "s~_MOATS_~${MOATS}~g" \ 2024-03-10 00:50:06 +01:00
fred 68975f3d0f MAKE BETTER THAN RANDOM !! CONNECT TO THE WARM... 2024-03-09 21:06:09 +01:00
fred dbb50dade4 UPlanet PLAYER TW link $:/moa ( imageHASH change -> renew Tiddler ) 2024-03-09 20:06:01 +01:00
fred eeb963d9f0 copy player "friend@www.email" tiddler into your TW ->>>> OPEN UPLAYER TW FLUX 2024-03-09 19:41:10 +01:00
fred 2d25538466 UFriends TW auto-loading Tiddler 2024-03-09 18:58:39 +01:00
fred e8f9a9c62d LOAD EXTERNAL TW 2024-03-09 16:51:08 +01:00
fred be8cc678f8 RESTORE PLAYER GPS.json (can be erase by WISH treatment) 2024-03-09 01:28:18 +01:00
fred 9956a13378 SECTOR TW NEWS template 2024-03-09 00:36:33 +01:00
fred 4a92c664ef $:/moa & moa tags identify _PLAYER_ drawing (with g1pub, player, president & tw fields) 2024-03-08 15:58:44 +01:00
fred 84b841941a extract ${PLAYER} Tiddler image 2024-03-08 15:40:26 +01:00
fred d05759045a default UPlanet TW model 2024-03-08 15:24:01 +01:00
fred 0f6c3f786d [[ ! -e ~/.zen/game/players/.current ]] 2024-03-08 14:52:47 +01:00
fred c227bfd8a8 NO CURRENT ? PLAYER = .current 2024-03-08 14:43:30 +01:00
fred c885afb076 timeout :180s + Zen memory 90s 2024-03-08 14:31:24 +01:00
fred 692f37bd4c Hardening GeoKeys ZEN memory system 2024-03-08 14:29:58 +01:00
fred 4899de4e68 --import ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json "application/json" 2024-03-08 13:24:15 +01:00
fred ec68072cc1 /ipns/${UMAPNS} 2024-03-08 13:07:26 +01:00
fred 7d3ebe6e34 more precise 2024-03-07 22:44:11 +01:00
fred c70982d333 UPLANET:UWISH:${PLAYER}:/ipfs/${MYWISHFLUX} 2024-03-07 22:20:15 +01:00
fred 218ffa0095 Add SECTOR/TWs 2024-03-07 21:52:07 +01:00
fred e955023b24 [days[-1]] External URL loading filter (https://talk.tiddlywiki.org/t/can-tiddlywiki-read-external-tiddlers-from-url-parameter/9204/28) 2024-03-07 20:27:25 +01:00
fred 431d54d1ae GPS.json format adaptation 2024-03-07 18:59:59 +01:00
fred a323db6c82 Add PaperClip action on"is_volatile" Tiddlers 2024-03-07 15:00:16 +01:00
fred 7987449290 log clarify 2024-03-07 11:35:39 +01:00
fred 4c6051e800 ${MY_PATH}/../tools 2024-03-07 11:31:20 +01:00
fred 899add82b9 /QR.png "$G1PUB" ## Check by VISA.print.sh 2024-03-07 11:01:51 +01:00
fred 962e273916 Arrrgggg [] and {} json 2024-03-06 22:35:35 +01:00
fred 3c4e5a5ff8 fix 2024-03-06 20:16:55 +01:00
fred a0b81691c1 la butinerie 2024-03-06 18:06:14 +01:00
fred d0013000e2 ! -s ~/.zen/game/myswarm_secret = refresh key 2024-03-06 15:29:39 +01:00
fred 991149a3ca CESIUM Tiddler iframe 2024-03-06 15:06:49 +01:00
fred 11f1995ea1 + -e "s~_PLAYER_~${PLAYER}~g" \ 2024-03-06 15:06:06 +01:00
fred 4b956fe62e + --import ~/.zen/tmp/${MOATS}/CESIUM.json "application/json" \ 2024-03-06 15:05:50 +01:00
fred de92f38788 GPS.json update with sectortw External Load 2024-03-06 14:34:52 +01:00
fred bac8936d00 Exemple Load G1Kodi 2024-03-06 02:59:15 +01:00
fred a3fd0e877f LAT LON 2024-03-06 02:55:40 +01:00
fred 3c91a43698 LOAD EXTERNAL 2024-03-06 02:36:14 +01:00
fred 1c8b16a9de Do not run if no player 2024-03-06 02:00:49 +01:00
fred 8be2fb525b Add CESIUM App iframe Tiddler 2024-03-06 01:55:54 +01:00
fred 3d663012f9 best order 2024-03-05 20:57:38 +01:00
fred b1cdea1508 EXTERNAL_SECTORNEWS ready ?! 2024-03-05 19:48:48 +01:00
fred e93770bc66 New TW model can load Tiddlers from external sources !! GREAT FLEXIBLE UX 2024-03-05 16:16:43 +01:00
fred c7bd474922 ameliorations 2024-03-05 12:26:45 +01:00
fred 2ee5f66b5c UMAP ACCOUNT 2024-03-05 03:53:46 +01:00
fred 3233d8d6e4 GRATITUDE ${GRATITUDE} to UMAP_${LAT}_${LON} WALLET 2024-03-05 03:49:59 +01:00
fred 712e0303cf myAPI="https://ipfs.$(myHostName)/5001" 2024-03-05 03:02:34 +01:00
fred 1e9cf9aeac fix 2024-03-05 02:30:21 +01:00
fred d3da9a6455 echo "
/|               /\\
                 /^^^/ |^\Z           /  |
                |         \Z         /   |
                / @        \Z       /   / \_______
   (  \      _ /            \Z     /   /         /
 (     ---- /G       |\      |Z   /   /         /
  (  / ---- \    /---'/\     |Z  /   /         /
             \/--'   /--/   /Z  /             /
              |     /--/   |Z  /            / \_______
             /     /--/    |Z  \           /         /
          --/     /--/     \Z   |         /         /
           /     /--/       \Z  /                  /
                |--|         \Z/                  /
                |---|        /              /----'
                 \---|                     /^^^^^^^^^^^^\Z
                  \-/                                    \Z
                   /     /        |                       \Z
               \---'    |\________|      |_______          |Z
             \--'     /\/ \|_|_|_||      |_|_|_|_|\_       |Z
              '------'            /     /  /      |_       /Z
                              \---'    |  / ``````        /Z
                            \--'     /\/  \ _____________/Z
                             '------'      \

"
2024-03-04 22:44:19 +01:00
fred 61cb2f34b1 "${title::3}" == '$:/' 2024-03-04 21:33:53 +01:00
fred 1862bf1492 filter system tiddler : ${title::3} == '$:/' 2024-03-04 21:33:30 +01:00
fred 79f832bdfe + Saq's plugin 2024-03-04 16:14:12 +01:00
fred 8829baf8ad juste realize IPFS add / publish <=> GIT add / commit / push without a 3rd party 2024-03-04 16:13:11 +01:00
fred ee9b3c3858 TWUPLANET + External URL from Saq's plugin repository 2024-03-04 16:10:44 +01:00
fred bd27f1b698 multitail : Extension of tail. More information: https://manned.org/multitail. 2024-03-04 12:52:47 +01:00
fred eff345b7b3 use LOW param to disable ipfs daemon in the day time 2024-03-04 12:49:25 +01:00
fred d84d9ce1f4 get abroad gchange ads - filter inactive 2024-03-04 12:33:42 +01:00
fred 3cd2e186c2 display logs + UPlanet UPbutton + Maya Kin 2024-03-04 12:11:16 +01:00
fred 41cb844f32 plays kin sound 2024-03-03 13:05:09 +01:00
fred 4128344e8e PLAYER send GRATITUDE to UMAP for refreshing VOEUX 2024-03-03 11:32:35 +01:00
fred c208e403f0 "__PLAYER_.tiddlers.rss.json" is created during VOEUX.refresh.sh 2024-03-03 11:08:40 +01:00
fred 77e0144a00 show date 2024-03-03 10:59:40 +01:00
fred 61bf1b9a04 ouep 2024-03-02 22:39:22 +01:00
fred 3c306690e6 ### STOP ASTROPORT DURING 20H12 UPDATE ### 2024-03-02 22:12:57 +01:00
fred 69731ff435 ---- SWARM COMMUNICATION BROKEN / RESTARTING IPFS DAEMON ---- 2024-03-02 22:11:33 +01:00
fred 4d784941bc annoncez votre score GameShell pour un bonus de +1 à +3 2024-03-02 20:29:30 +01:00
fred 766fd6dc79 TODO: Maya Kin calculation for PLAYER date of birth 2024-03-02 18:47:53 +01:00
fred a2990e9420 TODO: Maya Kin calculation for PLAYER date of birth 2024-03-02 18:00:08 +01:00
fred 0ea7169bac compare INSIDE.json and NEW.json 2024-03-02 09:55:51 +01:00
fred 5cc3fcff4a /| /\
/^^^/ |^\Z           /  |
                |         \Z         /   |
                / @        \Z       /   / \_______
   (  \      _ /            \Z     /   /         /
 (     ---- /G       |\      |Z   /   /         /
  (  / ---- \    /---'/\     |Z  /   /         /
             \/--'   /--/   /Z  /             /
              |     /--/   |Z  /            / \_______
             /     /--/    |Z  \           /         /
          --/     /--/     \Z   |         /         /
           /     /--/       \Z  /                  /
                |--|         \Z/                  /
                |---|        /              /----'
                 \---|                     /^^^^^^^^^^^^\Z
                  \-/                                    \Z
                   /     /        |                       \Z
               \---'    |\________|      |_______          |Z
             \--'     /\/ \|_|_|_||      |_|_|_|_|\_       |Z
              '------'            /     /  /      |_       /Z
                              \---'    |  / ``````        /Z
                            \--'     /\/  \ _____________/Z
                             '------'      \
2024-03-01 20:24:49 +01:00
papiche e4428cc3a3
Merge pull request #89 from gabrielcancel/master
first blockchain implementation
2024-03-01 19:27:21 +01:00
papiche c0333f9b28
Merge pull request #90 from gaetancorin/master
add blockchain python on gc space
2024-03-01 19:27:03 +01:00
papiche 8e6625ef3d
Merge pull request #91 from Jean-bouger/master
My description
2024-03-01 19:26:47 +01:00
papiche 39ede01263
Merge pull request #80 from FaycoTLS/master
kristofer rumeau
2024-03-01 19:24:17 +01:00
papiche 4910495491
Merge branch 'master' into master 2024-03-01 19:24:06 +01:00
fred 13c839b3ea mieux 2024-03-01 16:45:34 +01:00
Jean-bouger 8d5bb0de98
Merge branch 'papiche:master' into master 2024-03-01 16:29:57 +01:00
gaetancorin 80931e495b add blockchain python on gc space 2024-03-01 16:28:55 +01:00
vboxuser 5b35ffb40e me 2024-03-01 16:25:55 +01:00
NathanPzi d876cdc290 Merge remote-tracking branch 'refs/remotes/origin/master' 2024-03-01 16:20:47 +01:00
NathanPzi 1e459a8133 LA CHAINE 2024-03-01 16:15:45 +01:00
NathanPzi fd46c28fba LACHAINE 2024-03-01 16:12:57 +01:00
gabriel cancel b8868e39d3 first blockchain implementation 2024-03-01 16:11:30 +01:00
fred c99d25ce36 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-03-01 11:58:29 +01:00
papiche 92b9389fd6
Merge pull request #86 from anatolethien/master
information
2024-03-01 11:58:20 +01:00
papiche 12a7958ea8
Merge pull request #87 from gabrielcancel/master
fix:  missing exception and unused import
2024-03-01 11:57:34 +01:00
gabriel cancel 2f07c5976b fix: missing exception and unused import 2024-03-01 11:50:40 +01:00
anatolethien 79c4ef0db9
. 2024-03-01 11:34:39 +01:00
fred 49d53e8120 natools 2024-03-01 10:38:34 +01:00
fred 5fcaddfc85 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-03-01 10:37:57 +01:00
papiche 120294a5b6
Merge pull request #85 from gabrielcancel/master
add student
2024-03-01 10:36:27 +01:00
gabriel cancel 9c37df8494 add student 2024-03-01 10:30:10 +01:00
papiche 9f367f7101
Merge pull request #81 from gaetancorin/master
update gc
2024-03-01 10:29:53 +01:00
papiche 31a3924b2d
Merge pull request #82 from lou0608/master
Test Update LD
2024-03-01 10:29:42 +01:00
papiche 179140427b
Merge pull request #83 from Fabien-Vidor/master
Update Fabien
2024-03-01 10:29:30 +01:00
papiche 600dab43b1
Merge pull request #84 from Pell6631/master
add my dir
2024-03-01 10:29:18 +01:00
Fabien-Vidor 5b5190b1fd
Merge pull request #1 from Fabien-Vidor/Fabien-Vidor-patch-1
Create Me
2024-03-01 09:32:24 +01:00
AMARSILLE 421c160af1 add my dir 2024-03-01 09:28:35 +01:00
lou0608 114b849a2d
Merge branch 'papiche:master' into master 2024-02-29 19:43:52 +01:00
gaetancorin f6fff6d50c
Merge branch 'papiche:master' into master 2024-02-29 19:42:41 +01:00
tess 7a1660e91d Test Update LD 2024-02-29 19:41:20 +01:00
gaetancorin a49f41eb48 update gc 2024-02-29 19:41:19 +01:00
fred 26776d1c54 cosmetics 2024-02-29 14:20:39 +01:00
fred 2d8dc171aa fix 2024-02-29 02:57:24 +01:00
fred 332f0f2880 HPASS also stored in Astroport Tiddler (and AstroID, but can be deleted) 2024-02-29 01:48:15 +01:00
fred d2e7963b7d clean the mess 2024-02-28 23:25:24 +01:00
fred b1ddcc1747 ~/.zen/tmp/${MOATS}/${UMAP}.dunikey 2024-02-28 23:18:15 +01:00
fred d1394d5332 was ipfs private key format, must be dunikey 2024-02-28 23:17:19 +01:00
fred 134f219fa9 WELCOME MESSAGE 2024-02-28 01:45:32 +01:00
fred dceffe0229 REGION.refresh.sh publish JOURNAL (no 12 signatures tiddlers applyed yet) 2024-02-28 00:05:23 +01:00
fred c53c0dfc3a https://chat.openai.com/share/caa4bea2-3acb-46bc-af37-104d608e6a83 2024-02-28 00:03:44 +01:00
fred ae7a2ea964 [] debug 2024-02-27 23:46:23 +01:00
fred 909219a73a Dynamic Boostrap WoT and other change that can make the world better 2024-02-27 21:03:22 +01:00
fred f33c4d04dd Terminal can adapt to LAN (http), ♥Box and WAN (https) 2024-02-27 21:01:30 +01:00
fred 605d66b913 $isLAN or NOT (local ssl) and $(zIp) - remote ssl - 2024-02-27 20:48:07 +01:00
fred 3d76bd5243 Set Access-Control-Allow-Origin :: ---->>>> PUT "IP" in "~/.zen/♥Box" <==> "allow Zen Station remote access" 2024-02-27 16:43:26 +01:00
fred c508c7cb0a ZCHK= 2024-02-27 13:47:44 +01:00
fred 9a266c583d bug 2024-02-27 13:42:14 +01:00
fred 4989583264 IPFSNODEID _index.html 2024-02-27 03:21:49 +01:00
fred 911576a24c 7 2024-02-27 03:17:51 +01:00
fred 2de86d120c bugs & fix 2024-02-27 03:12:15 +01:00
fred 747f3d5b16 fix different case 2024-02-27 02:27:48 +01:00
fred 8c9ce2c3dd NEW {} & INSIDE [{}] 2024-02-27 02:03:29 +01:00
fred bfaa5bbe2b ${signatures} -gt ${gloops} :: send gratitude for > 1 signature tiddler (copied at least once) 2024-02-27 00:25:17 +01:00
fred 37311e89f1 fix 1 2024-02-26 22:59:54 +01:00
fred a411d9c516 Bug 2 2024-02-26 22:49:41 +01:00
fred a773872558 bug 1 2024-02-26 22:44:43 +01:00
fred 81e7930e1a Upgrade TW model to 5.3.3 external core 2024-02-26 20:19:34 +01:00
fred 7e299e905e Povide DRAGONs GPS listing API 2024-02-26 18:17:44 +01:00
fred 0d0d1c947e UPlanet "Zen" stations can become "Dragons" when applying "high security keygen procedure" and join "WoT" 2024-02-26 18:10:53 +01:00
FaycoTLS 6154d5ca0a réglage de bugs 2024-02-26 13:07:24 +01:00
fred c6bce9a13b INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${UMAPROOT}" 2024-02-26 12:52:21 +01:00
fred 80302af0f5 P4N template : Display Umap POI over openstreetmap.org (used by RUNTIME/UPLANET.refresh.sh) 2024-02-26 12:09:54 +01:00
fred 5a19b71d02 Install IPFS kubo_v0.20.0 LINUX for arm arm64 & amd64 2024-02-26 12:06:59 +01:00
fred 4831125504 INTERCOM - ZEN._ZONE_.memory.sh 2024-02-26 12:05:08 +01:00
fred 1c85b79dbe show wallets & p4n 2024-02-26 05:22:15 +01:00
fred daaaf455d7 first PLAYER fix 2024-02-26 04:25:03 +01:00
fred 6bbf606c02 UMAP TODATENS k51q... format 2024-02-26 02:59:59 +01:00
fred 6bc90788c8 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-02-26 02:56:50 +01:00
fred 96d7215b57 yop 2024-02-26 02:56:37 +01:00
fred 143c60d139 warp it 2024-02-26 00:16:19 +01:00
papiche 3944b28305
Merge pull request #79 from Ant0n10x78/master
Ajout dossier antonio.gernacaleixo@ynov.com
2024-02-25 23:43:39 +01:00
fred 3afec1738a table 2024-02-25 21:15:11 +01:00
fred 58df7898f3 📺 <=> SECTOR TW 2024-02-25 20:44:10 +01:00
fred c8353f69ad Internet Ŋ1 2024-02-25 20:40:06 +01:00
fred 12b8d50303 Node Weather 2024-02-25 20:30:44 +01:00
fred 5643f79535 weather conditions 2024-02-25 20:29:05 +01:00
fred ea7ba67add +++ ~/.zen/tmp/${IPFSNODEID}/weather.txt +++ 2024-02-25 20:07:49 +01:00
fred 066710056b REAME 2024-02-25 19:47:55 +01:00
fred a3acca4f94 | ipfsnodeid | Clef publique, balise de la station | 2024-02-25 19:45:56 +01:00
fred 863aa4add4 Keep UPlanetKeys flashmem updated 2024-02-25 19:38:48 +01:00
fred c44839ae38 DOCKER : compatible docker + APY : python micro services - IA services coming... 2024-02-25 19:26:43 +01:00
fred c921b12b87 # my_IPCity # Fonction pour récupérer la géolocalisation à partir de l'adresse IP 2024-02-25 18:30:04 +01:00
fred 8fb5a09f86 Introduce INTERCOM comment. Zen SECTOR memory sync = better UPlanet SECTOR.refresh conservation 2024-02-25 17:35:37 +01:00
fred 5394fd2f75 spread UPlanet TODATE Keys among stations (mean refresh every 3h) 2024-02-25 15:35:54 +01:00
fred b6af41c9ee REMOVING ${znod} FROM SWARM 2024-02-25 14:39:37 +01:00
fred ca18c6912e clean > 3h UPlanetKeys - flashmem multi refresh - 2024-02-25 14:34:06 +01:00
fred e467e49980 f 2024-02-25 05:23:55 +01:00
fred 0004d449e2 PING BOOSTRAP> /dev/null 2>&1 2024-02-25 05:21:36 +01:00
fred bf5e117fc1 miam 2024-02-25 05:18:14 +01:00
fred c681b66728 fixing 2024-02-24 12:33:46 +01:00
fred c93ef5ba34 NO $i PARAMETERS - GET ALL UMAPS 2024-02-24 11:26:07 +01:00
fred f561134897 TODATEREGIONNS _UPUPZONENS_ 2024-02-24 02:40:08 +01:00
fred c2cddee226 socat
https://www.morch.com/2011/07/05/forwarding-snmp-ports-over-ssh-using-socat/

Socat est utile pour connecter des applications à l'intérieur de boîtes distinctes. Imaginons que nous ayons une boîte A et une boîte B, et qu'à l'intérieur de la boîte A tourne une application de serveur de base de données. De plus, la boîte A est fermée au public, mais la boîte B est ouverte. Notre réseau autorisera une connexion de la boîte B à la boîte A.

Supposons maintenant qu'un utilisateur veuille lire le journal de la base de données. Nous ne voulons pas que l'utilisateur entre dans la boîte A, mais nous sommes d'accord pour qu'il entre dans la boîte B.

Socat peut connecter le journal de la base de données dans la boîte A à un lecteur de texte dans la boîte B. Ainsi, l'utilisateur peut lire le journal dans la boîte B. Nous ne devons pas compromettre la sécurité de la boîte A pour que l'utilisateur puisse faire son travail.

Socat peut fonctionner dans les deux sens. L'utilisateur de la boîte B peut vouloir envoyer des requêtes de base de données à l'application du serveur de base de données de la boîte A. Ensuite, l'application du serveur de base de données peut renvoyer le résultat à l'utilisateur de la boîte B. Socat prend également en charge la communication bidirectionnelle.
https://www.baeldung.com/linux/socat-command
2024-02-24 02:17:13 +01:00
fred 8687b76751 Ciao 2024-02-24 01:40:49 +01:00
fred 4306bb03b6 clean 2024-02-24 01:38:46 +01:00
fred e53d7c70d3 p4n + wallets 2024-02-24 01:16:47 +01:00
fred c253cae4d0 Open JOURNAL in md.html viewer : /ipfs/QmYNH85cJCwSVw4c7SyHtc2jtgh7dL5RegozX7e8Re28a9/md.htm?src=/ipfs/${RWEEKCID} 2024-02-24 00:07:08 +01:00
fred 98600faf81 LOG OUTPUT : exec 2>&1 >> ~/.zen/tmp/mailjet.log 2024-02-23 23:49:21 +01:00
fred 9bf2a4b1a8 my.sh path error 2024-02-23 23:44:33 +01:00
fred f8d2b3307f BOOSTRAP DISTRIBUTED (jeu du mouchoir, token ring aléatoire) 2024-02-23 23:40:07 +01:00
fred 80d9d385e9 Zen station CONSOLE 2024-02-23 23:39:54 +01:00
fred a0fdaf6e62 ; bug 2024-02-23 22:10:10 +01:00
fred 055e66c79f del 2024-02-23 16:12:49 +01:00
papiche 7bedcc05eb
Merge pull request #77 from NathanPzi/master
Ajout Nathan
2024-02-23 16:12:03 +01:00
Nathan Piazzi 026ce41b6b
Merge branch 'papiche:master' into master 2024-02-23 15:41:24 +01:00
NathanPzi 9675f50ea0 Nathan 2024-02-23 15:40:47 +01:00
= 46883dd838 add me.md 2024-02-23 15:37:57 +01:00
Fabien-Vidor e01bcd05d2
Create Me 2024-02-23 14:55:32 +01:00
NathanPzi bad7e7bd39 coucou 2024-02-23 10:58:08 +01:00
papiche aed0809785
Update readme 2024-02-23 10:52:53 +01:00
fred 15b96181ec BLOCKCHAIN SHARED REPO 2024-02-23 09:08:05 +01:00
fred 628e4a9e5c BLOCKCHAIN SHARED REPO 2024-02-23 09:02:02 +01:00
fred d28c1d0734 Boostrap SSH Dragons WOT 2024-02-23 00:19:33 +01:00
fred 3c7bdc278c ttp-equiv 2024-02-23 00:01:56 +01:00
fred 29a55e25f2 work better 2024-02-22 23:55:03 +01:00
fred 5fe84e4c76 debuggg 2024-02-22 23:50:23 +01:00
fred 3006bc8deb gloops 2024-02-22 23:45:43 +01:00
fred 84b544f978 re arrange better 2024-02-22 23:34:01 +01:00
fred becbc20b73 fix empty JOURNAL 2024-02-22 23:30:13 +01:00
fred 8b10839328 DRAGONS WOT off/on 2024-02-22 23:19:44 +01:00
fred 0b2870f3b9 ## Fill LNK - Tiddler - escape \& 2024-02-22 23:17:07 +01:00
fred c15bb02b10 coquille 2024-02-22 22:46:04 +01:00
fred 9d82cc493e renaming 2024-02-22 22:39:33 +01:00
fred a4293b20b8 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-02-22 22:37:34 +01:00
fred b5c5906321 minetest... finish by installing minetest game with docker exec 2024-02-22 22:37:20 +01:00
papiche ba41be7f2d
Merge pull request #75 from Anais031/patch-1
Create start.sh
2024-02-22 21:10:08 +01:00
fred 5497d86c21 hidden room activate after specific action 2024-02-22 21:06:10 +01:00
fred c9575a9ffa correct 2024-02-22 20:40:34 +01:00
fred ffff6c59e2 z_ssh.pub means "Dragon" = "PGP/SSH/IPFS" keygen ready 2024-02-22 20:39:55 +01:00
fred 7e5859c8ba [[ ${PLAYERONE[@]} == "" ]] && echo "EMPTY ASTROPORT - NO PLAYER - NO PUBLISHING" && continue 2024-02-22 20:39:01 +01:00
Anais031 b6bb2c2601
Create start.sh
Ajout jeu Anais Dupin
2024-02-22 20:25:45 +01:00
fred eb2b29f0b1 md reader page for displaying REGION JOURNAL 2024-02-22 19:05:09 +01:00
papiche c1f5fae6e7
Merge pull request #70 from draken555/master
Leber kévin
2024-02-22 18:22:53 +01:00
papiche fe0f693dc2
Merge pull request #68 from Thiam-moussa/master
Moussa_Thiam_modif
2024-02-22 18:22:24 +01:00
fred f55768249a remove cache if ipfs get failed 2024-02-22 17:14:40 +01:00
fred 12f2883b07 insist 180s and keep cache 2024-02-22 16:08:24 +01:00
Ant0n10x78 9f52166d17
Merge branch 'papiche:master' into master 2024-02-22 15:47:49 +01:00
fred eb30e49b70 sed -i='' bug was here 2024-02-22 15:22:48 +01:00
Ant0n10x78 117cbe65f2
Merge branch 'papiche:master' into master 2024-02-22 14:45:03 +01:00
Ant0n10x78 f25c1d03d1 change directory name 2024-02-22 14:42:02 +01:00
fred 5df64847ea transformer.js / api.py 2024-02-22 12:48:26 +01:00
fred 8fc9f46aac simplify 2024-02-21 22:54:10 +01:00
fred f15d3d947a not ME 2024-02-21 22:02:00 +01:00
fred e2772ac2c8 not ME 2024-02-21 22:00:56 +01:00
fred 81fda26724 clean game 2024-02-21 19:52:47 +01:00
fred 7a20666c6d echo "TODAY UPlanet landings" 2024-02-21 18:25:53 +01:00
fred 1d5e35bcee Seek UPlanet local & swarm KEYS 2024-02-21 15:18:09 +01:00
fred 015d01e769 [[ $? == 0 ]] && medo=$((medo +1)) 2024-02-21 15:04:44 +01:00
fred 1b65a0a0f9 :: TRICK :: EXECUTE LAST VISA.new.sh output LINE : export above VARs 2024-02-21 14:58:11 +01:00
fred 699b65962b +################################################ LAST LINE REPORT VALUES TO CALLING SCRIPT | tail -n 1 2024-02-21 14:49:13 +01:00
fred 93ac6daa8e ${MY_PATH}/ping_bootstrap.sh 2024-02-21 13:59:28 +01:00
fred 17dca2cafc UPlanet KEYS Flash Mem process 2024-02-21 13:54:34 +01:00
fred c2e9655e75 Good Sync Fork to All 2024-02-20 19:16:24 +01:00
fred e56956da3a /ipns/${TODATENS} 2024-02-19 16:27:02 +01:00
papiche d203840d03
Merge pull request #66 from Sanklote/master
script install nextcloud v2
2024-02-19 15:48:27 +01:00
anto 0ce75a3fdb script installation nextcloud V2 2024-02-19 15:45:25 +01:00
anto 5e72580c14 script installation nextcloud V2 2024-02-19 15:41:47 +01:00
papiche 91cc00bdea
Merge pull request #65 from Sanklote/master
script installation nextcloud
2024-02-19 14:58:03 +01:00
anto 2a6c094602 script installation nextcloud 2024-02-19 14:56:26 +01:00
fred e9ae6773cb chemin absolu MY_PATH/games 2024-02-19 14:51:00 +01:00
papiche 996784b951
Merge pull request #63 from Haaze9/master
Update
2024-02-19 14:23:06 +01:00
milla ea53f879cb Update 2024-02-19 13:49:07 +01:00
papiche 3e19a53ab5
Merge pull request #62 from Haaze9/master
GDA
2024-02-19 13:45:59 +01:00
milla 4b5a3541ee update 2024-02-19 13:43:03 +01:00
Haaze9 45d7dfff71
Merge branch 'papiche:master' into master 2024-02-19 13:41:37 +01:00
papiche af1f9b40aa
Merge pull request #61 from kholius/master
add: moi.sh
2024-02-19 13:39:49 +01:00
fred 4426278983 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-02-19 13:37:44 +01:00
fred 75d1c5f401 filter TW templates 2024-02-19 13:37:08 +01:00
kholius 1cdffe8387 add: moi.sh 2024-02-19 13:36:11 +01:00
papiche a010e9bab5
Merge pull request #60 from ershad-ra/master
supprimer
2024-02-19 12:34:02 +01:00
ershad.ramezani e1e87ced54 supprimer 2024-02-19 12:33:08 +01:00
papiche 2090d3f3ec
Merge pull request #59 from ershad-ra/master
new-folder
2024-02-19 12:30:33 +01:00
papiche 99eb4f8d5b
Merge pull request #58 from 0xs4yk/master
maxence lancosme
2024-02-19 12:30:17 +01:00
Ershad Ramezani f15a11e159
Merge branch 'papiche:master' into master 2024-02-19 12:30:02 +01:00
ershad.ramezani 96f2a17293 Merge branch 'master' of github.com:ershad-ra/Astroport.ONE 2024-02-19 12:29:06 +01:00
ershad.ramezani eb921650c7 new-folder-ershad 2024-02-19 12:28:29 +01:00
scripting 0559d23ec9 maxence lancosme 2024-02-19 12:28:15 +01:00
papiche 830b609899
Merge pull request #57 from quaktuss/master
Add mathieu.pheron@ynov.com
2024-02-19 12:27:52 +01:00
papiche 3ce72ce054
Merge pull request #48 from ershad-ra/master
create_ershad
2024-02-19 12:27:22 +01:00
qaktuss f1b8e5f4b1 Add mathieu.pheron@ynov.com 2024-02-19 12:27:15 +01:00
papiche 89ef6a5ef3
Merge pull request #49 from 0xs4yk/master
maxence lancosme
2024-02-19 12:27:05 +01:00
papiche 7682fc5179
Merge pull request #50 from eNS0c/master
add name
2024-02-19 12:26:53 +01:00
papiche ccc389c07c
Merge pull request #52 from GL0WIK/master
Upload Fichier.txt
2024-02-19 12:26:32 +01:00
Ershad Ramezani 49c29bd50a
Merge branch 'papiche:master' into master 2024-02-19 12:26:24 +01:00
papiche 2afb31a788
Merge pull request #53 from GSYnov/master
guillaume.sipra@ynov.com
2024-02-19 12:26:21 +01:00
papiche d553ac1034
Merge pull request #54 from SayTeK-Damien/master
Damien Khadir
2024-02-19 12:26:09 +01:00
papiche 5d256d000c
Merge pull request #55 from Sanklote/master
team jul
2024-02-19 12:25:57 +01:00
papiche 71e2ae764e
Merge pull request #56 from MaximeCaparros/master
ajout de MC
2024-02-19 12:25:09 +01:00
papiche d7a39a1862
Merge pull request #51 from ClotildeJa/master
test
2024-02-19 12:24:23 +01:00
mcaparros e479a68641 Ajout mc 2024-02-19 12:22:57 +01:00
milla e8fb53a180 gda 2024-02-19 12:22:14 +01:00
SayTeK 89f639b7cb
Merge branch 'papiche:master' into master 2024-02-19 12:20:47 +01:00
papiche d76b233556
Merge pull request #47 from quaktuss/master
Add sudo in unistall.sh
2024-02-19 12:13:01 +01:00
qaktuss 03abe9de3c Add sudo 2024-02-19 12:09:51 +01:00
debian 8cbf0c5310 test 2024-02-19 11:33:18 +01:00
anto cb1f100acb test 2024-02-19 11:33:14 +01:00
Dorito 4db6026549 add name 2024-02-19 11:28:40 +01:00
mcaparros 745d651325 add dossier mc 2024-02-19 11:27:34 +01:00
ershad.ramezani 6c5322bcb8 create_ershad 2024-02-19 11:23:50 +01:00
damien.khadir a1b5f8a246 Damien 2024-02-19 11:16:46 +01:00
scripting 8fc48dcbc1 maxence lancosme 2024-02-19 11:16:13 +01:00
Rémi Montagut 0c62b841d4 Upload Fichier.txt 2024-02-19 11:14:45 +01:00
user fc8fd3cf5c test 2024-02-19 11:10:31 +01:00
fred dbcc503225 infra - accounts 2024-02-19 10:58:38 +01:00
fred 837b9aaaa8 Explore Swarm World last TODATE keys 2024-02-17 15:34:47 +01:00
fred 80d331029e /ipns/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html
/ipns/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}/_index.html
/ipns/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/_index.html
2024-02-17 13:56:32 +01:00
fred 15bd82b2f7 move REGIONS and SECTORS into UPLANET/ 2024-02-17 13:12:37 +01:00
fred 84a04ab62d HACKGIPFS 2024-02-16 19:16:40 +01:00
fred 916f119a09 ${MY_PATH}/ping_bootstrap.sh 2024-02-16 13:07:53 +01:00
fred 6a48b90128 20h12.txt 2024-02-15 19:26:07 +01:00
fred 51a769cc9d [[ -s ~/.zen/game/players/.current/GPS.json ]] && echo LAT= 2024-02-15 19:22:03 +01:00
fred 9887e2eb66 Install then manually activate your Astroport Station 2024-02-15 18:46:06 +01:00
fred 965fec5951 UX 2024-02-15 18:35:29 +01:00
fred 9f875876a7 ♥BOX READY ? 2024-02-15 18:27:13 +01:00
fred 313e1a2d6c SWARM 3 DAYS OLD CLEANING 2024-02-15 18:07:23 +01:00
fred 98769ed48a PHONEBOOTH &record option 2024-02-15 17:39:41 +01:00
fred 9042e54ab3 upgrade CESIUM & VDO.NINJA 2024-02-15 16:07:01 +01:00
fred 7181149511 caching JSON 2024-02-15 15:20:27 +01:00
fred 49fa403354 List visited UPlanet ZONE 2024-02-15 14:53:26 +01:00
fred 03ec5b072c VDONINJA _IPFSNINJA_ 2024-02-15 01:47:40 +01:00
fred 3200133cc9 correct 2024-02-14 22:56:38 +01:00
fred 1c2979231a ${THEDATE} 2024-02-14 21:35:24 +01:00
fred f12cf474bf PLAYER UNPLUG procedure 2024-02-14 19:36:37 +01:00
fred 5fb54b2287 Add favicon from the web2.0 you wish to copy to WEB3 2024-02-14 19:29:30 +01:00
fred ceaedaa4be This directory contains "ASTROBOT" programs templates 2024-02-14 19:25:02 +01:00
fred 774363089b (✜‿‿✜) G1PalPay : CHECK LAST 10 TX comment seeking for e@mail or N1Program: 2024-02-14 19:00:02 +01:00
fred a8ab380a94 reworked 2024-02-14 18:51:39 +01:00
fred d6467e159a CACHE ACTIVATION : ~/.zen/tmp/ZONE_$LAT_$LON_$DEG.json 2024-02-14 15:38:40 +01:00
fred 7a88b9fc72 scan & connect 2024-02-14 15:08:30 +01:00
fred 97677b4024 PING & CONNECT to Boostrap && /swarm/* 2024-02-14 15:04:48 +01:00
fred 052ec4e539 clearest verbosity 2024-02-14 13:52:25 +01:00
fred a96508cbab RSS2UPlanetSECTORTW - TRANSFER SIGNED TIDDLER IN SECTOR TW 2024-02-13 23:57:25 +01:00
fred dc205f29ca RSS2UPlanetSECTORTW - TRANSFER SIGNED TIDDLER IN SECTOR TW 2024-02-13 23:57:05 +01:00
fred f37ce3edca 🗺 2024-02-13 23:29:50 +01:00
fred bc64e703f2 mysh 2024-02-13 23:01:50 +01:00
fred 2a779f63dd space in logs 2024-02-13 22:46:20 +01:00
fred 0fdd37e43c refreshing UMap DApp page 2024-02-13 22:44:58 +01:00
fred c188f6b194 DRAGONS linked with id_ed25519.pub 2024-02-13 19:56:43 +01:00
fred d11e07eb10 vvv 2024-02-13 19:55:56 +01:00
fred dd76dcbc5b _index.html twik 2024-02-13 03:00:25 +01:00
fred 86f388a633 key rm OR NOT key rm 2024-02-13 02:44:17 +01:00
fred e787072f21 DEBUG MODE 2024-02-13 02:36:37 +01:00
fred 98a02cddb3 2>/dev/null 2024-02-13 02:31:18 +01:00
fred 2755277ffa ## MAKE SECTOR DATA VISIBLE ## 2024-02-13 02:13:09 +01:00
fred b591656c30 send SALT/PEPPER 2024-02-13 02:07:19 +01:00
fred a6c491ac2d UPlanet : ZenCard & AstroID maker 2024-02-12 22:30:59 +01:00
fred 622d5e3fda fine tuning 2024-02-12 21:54:00 +01:00
papiche 53ad40b1e0
Merge pull request #45 from Janick974000/master
update
2024-02-12 17:11:24 +01:00
fred 2be174d251 SOLVE INITIALISATION CONFLICT 2024-02-11 20:52:01 +01:00
fred 79c596ce0e better log... 2024-02-11 20:47:20 +01:00
fred 801ea1c9f5 DRAGON_p2p_ssh.sh 2024-02-11 20:30:43 +01:00
fred d06892c791 export PATH=$HOME/.local/bin:$PATH 2024-02-11 20:05:23 +01:00
fred 3833963b26 DRAGON WOT ACTIVATED 2024-02-11 19:46:02 +01:00
fred 58f7ae6bb4 default TW modification 2024-02-11 16:57:10 +01:00
fred bec8748886 add silkaj 2024-02-11 14:39:12 +01:00
fred b520f49762 Sector RSS find debug 2024-02-11 14:29:42 +01:00
janick 941592ce44 update 2024-02-11 14:24:40 +01:00
fred b4b1880085 REGIONAL ♥BOX 2024-02-11 14:11:41 +01:00
fred b09b7704bf /ipns/ or not /ipns/ 2024-02-11 13:54:46 +01:00
fred 99854c9cb9 no speak 2024-02-11 13:48:26 +01:00
fred a5ec8c8678 message to PLAYER 2024-02-11 13:43:21 +01:00
fred 2562dd6294 READY FOR DEMAINDATE 2024-02-11 13:38:33 +01:00
fred 7e6268d0c5 GPS UMAP LINK UPDATE 2024-02-11 03:06:29 +01:00
fred f43c476ab4 /ipns/$IPFSNODEID/x_ssh.sh 2024-02-11 02:38:35 +01:00
fred 1664e4cbd0 Make Station publish SSH port on "/x/ssh-$(IPFSNODEID)" 2024-02-11 02:36:33 +01:00
fred 99d44c8291 && ipfs key rm ${TODATE}${G1PUB} ${YESYERDATE}${G1PUB} ${G1PUB} \ 2024-02-11 02:15:15 +01:00
fred a656913db8 X 2024-02-11 02:06:31 +01:00
fred edb0fee3a9 default 0.00 2024-02-11 01:56:43 +01:00
fred 678e9cafdf Tiddler with same title is existing in ${unique_combined[*]} TW(s) 2024-02-10 22:04:06 +01:00
fred ec4186f9ee Tiddlers from FRIENDS with same wishes are signed & copied into PLAYER TW 2024-02-10 21:58:31 +01:00
fred 6fbb42a3d3 SECTOR App template 2024-02-10 21:10:34 +01:00
fred c533e1c8a6 EXTEND PATH .local/bin 2024-02-10 20:58:40 +01:00
fred b5fa8ad10b REMOVE errors espeak zenity 2024-02-10 20:45:17 +01:00
fred 1d394616ae + -e "s~_ZONEIPFS_~${ZCHAIN}~g" \ 2024-02-10 20:28:38 +01:00
fred 2073e80de4 leading zero removed 2024-02-10 20:17:38 +01:00
fred 9d9d0e722e export PATH=$PATH:$HOME/.local/bin
CHROME_EXECUTABLE=/usr/bin/chromium
2024-02-10 17:47:31 +01:00
fred 64172434f7 precise 2024-02-10 17:43:19 +01:00
fred fff9ae8d31 azimut 2024-02-10 15:58:06 +01:00
fred 1f77420eb1 Open Cesium+ 2024-02-10 15:50:28 +01:00
fred 51a8451310 [START / STOP] Astroport.ONE = IPFS + ASTROPORT + G1BILLET 2024-02-10 15:10:10 +01:00
fred 6046854f7d ASCII ART HTML EMAIL 2024-02-10 14:35:57 +01:00
fred 6fbd4e2730 argon2 unused... using natools.py ... Adding shellcheck 2024-02-10 13:52:32 +01:00
fred a47a2a7416 https://naturaltime.app 2024-02-10 13:28:58 +01:00
fred 3940b577b8 Merge branch 'master' of github.com:papiche/Astroport.ONE 2024-02-10 13:28:14 +01:00
papiche cbfd192d63
Merge pull request #43 from OtterMaster/master
Espenel Damien v3
2024-02-10 13:06:05 +01:00
fred c1a7ce25b2 support@qo-op.com= Unamed UPlanet World Keeper 2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH 2024-02-10 12:55:29 +01:00
fred 2a4391fc11 protect variable set 2024-02-10 12:36:57 +01:00
fred 05283313b7 debug 2024-02-09 22:59:58 +01:00
fred 1095fd1b70 a Cosmic Journey with AstroID & ZenCard System and Astroport.ONE 2024-02-09 18:55:08 +01:00
fred fea2d06d6e Renommez avec votre adresse email, ajoutez votre jeu 2024-02-09 16:29:46 +01:00
fred 9a8c779877 resync 2024-02-09 16:28:24 +01:00
fred 3a5b41991b TODATESECTORNS 2024-02-08 15:58:36 +01:00
aristo 215164a59d masterguesser final 2024-02-08 15:26:30 +01:00
fred 16ca189b54 ENTRY POINT games/email@ynov.com/rooms/start.sh 2024-02-07 19:23:19 +01:00
fred 64f199fec4 adventure.sh 2024-02-07 19:20:08 +01:00
fred 9a159ccd5c . 2024-02-07 18:13:42 +01:00
papiche 5564dc4307
Merge pull request #39 from MaTa31/master
Mise à jour nom de dossier
2024-02-07 17:57:53 +01:00
fred 9ba87b27d9 this file is made wih sed bug 2024-02-07 17:57:32 +01:00
Mickael Fernandez c5320eff15 Rename folder 2024-02-07 17:23:55 +01:00
fred 7417ae952e FM 2024-02-07 16:17:21 +01:00
papiche ab6cb86818
Merge pull request #35 from Mickado31/master
mickael.ferez@ynov.com
2024-02-07 16:13:13 +01:00
papiche ffd274949a
Update do you wanna play.sh
be nice, at least once !
2024-02-07 16:12:43 +01:00
fred b8692146a6 JT 2024-02-07 16:06:52 +01:00
papiche d406880ce3
Merge pull request #34 from SiriusTuks/Tuuake.jessop@ynov.com
Puissance 4
2024-02-07 16:00:11 +01:00
fred 138ee637b2 RM 2024-02-07 15:59:00 +01:00
papiche b7271bd302
Merge pull request #33 from xyo-mt/master
Jeu du pong
2024-02-07 15:57:48 +01:00
fred 3b4ed03409 PB 2024-02-07 15:57:08 +01:00
papiche 5e43185cb8
Merge pull request #32 from PuigB/master
Add files via upload
2024-02-07 15:54:37 +01:00
papiche f5c9aa5393
Merge pull request #31 from MCAzertox/master
Young hacker game
2024-02-07 15:50:53 +01:00
papiche ec2744b621
Merge pull request #30 from JonioDiPonio/master
Joris Vidiella
2024-02-07 15:49:26 +01:00
fred 6683abba22 EA 2024-02-07 15:47:11 +01:00
papiche 92ec6c956f
Merge pull request #29 from Geekospirit/master
Jeu adventure yassine.elazzaoui@ynov.com
2024-02-07 15:42:31 +01:00
fred 19f5b15dec _votrejeu origin 2024-02-07 15:41:49 +01:00
fred 0946b2d4e2 DI 2024-02-07 15:40:07 +01:00
papiche f34dcf18dc
Merge pull request #28 from IlanDoumenc/master
Add my game in Adventure/mygame
2024-02-07 15:37:07 +01:00
fred e7bb5d3fce EA 2024-02-07 15:19:48 +01:00
papiche c7331f7c40
Merge pull request #26 from bhaloot/master
Merge Request Astroport ONE
2024-02-07 15:18:59 +01:00
fred 66010597dd games arangement 2024-02-07 15:12:04 +01:00
fred a5be43c570 TV + JB 2024-02-07 15:09:28 +01:00
FaycoTLS 0e953757e3 réparation du levier 2024-02-07 12:36:29 +01:00
fred fec76615ba RETRO ENGINEERING AND CODE SNIFFING TOOLS 2024-02-06 17:18:37 +01:00
fred 716630094e time shifting keys 2024-02-06 16:45:39 +01:00
fred 37de4e3c38 moving jeumarteau in adventure/games/ adding votrejeu/adventure.sh 2024-02-06 15:24:20 +01:00
papiche add49445be
Merge pull request #25 from jonathanbordes/master
Jonathan Bordes
2024-02-06 15:17:28 +01:00
papiche b7a3ceb943
Merge pull request #24 from Vansxur/master
Merge Request Tom Van Schendel
2024-02-06 15:16:59 +01:00
papiche 7a79ede598
Merge pull request #23 from dalsimhunk/master
selau
2024-02-06 13:16:45 +01:00
fred fb30f3904e ## TODATENS ################## UPDATE GPS Tiddler 2024-02-06 13:06:17 +01:00
fred 36d6cf9727 0 BUG 2024-02-06 12:45:46 +01:00
Mickael Fernandez 0070b54be1 Fork ASTROPORT.ONE debut new story 2024-02-05 16:57:06 +01:00
Thiam-moussa aeb882b802 ma modif 2024-02-05 16:36:54 +01:00
Mickado31 f4dcff26c4
Add files via upload 2024-02-05 16:34:45 +01:00
FaycoTLS 2797600d0f corec mineure 2024-02-05 16:32:12 +01:00
Morgan Riviere 120673ef3b
Add files via upload 2024-02-05 16:31:49 +01:00
FaycoTLS ae369f805d correc mineure 2024-02-05 16:31:24 +01:00
SiriusTuks fbf236b0e7
Add files via upload
Multi Jeux style Roblox
-Création d'un menu pour ajouter des jeux 
- Jeu Puissance 4 

Possibilité de rajouter dans le script Menu.sh
2024-02-05 16:31:22 +01:00
FaycoTLS 53858cbdd7 explications debug 2024-02-05 16:30:49 +01:00
PuigB 0213eac553
Add files via upload 2024-02-05 16:28:45 +01:00
MCAzertox f4cb8a9bb6 Young hacker game 2024-02-05 10:28:11 -05:00
Jonio b0cf825813
Add files via upload 2024-02-05 16:26:09 +01:00
user d7412899cd test 2024-02-05 16:23:59 +01:00
Yassine 798cf3907f Merge branch 'master' of https://github.com/Geekospirit/Astroport.ONE 2024-02-05 16:23:33 +01:00
Jonio d88b5523c3
Add files via upload 2024-02-05 16:23:03 +01:00
FaycoTLS 02da0c339e Kristofer Rumeau 05/02 2024-02-05 16:15:13 +01:00
Jonio 17137be26d
Merge branch 'papiche:master' into master 2024-02-05 16:10:58 +01:00
IlanDoumenc 3953c8c950
Add files via upload 2024-02-05 16:10:04 +01:00
Yassine b410295c63 update 2024-02-05 16:04:24 +01:00
Vansxur 1f9641f143 [Fix] meteo france 2024-02-05 15:57:33 +01:00
cyril 9979313215 selau 2024-02-05 15:54:54 +01:00
Ant0n10x78 924baa11ae update Antonio 2024-02-05 14:57:17 +01:00
fred 3e9b4a2e81 nouvelle image 2024-02-05 14:47:29 +01:00
jonathanbordes 2c9d6b70e7 ddMerge branch 'master' of https://github.com/jonathanbordes/Astroport.TWO 2024-02-05 14:42:21 +01:00
Kali 12d2285380 ajout d'une logique de levier dans la salle red.sh et ajout d'un yellow.sh pour activer le levier 2024-02-05 08:38:28 -05:00
jonathanbordes 5d7e8e732f changements 2024-02-05 14:37:39 +01:00
jonathanbordes 86b2c5ebb5
Create meteofrance2.sh 2024-02-05 14:24:46 +01:00
Vansxur 9ef81d639d [Fix] display choice to user 2024-02-05 14:21:58 +01:00
jonathanbordes d500888247
Update kroo3.sh 2024-02-05 14:21:22 +01:00
root 19cc43fce7 changements 2024-02-05 14:08:49 +01:00
Vansxur f8e09eb54d [Fix] problem with the variable leverstatetwo for the door 2024-02-05 14:08:35 +01:00
fred 14ef3a1cbe TODATENS 2024-02-05 14:05:19 +01:00
fred 68b4628e82 Ğ1Quest + Groceliande 2024-02-05 13:41:28 +01:00
fred e380648293 spatio temporal shifting UPlanet IPNS keys 2024-02-05 13:28:01 +01:00
fred 6f4acb87cf TODATE NS & SECTORNS 2024-02-05 12:41:26 +01:00
Vansxur de7ac6f33a [Feat] added the door 2024-02-05 12:33:25 +01:00
Vansxur 0bfa38773b [Feat] new lever 2024-02-05 12:20:17 +01:00
Kali 021d282c89 modif fichier start et riddle 2024-02-05 06:05:25 -05:00
Ant0n10x78 c5e031c02b update 2024-02-05 11:57:02 +01:00
jonathanbordes 3fb48c969c
Update mainroom.sh 2024-02-05 11:17:32 +01:00
jonathanbordes 057a173420
Update white.sh 2024-02-05 11:16:41 +01:00
jonathanbordes 6d93eb1755
Update start.sh 2024-02-05 11:13:18 +01:00
jonathanbordes 492563c006
Update white.sh 2024-02-05 11:11:21 +01:00
jonathanbordes 8abfe06b59
Create kroo3.sh 2024-02-05 11:09:19 +01:00
jonathanbordes 1d0e657b8b
Update end.sh 2024-02-05 11:06:39 +01:00
Kali f2eaa4ac65 creation du repertoire du mon jeu 2024-02-05 04:58:43 -05:00
Vansxur a4ed113595 [Fix] problem with art and logic folder 2024-02-05 10:50:19 +01:00
jonathanbordes c1f0e4437d
Update stationlogic2.ben 2024-02-05 10:47:28 +01:00
jonathanbordes 57fcd41e87
Update mainroom.sh 2024-02-05 10:45:25 +01:00
jonathanbordes bba10c8e25
Update white.sh 2024-02-05 10:43:21 +01:00
jonathanbordes 0b82ee0d79
Update white.sh 2024-02-05 10:41:39 +01:00
Vansxur 7d783c4c62 [Feat] Added adventuremulti.sh and initiated my game folder 2024-02-05 10:41:31 +01:00
jonathanbordes c6c1a24f15
Update white.sh 2024-02-05 10:40:35 +01:00
jonathanbordes 39e13e2367
Update white.sh 2024-02-05 10:39:08 +01:00
jonathanbordes ca9bda5907
Create stationlogic2.ben 2024-02-05 10:33:40 +01:00
jonathanbordes d45922f982
Rename a to leverlogic2.ben 2024-02-05 10:33:15 +01:00
jonathanbordes 7adf945724
Create a 2024-02-05 10:32:55 +01:00
jonathanbordes 9019dc9b9c
Update mainroom.sh 2024-02-05 10:32:18 +01:00
jonathanbordes f3b18c1242
Update mainroom.sh 2024-02-05 10:30:10 +01:00
jonathanbordes 27146f4155
Update mainroom.sh 2024-02-05 10:28:15 +01:00
jonathanbordes 1ed34c1ccf
Update mainroom.sh 2024-02-05 10:20:50 +01:00
fred f2f3515550 TODO : replace "support@g1sms.fr" with variable from ~/.zen/MJ_APIKEY 2024-02-05 07:21:42 +01:00
fred c216d7002e ${myDOMAIN} 2024-02-05 07:15:04 +01:00
fred 2aa0581541 docker-compose 2024-02-04 18:36:22 +01:00
fred 6b457a71dc python3-aiohttp 2024-02-04 16:52:23 +01:00
fred 0d4f95d6ff /ipfs/QmYGS24WxVbsmmQfqWohXhXQZiwSmNswhTtSj9msVWKkNh 2024-02-04 15:39:49 +01:00
fred 29a07a95c3 logos & stars 2024-02-04 15:13:48 +01:00
fred 6661e8b9ed (*)UPlanet World Keeper 2024-02-04 15:11:02 +01:00
fred e111e5c1b5 REGION FINANCE ♥BOX https://opencollective.com/monnaie-libre/projects/coeurbox/donate 2024-02-04 14:10:20 +01:00
fred b8f30ba6e7 TODATE ZONENS & UPZONENS 2024-02-04 13:29:40 +01:00
fred 5a7a29c3be REGLON 2024-02-04 13:23:36 +01:00
fred 5223dd640f pseudo="/ipns/${CLYUSER}${YOMAIN}.$(myDOMAIN)" 2024-02-03 16:42:59 +01:00
fred 0c3b8346dd <br>Your ASTROPORT STATION is <a href='${myAPI}'>NODE#${IPFSNODEID}</a> 2024-02-03 16:36:44 +01:00
fred 751041bb85 welcoming email 2024-02-03 16:20:41 +01:00
fred f4a6814ccb ${YESTERDATE} > ${UPLANETNAME} > ${TODATE} 2024-02-03 15:18:29 +01:00
fred d2f5b87463 south park edition 2024-02-03 12:55:33 +01:00
fred 5b247ca935 waving 2024-02-03 12:53:12 +01:00
fred 1d04eb627b overide system 2024-02-03 12:26:30 +01:00
fred aac7c76dde icons 2024-02-03 11:33:12 +01:00
fred 99e065d25f --break-system-packages 2024-02-02 20:14:50 +01:00
fred 6aa2ad05b9 update 2024-02-02 20:11:54 +01:00
fred e306b8ba1d Scan <b>ZenCard</b> "AstroID" QRCODE 2024-02-02 20:00:08 +01:00
fred 57a7f823f6 sharper 2024-02-02 19:42:57 +01:00
fred c63e09a54d HELP is coming 2024-02-02 19:37:00 +01:00
fred c6771bf5ca NOTERIB 2024-02-02 19:32:36 +01:00
fred 24a6b49567 lighter 2024-02-02 18:42:52 +01:00
fred fa8a42ef5a remove G1PUB/:ZEN trailing 2024-02-02 16:08:23 +01:00
fred 42b7d07df8 ipfs:// 2024-01-31 17:44:42 +01:00
fred 1d905650a1 push 2024-01-31 14:28:26 +01:00
fred b0d26b8233 Make your own Adventure 2024-01-31 12:32:08 +01:00
fred 2870305b10 Uninstall 2024-01-31 11:36:03 +01:00
fred b66c1be838 ![](game_map.png) 2024-01-31 11:24:58 +01:00
fred 7da4287b58 [![](game_map.png) 2024-01-31 11:24:24 +01:00
fred 5361bc4bd1 Make Your Own Adventure 2024-01-31 11:22:17 +01:00
fred c2d48c4136 create caching file (in case PORT is killed during /?qrcode=station run) 2024-01-30 18:02:32 +01:00
fred 9c85c98f63 better like that 2024-01-29 16:26:17 +01:00
fred 0c074b48c0 -z $COINS 2024-01-29 14:20:32 +01:00
fred 5bc2f6636a Cesium 1.7.10 2024-01-28 18:54:42 +01:00
fred 36af558ec3 Cesium APP loaded from IPFS 2024-01-28 18:49:55 +01:00
fred efe04f0ca6 https://demo.cesium.app/#/app/wot/tx/_SECTORG1PUB_/ 2024-01-24 14:23:05 +01:00
fred d8ebf31d39 /${IPFSNODEID}/REGIONS/_${REGLAT}_${REGLON}.JOURNAL.md 2024-01-24 14:03:18 +01:00
fred 157f49149a REGION have JOURNAL file and Ask.AI link 2024-01-24 14:00:55 +01:00
fred 4842096007 360 sec wait for ipfs restart 2024-01-22 17:45:05 +01:00
fred 23d369f967 Sector TW update period finished 2024-01-20 13:58:15 +01:00
fred 75e755ab1d Introduce Minetest 2024-01-20 13:53:32 +01:00
fred ed24f05f52 split output, log elsewhere 2024-01-20 13:46:37 +01:00
fred 12a30e8aef Get GC & CS+ extra data in ~/.zen/tmp/coucou 2024-01-19 20:56:36 +01:00
fred 33e5188d68 /g1gate 2024-01-19 19:39:45 +01:00
fred 4e476c632b ## TODO MAKE PAGE FROM JSON # BETTER FOR AIAPI 2024-01-19 19:17:25 +01:00
fred 44ffccfb0d TX 2024-01-19 18:50:15 +01:00
fred ab2be9ec5c better timings 2024-01-19 15:48:21 +01:00
fred 8503605c21 ## TODO get from ~/.zen/tmp/${IPFSNODEID}/REGIONS/_${REGLAT}_${REGLON}.week.cid produced by REGION.refresh 2024-01-17 20:33:14 +01:00
fred 145253025b /tellme/?cid=_RWEEKCID_ 2024-01-17 20:27:29 +01:00
fred d9c6429d6a update 2024-01-17 19:50:07 +01:00
fred 9eccd70b3d UNPLUG ALL = empty wallet & payback to WORLDG1PUB 2024-01-17 13:19:36 +01:00
fred 5262ddaf6f DApp now can find SECTORS data mashup IN /ipns/REGIONNS/RSS/_LAT_LON.week.rss.json 2024-01-17 13:18:21 +01:00
fred 4761e5609b new 2024-01-16 21:12:38 +01:00
fred 52db869aa1 readthedocs 2024-01-16 21:11:01 +01:00
fred 47e0bee33f collecting sectors week RSS into REGION week RSS 2024-01-16 18:18:09 +01:00
fred 395b8bf4fc MAILJET & GPS 2024-01-16 15:36:25 +01:00
fred 3ed11810c7 In order for "Boostrap Station" to send emails to PLAYERs, we use [mailjet service](https://mailjet.com/). 2024-01-16 15:34:51 +01:00
fred f5011e3ac8 myIPFSW 2024-01-16 15:02:26 +01:00
fred dc0e9c8053 route missing 2024-01-15 11:36:56 +01:00
fred ad6c467e1c TODO : only dragons can decrypt key 2024-01-15 00:12:38 +01:00
fred 0f69af3438 EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE 2024-01-15 00:00:20 +01:00
fred 1e3749f0c7 updated sector template. now with atom rss export plugin 2024-01-14 19:23:16 +01:00
fred f77412d20f SECTOR MODEL MIGRATION TODO REMOVE 2024-01-14 19:18:19 +01:00
fred 51f760f35b better namings 2024-01-14 19:05:53 +01:00
fred df55740e80 IPFSPOP 2024-01-14 18:51:15 +01:00
fred fcff04ed35 inline 2024-01-14 18:12:07 +01:00
fred b5b60759fa REGIONS 2024-01-14 18:10:51 +01:00
fred d76688ceab ACTINGNODE=${STRAPS[0]} 2024-01-14 18:08:20 +01:00
fred 0e1ccd9fe9 Activate REGION refresh 2024-01-14 16:47:30 +01:00
fred 8826624d6d Informations in SECTOR : /RSS/_all.json /COINS /ZEN /N 2024-01-14 15:31:02 +01:00
fred 6c9ea2a113 better linking 2024-01-14 14:40:17 +01:00
fred 8091df0618 _DATE_ 2024-01-13 12:04:05 +01:00
fred 3385dfb8fd debug ed 2024-01-13 11:59:37 +01:00
fred ed238e577d mesage 2024-01-12 21:09:48 +01:00
fred c460c37921 MESSAGE 2024-01-12 21:04:18 +01:00
fred b0dd4fa377 /EARTHCID/QmTepoka99jCNMkYT2covaJtGRMC91WEzwo5g9xYLU91bL 2024-01-12 20:40:38 +01:00
fred 7301c42bb3 d 2024-01-12 16:52:08 +01:00
fred 1e3e419bd2 maijet message title 2024-01-12 16:40:39 +01:00
fred 6df8b22d36 <h2>OK</h2></html>" > ${PENDINGDIR}/${MOATS}.result 2024-01-12 16:24:37 +01:00
fred 86354516c6 x11 & wayland 2024-01-11 16:59:16 +01:00
fred 5249433ee5 RUN and diagnose installation problems 2024-01-11 14:53:35 +01:00
fred 60b7916d71 install docker + nginx-proxy-manager 2024-01-11 13:12:26 +01:00
fred 04ca4f4e33 must be used with proxy (port 8888) 2024-01-11 01:45:29 +01:00
fred 4fc9b0caf3 cleaning NODE cache 2024-01-11 01:17:20 +01:00
fred b6b3d55750 Basic docker services 2024-01-11 00:59:25 +01:00
fred 0523eff6ab 30 days swarm caching 2024-01-11 00:18:46 +01:00
fred 657dd0f684 + 2024-01-10 23:49:26 +01:00
fred 05c6c1625f debug 2024-01-10 23:03:25 +01:00
fred 4f4074d5cb yes 2024-01-10 22:43:33 +01:00
fred c734750abd --break-system-packages python3 2024-01-10 21:13:47 +01:00
fred 7997784146 crazy PC 2024-01-10 18:51:37 +01:00
fred 522eb0b961 TEST 2024-01-10 18:44:44 +01:00
fred ab3fa43d1d Test if core tools are working 2024-01-10 18:41:17 +01:00
fred 2351202bdd Test if core tools are working 2024-01-10 18:40:58 +01:00
fred d81951d9bc Astroport.ONE Welcome Space Kitty Please finish keygen procedure https://pad.p2p.legal/keygen 2024-01-10 18:14:59 +01:00
fred 0049ee502c help webcam loading 2024-01-10 17:05:01 +01:00
fred 0871685d1b <h3>May the force be with you.</h3> 2024-01-08 23:46:43 +01:00
fred 3f985dce3d ## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT 2024-01-08 22:28:40 +01:00
fred 229ed6ac9b 0.3 2024-01-08 05:04:06 +01:00
fred 068536a84c UPlanet TW in 32 languages 2024-01-08 04:20:59 +01:00
fred ffa0a7ecbf better information 2024-01-07 23:16:00 +01:00
fred beb3a70fce fix 2024-01-07 22:50:56 +01:00
fred a81a7849c8 create .all.json from all .rss.json in directory 2024-01-07 22:33:28 +01:00
fred 2e08fd7764 Create .all.js from "tiddlers.rss.json" for "G1Tags" WISHES ("Astroport TW smart contract") 2024-01-07 22:32:36 +01:00
fred 27a5b5dccb CREATE .all.json for RSS in NODE and UPLANET published data 2024-01-07 22:22:57 +01:00
fred 733b848c5b Add _DATE_ 2024-01-07 22:13:47 +01:00
fred 5e28d385fc bandeau Gchange on top 2024-01-07 22:05:47 +01:00
fred 46c29df78c INSIDE.json correction 2024-01-07 13:30:31 +01:00
fred 385ef6b17c /g1gate G1 "incomes & expenses" + map_render EXPLORE _ZONE_ adapted button 2024-01-07 13:01:22 +01:00
fred 865993d4ef #To Make private UPlanet# UPLANETNAME could be defined in ~/.zen/UPlanetSharedSecret 2024-01-07 12:23:05 +01:00
fred 983b9487f7 UMAP PHONEBOOTH="${G1PUB::30} 2024-01-07 12:08:02 +01:00
fred 883987e60b distribute $1 units on $2 coins (default 30 10) 2024-01-07 00:57:30 +01:00
fred 833267847f GRATITUDE ~= 3 ( min = 1 max = 21 ) 2024-01-07 00:42:03 +01:00
fred 0fbe606cbf ok 2024-01-07 00:27:48 +01:00
fred 6d497ef1d4 📺 2024-01-06 21:37:13 +01:00
fred 0501e33ace GRATITUDE COINScheck PAY4SURE 2024-01-06 19:18:06 +01:00
fred 16fd20ae7e THAT 2024-01-05 20:38:16 +01:00
fred 190494352a are you ZEN? 2024-01-05 20:36:18 +01:00
fred c4108606b3 ZCHK is what is after : 2024-01-05 20:32:35 +01:00
fred e0cc11371e san 2024-01-05 20:29:13 +01:00
fred 5b2cb8c9ba 📶( ° - ° ) 2024-01-05 19:59:19 +01:00
fred c94d8ac11d @@ - 2024-01-05 17:58:09 +01:00
fred ad8cfdaf27 review login/logout for G(eo)UZenCard types 2024-01-05 02:45:27 +01:00
fred e2ba742772 reset PLAYER key 2024-01-04 19:13:44 +01:00
fred fada606761 quiet 2024-01-04 19:13:19 +01:00
fred 6c644850ab clear cache 2024-01-04 19:02:24 +01:00
fred c2080ce9fd stronger security + UPlanet/g1gate 2024-01-04 18:57:31 +01:00
fred 6dcddfc3c2 /map_render.html 2024-01-04 13:42:35 +01:00
fred 5d693051d5 OK. that was my bad || part. Stop using this, separate in 2 tests 2024-01-04 13:07:55 +01:00
fred 2ab1327d6d like that 2024-01-04 13:05:31 +01:00
fred a428d6551f whatr a strange error 2024-01-04 13:01:36 +01:00
fred e23c3bc1a6 what is that bug ::: 2024-01-04 12:56:16 +01:00
fred c9a253371d DEBVUG 2024-01-04 12:49:30 +01:00
fred 46c442ab72 blindage 2024-01-04 12:44:15 +01:00
fred a20573c292 debug 2024-01-04 12:35:40 +01:00
fred 5ff26d06b9 patching 2024-01-04 12:27:19 +01:00
fred fcd3879da2 push it 2024-01-04 12:19:39 +01:00
fred 73b18b08cd wtf 2024-01-04 12:17:52 +01:00
fred e937e8764d PLAYER 2024-01-04 12:05:14 +01:00
fred 947ac2f4dc some extra 2024-01-04 12:04:07 +01:00
fred e6f3a1cc37 fix sector desycn 2024-01-04 00:11:50 +01:00
fred f5d5ed5928 BRO system being activated. if ZEMAIL found in today Duniter history and today Tiddlers. G1 sent. 2024-01-03 21:29:37 +01:00
fred bf75affd2c BETTER 2024-01-03 20:39:39 +01:00
fred d1cde08d55 PAY4SURE 2024-01-03 19:37:08 +01:00
fred 3d44af8b83 SECTOR SENDS GRATITUDE TO PUBLISHING PLAYER 2024-01-03 17:46:04 +01:00
fred 53128a0c26 good to go PLAYER to UMap to SECTOR connected... REGION data through LLM coming... 2024-01-03 15:58:52 +01:00
fred 91ba51cb3a _UPLANETLINK_ 2024-01-03 15:36:26 +01:00
fred 9396d2a7d7 _PHONEBOOTH_ 2024-01-03 15:25:27 +01:00
fred 5a2a1a400c put some html in messages 2024-01-03 14:36:53 +01:00
fred 0f3701b843 MAKE ZEN a NUMBER 2024-01-03 03:37:01 +01:00
fred dc463a1eb6 better routing 2024-01-03 00:29:44 +01:00
fred 19830a9dc2 UPlanet Entrance : https://qo-op.com 2024-01-02 16:20:40 +01:00
fred 16eb0f7b1a What can be done by just receiving an EMAIL (PLAYER id). EXTEND AT YOUR NEED 2024-01-02 16:19:01 +01:00
fred 4f19e9a7f5 ReadMe 2024-01-02 16:18:06 +01:00
fred 55d8fc7810 VISIO on https://ipfs.copylaradio.com 2024-01-02 16:01:31 +01:00
fred 477b105656 TW Update 2024-01-02 14:34:54 +01:00
fred bad174f473 Update index.html 2024-01-02 13:54:24 +01:00
fred 05c3649e13 SEND unplugged PLAYER LAST KNOW TW 2024-01-02 12:22:32 +01:00
fred 48c9103b9d ipfs cat $TWMODEL > templates/twdefault.html 2024-01-02 00:45:42 +01:00
fred 2eb14fd885 make message HTML & add FUN 2024-01-02 00:16:48 +01:00
fred 841f3f4422 ipfs daemon --migrate --enable-pubsub-experiment --enable-namesys-pubsub ( isLAN? --routing=dhtclient) 2024-01-01 16:00:58 +01:00
fred f5022ddec1 New Earth CID & wallets 2024-01-01 04:48:35 +01:00
fred 8db9e5b15e correct G1AMOUNT calculation 2024-01-01 03:45:36 +01:00
fred d553cdf1b6 DATA is ${hours} hours ${minutes} minutes ${seconds} seconds OLD 2024-01-01 03:37:57 +01:00
fred 019e0eb886 & escape 2024-01-01 03:25:53 +01:00
fred 02ab090bd0 arrange templates 2024-01-01 03:15:32 +01:00
fred ccfe274719 arrange bad GPS 2024-01-01 02:53:58 +01:00
fred 1dd2495a2e better like that 2023-12-31 19:22:16 +01:00
fred fde01d2478 muuch better 2023-12-31 18:46:23 +01:00
fred f3964ee438 UPlanet VISION ( ° - ° ) 2023-12-31 18:11:55 +01:00
fred 02028858e7 <a href="http://127.0.0.1:8080/ipfs/QmcSkcJ2j7GAsC2XhVqGSNAKVRpXgxfjjvDbhD5YxrncZY/?room=_UPZONENS_" target="aframe"> ( ° - ° ) </a> 2023-12-31 18:09:32 +01:00
fred c6bd4d7d49 PLAYER send $GRATITUDE ZEN to SECTOR when WISHES are run 2023-12-31 17:40:33 +01:00
fred 749c1127c2 SECTORG1PUB 2023-12-31 17:32:59 +01:00
fred 7710562046 new design 2023-12-31 17:08:19 +01:00
fred 349ca75f67 http://127.0.0.1:8080/ipfs/QmZp1T7MyLhLNYM1uuLQo1HWVx5NLbBzh56RXm9fDEtLrs 2023-12-31 16:50:20 +01:00
fred 92cd3a1028 SECTOR is grey 2023-12-31 16:30:50 +01:00
fred 5000f8dbf5 Ẑ INFO.png 2023-12-31 16:24:13 +01:00
fred 67d44af782 lozange for SECTOR 2023-12-31 16:21:49 +01:00
fred b05de8cf2a UPlanet Umap template 2023-12-31 16:10:24 +01:00
fred 1015677488 UPlanetSector UPlanetUmap are different templates 2023-12-31 16:08:38 +01:00
fred 8375a38a43 little change 2023-12-31 15:20:11 +01:00
fred 92f7dd0386 VOEUX.refresh send GRATITUDE ZEN to SECTOR 2023-12-31 15:06:34 +01:00
fred 5d4a405020 mailjet 2023-12-31 13:39:42 +01:00
fred 1fc4f783bf get a random coin from gratitude box (30 units over 10 coins) 2023-12-31 13:20:18 +01:00
fred 5c7cf37272 show pseudo in title 2023-12-31 12:35:34 +01:00
fred 883813bb8e Used for VLOG Tiddlers 2023-12-31 04:05:06 +01:00
fred abe8acf479 ipfs cat $TWMODEL > templates/twdefault.html 2023-12-31 03:12:26 +01:00
fred 4fad876f66 introduced & remove bug 2023-12-31 00:35:30 +01:00
fred 65e332cd04 this template is used for UMap & Sector display 2023-12-31 00:28:22 +01:00
fred fe619429cc timeout for jaklis 2023-12-31 00:12:33 +01:00
fred 4e153f9ef3 better 2023-12-30 21:05:26 +01:00
fred 1c4ced0b80 myIpfsGw is a my.sh function 2023-12-30 20:16:39 +01:00
fred 2082197e66 all case scenario 2023-12-30 18:55:11 +01:00
fred 455870d33a LEVELed LAT LON 2023-12-30 18:50:42 +01:00
fred 0f91309598 better zone information catching 2023-12-30 18:38:02 +01:00
fred 002d9ff599 correct RSS/all.json 2023-12-30 14:20:26 +01:00
fred a8990ce2df providing json Lat/Lon/Deg information 2023-12-30 03:30:43 +01:00
fred 4fea205f55 reinforcement 2023-12-30 02:37:54 +01:00
fred 3f19d12b54 commit 2023-12-29 02:26:31 +01:00
fred 52ae17019a les than 2 G1 (10 Zen) not publishing for more than a month TW will be UNPLUGGED in 3 days 2023-12-28 13:28:14 +01:00
fred 0a40ff9d91 myIpfsGw is defined in A_Boostrap file 2023-12-28 12:09:41 +01:00
fred a7991fe9e7 Zen 2023-12-26 17:59:05 +01:00
fred f14b329b4d bcc & new earth code 2023-12-26 17:53:33 +01:00
Jonio 44cb0999e3
Merge branch 'papiche:master' into master 2023-12-19 16:13:21 +01:00
JonioDiPonio c977b22a0f t 2023-12-19 15:21:38 +01:00
fred 5f903b7dd3 NO VENV 2023-12-19 11:51:44 +01:00
fred aecd5baecc sender 2023-12-19 07:32:52 +01:00
fred 86e77936a1 use mailjet 2023-12-18 21:18:31 +01:00
fred f77c001b75 new earth 2023-12-18 19:09:01 +01:00
fred e857837c9b link correction 2023-12-18 18:13:20 +01:00
fred 22c2814b3a bug path 2023-12-18 17:57:47 +01:00
fred e320ed4161 COMBINE ALL JSON & play with colors 2023-12-18 17:27:06 +01:00
fred 252709f8d9 pubsub echange 2023-12-18 16:35:22 +01:00
fred 3af864f5de color based common crypto land 2023-12-18 16:23:18 +01:00
fred d4ddfd15d3 argon2 2023-12-18 15:32:45 +01:00
fred 7888472307 sector MIZ sphere texture 2023-12-17 17:32:55 +01:00
fred e933bdbb11 New Mailjet engine 2023-12-17 17:32:13 +01:00
fred caa667f3f8 Scan Gchange/Cesium for G1PUB -> gchange presence & potential related member wallet 2023-12-15 18:25:20 +01:00
fred 7005c995b6 to pimp up sphere mapping 2023-12-15 18:21:47 +01:00
fred 6386accc27 SECTOR country style 2023-12-15 17:20:22 +01:00
fred a4e5e201e0 Usector sphere 2023-12-13 18:12:45 +01:00
fred c367454f87 UPlanet software update 2023-12-12 18:37:20 +01:00
fred 0f2148a29b be zen 2023-12-12 14:08:35 +01:00
fred c76739652b update minimal TW 2023-12-07 19:11:14 +01:00
fred f28bed7224 Enter Email 2023-12-07 18:55:04 +01:00
fred 46db511e2a new zencard 2023-12-07 17:07:26 +01:00
fred f3bfe7178e nice 2023-12-07 17:04:46 +01:00
fred 398529dffd Make payment to SECTORG1PUB 2023-12-07 16:40:29 +01:00
fred 17c35ce894 plus joli 2023-12-07 15:38:12 +01:00
fred 5c81299ef1 Activate better cache refreshing 2023-12-07 15:09:54 +01:00
fred 0c9299bb8d CLEAN OLD ${znod} 2023-12-07 01:06:17 +01:00
fred 420dbf35f0 QRCODE IS IPNS OR ZEN FORMAT 2023-12-07 01:05:30 +01:00
fred ffeba37cd2 mieux 2023-12-07 00:53:39 +01:00
fred 1a2041a280 correct bad replacements 2023-12-06 13:09:47 +01:00
fred b3b663ccc6 ## zday marking 2023-12-06 01:23:47 +01:00
fred 65bff37712 isLAN = ipfs.$(hostname).local:8080 & astroport.$(hostname).local:1234 2023-12-06 01:11:34 +01:00
fred 595a37c38b [[ ${floop} -gt 2 ]] && echo "0lder Tiddlers are similaR... BREAK" && break 2023-12-06 00:51:24 +01:00
fred 1822563569 INSERT Tiddlers with latest first. bloc after similar found 2023-12-06 00:50:56 +01:00
fred 3eddfbeccb ## ¤$£€ removed copy OSM map to IPFS. TODO. scrap tiles instead of screen copy 2023-12-05 23:50:44 +01:00
fred 9d6daccf29 corrected 2023-12-05 23:45:13 +01:00
fred 8cee5c3b9c EXPLORE UMAP LINK 2023-12-05 16:57:54 +01:00
fred 526a67114a TW change some /ipns/ with current /ipfs/ (to make quicker access) 2023-12-05 16:33:32 +01:00
fred 68881f008d button to close / open / enlarge console 2023-12-05 15:13:52 +01:00
fred 22fd4a481b XXX 2023-12-05 14:48:31 +01:00
fred c878cfffa8 fixing 2023-12-05 14:47:11 +01:00
fred 58e38a4b09 SEARCH FOR TW on NODE & in SWARM 2023-12-05 14:39:06 +01:00
fred d92aa2d88d # SEND COINS TO UMAPG1PUB - ẐEN VIRTUAL BANK - EVERY 800 METERS - ;) 2023-12-05 13:56:36 +01:00
fred f5c1911773 ASTROPORT CAN BE ACCESSIBLE THROUGH LAN - problem with Docker 2023-12-04 18:20:22 +01:00
fred d7fb8260f3 O 2023-12-04 18:02:55 +01:00
fred 4bc73417fc _index.html App 2023-12-04 16:45:54 +01:00
fred 839974abc1 REDIRECT OUTPUT TO "coucou/pay4sure.log" 2023-12-04 14:05:53 +01:00
fred 843a32e522 EXPLORE IPNS BUTTON APPEARS NOW 2023-12-04 14:05:43 +01:00
fred 0a8a1188c6 UPLANET ZONE API 2023-12-04 12:58:28 +01:00
fred f18256ec8b UPlanet + ZONE API 2023-12-03 22:17:12 +01:00
fred 100fccfcc0 Add ZONE ask how many TW on UPlanet 2023-12-03 22:15:46 +01:00
fred 9d912e5247 AstroID.json model & ZONE API birth 2023-12-02 22:27:45 +01:00
fred f7002dce99 this is hot 2023-12-02 22:26:31 +01:00
fred 2717a9f97e EARTHCID & minimal update 2023-12-02 20:56:44 +01:00
fred eb5bda3b10 bug 2023-12-01 22:30:36 +01:00
fred 81087d3a04 GPS little change 2023-12-01 22:19:16 +01:00
fred 66272bb99f Try Umap _index.html 2023-12-01 21:56:07 +01:00
fred 76df4cde8d /ipns/UMAPNS/_index.p4n.html showing P4N+GC data 2023-12-01 21:27:00 +01:00
fred 121e139621 UMAP < SECTOR < REGION < PLANET < ONE 2023-12-01 18:01:22 +01:00
fred 8c3c8ac157 UPlanet UMap App = All TW from same Umap 2023-12-01 17:25:10 +01:00
fred 774d6f7e7a [[ $(echo "$CURCOINS > 100" | bc -l) -eq 1 ]] 2023-12-01 03:26:56 +01:00
fred d5c4414747 better look 2023-12-01 03:06:35 +01:00
fred 59753a3d45 QmZSyeLDndc6DbaHv2wKuhhjBcm39MokAVAn5ihhJWfG84 2023-12-01 02:30:34 +01:00
fred d28f21bc0a console /ipns/_SECTORNS_/TW 2023-12-01 02:02:48 +01:00
fred e1bb6cfadd ACCOUNT WILL BE UNPLUGGED IN 3.2.1 DAYS 2023-11-30 21:48:43 +01:00
fred 8d6329eda6 bug \ 2023-11-30 21:29:23 +01:00
fred 159d7d54b3 (( $(echo "$CURCOINS > 100" | bc -l) )) && [ "$PALPE" != 0 ] 2023-11-30 21:25:27 +01:00
fred ff3075386d (( $(echo "$COINS > 0" | bc -l) )) replace integer only test [[ $COINS > 0 ]] 2023-11-30 21:21:57 +01:00
fred b74aa9f37b /_${SLAT}*_${SLON}* filter 2023-11-30 21:04:32 +01:00
fred b3c3856963 root App for SECTORNS key 2023-11-30 18:27:09 +01:00
fred e867cb3960 NOW SECTOR key publish _index.html in UPlanetSector template. COOL 2023-11-30 18:23:35 +01:00
fred efe8a15a4c echo "TW REFRESH HAS FAILED... USE IT ONLINE : ${myIPFS}/ipfs/${NOWCHAIN}" > ~/.zen/tmp/result 2023-11-30 01:27:23 +01:00
fred ff780ca171 inform PLAYER 2023-11-30 00:05:05 +01:00
fred dde884d38e debug 2023-11-29 23:30:53 +01:00
fred c9fd71a52c Return data to command.sh # KEEP IT 2023-11-29 18:32:09 +01:00
fred 49098cd614 is payment success or retry 2023-11-29 17:32:24 +01:00
fred d17a164776 MAKE PAYMENT (+ 3 RETRY) 2023-11-29 17:29:38 +01:00
fred 7888a31830 various twik + auto unplug PLAYER account v0.1 2023-11-29 16:50:42 +01:00
fred 85eb8221ee myASTROPORT isLAN? myIP addressing 2023-11-28 22:57:42 +01:00
fred 2d9b301064 Add .ipfs/api 2023-11-28 22:08:12 +01:00
fred 66a6233a85 EXPOSE ALL PORTS: 1234 12345 33101 33012 45780 45781 45782 45783 45784 45785 45786 45787 45788 45789 45790 2023-11-28 17:29:06 +01:00
fred 44837aff91 myos IPFS api compatible 2023-11-28 14:54:27 +01:00
fred b2095a6156 found a bug 2023-11-27 20:56:16 +01:00
fred b5a50781da ${UPLANETNAME} UPlanet key decay 2023-11-27 20:40:46 +01:00
fred 8ef8a39185 G1Fablab 2023-11-27 19:33:28 +01:00
fred 4b65ab00d6 Astroport: Decentralized Storage for the Future 2023-11-27 19:01:30 +01:00
fred c013c6f0e5 ASTROPORT CREW GILET https://astroport.myspreadshop.fr/create?product=a68ad31e-d554-4c75-821d-97b00d6ad13f&view=2 2023-11-26 21:57:05 +01:00
fred 49747a6ef1 CURRENT mode is better 2023-11-26 21:55:20 +01:00
fred 6199854076 make UPlanet VISA 2023-11-26 17:44:03 +01:00
fred 91109a0918 ZenCard 2023-11-26 17:07:48 +01:00
fred c0914a2393 ${EARTHCID} is latest UPlanet interface 2023-11-25 17:43:57 +01:00
fred 922adfcafb Stronger email TW PASS 2023-11-25 17:03:18 +01:00
fred 192943be08 ~/.zen & myos compatibility 2023-11-24 23:34:52 +01:00
fred 80f70d84b4 Run Player & UPlanet refresh + stop or restart ipfs 2023-11-24 23:23:13 +01:00
fred cdb75fb8cd email containing "_" is banned (sorry it breaks @_dice_ware format) 2023-11-24 19:21:13 +01:00
fred 89b2b06694 PIN _canonical_uri in case of multi signed Tiddlers 2023-11-24 19:01:00 +01:00
fred 50c95d9a32 BOOSTRAP is important... every chain has a seed, better if it is you really! 2023-11-24 18:02:20 +01:00
fred adce8d8c10 ẐenStation switch 2023-11-24 14:51:27 +01:00
fred c8d96e82e4 Merge branch 'master' of github.com:papiche/Astroport.ONE 2023-11-24 14:36:05 +01:00
fred ebd0ef5c07 more detail on how to install 2023-11-24 14:35:51 +01:00
aynic.os dd2046f587 port mapping 2023-11-24 04:07:45 +00:00
aynic.os 174f620460 fix docker install 2023-11-24 03:44:45 +00:00
fred b1d87c0a11 New Uplanet 2023-11-24 04:17:22 +01:00
fred 0a8988152f Merge branch 'master' of github.com:papiche/Astroport.ONE 2023-11-24 04:16:35 +01:00
aynic.os 5fd1bb48c5 fix docker install 2023-11-24 03:13:06 +00:00
fred af183456ca Ẑen 2023-11-24 03:09:17 +01:00
fred 2db1c4153b (€‿|‿Ẑ) 2023-11-24 03:03:24 +01:00
fred 814c8e4e7a &&&&& UPLANET ZENCARD TYPE 2023-11-24 02:43:18 +01:00
fred 64c4d5af23 1 Zen = 1 Zen 2023-11-24 02:41:09 +01:00
fred 72f450da0d make && make install 2023-11-23 19:38:50 +01:00
fred 2f0725affe fixin 2023-11-23 12:31:25 +01:00
fred d9de4f7c69 README 2023-11-21 23:38:18 +01:00
fred 66b0f7d035 Methods & "Contrat Intelligent" ASTROBOT 2023-11-21 22:59:56 +01:00
fred f0ae1d65dc taste the difference 2023-11-21 22:34:54 +01:00
fred 2dd3dd411d Merge branch 'master' of github.com:papiche/Astroport.ONE 2023-11-21 21:01:58 +01:00
aynic.os b95b9853ad fix docker 2023-11-21 19:58:23 +00:00
fred 07a7f68d73 new earth cid 2023-11-21 00:13:13 +01:00
fred d72eafc405 ${MY_PATH}/../ASTROBOT/ 2023-11-20 22:31:11 +01:00
fred 91ca169fb2 G1PalPay monitor incoming G1Tx - run N1 script, apply payments,. .. 2023-11-20 22:03:23 +01:00
fred b0a2343886 G1PalPay is part of RUNTIME now (no need to make a wish for ASTROBOT) 2023-11-20 22:02:10 +01:00
fred 73e394d538 /ipfs/QmTJKQ5eymHyVyTmZM1pqo4z7Sn1bwox2p9i5eKPRAvNA3 2023-11-20 15:23:16 +01:00
fred 1c2133460d Ẑen Station 2023-11-18 00:55:40 +01:00
fred c3a57ca481 better now 2023-11-18 00:40:18 +01:00
fred 8b6531988c UPlanet redirect EARTHCID 2023-11-17 15:50:08 +01:00
fred a1ad191d30 open_with extension for firefox 2023-11-17 03:31:52 +01:00
fred e16d8777c3 plenty little things 2023-11-17 03:29:25 +01:00
fred 96b5fd260d ZENCARD/ASTROID :: ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1) 2023-11-16 18:07:55 +01:00
fred 830a11ee83 ### CHECK FOR pending 2023-11-14 19:16:00 +01:00
fred db7cbaa9fa exec redirect output 2023-11-14 18:31:42 +01:00
fred dcb471c0ad > -gt 2023-11-13 17:52:40 +01:00
fred 7820691038 > 0 2023-11-13 16:05:17 +01:00
fred e4fead53b5 BCC support@qo-op.com 2023-11-13 10:47:09 +01:00
fred 4f6be54321 fred@g1sms.fr BCC 2023-11-13 00:40:17 +01:00
fred b360ba3ab9 St Petersbourg mode 2023-11-13 00:10:23 +01:00
fred 0660aff78b Tidme, a very intesting TidllyWiki template for best repetitive learning 2023-11-12 20:14:01 +01:00
fred 3bdd958828 refresh for best 2023-11-12 20:12:51 +01:00
fred 58994e2aa4 email routing 2023-11-12 14:20:58 +01:00
fred cf4a688c05 Change email relay server with yours 2023-11-11 15:21:23 +01:00
fred eb115a37db ${APPNAME} == "flipper" - OSM2IPFS/earth/coinflip 2023-11-11 15:20:36 +01:00
fred 6fa5508b92 BROKEN ... must fix 2023-11-10 05:16:07 +01:00
fred e11fe58bdc fixing ~/.zen/tmp 2023-11-10 05:09:47 +01:00
fred 3cf1422eac TRY TO CORRECT ERROR WITH PYTHON ENV DURING INSTALL 2023-11-10 05:08:11 +01:00
fred 8eb67e2a3a python3 -m venv ~/.venvs/astro 2023-11-10 04:48:45 +01:00
fred 5185c473a9 bug 2023-11-10 02:27:01 +01:00
fred 81f6c817f6 install in ~/.zen/Astroport.ONE and run Station 2023-11-10 01:01:27 +01:00
fred bea59680fa reglages 2023-11-10 00:59:26 +01:00
fred 167486cb92 zday of the week for IPFSNODEID 2023-11-09 02:19:07 +01:00
fred 8ba27150bd ipfs ping & (re)connect boostraps 2023-11-09 01:52:47 +01:00
fred 521c7d5469 SECTOR TW update 2023-11-08 01:52:54 +01:00
fred b3f2bd5a0f 2 copy a day. COINS for more ?! 2023-11-07 22:48:57 +01:00
fred 214727741c To continue... 2023-11-07 20:13:59 +01:00
fred 258faa6609 adventure game 2023-11-07 12:14:11 +01:00
fred 46aee42115 a BASHventure game on IPFS 2023-11-07 11:36:15 +01:00
fred 89727c2ab1 mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR} show SECTOR name 2023-11-06 21:09:18 +01:00
fred ea1d10354b Sector map_render & OSM2IPFS/earth update 2023-11-06 21:04:17 +01:00
fred b0ef9af415 Make your adventure 2023-11-06 13:47:30 +01:00
fred ba010ce3a7 Make your adventure 2023-11-06 13:46:56 +01:00
fred 95f61c4f6e todo debug 2023-11-06 13:33:12 +01:00
fred 3db5b854b9 ipfs daemon are not restarting on some ! LOWMODE nodes 2023-11-05 21:09:56 +01:00
fred 8eb0660a34 boostrap stations admins need personal "email@g1sms.fr" 2023-11-05 18:17:15 +01:00
fred d8decf671b +++ 2023-11-05 15:41:15 +01:00
fred e7feddd775 SECTOR TW TEMPLATE 2023-11-04 23:19:48 +01:00
fred d8ec646a3f Update Milgram to Wish Fidelity sub wallets @PASS 2023-11-04 23:10:02 +01:00
fred a9fb7a85c5 insidious bug found 2023-11-03 11:48:48 +01:00
fred c66c233989 Play with Astroport Command Line 2023-11-02 23:15:26 +01:00
fred ebb2ff59f7 some favicon 2023-11-02 15:15:46 +01:00
fred 7b3fbf1a1f STRAPS[0] correct swarm missed updates 2023-11-02 01:33:05 +01:00
fred 24701e1aac minimum 2023-10-30 17:55:53 +01:00
fred 8cfa5cf76c timings 2023-10-30 13:25:08 +01:00
fred 36d04f8447 try do not fork publishing task 2023-10-30 13:17:47 +01:00
fred 56df7fccc2 if SECTOR refresh is less than 5h, been rotated, get yesterday refresher list 2023-10-29 11:40:13 +01:00
fred 5bba9d4000 bug bracket 2023-10-26 23:47:06 +02:00
fred a4726a115d new favicon 2023-10-26 21:31:31 +02:00
fred 8b94f603df UMap SECTOR / REGION better sorting 2023-10-26 16:16:29 +02:00
fred 33833ed708 UREFRESH correction 2023-10-26 16:00:52 +02:00
fred aedd8e1b52 GPS & LOWMODE patch 2023-10-26 14:41:38 +02:00
fred 442ceb04d4 bootstrap correction 2023-10-26 11:09:19 +02:00
fred 1e137bbe82 TITLE FORK TO BE SOLVED. NEED "SAME EMAILS SIGNATURES" 2023-10-26 01:34:32 +02:00
fred 014fb5a99e some twix 2023-10-26 00:55:47 +02:00
fred 4affb86489 One time SECTOR TW reset 2023-10-25 12:37:31 +02:00
fred 76ca27a5a4 LAT LON loop correction 2023-10-25 12:34:06 +02:00
fred a1f9fe05f9 [0.00]-[0.00] registration 2023-10-23 17:07:59 +02:00
fred 5b6e2473e5 some corrections and better behaviour 2023-10-23 15:06:58 +02:00
fred e96fabb97d Chain should have been modified more than 5 hours ago to be updated on the next 24h 2023-10-22 16:34:26 +02:00
fred 5bfad89065 Add own CHAIN to SECTOR.refresh.sh 2023-10-21 19:48:56 +02:00
fred 4715efb4e3 Create Umap_geolinks json 2023-10-21 18:27:59 +02:00
fred 216dc1dbd7 Oula U planet 2023-10-21 17:09:44 +02:00
fred e9dee076e1 Oula U planet 2023-10-21 17:04:22 +02:00
fred 2a293d1fc3 should work better 2023-10-21 02:18:50 +02:00
fred 9978e606f0 while read because of spaces in titles 2023-10-21 02:14:07 +02:00
fred e10a318a91 UPlanet 42s timeout 2023-10-20 22:50:37 +02:00
fred 3a5b7a3335 blue links 2023-10-20 22:22:12 +02:00
fred 56e29ea22d a colors 2023-10-20 22:16:17 +02:00
fred 20ff5746ca Updating PLAYER refresh & GCHANGE friendship 2023-10-20 01:53:09 +02:00
fred f9dbfd8dc9 relative linking : ln -s "./${YID}.TW.json" "${ZFILE}.json" 2023-10-20 01:32:28 +02:00
fred 45647e3037 SECTOR and REGION directories 2023-10-20 01:20:00 +02:00
fred b485b60325 /TW 2023-10-20 01:12:44 +02:00
fred f81ac4c1a6 Boostrap can be removed -> then 1st Strap is elected 2023-10-20 01:05:33 +02:00
fred dbccb945c7 SECTOR refreshing 2023-10-20 00:30:30 +02:00
fred d08dce6d72 Change G1CopierYoutube template to make VOEU.refresh.sh output nicer DApp 2023-10-19 19:11:46 +02:00
fred 85d09aa14b correct logging 2023-10-19 17:58:14 +02:00
fred 40f51e375c Adapt links to astroport.domain.tld (1234) and ipfs.domain.tld (8080) Gateway 2023-10-19 17:52:40 +02:00
fred ed4a2b49a3 ?ipns= 2023-10-19 17:20:10 +02:00
fred d638fc4793 Update SECTOR TW with UMaps RSS 2023-10-19 14:14:10 +02:00
fred 8ee934ab00 "PUBLISHING ${SECTOR} ${myIPFS}/ipns/${SECTORNS}" 2023-10-18 16:02:22 +02:00
fred 4d8baec5b5 Hello\n\n
Tiddler with same title is existing in ${unique_combined[*]} TW(s) \n\n
$title\n\n
Please choose update your TW grabbing it from\n
* ACTUAL: ${myIPFS}/ipfs/${INSIDETID}\n
* NEW: ${myIPFS}/ipfs/${NEWTID}\n\n
or fork modifying titles

You can discuss about it in room ${MOATS}\n
https://vdo.copylaradio.com
2023-10-18 03:57:04 +02:00
fred 6f0e94fd3e You can discuss about it in room ${MOATS}\n
https://vdo.copylaradio.com
2023-10-18 03:50:42 +02:00
fred 6aecccba2c Inform PLAYERS from same SECTOR if Tiddler with same Tittle is imported twice with != emails in tags 2023-10-18 03:42:48 +02:00
fred 9c19754d24 # CHAINING BACKUP 2023-10-18 03:32:59 +02:00
fred 924808ac04 SECTOR calculation error correction 2023-10-18 02:41:17 +02:00
fred b5c21d825c "" 2023-10-18 02:24:23 +02:00
fred e21c6e4e59 Collect Sector TWs RSS json Tiddlers into UPlanet SECTOR TW 2023-10-18 01:06:29 +02:00
fred 1051fabf20 Introduce - SECTOR TW - Updated with 10x10 UMap's TWs 2023-10-18 00:36:03 +02:00
fred eddae0c7c9 pip3 2023-10-17 23:13:30 +02:00
fred 9aadaa4e55 coucou only for COINS and not served PORT 2023-10-17 21:30:38 +02:00
fred 699e51a576 coucou is for COIN.check only (other goes to MOATS temp dir) 2023-10-17 21:26:04 +02:00
fred b51be6bb09 REMOVE TMP BUT KEEP SWARM 2023-10-17 21:03:17 +02:00
fred afed1ac6b4 more 2023-10-17 21:01:04 +02:00
fred 522dbcef3a fff 2023-10-16 23:49:52 +02:00
fred b86b154785 1st 2023-10-16 23:39:43 +02:00
fred 914025775d Need a bit more boostrap 2023-10-16 23:35:27 +02:00
fred 541570f145 COINScheck 2023-10-16 23:34:25 +02:00
fred f034722f8b c mieux 2023-10-16 22:52:39 +02:00
fred bd0abd9c39 scorpio 1st UPlanet refresher 2023-10-16 22:37:57 +02:00
fred 420a488e67 genify 2023-10-16 22:27:35 +02:00
fred 4af28a8840 not remove cache in loop 2023-10-16 22:16:41 +02:00
fred 04a210ddbb refresher 2023-10-16 22:09:34 +02:00
fred 4bf875dabf cache search & find less verbose 2023-10-16 21:00:48 +02:00
fred f1b48fb7d1 si if 2023-10-16 20:56:44 +02:00
fred 601d33a463 NODE refresh for publishing new state 2023-10-16 20:00:10 +02:00
fred a68d8b33ab Boostrap Node selection in UMAP.refresher 2023-10-16 18:28:43 +02:00
fred 618ad5eaca yep ti mal 2023-10-14 20:19:02 +02:00
fred c6bae83332 bug 2023-10-14 18:47:23 +02:00
fred 7612da2fca New UPlanet treatment - distribute UMap, USector & URegion keys - publish RSS numbers 2023-10-14 18:31:07 +02:00
fred 3469acc3e6 SWARM is all nodes connected to Boostrap nodes 2023-10-14 17:11:14 +02:00
fred 1ff1d5e305 SWARM.refresh inspecting and debugging 2023-10-14 17:09:07 +02:00
fred 2d59456951 Umap key sharing 2023-10-13 14:09:33 +02:00
fred 551d2d911f UMap refreshing randomly balanced among Boostrap list 2023-10-13 13:14:13 +02:00
fred 5500a240c2 Copy same UMAP TW & RSS from SWARM 2023-10-13 12:33:47 +02:00
fred 70ee8cebb8 Introduce SECTOR = 0.1° and REGION= 1° Keys 2023-10-12 22:04:37 +02:00
fred f2cb1ea33e stop loop after 12 copies 2023-10-12 00:28:17 +02:00
fred d215546de1 Multi Node key sharing... Coud be closest one... 2023-10-11 19:56:51 +02:00
fred 0e49836467 Proto UMap key sharing... To enhance 2023-10-11 19:53:38 +02:00
fred 72f4e77b77 Do not over write "TW abonnements", let light-beam do it 2023-10-11 19:32:19 +02:00
fred a1838a1cc0 PORT CONSUMED TIME LOG 2023-10-11 15:27:53 +02:00
fred 255001d7f8 ## MAINTAIN R/RW TW STATE 2023-10-11 14:24:09 +02:00
fred 98f765f1c2 MONITOR 2023-10-10 19:27:04 +02:00
fred 47345bdc67 Get TW & register on ★ GCHANGE LIBRE MARKET ★ 2023-10-10 14:04:08 +02:00
fred f4830b85d9 PASS not used any more... VAL could become a TW selector 2023-10-10 13:58:58 +02:00
fred 5e561ae3f5 better welcoming messages 2023-10-10 13:52:01 +02:00
fred bd44f61755 args=['--disable-gpu'] # Add this line to disable GPU 2023-10-09 22:59:46 +02:00
fred 2224544b95 Unleash MAP . bug removal 2023-10-09 22:39:10 +02:00
fred 73ee81cc12 Correct & extend 2023-10-09 22:15:29 +02:00
fred 4cd7ca89d8 make it right 2023-10-09 17:24:54 +02:00
fred 30ade33e4b null 2023-10-09 17:22:12 +02:00
fred c4b316c658 format evolution fixing 2023-10-09 17:16:20 +02:00
fred 65e0e557ce saltpepper.http homeAstroportStation URL replacement 2023-10-09 16:50:14 +02:00
fred ba748e85c1 no bug 2023-10-09 16:26:12 +02:00
fred 72ae1d7855 correct bug on 12345 missing replacement 2023-10-09 16:22:13 +02:00
fred fb64f253d1 ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html 2023-10-09 16:12:59 +02:00
fred 92fc6780d4 Make the Soup 2023-10-09 16:04:14 +02:00
fred 18ffeafb41 Send AstroID and G1Visa to EMAIL 2023-10-09 16:03:23 +02:00
fred 69ed051b7a HOWTO join OFFICIAL La♥Box Network 2023-10-09 15:47:14 +02:00
fred 7337de7000 www is G1Tag DApp template 2023-10-09 15:24:40 +02:00
fred a59d4d9ccc ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/feed.html - redirect to last json IPFS CID - 2023-10-09 15:05:12 +02:00
fred 0a18b3b362 Better Getting Started 2023-10-09 15:04:25 +02:00
fred a9717a78d0 www = ASTROBOT DApp Templates 2023-10-09 12:15:41 +02:00
fred 6e62165480 no matomo 2023-10-09 10:52:18 +02:00
fred 998af2376d better GPS on minimal TW 2023-10-09 09:51:42 +02:00
fred 420c5e03f7 online talking 2023-10-08 20:42:00 +02:00
fred 5e581dbaed check for bug for xastro G1BILLET - creating 6 Notes - 2023-10-08 18:38:58 +02:00
fred 207b28875d solar time calculator 2023-10-08 17:07:21 +02:00
fred 6cd0fc7403 IMAGINE - UPlanet - 2023-10-08 15:45:15 +02:00
fred 8a4ceabf1a Time 2 Solar v1 2023-10-08 14:43:07 +02:00
fred 176202d48f link to _MySwarm.$(myHostName).html 2023-10-08 14:42:48 +02:00
fred 044f429770 COPY PLAYER CACHE TO STATION SWARM CACHE 2023-10-08 02:27:07 +02:00
fred 57f62ba254 un bug 2023-10-07 17:21:16 +02:00
fred 10309bc08d TODO better HTML emailing 2023-10-07 17:15:53 +02:00
fred 5ed0b7797b natools path 2023-10-07 17:12:48 +02:00
fred 7fd22aa70c missing my.sh 2023-10-07 17:06:56 +02:00
fred df70031910 Lighter 2023-10-07 17:03:01 +02:00
fred 042e1ce670 ${MY_PATH}/keygen 2023-10-07 16:54:08 +02:00
fred 8a1f1635ca My TiddlyWiki on Astroport 2023-10-07 15:59:18 +02:00
fred d87550beb0 My TiddlyWiki on Astroport 2023-10-07 15:58:55 +02:00
fred 4edf93fea5 COUNT NO CHANGE 2023-10-06 21:03:44 +02:00
fred 901e5e6bd7 G1Card rulz 2023-10-06 17:20:13 +02:00
fred 8fab358bc1 provide salt pepper interface 2023-10-06 15:28:45 +02:00
fred 209c9515c9 Activate access to SaltPepper G1Card login, TODO arrange better 20H12 sun time multi node (a)sync 2023-10-06 15:20:55 +02:00
fred ddc5a7dee4 VISA.new - UPlanet - 2023-10-03 22:50:59 +02:00
fred f7fef2fdb4 problem executing page_screenshot.py on libra ?! 2023-10-03 13:07:31 +02:00
fred c3176d2a4b TW now with CPL plugins & drawio 2023-10-03 02:54:16 +02:00
fred f029251571 get more goodies 2023-10-03 00:33:27 +02:00
fred 9c3ad6bf08 Scan 50km Ads 2023-09-28 19:57:55 +02:00
fred 5d4798f331 make it good 2023-09-28 17:03:25 +02:00
fred 1afc0e9a2b bien 2023-09-28 14:39:54 +02:00
fred f6daf7f322 Reduce IPFSNODEID Swarm Size : /TW/PLAYER/index.html = redirect to /ipns/${ASTRONAUTENS} 2023-09-28 14:32:20 +02:00
fred a99b69f11e Umap collecting gchange 100km + SWARM PLAYERS RSS 2023-09-28 12:58:54 +02:00
fred ec3bdaf4c5 iframe presentation 2023-09-28 10:55:00 +02:00
fred 95a555dbbe p4n.json 2023-09-26 16:53:28 +02:00
fred 23b7f674a4 } 2023-09-26 14:52:20 +02:00
fred 2c19d599b5 maximum 30 sec 2023-09-26 13:52:35 +02:00
fred 8d2df19b73 UMAPROOT 2023-09-26 12:26:08 +02:00
fred e58ca592ac libra virtualization 2023-09-25 14:50:48 +02:00
fred 1ce78004e8 magnify swarm data 2023-09-25 14:44:47 +02:00
fred e93a3aa785 UPlanet confidence circle protocol 2023-09-25 14:08:04 +02:00
fred 46c1fb5c22 hidden & visible 2023-09-25 12:15:01 +02:00
fred 374903ddb4 visible 2023-09-25 12:13:40 +02:00
fred 3a3d70a5cc iframe visible 2023-09-22 17:49:01 +02:00
fred 8370eb9424 LOWMODE for isLAN stopped or disabled ipfs 2023-09-20 14:15:21 +02:00
fred dfec4fea65 boudiouh 2023-09-14 13:17:52 +02:00
fred 2d0da3df18 check it 2023-09-14 13:01:35 +02:00
fred 4fa66ada1a libra struck on page_screenshot.py ... need more tests... 2023-09-14 12:55:34 +02:00
fred b6f35e9ebd OSM2IPFS screenshot is working 2023-09-13 18:26:51 +02:00
fred bf22b7968e ipfs config changes : https://github.com/ipfs/kubo/blob/master/docs/config.md 2023-09-13 18:02:38 +02:00
fred 7b34d77c38 UMAP LAT LON replacement + 12345 CACHE UPDATE 2023-09-13 13:55:37 +02:00
fred 39852a73c7 fix 2023-09-13 12:23:53 +02:00
fred 51448e48fd ${IPFSNODEID}/UPLANET 2023-09-13 00:07:28 +02:00
fred 132e7bbea4 correction 2023-09-13 00:01:03 +02:00
fred 3708707231 "BUG 2023-09-12 22:42:34 +02:00
fred d714c15b69 this is it 2023-09-12 22:19:25 +02:00
fred 7df4a6cb68 check 2023-09-12 22:03:28 +02:00
fred 5e0230294c _MySwarm.moats 2023-09-12 21:43:25 +02:00
fred ef43755c81 remove --allow-offline 2023-09-12 20:16:21 +02:00
fred de6d3fe012 treating ~/.zen/tmp/swarm/_${ipfsnodeid}/ 2023-09-12 19:04:19 +02:00
fred 6dc269f58c better cache control and update 2023-09-12 19:01:42 +02:00
fred e1f908c3df Takes care of maintaining ~/.zen/tmp/swarm updated 2023-09-12 18:17:43 +02:00
fred 8344a12dd1 UPLANET release candidate is coming. 2023-09-12 18:10:42 +02:00
fred 38659ad19a UPLANET : UMAPNS now have a navigator App (umap.html is the template) 2023-09-12 17:19:36 +02:00
fred 7dd90e385e debug 2023-09-12 16:46:15 +02:00
fred 901bb879b3 display Umap with direction arrows 2023-09-12 00:43:41 +02:00
fred ad53814c69 debug time 2023-09-11 23:55:07 +02:00
fred 8d1c5f01b2 moving 2023-09-11 17:09:08 +02:00
fred 9d72e401fe UPLANET.refresh & cache management & bug hunting 2023-09-11 17:08:22 +02:00
fred b174e15995 debug & UPLANET RSS UMAP 2023-09-11 01:45:42 +02:00
fred 201c276a19 opacity=0.9 2023-09-10 18:16:13 +02:00
fred 7c698e38a1 MAP LAYER BETTER CONNEXION 2023-09-10 17:43:53 +02:00
fred 32b42cf07c maintain swarm cache 2023-09-10 16:45:11 +02:00
fred 119f3b9b0c wait 30s for actual LAT LON key refresh 2023-09-10 16:28:14 +02:00
fred 1bfca63e46 wait more time : 90s 2023-09-10 16:26:52 +02:00
fred a9da1f3fd2 hide & seek 2023-09-10 15:43:46 +02:00
fred f9798a2dab rearrange welcome app 2023-09-10 15:38:32 +02:00
fred 036dedc322 error correction
Creating Youtube "oGGDJAAFF-M" tiddler : G1CopierYoutube !
<video controls width=100% poster='/ipfs/QmX1C9u1k2yCTRadUxwaNGML7zeEpDCTb5JijfGS8RhshJ'> <source src='/ipfs/QmeCxzmThHtqMbaAb7TtVjemtGoHWMPrNJ1t9B2MvZHxdh' type='video/mp4'> </video> <br> {{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}}) <br> <h1><a href='https://www.youtube.com/watch?v=oGGDJAAFF-M'>NARCISSUS_by_Pacific_</a></h1>
/home/pi/.zen/Astroport.ONE/RUNTIME/../ASTROBOT/G1CopierYoutube.sh: line 238: /home/pi/.zen/tmp/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u/G1CopierYoutube/amour@yopmail.com/oGGDJAAFF-M.TW.json: No such file or directory
cp: cannot stat '/home/pi/.zen/tmp/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u/G1CopierYoutube/amour@yopmail.com/oGGDJAAFF-M.TW.json': No such file or directory
2023-09-10 15:06:16 +02:00
fred 271f4b6b8f UPLANET HOME LINK REPLACEMENT 2023-09-10 14:58:59 +02:00
fred b0f385bd5d uplanet 2023-09-10 02:21:32 +02:00
fred 94ee9dd562 this is it for tonight 2023-09-10 02:17:20 +02:00
fred 5ee755686d url='http://127.0.0.1:12345' used by astro.js 2023-09-10 02:02:02 +02:00
fred 76dc9e1bd4 <a href=http://127.0.0.1:12345 target='aframe'>RETRY</a> 2023-09-10 01:05:05 +02:00
fred 02e01939ba TWPORTATION 2023-09-10 00:47:34 +02:00
fred 082408b957 pouche 2023-09-10 00:40:49 +02:00
fred c767f69b69 Umap QR 2023-09-10 00:22:22 +02:00
fred 9ec2df17f7 G1Station 2023-09-10 00:13:59 +02:00
fred 5b123d9d5c quicker API 2023-09-10 00:07:00 +02:00
fred 37445d7ba2 PORT mode mitraillette 2023-09-09 23:53:11 +02:00
fred e4eaaa5728 http (s) 2023-09-09 17:21:09 +02:00
fred e37392e54a CONSOLE 2023-09-09 17:17:39 +02:00
fred 45b6d276e0 Station LOOP # 2023-09-09 17:15:15 +02:00
fred 182b665010 Use of amzqr API 2023-09-09 17:11:53 +02:00
fred ac25e42e73 AMZQR API /?amzqr=URLENCODEDSTRING&logo=IMAGE - produce png QRCODE IPFS link 2023-09-09 15:10:03 +02:00
fred f205a51009 AMZQR.sh API 2023-09-09 13:34:49 +02:00
fred 5f1d43a0b3 zip null problem checking on some nodes 2023-09-08 21:59:46 +02:00
fred 149f830186 fixing log 2023-09-08 17:02:09 +02:00
fred c1821444cf * (qo-op) * now allow to recenter UMAP 2023-09-08 16:58:00 +02:00
fred c29aeb3c7a Decalage de - 0.05° = MAP coord SW 2023-09-08 16:50:35 +02:00
fred 3205d0bb1d UPLANET/_${LAT}_${LON}/index.html is hidding UPLANET/_${LAT}_${LON}/RSS/ 2023-09-08 16:40:39 +02:00
fred e305b21a9c Put "12345" Mapping in cache ~/.zen/tmp/${IPFSNODEID}/GCHANGE/${PLAYER}/ 2023-09-08 16:06:58 +02:00
fred 671f9161d6 PLAYER.unplug.sh : remove PLAYER from ~/.zen/game/players/ & remove from UmapNS 2023-09-08 15:58:39 +02:00
fred f83e1606e0 PLUG / UNPLUG 2023-09-08 14:36:47 +02:00
fred 6a409ad5c1 SHOW FEEDNS 2023-09-08 02:14:10 +02:00
fred 087a6ad1f6 +1 2023-09-08 02:06:14 +02:00
fred 6963bdc84d PRINT G1Card for LOGIN/LOGOUT 2023-09-08 01:22:41 +02:00
fred 2c94b442e5 2 x 42s 2023-09-08 01:20:18 +02:00
fred 508022fe8f PSEUDO="qo-op" 2023-09-08 01:13:50 +02:00
fred 8f8166d9d5 read 2023-09-08 01:11:20 +02:00
fred 3cd930f911 $LAT 2023-09-08 01:02:23 +02:00
fred 6728075d91 SALT=${THIS} 2023-09-08 00:58:49 +02:00
fred 26670c8cec PEPPER=${WHAT} 2023-09-08 00:56:57 +02:00
fred 472905d6f3 != 2023-09-08 00:54:39 +02:00
fred e6e56e1919 OK Merge branch 'master' of github.com:papiche/Astroport.ONE 2023-09-08 00:51:41 +02:00
fred 6e0c3d789c Now it should work 2023-09-08 00:51:13 +02:00
aynic.os 7637d213b7 update dockerfile 2023-09-07 18:37:03 +00:00
fred 6a2f262d1c inscription 2023-09-07 17:43:14 +02:00
fred 10e3da0044 real bug was NPASS 2023-09-07 14:54:24 +02:00
fred 501843b7bb bug 2023-09-07 14:36:37 +02:00
fred 684ef63909 BUG 2023-09-07 14:26:16 +02:00
fred faf693ab97 bug ' 2023-09-07 13:52:42 +02:00
fred 5a4468ff07 fixes 2023-09-07 02:07:41 +02:00
fred 81e2b16824 --load 2023-09-07 01:38:26 +02:00
fred a1b82be754 Filter TW PLAYER already existing 2023-09-06 14:40:57 +02:00
fred d883a207ad Some CACHE cleaning 2023-09-06 14:16:59 +02:00
fred 7cd484b776 Move COINS in ./COINS 2023-09-06 14:08:20 +02:00
fred d2d1e0ec80 birthdate 2023-09-06 02:06:28 +02:00
fred aa91a4f708 print 0.01 registration to PLAYER 2023-09-06 01:15:52 +02:00
fred b3fd287519 OK 2023-09-06 01:09:15 +02:00
fred fa1323366b REDIR 2023-09-06 00:34:38 +02:00
fred 955ac3d382 (<span id='LAT'></span>:<span id='LON'></span>) registration<br> 2023-09-06 00:21:08 +02:00
fred b6cd5ab63d publish RSS feed on UPLANET 12345 network 2023-09-05 23:50:02 +02:00
fred d15696d2ef Pusblish RSS 2023-09-05 22:55:18 +02:00
fred 15ef3a8a8a NPASS 2023-09-04 19:24:10 +02:00
fred f19081f12a 8 DIGIT for Gchange 2023-09-04 19:23:12 +02:00
fred ec83600bf9 NEED G1 TO MAKE A WISH 2023-09-04 17:04:20 +02:00
fred 4ac4eca9fe countdown visibility 2023-09-04 15:20:43 +02:00
fred 05a5ef867a Clic Smiling Face ;) 2023-09-04 15:12:14 +02:00
fred 4ce31a812a Get response by clicking smiling face ;) 2023-09-04 15:04:14 +02:00
fred 041cbf94ed links OK 2023-09-04 15:00:12 +02:00
fred b16b26459c https://ipfs.copylaradio.com/ipns/copylaradio.com replace https://qo-op.com 2023-09-04 14:39:45 +02:00
fred 24f0043948 Community HotLine 2023-09-04 14:15:06 +02:00
fred b8345de735 LOCAL | GLOBAL 2023-09-04 13:24:49 +02:00
fred 6c623bfa03 MESSAGE 2023-09-04 13:04:03 +02:00
fred 842df7e71d MESSAGE.html 2023-09-04 12:12:35 +02:00
fred 48d13b7a48 sat_render correct 2023-09-04 04:28:24 +02:00
fred d2dfdec89e Umap 2023-09-04 03:45:23 +02:00
fred 78b5c7aeee better session calibration 2023-09-04 03:38:48 +02:00
fred bc686e2b11 Respect IPNS default PUBLISH pubkey format 2023-09-04 03:14:39 +02:00
fred 08ab7d774a Astroport.ONE 2023-09-04 02:24:41 +02:00
fred 9b685a3da0 Usat & Umap 2023-09-04 02:14:41 +02:00
fred ebf9d4d212 cut 2023-09-04 01:39:11 +02:00
fred f3e36a3dcd remove old testing API period verbosity 2023-09-04 01:38:39 +02:00
fred 5331d46957 LOGOUT with PASS & EMAIL 2023-09-04 01:34:10 +02:00
fred a52f53faad bad email = calculate UMAPNS for visiting without registration 2023-09-04 00:55:40 +02:00
fred 18e85edc8d VAL="$(echo ${VAL} | detox --inline)" ## DETOX VAL 2023-09-04 00:47:04 +02:00
fred 09df72499f LOGOUT with G1Card 2023-09-04 00:24:43 +02:00
fred f9ca8a13a7 MESSAGE is better 2023-09-04 00:01:27 +02:00
fred 763556fb4b 90 seconds is the delay for Umap & PLAYER key creation process. 2023-09-03 23:40:47 +02:00
fred 80b329f4c0 https://qo-op.com 2023-09-03 23:30:20 +02:00
fred fe239b77bb EN - FR TW 2023-09-03 23:10:22 +02:00
fred 02dd2e8329 GPS / UPlanet - Umap_0.00_0.00 2023-09-03 22:05:48 +02:00
fred af8f3ecdb4 CHECK FOR NOT PUBLISHING ALREADY (AVOID IPNS CRUSH) 2023-09-03 21:39:28 +02:00
fred 79c7b50c24 60s IPNS sync waiting time 2023-09-03 21:30:26 +02:00
fred 3acb4c366f _visitors 2023-09-03 21:25:48 +02:00
fred 2a93d99965 LOGIN / LOGOUT 2023-09-03 20:36:29 +02:00
fred dd4ea64cfb Crypto Commons Playground 2023-09-03 20:29:23 +02:00
fred d57b639e47 myG1BILLET 2023-09-03 20:27:21 +02:00
fred 43fe8ac749 WRITE INTO 12345 SWARM CACHE LAYER 2023-09-03 20:11:54 +02:00
fred 7674062569 jAV 2023-09-03 19:17:18 +02:00
fred 8479bf7c97 miami 2023-09-03 18:56:17 +02:00
fred f714cd3801 rewriting 2023-09-03 02:26:43 +02:00
fred c4b8658aa1 Evolution du modele twdefault.html GPS COMPATIBLE 2023-09-03 02:17:18 +02:00
fred d35944962e Default Entrance is 0.00 0.00 2023-09-03 01:57:25 +02:00
fred aff11948ba need some testing, but mostly ok 2023-09-03 01:50:06 +02:00
fred a0a39c8af7 missing fi 2023-09-03 01:37:10 +02:00
fred 81308cf6c0 MAKE A MESSAGE 2023-09-03 01:33:16 +02:00
fred 4e919399b5 add message.html 2023-09-03 01:24:42 +02:00
fred 4067b64c60 current not changed 2023-09-03 00:53:42 +02:00
fred df7d2eb972 Create TW link for PLAYER on LAT/LON KEY 2023-09-03 00:47:24 +02:00
fred f56314a0fd RECORD ON YOUR ASTROPORT ONLY 2023-09-03 00:29:00 +02:00
fred 234ce18aef convert directories to json filename=content ... WARNING ... dangerous with large files git add . 2023-09-03 00:04:47 +02:00
fred a532345130 No PASS, just visit
PASS = create PLAYER (EMAIL/PASS)
2023-09-03 00:03:05 +02:00
fred 8914fde3eb Email / PASS registration 2023-09-02 23:11:41 +02:00
fred 0a6c811c4c ${LAT}_${LON} .00 2023-09-02 22:39:18 +02:00
fred e284a53d4d fixes & more 2023-09-02 22:32:59 +02:00
fred 59954771cc used to put your LAN node on WAN 2023-09-02 16:40:20 +02:00
fred a5975d19d5 myG1BILLET="https://libra.copylaradio.com" 2023-09-02 04:00:39 +02:00
fred bf102fe71a pepper 2023-09-02 03:58:30 +02:00
fred d3a2835dbd salt pepper copying from URL to form 2023-09-02 03:56:41 +02:00
fred 36aac6bb74 salt pepper = lat lon 2023-09-02 03:50:54 +02:00
fred 6aa24b62d4 ${HOME}/.zen/tmp/${MOATS}/Umap_${SALT}_${PEPPER}.jpg 2023-09-02 03:24:56 +02:00
fred c937a75292 ## TODO find a better crawling method (pb tiles are not fully loaded before screenshot) 2023-09-02 03:22:54 +02:00
fred 4e5d206b64 UPLANET is looped with htpps://qo-op.com 2023-09-02 03:19:07 +02:00
fred 34c6383ce6 better 2023-09-02 02:52:36 +02:00
fred 8c223a140f UPlanet :: G1Visa & G1Card distribution 2023-09-02 02:44:50 +02:00
fred 1b61a767c4 Getting IPNS cache
Wait 1 minute before clicking on yellow button
2023-09-02 02:26:28 +02:00
fred 66e766563f Umap are not fully loaded when captured... Could do better 2023-09-02 00:43:20 +02:00
fred 1e12d683d2 Umap are not fully loaded when captured... Could do better 2023-09-02 00:08:40 +02:00
fred c7bd3b2298 UPlanet 2023-09-01 20:15:15 +02:00
fred f4371a1375 crypto commons Umap 2023-09-01 03:56:55 +02:00
fred 779df0d09e UPlanet MOATS publishing 2023-09-01 02:12:02 +02:00
fred 63f96bd547 U Planet - LAT LON KEYS - Crypto Commons 2023-09-01 01:25:25 +02:00
fred e0a3f5ad84 RENAME TO docker-compose.yml & RUN docker-compose up -d 2023-08-23 16:07:30 +02:00
fred c6e668c548 atelier multi outils 2023-08-15 23:01:47 +02:00
fred 5f7748c1ea DEBUG WID calculation 2023-08-05 16:35:46 +02:00
fred d294eeaafb OUTDATED. PLEASE REVIEW 2023-08-05 16:35:26 +02:00
fred 752a1072da SECRET2="${VoeuName} ${PLAYER}" 2023-08-01 01:27:34 +02:00
fred 6471dcab15 wishes keys are (SECRET2 / WishName EMAIL) 2023-08-01 01:17:38 +02:00
fred 2218958d85 comment=N1Kodi:TiddlerTiltleHash 2023-07-31 17:08:55 +02:00
fred cf97839a81 G1Kodi / N1Kodi QR code : OK 2023-07-29 13:46:20 +02:00
fred 09fe26c632 Convert TW to Obsidian https://forum.obsidian.md/t/import-from-tiddlywiki-5-to-obsidian/731/18 2023-07-27 13:12:47 +02:00
fred 95a0abd229 WID=myAPI 2023-07-26 12:28:58 +02:00
fred 416da3cec5 N1Process fired by G1PalPay 2023-07-24 11:26:39 +02:00
fred 663f7a26d2 G1Kodi TW double publish resolve 2023-07-23 22:21:05 +02:00
fred e7bb21149a G1Kodi 2023-07-22 01:34:12 +02:00
fred 5b0dfbabba VOD on pay with comment "N1Kodi:TiddlerTittleHash" 2023-07-22 01:00:07 +02:00
fred 37fbc674e0 Building a ditributed broadcasting VOD - G1Kodi - 2023-07-20 20:55:26 +02:00
fred b43123c578 Step to go 100% installable from IPFS 2023-07-19 23:07:06 +02:00
fred 68465e63bf The Art of key derivation, chaining & use 2023-07-19 12:23:24 +02:00
fred 7d36c2fcab G1Visa extended 2023-07-19 11:22:39 +02:00
fred 9ce47f0157 Web3 2023-07-19 11:11:38 +02:00
fred 7ed17f22e8 TWMODEL="/ipfs/bafybeiawwjh3tbbi4t27kwevzvcjzydgsjksrqeompsyhgkqlg7ninuhca" 2023-07-19 10:46:28 +02:00
fred 3d40288540 issuer = EMAIL 2023-07-14 15:45:07 +02:00
fred 19cfeeb04e G1Kodi make movie RSS stream from friends 2023-07-12 16:15:41 +02:00
fred 20eae30528 update Kodi params with RSS ASTROPORT movies source 2023-07-12 15:05:17 +02:00
fred 9c38d6e954 bug removal 2023-07-12 10:57:50 +02:00
fred 155a5cfc54 INDEX="$HOME/.zen/tmp/${MOATS}/index.html" 2023-07-11 21:33:12 +02:00
fred 06abde6e36 PROGRAM check 2023-07-11 21:13:56 +02:00
fred 18878b602c G1Kodi WISH : share Kodi mp4 movies between friends: entering BETA period 2023-07-11 13:26:11 +02:00
fred 4e3119f576 Better cache for FRIENDS 2023-07-10 12:39:33 +02:00
fred 323c9ff40e G1Kodi 1st step 2023-07-10 11:51:36 +02:00
fred 708b0a3e87 TODO: VERIFY IN HISTORY "G1CARD:MOATS" APPEARING 2023-07-06 17:10:02 +02:00
fred f572c4470d RUNTIME 2023-07-06 17:06:34 +02:00
fred 39849e1254 RUNTIME 2023-07-06 17:06:09 +02:00
fred 4460b23a87 TW SECRETS 2023-07-04 17:20:35 +02:00
fred e495e860a8 What is underneath cyber? Web2, API, Blockchain, P2P, Web3 & Crypto school material 2023-07-04 14:18:23 +02:00
fred 95507e0315 READ THIS TO UNDERSTAND WHAT IS UNDERNEATH 2023-07-04 12:41:50 +02:00
fred 87e30178fe BOOTSTRAP 2023-07-04 02:16:57 +02:00
fred f4eaad73e3 EXPLAINATIONS 2023-07-03 23:05:08 +02:00
fred 74071104b0 2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH 2023-07-03 17:05:53 +02:00
fred c9eb4eb2e4 G1Kodi is publishing local Kodi movies as PLAYER G1Voeu RSS feed any other Kodi could add as new source. ex : https://ipfs.copylaradio.com/ipfs/QmSJYf4uTj3NmqovSFZpBZuUhSS8j9FXKKnAjUMuVE896k 2023-07-03 16:35:27 +02:00
fred 8708c2cb50 Allow TW record in WAN condition
https://ipfs.copylaradio.com (8080)
https://ipfs.libra.copylaradio.com (5001)
2023-07-03 12:13:10 +02:00
fred 53003497bb G1CARD 2023-07-03 03:04:45 +02:00
fred 8d8e15e1a4 G1PUB:CRC 2023-07-03 02:55:15 +02:00
fred 302ae697fa # G1nkgo compatible 2023-07-03 02:45:25 +02:00
fred bc2d16c840 Last10GChangeNewUser.json.sh 2023-07-01 23:51:37 +02:00
fred 1f382574a4 myIp 2023-07-01 21:44:29 +02:00
fred 2cec42fa8e ${myIP} & more 2023-07-01 21:29:34 +02:00
fred 68e1246d63 Declencheur Automate RUNTIME 20H12 2023-07-01 20:32:32 +02:00
fred 9a6ea83c9d L'architecture attachée à chaque clefs publiques se déploie et en forme de "pétales de fleur 2023-07-01 19:02:51 +02:00
fred fccd11e623 Takes care about swarm map (http://127.0.0.1:12345) 2023-07-01 17:08:54 +02:00
fred 2769c656d9 Launch "netcat" API server (http://127.0.0.1:1234) 2023-07-01 13:23:48 +02:00
fred 905d7f132a CopierYoutube DApp Model 2023-06-30 21:37:14 +02:00
fred f0f64bd180 APPLY FOR ${WISHNAME} MODEL : make index.html 2023-06-30 21:36:25 +02:00
fred bd919b0394 plus 2 cleaning... test code in _sandbox 2023-06-30 21:31:16 +02:00
fred 98668ba4a7 now astroport is systemctl controled 2023-06-30 21:24:27 +02:00
fred ab1411750c https://ipfs.asycn.io 2023-06-30 16:34:42 +02:00
fred 8f7ab6099e ranging the code mieux 2023-06-30 13:50:34 +02:00
fred 87781f3236 ${WISHNAME} 2023-06-30 02:24:30 +02:00
fred aabe8c01f6 LAN / WAN / ENV 2023-06-30 01:46:15 +02:00
fred 01b860d8cf Get PLAYER own G1Tag json or all FRIENDS (sharing same G1Tag) json 2023-06-07 14:03:30 +02:00
fred f039d5958b updating to kubo v0.20.0 2023-06-07 12:11:10 +02:00
fred effab20e3e Demon App only for G1CopierYoutube (others publish _email.json with no index.html) 2023-06-06 21:21:51 +02:00
fred b2fb1f1bfe Les données sont stockées [dans des Tiddlers] 2023-06-05 00:32:08 +02:00
fred 82b4d60519 wish 2023-06-04 22:22:17 +02:00
fred 50e44c7415 participate 2023-06-04 21:58:50 +02:00
fred 0a723be3e0 pandoc & G1CB secrets 2023-05-29 23:05:04 +02:00
fred 8bba2dacb5 Bootstrap change (3 nodes : libra, scorpio, sonic) 2023-05-27 14:43:16 +02:00
fred 553373180f cleaning 2023-05-17 17:50:09 +02:00
fred 5e3638b7d6 adapt G1BILLET url 2023-05-16 03:20:01 +02:00
fred 26ee21b165 cache restore 2023-05-15 20:57:47 +02:00
fred b9076d6cd1 was making nasty sneaky misbehaviour 2023-05-14 20:59:44 +02:00
fred f13be7b276 QRCODE PRINTING LAYER 2023-05-13 16:36:21 +02:00
fred 0d55f29d6a Swarm /p2p/ 2023-05-13 14:44:11 +02:00
fred 5ee4f1d4ed correct G1BILLET link 2023-05-13 13:53:39 +02:00
fred a89cd69631 BUG !:!:!: with virtual player... 2023-05-12 20:40:19 +02:00
fred b1949789c6 g1billet 2023-05-11 13:20:20 +02:00
fred d7fab30ab7 45780 45781 response port only in DEMO zip mode 2023-05-10 16:56:08 +02:00
fred 9bd0ed4094 $(zIp) activate outside internetBOX access - activate for DEMO only - 2023-05-10 16:33:23 +02:00
fred 3b9048cdcc a w& 2023-05-10 15:04:10 +02:00
fred ce2c04eac6 Now PLAYER can create any G1CARTE from any Station (without TW) 2023-05-10 13:56:07 +02:00
fred b5e78178eb The Art of key derivation 2023-05-08 14:45:01 +02:00
fred bf956f35ba v2.rc1 2023-05-07 03:03:42 +02:00
fred 423280f29c pus 2023-05-06 04:18:05 +02:00
fred d15fe6fb2b ae 2023-05-06 04:15:51 +02:00
fred 3b4d24ba64 zIP 2023-05-06 04:09:08 +02:00
fred e59eb98d31 45780 45781 port switchin 2023-05-06 03:50:23 +02:00
fred c056afdd48 zip try 2023-05-06 03:43:31 +02:00
fred 6963fd8f1e dz 2023-05-06 03:39:28 +02:00
fred d5093f90db zipipipzz 2023-05-06 03:35:08 +02:00
fred 027d947ea4 Zipping 2023-05-06 03:29:01 +02:00
fred 8a482a4648 echo "$myZip" 2023-05-06 03:15:09 +02:00
fred 28395c89f5 yop 2023-05-06 03:10:12 +02:00
fred d9b86f3f0e local zip=$(cat ~/.zen/♥Box 2>/dev/null) 2023-05-06 02:54:37 +02:00
fred 834edad954 \342\231\245Box 2023-05-06 02:35:50 +02:00
fred 024e9cd972 refined & easy ♥Box system interconnection
MODE DEMO :: BRECHE DE SECURITE POTENTIELLE :: LA SECURITE EST DANS IPFS la G1 et sa Toile de Confiance ::
Indiquez l'IP externe de la BOX "Internet" dans le fichier ~/.zen/♥Box
Ouvrir les ports mis en commentaire dans my.sh

YOU ARE WISITING US THROUGH N0 WORLD
TROLLS LAND -
DO NOT USE IN PRODUCTION !!
 IF YOU LIKE TO HACK COME WITH US.
PLENTY NEW LEVELS ARE RISING
2023-05-06 02:35:06 +02:00
fred cee27162f0 zzzz 2023-05-03 02:45:17 +02:00
fred fa04f27710 MAP.refresh is NOT ASTROBOT program : move to tools 2023-05-02 03:08:16 +02:00
fred b82fa2f134 detect BAD PLAYER 2023-05-02 02:51:23 +02:00
fred 6cb83834b2 we 2023-05-02 02:45:17 +02:00
fred ba8845d1aa we 2023-05-02 02:45:05 +02:00
fred d6e73b500b __pycache__ 2023-05-02 01:36:44 +02:00
fred 620659f710 remove warnings 2023-05-02 01:34:49 +02:00
fred 6e431a9da1 rewriting 2023-05-02 01:29:35 +02:00
fred 15ee4afdad send new G1PASS by email 2023-05-02 01:17:22 +02:00
fred 4627dbcda0 comes with G1BILLET / G1PASS / G1TW / @PASS 2023-05-01 21:43:17 +02:00
fred ffbfef7304 Choose to install PRINTER LAYER 2023-05-01 21:42:18 +02:00
fred ddfae0e423 DApp icons & desktop shortcuts 2023-05-01 21:29:43 +02:00
fred 3ba64d1be9 Upgrade 2023-05-01 21:29:04 +02:00
fred e689bfd354 (•‿‿•) : Missive ${VoeuName} - ${UPASS} - La♥Box 2023-05-01 05:07:01 +02:00
fred 1b63e7c449 G1MISSIVE 2023-05-01 04:47:17 +02:00
fred 6ab293ff05 Evolution Milgram workflow & UX 2023-05-01 03:50:19 +02:00
fred f78c8041f0 G1Milgram is for G1Missive UX 2023-04-30 15:27:26 +02:00
fred 666a0a8dc8 G1Milgram is for G1Missive UX 2023-04-30 15:27:10 +02:00
fred 278255feb4 We had a / problem 2023-04-30 15:24:29 +02:00
fred 21ca95fe0f G1Milgram v0.1 / Sub PLAYER G1Voeu YYYYMM - must be relayed to find target - maximum validity 2 month 2023-04-29 23:27:49 +02:00
fred 4590d0b7a3 cosmetics in code & extra protections 2023-04-29 20:03:54 +02:00
fred f877cceba7 réglage fin 2023-04-29 03:20:43 +02:00
fred 6b53a9093b AUTO RELAUNCH IN ABOUT AN HOUR : DESYNC SWARM REFRESHINGS 2023-04-29 03:15:42 +02:00
fred f256523637 REMOVE EMPTY DIRECTORIES 2023-04-28 22:27:13 +02:00
fred 8807970cdb ZNOD's SWARM CACHE AUTO PROPAGATION ACTIVATED 2023-04-28 18:14:12 +02:00
fred 3d91fb0cd0 SWARM NODE DATA CACHE REPLICATOR 2023-04-28 16:34:59 +02:00
fred f31aa39c80 window.open 2023-04-28 14:46:49 +02:00
fred 0b800bf4f8 add matomo monitoring 2023-04-28 03:30:07 +02:00
fred 414609a859 G1Tag is related to a derivated key and a merging DApp 2023-04-27 12:20:49 +02:00
fred ad07d6d88c ncdu 2023-04-27 00:48:16 +02:00
fred 7e639eb414 Pas satisfaisant... desactivation copie "web" Hey les DEV à voir si ça vous dit de réactiver ça 2023-04-27 00:39:27 +02:00
fred c2b9ced029 stabilize p2p connexion 2023-04-27 00:26:59 +02:00
fred dbaa4a9cbd SHARE A PORT : EXPERIMENTAL : ipfs p2p forward & listen 2023-04-26 23:50:27 +02:00
fred 8339311d19 (◕‿‿◕) YOUR ASTROPORT 2023-04-26 23:21:47 +02:00
fred e316d5f1c4 netcat BASH API 2023-04-26 23:13:03 +02:00
fred 81066d12e7 ~/Astroport// : Your Web3 shared directories 2023-04-26 23:05:35 +02:00
fred dab40e065a 160 MB of code to open an infinite network of friends 2023-04-26 21:20:36 +02:00
fred 34f72ea274 PalPay 2023-04-25 21:20:11 +02:00
fred 333cc6cdc1 push 2023-04-25 19:24:26 +02:00
fred 025df24806 rewrite $VAR into ${VAR} 2023-04-25 18:17:46 +02:00
fred 6272e89a24 replace "ASTONAUTENS" whith "ASTRONAUTENS" 2023-04-25 18:11:40 +02:00
fred fbf9ded5ef ASTRONAUTENS 2023-04-25 14:50:40 +02:00
fred 9c35624413 login is made on "Open Station" 2023-04-24 22:43:56 +02:00
fred 93e40403f3 Welcome EMAIL arranged 2023-04-24 22:41:43 +02:00
fred 33926d0e0f larger input box 2023-04-24 21:55:27 +02:00
fred f5cb83cfb4 log but less verbose 2023-04-24 21:46:23 +02:00
fred cbad92edb1 remove amzqr 1 output 2023-04-24 21:42:32 +02:00
fred 1ee302a622 remove DEV warning 2023-04-24 21:32:14 +02:00
fred 9b3c72dca4 Now you can login & open TW with your G1PASS (and email) 2023-04-24 20:53:44 +02:00
fred 482e6fe920 AstroID.png is 480x480 pixels 2023-04-24 19:20:43 +02:00
fred 0290d4017b --exclude-dir='.git*' 2023-04-24 19:06:38 +02:00
fred 46ab6f015f better 2023-04-24 17:03:00 +02:00
fred 6fb049c192 Lancer la copie d'une URL par PLAYER 2023-04-24 16:21:21 +02:00
fred 75cf71307f QRCODE is G1*? Redirect to G1WishApp / Export (G1)Tagged Tiddlers json from TW 2023-04-24 16:04:21 +02:00
fred e681137d6d QRCODE API update 2023-04-24 16:02:29 +02:00
fred 400c9f6358 qrcode=G1Tag export API : OK + other goodies 2023-04-24 15:51:48 +02:00
fred 4d6cf631fa ok 2023-04-23 19:04:36 +02:00
fred dc729542aa cp /etc/resolv.conf /etc/resolv.conf.backup 2023-04-23 18:21:09 +02:00
fred 282509fe28 split REC & Astroport G1Station desktop icons + Nemo "Add To IPFS" 2023-04-23 18:19:01 +02:00
fred 26bf94f0fe friend G1PASS : send ★'s to g1pub 2023-04-23 17:40:38 +02:00
fred 78a5d496b7 no more url logging 2023-04-23 17:22:39 +02:00
fred 435aeeb883 every day refreshing ${G1PUB}.g1history.json 2023-04-23 17:15:08 +02:00
fred 3abe9eb39a You can Send ॐ★ॐ to friends on your G1Station 2023-04-23 02:00:34 +02:00
fred 776f36259e mixup 2023-04-23 01:13:07 +02:00
fred e372c80769 now DEBIAN better compatible / install sudo / 2023-04-22 00:25:31 +02:00
fred c6cc502203 Was not in PATH for docker WAN 2023-04-21 22:28:59 +02:00
fred 1c8d64fd53 MadeInZion tiddlers contains :: _DAO_ / _ROOT_ / _SECTOR_ :: used to link TW & G1PASS 2023-04-21 17:22:14 +02:00
fred a83257c215 fonctionne aussi
+                    <br>avec les portefeuilles
2023-04-21 05:00:51 +02:00
fred 261f527f20 myHOST 2023-04-21 04:53:56 +02:00
fred 45cb56070a Work on WAN Station 2023-04-21 04:48:49 +02:00
fred 1c669d1dd3 PREVENT DUNITER DESYNC (KEEPING ASTROPORT LAST KNOWN VALUE) 2023-04-21 04:33:16 +02:00
fred f99cdd2e1c watt 2023-04-21 04:18:26 +02:00
fred 26179c0ff2 G1PASS G1PUB 2023-04-21 04:00:19 +02:00
fred 9346938eed 600x500 2023-04-20 23:05:34 +02:00
fred 491f509e0c G1PASS FEATURES : balance - pay - history - etc ... 2023-04-20 19:16:10 +02:00
fred a81b92ac6a [make a G1PASS (security level 6)](http://g1billet.localhost:33101/?montant=0&style=xbian&dice=6) 2023-04-20 16:08:23 +02:00
fred 851079ef02 CODE BEHAVIOUR. monitor && rewards || fork signal 2023-04-20 15:37:39 +02:00
fred f74624d725 www/G1PalPay/G1PalPay_fichiers/astro.js 2023-04-20 15:27:18 +02:00
fred 164c6bf7a1 astro.js PORT twisting API 2023-04-20 15:26:10 +02:00
fred 5888e06eb6 plus joli comme ça 2023-04-20 15:09:17 +02:00
fred b99e3bc8a1 Add G1PUB on G1Visa 2023-04-20 04:52:07 +02:00
fred 9da9f92582 perfect 2023-04-20 04:45:37 +02:00
fred e3b7a26e26 plein de truc cool 2023-04-20 03:56:28 +02:00
fred fd50ffad45 monitor behaviour and send reward 2023-04-20 01:00:21 +02:00
fred edaac3df42 Add "login" feature using G1PASS QRCODE 2023-04-19 22:57:23 +02:00
fred 7b280f585f PALPE=1, 10, 50 / depending on null / gchange / cesium 2023-04-19 19:18:13 +02:00
fred d31fd9cfee install was locked ;) unlock now 2023-04-19 14:56:19 +02:00
fred eb1dbad28e COCODING MEETING ROOM 2023-04-19 04:17:35 +02:00
fred 1f69d2d9c4 make it better 2023-04-19 04:10:17 +02:00
fred 505df45d61 UPSYNC TO is correct now 2023-04-18 15:44:02 +02:00
fred a052f681fd MACHINEPUB 2023-04-18 05:10:42 +02:00
fred 9f7ea817aa ♥Box ready 2023-04-18 04:56:45 +02:00
fred 92a6e42f22 MySwarm_${IPFSNODEID} IS /proc/cpuinfo DERIVATED KEY USED TO DECODE TW MadeInZion BASE16 2023-04-18 04:53:01 +02:00
fred bdb1a12b88 Add To IPFS Nemo right click action 2023-04-17 16:41:18 +02:00
fred c2bbaca55a make your station shut up or speak 2023-04-17 14:51:43 +02:00
fred 9c6607d865 not looping on me 2023-04-17 10:36:35 +02:00
fred 2fa7bc613a ON / OFF / LOW 2023-04-17 10:17:47 +02:00
fred 1d727af793 ## BE CAREFUL NOT MAKING A LOOP !!! 2023-04-17 09:29:20 +02:00
fred e8eb8fa8cd remove empty directories 2023-04-17 02:01:40 +02:00
fred e36c8e8f2a TODO: make it extract data for RADAR map (zeg1jeux rewriting) 2023-04-17 01:41:15 +02:00
fred 17681e86a8 We Make 👉Le Claude👈 2023-04-17 01:23:20 +02:00
fred 7baeb14ca2 no error 2023-04-17 01:09:36 +02:00
fred cb0e58d395 NODEG1PUB ~/.zen/tmp/swarm & ~/.zen/tmp/$IPFSNODEID 2023-04-17 01:08:22 +02:00
fred 05131bca38 2 2023-04-16 23:26:48 +02:00
fred 0805e918fc hhh 2023-04-16 23:23:41 +02:00
fred 3cdeb73053 players 2023-04-16 22:43:36 +02:00
fred 3190f0795a IPNS_VOEUNS=/ipns/VOEUNS 2023-04-16 21:22:28 +02:00
fred b9d1b5beff UPDATE TW HPASS & PINNING IPFS MEDIA - PROOF OF COPY SYSTEM - 2023-04-16 20:44:29 +02:00
fred fc6e3bbbd1 UPDATE HPASS 2023-04-16 18:34:43 +02:00
fred 96bc4b48cf pdf import 2023-04-16 02:00:19 +02:00
fred f85c2b82ed a 2023-04-16 00:03:49 +02:00
fred bd475abb2f fixing tight 2023-04-15 23:56:53 +02:00
fred 5fdaa737f4 smooth 2023-04-15 21:59:50 +02:00
fred 9a6ad5b7a2 Une fois votre G1PASS obtenu, direction https://gchange.fr ! 2023-04-15 16:09:11 +02:00
fred 68528599c2 astro.js replace #countdown innerHTML 2023-04-15 15:45:23 +02:00
fred 9f06e445bb astro.js upgrade 2023-04-15 15:39:53 +02:00
fred b837f4cd4d INSTALL & ENJOY MAKING WEB3 TOGETHER 2023-04-15 15:28:47 +02:00
fred 44ffa4c4a0 Astroport.ONE takes 20 minutes to Install on your Station : "Own your Data" = "Own The Internet" 2023-04-15 15:19:32 +02:00
fred fe81ad0fea WAN is for demo / LAN is for production 2023-04-15 15:04:00 +02:00
fred 8d41fbb484 THIS IS A WEB LINK mode 2023-04-15 00:11:57 +02:00
fred 8cdd1471bb adjusting 2023-04-14 23:18:04 +02:00
fred bb9b7bf070 > ~/.zen/tmp/topgp
cat ~/.zen/tmp/topgp
2023-04-14 22:57:12 +02:00
fred 3d29a5b36f G1Voeu WISHKEY is G1PUB 2023-04-14 22:23:42 +02:00
fred d50dae7ee6 ipfs path correction 2023-04-14 21:28:32 +02:00
fred 21cf3d8998 LOW MODE detection 2023-04-14 17:42:58 +02:00
fred b086446dfc G1BILLET Linking to myIP:33101 2023-04-14 17:17:38 +02:00
fred 1279f1d198 Nous utilisons "astro.js" dans l'Application DEMO 2023-04-14 16:49:50 +02:00
fred c2d2b61f92 http://127.0.0.1:8080/ipfs/QmYjUbg8NzsXxkYV5NnK2rwv38VGd5z8dhxr3zEph6qFQM/astro.js 2023-04-14 16:48:41 +02:00
fred 5a06a1232b [DOCUMENTATION](https://pad.p2p.legal/s/Astroport.ONE) 2023-04-14 16:23:25 +02:00
fred 1594599785 [DOCUMENTATION](https://pad.p2p.legal/s/Astroport.ONE) 2023-04-14 16:14:06 +02:00
fred 87bcfbac34 Add Screen capture 2023-04-14 14:36:44 +02:00
fred a6940e2bc3 UPDATE TW CHAIN WITH PREVIOUSLY RECORDED CHAIN 2023-04-14 14:19:20 +02:00
fred 60e7669f52 QRLINK new 2023-04-13 14:52:12 +02:00
fred a938a81c32 better cache cleaning 2023-04-13 12:59:24 +02:00
fred cb335842ca Do not use Wish credential (G1 prefixed Pepper) in salt API 2023-04-13 12:49:56 +02:00
fred 4ffc937304 print G1PASS on page 2023-04-12 19:10:22 +02:00
fred f8847a776a LOW ON and OFF 2023-04-12 18:50:24 +02:00
fred 6ddd839231 LOW mode 2023-04-12 18:47:21 +02:00
fred 94cba1e6ed LOW mode enable IPFS only during 20H12 sync time 2023-04-12 18:45:10 +02:00
fred a83f770933 STATION MAP & PLAYER DATA PROPAGATION 2023-04-12 11:57:51 +02:00
fred 2584bb7376 BUG 2023-04-11 17:06:52 +02:00
fred ea05694891 ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/ 2023-04-11 15:34:55 +02:00
fred f458d74b79 astroport 2023-04-11 13:45:35 +02:00
fred 7f676804a2 /usr/local/bin/yt-dlp 2023-04-10 20:50:13 +02:00
fred 94e4db5ba4 youtube-dl 2023-04-10 20:47:21 +02:00
fred 2f239feaa6 new earth 2023-04-10 20:42:26 +02:00
fred bd4c9e8ca9 new one 2023-04-10 13:22:53 +02:00
fred bde14d4bc8 missing end bracket 2023-04-10 12:34:38 +02:00
fred 8e2141b35f MAP FRIENDS 2023-04-09 01:31:33 +02:00
fred d593908810 css 2023-04-08 23:59:30 +02:00
fred 8972651f8c G1Voeu 1st Sharing App 2023-04-08 23:54:42 +02:00
fred 6760beb631 G1PalPay 1 JUNE A CHAQUE DEDICACE A CHAQUE NOUVELLE COPIE 2023-04-08 16:53:21 +02:00
fred 9d851aadf6 ## SEND nb JUNE TO ALL FOUND EMAIL ## MAKE ONE EACH AFTER ALL EMAIL CONSUMED ## 2023-04-08 16:27:23 +02:00
fred 33e653a8b8 check Duniter & TW for new event with "email" in comment and tag. 2023-04-08 16:24:58 +02:00
fred 103e7805e6 Make G1PASS with new PASS & fuzzy s= p= / TW - official - HPASS / 2023-04-08 15:48:14 +02:00
fred 4811fb33e0 G1BILLET random s & p 2023-04-08 15:37:28 +02:00
fred 661add1ed1 cleaning tmp cache G1BILLET 2023-04-08 15:20:16 +02:00
fred 6ce3f9c0b8 G1CopierYoutube Tag PATCH 2023-04-08 15:11:56 +02:00
fred 1baf358815 AVOID EMPTY CURCHAIN 2023-04-08 14:37:21 +02:00
fred c6c864d612 limit 30 2023-04-08 13:51:16 +02:00
fred 1f22c8ad7a limit 30 2023-04-08 13:50:12 +02:00
fred ca1ee54682 sonic changed its IPFSNODEID 2023-04-08 13:36:28 +02:00
fred fbe2d97ad3 keeping TW chain updated in TW 2023-04-08 12:18:27 +02:00
fred 09f4b78a06 <title>_G1VOEU_ : _PLAYER_ : http://astroport.localhost:1234</title> 2023-04-07 14:52:21 +02:00
fred d91e8e9628 draggable Tiddlers 2023-04-07 14:07:33 +02:00
fred 7e0d2fe193 preinit channel 2023-04-07 13:33:20 +02:00
fred 5528b3d0b0 ♥Box Ğ1Station - Astroport Ŋ1 ${IPNSTAIL} != "_ASTROPORT_" 2023-04-07 13:22:28 +02:00
fred 964ac5e4a9 certified astro.js evolution /QmYjUbg8NzsXxkYV5NnK2rwv38VGd5z8dhxr3zEph6qFQM/astro.js 2023-04-06 17:20:41 +02:00
fred 7fbae8bfeb publishing PLAYER/FRIENDS/* in Station MAP 2023-04-06 17:11:24 +02:00
fred c1f8201a85 PREVENT DUNITER UNAVAILABLE (KEEPING ASTROPORT ZEN VALUE) 2023-04-06 16:35:42 +02:00
fred 9bcd7724fe unleash your wishes 2023-04-06 14:58:24 +02:00
fred af9465b80d REC Machine made easy 2023-04-06 14:09:03 +02:00
fred aa2bc61b9d nicer 2023-04-05 19:17:26 +02:00
fred 43f1b8d1b6 G1PASS 2023-04-05 18:07:18 +02:00
fred 3840a3002c REC home Astroport mp3 2023-04-05 16:50:12 +02:00
fred 1cc89cf654 better restart with systemd & g1billet 2023-04-05 14:48:08 +02:00
fred 68b351ca3d mise en page 2023-04-05 14:19:49 +02:00
fred 689ca72487 better QR Code recognition 2023-04-04 20:36:36 +02:00
fred ec6a99a278 NEW G1BILLET G1VISA MULTI PRINT 2023-04-04 20:33:01 +02:00
fred 056c9f9c50 authorise already login PLAYER to transfer his TW on STATION 2023-04-04 17:16:59 +02:00
fred 8d9e31a9fa yam yami 2023-04-04 17:05:10 +02:00
fred 04cbd612d9 ## CHECK IF ASKING FRIEND TW EXISTS 2023-04-04 16:03:10 +02:00
fred 4dd0c1f4d4 <a target="gchange" href="https://data.gchange.fr/user/profile/_G1PUB_/_share">_G1PUB_</a> 2023-04-04 15:52:07 +02:00
fred a86a1a2f46 TODO LIST 2023-04-04 15:45:17 +02:00
fred 73d89a42a5 Astroport.ONE is reaching self mapping ability + many fun hacking points - App - Security - Stargates - 2023-04-04 15:43:32 +02:00
fred 79159a53e3 ## DOES CURRENT IS RICHER THAN 100 G1
## THEN SEND PALPE JUNE. SEND MESSAGE TO GCHANGE MESSAGING. SEND 1 ★
2023-04-04 14:57:29 +02:00
fred 08549d37ca # CADEAU DE 10 JUNE AU G1BILLET VIDE (Si le .current en a plus de 100) 2023-04-04 14:54:22 +02:00
fred 07a59dba57 comment 2023-04-03 20:12:39 +02:00
fred 0746bbf639 path correction 2023-04-03 19:45:31 +02:00
fred f59c4b3d9c fixing 2023-04-03 18:40:23 +02:00
fred f7a413ce36 bug 2023-04-03 17:53:08 +02:00
fred acc3c79417 12345 MAP optimisation + UPSYNC command 2023-04-03 17:17:47 +02:00
fred 9115f4b136 yellow green 2023-04-02 02:56:31 +02:00
fred 624e06544a youpla 2023-04-02 01:41:44 +02:00
fred 3f549b8dee Astroport.ONE G1BILLET release candidate 2023-04-01 19:27:36 +02:00
fred 637b1816ad better timings 2023-03-31 18:57:16 +02:00
fred 6fe4f63965 explore JSON astro.js API use 2023-03-31 18:49:40 +02:00
fred b83852a172 BRO system 2023-03-31 17:47:28 +02:00
fred ba40f680c3 poush 2023-03-29 18:16:32 +02:00
fred 6e1d3a5ccb Cour d'Honneur du Palais de l'Elysée 2023-03-29 15:26:42 +02:00
fred 0846815031 Now PLAYER can move TW from Astroport to Astroport 2023-03-29 14:52:53 +02:00
fred e63bcc1899 bigger iframe 2023-03-29 00:15:43 +02:00
fred 39dca34629 missing a spa ce 2023-03-28 20:26:08 +02:00
fred f328559f82 Astroport.ONE est un logiciel libre développé sous licence AGPL v3 2023-03-28 20:15:47 +02:00
fred 9b8c51de5d work efficiently 90% of the time 2023-03-28 19:53:57 +02:00
fred 0cf83a5d51 PGP - PASS - QRCODING 2023-03-28 16:07:54 +02:00
fred 838779469d it was a bug 2023-03-27 23:42:50 +02:00
fred 87364ad711 choose your nodes https://ginspecte.mithril.re/service_types/2 2023-03-27 23:18:43 +02:00
fred 1b7a7f4ab0 Make better G1WISH QRCode 2023-03-27 21:51:56 +02:00
fred eea9199356 PGP encode / decode $PASS : ${salt} != "" && ${pepper} != "" 2023-03-27 20:53:11 +02:00
fred 6d0a510032 puussshhh 2023-03-27 20:06:48 +02:00
fred 0022173acd DISCO $(cat ~/.zen/tmp/${MOATS}/disco) 2023-03-27 18:12:03 +02:00
fred 3e534461d0 Get & Keep COOKIE using QRCODE API 2023-03-27 17:40:05 +02:00
fred 11d875ebf0 COOKIE SESSION PROPAGATION 2023-03-27 17:26:19 +02:00
fred 79af5d395d fixes & cookies 2023-03-27 13:27:57 +02:00
fred 5563061104 relative IPFS GW 2023-03-26 21:18:00 +02:00
fred 9ca6a52718 Show Tiddler into aframe 2023-03-26 21:07:53 +02:00
fred 96416bd126 Redirections 2023-03-26 20:46:27 +02:00
fred de43c71fcd full RAM 2023-03-26 20:31:27 +02:00
fred cdba41aa52 information flows better like that 2023-03-26 19:53:57 +02:00
fred ec34535245 IPFS gateway relative loading 2023-03-26 19:15:56 +02:00
fred aea265a1fd myTUBE 2023-03-26 19:12:53 +02:00
fred 3bf28044b0 ⚠ ASTROPORT NETCAT SYSTEM ⚠ 2023-03-26 19:02:01 +02:00
fred 26e841caf3 Voici comment procéder en BASH ou JAVASCRIPT 2023-03-26 18:17:06 +02:00
fred aa75d8a6a5 working better 2023-03-26 18:03:42 +02:00
fred 77c033fa80 IPNSkey 2023-03-26 13:45:33 +02:00
fred 81384aaecd verbosity change 2023-03-26 04:27:19 +02:00
fred 081c330277 manage PLAYER on Station 2023-03-26 03:50:17 +02:00
fred 2d04627169 0.1 JUNE pour le Voeu $WISHNAME 2023-03-26 01:49:43 +01:00
fred 30adac7b5a shaping system 2023-03-26 01:25:33 +01:00
fred bca4bea4c0 WISHQR PGP protected with PLAYER "PEPPER" (mot de passe) 2023-03-26 00:31:57 +01:00
fred f4cccc2343 DISCO PGP QRCODE to MAKE Contact Free Ğ1 PAYMENTS 2023-03-26 00:24:25 +01:00
fred 26cdb3bbed Ativate default Wishes : CopierYoutube & PalPay 2023-03-25 20:16:45 +01:00
fred 91735a9b8e fresh 2023-03-25 20:11:58 +01:00
fred 8a9a3f9cd8 introducing GPG passphrase 2023-03-25 19:49:45 +01:00
fred d5c2e07450 fixing 2023-03-25 15:03:14 +01:00
fred e636ef09e9 DNS 2023-03-24 23:03:23 +01:00
fred b655bebdd4 debug 2023-03-24 00:05:02 +01:00
fred 3df723b300 can do much of thing now 2023-03-23 19:45:46 +01:00
fred 28d98e01ee Versatile API. G1BILLET to GCHANGE to CESIUM to PLAYER 2023-03-23 17:52:52 +01:00
fred 9d55782823 302 cookie delivered 2023-03-22 18:13:34 +01:00
fred d2221566cb Now we serve cookie 2023-03-22 18:08:38 +01:00
fred e9649fce94 G1Film est le premier voeu de ce TW. FleeXnet. 2023-03-22 17:54:49 +01:00
fred d5aec2b9cc playing 2023-03-22 16:48:15 +01:00
fred 44f2aa2872 correxction 2023-03-22 16:47:14 +01:00
fred 14a46e2b2c js correction 2023-03-22 16:17:01 +01:00
fred 291a480dde Set-Cookie HTTP HEADER 2023-03-22 16:05:25 +01:00
fred d9696fdbeb ## COOKIE RETRIEVER ## 2023-03-22 15:58:23 +01:00
fred 9ffab4c3fd all bugs 2023-03-21 17:05:04 +01:00
fred 514994260f virgule problem réglé 2023-03-20 21:31:51 +01:00
fred 887a26cafc GET FRIEND EMAIL = APLAYER 2023-03-20 21:21:46 +01:00
fred 317e1efaf9 miam 2023-03-20 14:34:28 +01:00
fred 1d2a7470e6 ${#FINDEX[@]} 2023-03-20 14:32:30 +01:00
fred 0976735cd7 try++ 2023-03-20 13:39:09 +01:00
fred 04c88a4af9 escape du dollar !!! \$ 2023-03-20 13:33:16 +01:00
fred f1ff2d4d20 COINScheck refresh 24h wallet cache 2023-03-20 13:26:16 +01:00
fred dfdee394e5 bad link removal 2023-03-19 20:10:00 +01:00
fred c6a9c7c764 fff 2023-03-19 20:02:38 +01:00
fred 09d9c3e5e4 sweepit 2023-03-19 15:35:55 +01:00
fred 3b9a7155d9 W0rld of Wish. FoF default locations 2023-03-19 15:12:50 +01:00
fred 0ecd9ee77b Each Wish makes a FoF W0rld discovery chain 2023-03-19 15:11:43 +01:00
fred 192763dc80 get ASTROPATH and make PLAYER G1BILLET 2023-03-18 16:01:41 +01:00
fred 4f7ba1ec93 target aframe 2023-03-18 14:55:45 +01:00
fred 1677814e7b TWMODEL="/ipfs/bafybeibqfmvgbzg7o3vkuexatxoc7j3xo7j5e2m24dbjvm3mrbx2ihwcim" 2023-03-16 22:15:34 +01:00
fred 11a197cfca found a bug 2023-03-16 21:52:42 +01:00
fred 72103666e0 QRG1avatar injection 2023-03-16 21:18:21 +01:00
fred a1eb3f235f debug 2023-03-16 21:14:45 +01:00
fred 72c571dcd9 stop auto creation of g+ / c+ 2023-03-16 20:02:12 +01:00
fred c5f2c18f18 Earth - Spread you Wishes - Vote - Earn for what you realize 2023-03-16 19:11:39 +01:00
fred 7458e23752 becoming my metaverse explorator 2023-03-16 19:08:47 +01:00
fred 6509780051 hello there 2023-03-16 18:15:42 +01:00
fred b5d6003379 show player wishes buttons 2023-03-16 18:07:52 +01:00
fred 019bdfe8bb clic & link WORLD & PLAYER Ŋ1Flux 2023-03-16 17:31:39 +01:00
fred 47d4138685 evolution 2023-03-16 17:03:37 +01:00
fred a78e391bdb mise en page 2023-03-16 16:20:32 +01:00
fred a5130ba926 QRG1avatar.png appears in PLAYER Ŋ1Flux 2023-03-16 16:17:21 +01:00
fred 42c0513b91 mieux 2023-03-16 14:52:50 +01:00
fred f2facf526d coooooool 2023-03-16 14:38:25 +01:00
fred 98e4b62bb6 astro.js and geodata into IPFS 2023-03-16 03:51:33 +01:00
fred 1618fa2924 what a peaceful night 2023-03-16 03:46:43 +01:00
fred 0d27f4d88b little better 2023-03-16 01:44:50 +01:00
fred 1a6b4d653c test add mp3 2023-03-16 00:06:05 +01:00
fred 701261c5f0 shape 2023-03-15 20:35:10 +01:00
fred 54f767c116 mieux 2023-03-15 20:11:22 +01:00
fred 42801f6525 oui 2023-03-15 06:15:18 +01:00
fred e646c91443 g1billet 2023-03-15 05:57:14 +01:00
fred c9cfd1976a pip 2023-03-15 05:52:08 +01:00
fred 66ac4b8fdb new 2023-03-15 05:50:05 +01:00
fred 8909459dce resized 2023-03-15 05:49:28 +01:00
fred a11f8a5355 resized 2023-03-15 05:46:33 +01:00
fred f21832937f he 2023-03-15 05:42:13 +01:00
fred 27bcef2e63 done 2023-03-15 05:37:03 +01:00
fred 1aa277ee09 timeout 3s 2023-03-15 05:17:09 +01:00
fred 5703a4e81e <div id='countdown'></div> 2023-03-15 05:10:23 +01:00
fred 45487ac41f Station Accounts 2023-03-15 05:06:49 +01:00
fred 8a10eb9c53 url grabb 2023-03-15 04:14:37 +01:00
fred 73a20e82f7 more tags 2023-03-15 01:36:20 +01:00
fred 90b8ff7013 url= for LaBureautique access 2023-03-14 21:54:55 +01:00
fred 36409d10f3 SLURP message 2023-03-14 18:16:08 +01:00
fred 5b4bee5066 patch 2023-03-14 17:57:14 +01:00
fred 78535de293 com 2023-03-14 17:34:36 +01:00
fred 0485eb431f API : getipns & getg1pub 2023-03-14 17:10:20 +01:00
fred f9bffdd305 information spreading and shaping 2023-03-13 22:05:30 +01:00
fred 20b8a6e41c Creates Ŋ1 Crypto World for YOU 2023-03-13 18:55:13 +01:00
fred d634c9c673 Extend Your Desired Reality 2023-03-13 18:51:36 +01:00
fred fba77af447 To my Brother - birthday gift - 2023-03-13 18:50:20 +01:00
fred 45e421b89f do do 2023-03-13 05:52:49 +01:00
fred d8c206fd36 late push 2023-03-13 05:14:51 +01:00
fred 809c61561b pretty nice ♥Box Ğ1 Station 2023-03-13 04:26:59 +01:00
fred e1899099ac be bop 2023-03-13 02:19:37 +01:00
fred ce226d741a pop it 2023-03-13 00:50:08 +01:00
fred bff56cd062 play more 2023-03-12 22:31:11 +01:00
fred 787768aba5 Choisissez un Parrain 2023-03-11 15:21:08 +01:00
fred a189833eb6 PLAYERONE 2023-03-11 14:36:41 +01:00
fred 1afe72d6ba Send ★ to G1FRIEND SALT API 2023-03-11 14:29:27 +01:00
fred 0c55445a0f @ PATCH 2023-03-10 19:18:58 +01:00
fred d69ac4bf14 _PLAYER_ PASS POR 2023-03-10 18:46:05 +01:00
fred eee9bb2a2a 1st TW & FoF UX 2023-03-10 18:33:28 +01:00
fred ad57993444 astro.js allow to document.getElementById(station).addEventListener(click, homeAstroportStation); 2023-03-10 17:33:56 +01:00
fred b4215a550a <a href="/?qrcode=station">♥</a> 2023-03-10 16:13:44 +01:00
fred 4e9c4a5050 Le Claude is made with "LA♥BOX" 2023-03-10 01:08:43 +01:00
fred 1dc9a4fb0a pimp up 2023-03-10 01:05:06 +01:00
fred 4ca5ef07ce https://astroport.copylaradio.com/?qrcode=station - PalPay Welcome - 2023-03-10 00:57:16 +01:00
fred efc6bb4c91 qrcode API extension 2023-03-09 19:42:41 +01:00
fred d9ebd8b955 amzqr "$myASTROPORT/?qrcode=$G1PUB&junesec=$PASsec&askpass=$HPass&... contain /secret.june with AES.crypto secured | base64 -w 0 | jq -sRr '@uri' 2023-03-08 17:00:53 +01:00
fred e98d0d1ebc fixing 2023-03-07 14:58:12 +01:00
fred eeac171c52 espeak "Please create a player" 2023-03-07 03:21:17 +01:00
fred 3a81b50313 top 2023-03-07 02:26:23 +01:00
fred bf3ce311ff qr 2023-03-07 02:13:15 +01:00
fred bf338b368a debug 2023-03-07 02:10:55 +01:00
fred e6bad0633c imagic width 2023-03-06 20:11:21 +01:00
fred fe19934100 50% logo 2023-03-06 19:48:10 +01:00
fred 9368e21a17 Decode next URL with PASS 2023-03-06 19:24:28 +01:00
fred d4f915e94d AMZQR optimize 2023-03-06 19:22:13 +01:00
fred aef6e5a89c Gif first 2023-03-06 18:57:55 +01:00
fred b5c6dd6c65 G1Voeu web interface 2023-03-06 18:55:35 +01:00
fred 45abea9b80 sha512sum cleaning 2023-03-06 17:56:08 +01:00
fred 5c507268bb Update G1Visa & AstroID Tiddlers on each TW Station transfer 2023-03-06 01:50:12 +01:00
fred 3186726f76 QRCode generation 2023-03-06 01:32:29 +01:00
fred 3500911874 TW droping 2023-03-05 03:59:45 +01:00
fred 9bf211fae9 smooth carousel made from image from G1WALLET or your own pictures 2023-03-05 02:38:03 +01:00
fred 823588beb8 Creating & Refreshing a Wish moves 1 G1 (non blocking TX) 2023-03-05 01:45:08 +01:00
fred cc88d690df debug 2023-03-04 20:20:44 +01:00
fred 716fc91737 amzqr codification 2023-03-04 18:34:16 +01:00
fred d562f3ab7b TODO : REFRESH WORLD SAME WISH (reveal to one with the more G1) 2023-03-04 17:43:59 +01:00
fred c0190f7880 Keep .link in ~/.zen/game/world for station network refreshing (TODO add to 20H12) 2023-03-04 17:39:19 +01:00
fred d1e56500fb TW are like "small worlds" making "wishes" connected to same.
ASTRO is putting wishes with same name together
Each Station keeps record of visitor wishes in  ~/.zen/game/world/G1WishName/
2023-03-04 17:17:39 +01:00
fred c9d16af39c All derivative keys comes from PLAYER credentials. So, every TW (salt/pepper) will make the same Wishes Keys 2023-03-04 16:42:01 +01:00
fred 9095333b5c amzqr "$myASTROPORT/?qrcode=$G1PUB&sslpassdunikeysec=$PASsec&askpass=$HPass&tw=$ASTRONAUTENS" \ 2023-03-04 01:26:30 +01:00
fred 382a10a415 PLAYER Magic QRCode to keep all your key protected with your PASS then your PEPPER 2023-03-04 00:49:59 +01:00
fred 2ea072ed25 Conserve la clef IPNS chiffrée par G1Pub dans le Tiddler du G1Voeu (évite de les perdre en déménageant de CoeurBOX) 2023-03-04 00:37:14 +01:00
fred e16d200333 a new day of freedom 2023-03-04 00:22:08 +01:00
fred 31ba8c9552 Astroport ONE est une ambassade numérique d'un monde fait de toiles confiances algorithmiques interconnectées 2023-03-03 14:43:40 +01:00
fred bd5ae1939b ASTROPORT SETUP 2023-03-03 14:40:03 +01:00
fred 0b8ab3c608 SETUP SYSTEM FOR ASTROPORT API/CRON 2023-03-03 13:48:26 +01:00
fred 3624003355 new great features 2023-03-03 13:44:03 +01:00
fred 392687f8d0 better 2023-03-03 00:50:08 +01:00
fred 17cddeb5d5 Reveal new App on Ŋ1 Flux 2023-03-02 23:48:47 +01:00
fred fc16efd83f amzqr Player & Wishes Pimp Up 2023-03-02 23:48:10 +01:00
fred e5ddce0b79 update 2023-03-01 20:17:24 +01:00
fred 33ac36f226 1234 JS API 2023-03-01 03:19:05 +01:00
fred 01da5a332f STATION WORLD WHISHKEY DATABASE ~/.zen/game/world/$PEPPER/$WISHKEY 2023-03-01 02:44:11 +01:00
fred 487abdcd80 rock64.copylaradio.com 2023-03-01 00:37:50 +01:00
fred 89541c5ff5 if 2023-03-01 00:24:43 +01:00
fred d472f9682f 45780 45781 PORT SWAPING 2023-03-01 00:23:36 +01:00
fred 8865ab418d OPEN FIREWALL HTTP(80 S 443) ASTRO :1234 MAP : 12345 API : 45780 45781 IPFS : (+8080 (+4001 +5001)) 2023-03-01 00:18:31 +01:00
fred 55a49fdf3c remove Claude link 2023-03-01 00:02:33 +01:00
fred 9c113ae94d to make register page works on LAN 2023-02-28 23:48:12 +01:00
fred f767e5cc2c yunohost OPEN FIREWALL 1234 12345 45780 only 2023-02-28 20:15:53 +01:00
fred b62d00d0c3 tot=$((tot+1)) 2023-02-28 02:30:38 +01:00
fred 68013d01ac correct 2023-02-27 21:29:08 +01:00
fred 53bba36065 G1MagicQRCode 2023-02-27 20:10:31 +01:00
fred c702c67a98 Spot have links now : control are in demo.js 2023-02-27 19:25:41 +01:00
fred ec52ea6366 # Makes your G1Wishes collide : merge and fork. G1Voeu derivated keys system) 2023-02-27 19:17:24 +01:00
fred bb829938cf Hack this page to enhance your QRCode dialog 2023-02-27 18:27:30 +01:00
fred ccc807dfd5 texture: '/ipfs/QmNNSAJyzVSF2m16dReYgmqmiRkKa5HMKvFUgwhbRzTYto/mars1024x1024.jpg', // texture used by G1Wish planet 2023-02-27 18:04:44 +01:00
fred f0d58decfb Snapshot of G1Voeu Navigation System... 2023-02-27 17:49:23 +01:00
fred 63353dc702 Seeking for graphic art designing. This place is yours... 2023-02-27 17:20:55 +01:00
fred cceda4a195 Partagez vos G1Dons. Découvrez vos G1Talents ! Tissez votre Toile de Confiance Ŋ1 2023-02-27 17:19:17 +01:00
fred a0b270a347 now showing the planet and flying astroplanes 2023-02-27 15:52:48 +01:00
fred df7d41bfc7 setup is for resetting IPFSNODEID & check tools are working 2023-02-27 15:49:04 +01:00
fred 3b49124306 Ŋ1 Shaping - New G1Voeu index.html with earth animation - next step - insert gifpic onto mars texture - locate friends zone on earth spot - 2023-02-27 15:10:21 +01:00
fred 446ac51391 HOP HOP HOP 2023-02-27 13:38:11 +01:00
fred 32dce24893 ALL PLAYER EVERYWHERE. 20H12 ONLY FOR ASTROPORT OFFICIAL 2023-02-27 03:44:39 +01:00
fred 21ffedfbe3 Envoyer des ★ active vos toiles de confiance et active votre niveau Ŋ1 2023-02-27 02:46:41 +01:00
fred ed7146cfa9 DISCONNECT / CONNECT 2023-02-27 02:42:02 +01:00
fred 4154652817 MOVED PLAYER (KEY IS KEPT ON LAST CONNECTED ASTROPORT) 2023-02-27 02:34:26 +01:00
fred 1ad01d0aec fixing 2023-02-26 01:19:42 +01:00
fred 4a6b87acd4 fix 2023-02-26 01:11:13 +01:00
fred 0756e6c5eb Please take time to read why Ŋ1 Network (are/is) the best solution 2023-02-26 00:41:38 +01:00
fred cf1da7a9d5 README 2023-02-25 18:30:03 +01:00
fred df0bee625a CLEAN LOST ACCOUNT 2023-02-25 03:19:33 +01:00
fred 45e7624417 setup 2023-02-25 02:49:24 +01:00
fred ad331f7e5f bup 2023-02-24 00:47:11 +01:00
fred d50eff367e ifframe 2023-02-24 00:44:14 +01:00
fred c8e841b609 Activez le Voeu 2023-02-24 00:40:52 +01:00
fred 5ae461e6cc La chaine Youtube de la Terraformation - ♥BOX Edition - https://www.youtube.com/channel/UCgbd28yps5uF3NWDq-FLE9A 2023-02-24 00:37:47 +01:00
fred 65bfc83050 QRCODE PortalApp [![](http://ipfs.localhost:8080/ipfs/QmafsWdAeB5W9HcNPQWK2yjTgcW8eTxHoSD7bzE55mtrdP) 2023-02-24 00:00:49 +01:00
fred 1877115dcc absolute /ipfs 2023-02-23 22:15:58 +01:00
fred a012b67e08 FOUND : ${PLAYERONE[@]} 2023-02-23 20:58:01 +01:00
fred e31f00d0e4 API for LOGIN / LOGOUT PLAYER - IPNS 5001 access control - 2023-02-23 18:46:55 +01:00
fred eb8ab6433b English readme + Webcam QRCode scanner 2023-02-23 17:22:38 +01:00
fred 55fbfdf46e localhost filtering 2023-02-23 02:35:46 +01:00
fred 7d0818f5da ~/.zen/game/players/${PLAYER}/secret.dunikey 2023-02-23 02:33:00 +01:00
fred 6b7f31d795 Choix du PLAYER 2023-02-23 01:42:43 +01:00
fred 4ea28098f5 LOGOUT PLAYER (remove IPNS keys from Station) 2023-02-22 18:38:53 +01:00
fred 0c97990741 must have more gva API servers 2023-02-21 02:51:55 +01:00
fred 8c94147fed IPFS Application & Protocol Fat Crypto Layer install 2023-02-20 23:54:18 +01:00
fred c40423a2a3 NOURRISSEZ VOTRE BLOB depuis Firefox !! 2023-02-20 20:33:17 +01:00
fred 123907887d NOURRIR SON BLOB 2023-02-20 19:39:34 +01:00
fred 274d1df66f cmake 2023-02-20 19:36:44 +01:00
fred 8b65637833 COORD. GPS DE VOTRE STATION IPFS 2023-02-20 19:34:30 +01:00
fred 27673e3977 CALIBREZ LA SYNCHRO 20H12 AVEC LE TEMPS NATUREL 2023-02-20 19:30:15 +01:00
fred 36654944a1 no rescale 2023-02-17 14:01:02 +01:00
fred c7e654cf39 Using PLAYER PEPPER AS WISH SALT 2023-02-13 13:30:41 +01:00
fred f27de9657f youppppi 2023-02-13 13:27:12 +01:00
fred f72c77638c G1 COINS value 2023-02-12 16:15:49 +01:00
fred 274780d002 API + 2023-02-11 21:48:26 +01:00
fred f3e463827d API qrcode=station & PLAYER Web2.0 cookie delegation 2023-02-11 20:40:17 +01:00
fred 3889d3ee1e Default. Give all incoming G1 into PLAYER's ZEN GAME 2023-02-11 20:03:39 +01:00
fred bdeb411f4c Modifier URL ♥BOX - CopierYoutube du PLAYER 2023-02-10 02:11:49 +01:00
fred 30617eb9a8 ♥BOX CopierYoutube CHANGES 2023-02-10 02:07:28 +01:00
fred 3074add864 player=EMAIL&url=URL 2023-02-10 01:40:38 +01:00
fred a9a19425fc make it 2023-02-09 20:13:18 +01:00
fred 45fb8275ff "w oo oo" 2023-02-09 13:04:15 +01:00
fred 8b6bb474cc N Tem 2023-02-04 21:10:12 +01:00
fred f32614f925 321 2023-02-04 20:02:57 +01:00
fred 9ac4e04cd8 <button onclick="history.go(-1)">Go Back</button> 2023-02-04 19:22:28 +01:00
fred 569c64be00 Used to redirect to external links in Web IPFS Copy Capsule 2023-02-04 19:04:33 +01:00
fred 4fd9fa4ed2 cp $MY_PATH/templates/external.html $FILE_PATH/$DOMAIN/ 2023-02-04 19:03:42 +01:00
fred 1a00441a81 TODO CUSTOMIZE HOW TO HANDLE EXTERNAL LINKS
#~ # COULD BE AN IPFS KEY !! OR IPNS !!!!
2023-02-04 18:55:28 +01:00
fred 83cc6c1a9b correct ../external.html into external.html 2023-02-04 18:50:32 +01:00
fred 23cd457369 ## KILL ALL REMAINING nc 2023-02-03 22:35:05 +01:00
fred bfde0c967f nos chaînes se compte en monnaie libre, en informations libres, en libertés retrouvées et en partages d'expériences. 2023-02-03 18:13:34 +01:00
fred c9982c4a7e Favicon 2023-02-02 21:56:00 +01:00
fred 11d69d658f make sure ipfs daemon is stopped 2023-01-30 17:54:41 +01:00
fred 4110474930 uqload kodi autodownload 2023-01-22 04:22:01 +01:00
fred 739fe351e2 $WISHKEY/.salt 2023-01-22 04:18:07 +01:00
fred 87f44a5adf ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS 2023-01-21 23:06:03 +01:00
fred 19ecb90a75 IPFSNODEID channel publish 2023-01-21 23:00:21 +01:00
fred 63175f63fa # Get PLAYER wallet amount 2023-01-21 22:12:32 +01:00
fred d05520ca4a Envoyez, recevez des ★. Activez vos toiles de confiance Ŋ1 2023-01-21 22:08:20 +01:00
fred d039bf5a02 ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS 2023-01-21 19:30:36 +01:00
fred 1db9f05d7c readable date in log please 2023-01-21 19:29:05 +01:00
fred 71f68b74dc ♥ IPFS Ŋ1 DRIVE INIT ♥ 2023-01-21 19:04:45 +01:00
fred 3899cc8e84 ♥ IPFS CENTRAL ♥ 2023-01-21 19:03:48 +01:00
fred 11fca8cdba kind of a log 2023-01-21 18:33:04 +01:00
fred f93f0a0612 mmm 2023-01-21 18:18:20 +01:00
fred f4c584ef65 PLAYER COPIER "_URL_" FAVORITE 2023-01-21 13:51:44 +01:00
fred d574d880c7 # LOG 2023-01-21 02:21:41 +01:00
fred 949218da6e 🔥.^999.^888.^777.^666.^555.^444.^333.^222.^111 Partez 🚀^4321 2023-01-20 22:50:48 +01:00
fred c13c1e1b7e 😤 2023-01-20 22:45:17 +01:00
fred 4abae956ba 🔥in the hole 2023-01-20 22:42:05 +01:00
fred 5be23f02f2 +⚠ TELETUBE TELEPORT SYSTEM ⚠ 2023-01-20 20:56:42 +01:00
fred 0e8c0a4ea0 API : "♥BOX" 2023-01-20 20:49:01 +01:00
fred 610b93ea63 WE MAKE 📺 2023-01-20 20:45:01 +01:00
fred 997d75bb31 ♥BOX + <<hide>> plugin 2023-01-20 20:17:04 +01:00
fred b5ba93b20f ! $isLAN BOX <<hide tiddler-controls>> 2023-01-20 20:14:59 +01:00
fred 34c5e9d1c5 soft API 2023-01-20 18:56:17 +01:00
fred 7816a0c707 TW ♥BOX 2023-01-20 17:07:28 +01:00
fred 8a282df3cb AstroBot is speaking 2023-01-20 15:44:26 +01:00
fred 7e44594ca4 Transform TW json Ŋ1 flux into m3u video playlist 2023-01-20 15:18:45 +01:00
fred 9bea4bcb9a better TW control 2023-01-20 15:17:02 +01:00
fred 73124bdfcf new 2023-01-19 00:49:14 +01:00
fred e709bc9b88 unhide g1pub=_URL_ 2023-01-19 00:46:59 +01:00
fred 1b3e9c4fbc Votre portefeuille est vide. Alimentez votre G1Visa avec Cesium. 2023-01-19 00:15:16 +01:00
fred 9fbd55e70b log IPNS link 2023-01-18 02:02:47 +01:00
fred e46a86ad74 detect IPFS add error but continue loop 2023-01-17 23:46:44 +01:00
fred cac4f43687 DEBUG & finetunings 2023-01-17 21:53:10 +01:00
fred 8fc3f1e72a support@g1sms.fr 2023-01-17 19:42:04 +01:00
fred d1546bf557 RESET try for FRIEND with TW contact 2023-01-17 19:01:20 +01:00
fred 6fd76563dc liking_me IS A GOOD FRIEND. PLAYER Send $my_star_level COIN 2023-01-17 18:53:25 +01:00
fred 633cca724c ★ SENDING $my_star_level STAR(s) ★ 2023-01-17 18:49:07 +01:00
fred b6f1576b3f ## liking_me IS A GOOD FRIEND. PLAYER Send 1 COIN. 2023-01-17 17:03:01 +01:00
fred 412ccf6e3a ameliore votre IPFS 2023-01-17 16:24:26 +01:00
fred 7a875bf2ea renew ipfs config 2023-01-17 15:23:45 +01:00
fred d06e6c6019 YOU have $COINS Ğ1 Coins 2023-01-16 23:58:20 +01:00
fred bb263ca071 PLAYER 2023-01-16 23:42:33 +01:00
fred 05ed91f091 online first 2023-01-16 23:36:03 +01:00
fred fd3cb48fae CACHE TW 2023-01-16 23:22:46 +01:00
fred 63caa30c64 mad am 2023-01-16 22:38:34 +01:00
fred beee918361 NO G1 NO WISH 2023-01-16 22:34:28 +01:00
fred debf88d8bd Your New TW 2023-01-16 21:12:33 +01:00
fred 4d26b1d8b7 make it runnnn 2023-01-16 19:59:55 +01:00
fred 688debb7ee INSTALL 2023-01-16 19:12:10 +01:00
fred 149cf00408 Add timeout to jaklis.py call 2023-01-16 15:27:50 +01:00
fred a203885dc3 use G1 & TW QRCode in profile Avatar 2023-01-16 15:16:25 +01:00
aynic.os 84e6c11dbf template 2023-01-15 17:40:52 +01:00
fred b60b36eb45 ### EXPERIMENTAL ### FINISH ASTROPORT/KODI SETUP BY IPFS ## OUI ? ENTER sinon Ctrl+C 2023-01-15 17:38:09 +01:00
aynic.os 004ce85c50 Merge branch 'develop' 2023-01-15 17:18:28 +01:00
fred aee32ff597 http://ipfs.localhost:8080/ipns/$ASTRONAUTENS 2023-01-15 16:47:58 +01:00
fred 30d053d6ad find a LAN hostname resolution 2023-01-15 16:42:56 +01:00
fred aaa84cb7b8 +pv -sjcl-cli 2023-01-15 16:15:43 +01:00
fred bd2eccccf8 http://kitty.local:8080 2023-01-15 16:10:15 +01:00
fred 9ffb90ecbe Wait 10mn for a PLAYER TW to receive now IPNS online 2023-01-15 15:59:33 +01:00
1037 changed files with 1032839 additions and 4591 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
.env
*.pyc
__pycache__
tiddlywiki.html
tools/jaklis/.env

32
.readthedocs.yaml Normal file
View File

@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt

155
12345.sh
View File

@ -13,7 +13,7 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/tools/my.sh"
PORT=12345
PORT=45779
YOU=$(myIpfsApi); ## API of $USER running ipfs
echo "YOU=$YOU"
@ -22,34 +22,24 @@ PORT=12345
TUBE=$(myTube)
echo "TUBE=$TUBE"
mkdir -p ~/.zen/tmp/coucou/ ~/.zen/game/players/localhost
mkdir -p ~/.zen/tmp ~/.zen/game/players/localhost # ~/.zen & myos compatibility
## CHECK FOR ANY ALREADY RUNNING nc
ncrunning=$(ps axf --sort=+utime | grep -w 'nc -l -p 1234' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
ncrunning=$(ps axf --sort=+utime | grep -w 'nc -l -p 1234' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ $ncrunning ]] && echo "RESTARTING" && kill -9 $ncrunning
## NOT RUNNING TWICE
# Some client needs to respect that
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
HTTPCORS='HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
echo "_________________________________________________________ $(date)"
echo "LAUNCHING Astroport API Server - TUBE : $LIBRA - "
'
echo "_____________________ $PORT ________________________________ $(date)"
echo "LAUNCHING Astroport API Server : ASTROPORT : ${myASTROPORT}"
echo
echo "GCHANGE ${myASTROPORT}/?salt=totodu56&pepper=totodu56&g1pub"
echo "OPEN TW ${myASTROPORT}/?salt=totodu56&pepper=totodu56&g1pub=astro"
echo "GCHANGE MESSAGING ${myASTROPORT}/?salt=totodu56&pepper=totodu56&messaging"
echo "CREATE SAME PLAYER : ${myASTROPORT}/?salt=totodu56&pepper=totodu56&g1pub=on&email=totodu56@yopmail.com"
echo
echo "NEW PLAYER : ${myASTROPORT}/?salt=${RANDOM}&pepper=${RANDOM}&g1pub=on&email=astro${RANDOM}@yopmail.com"
echo
echo "BunkerBOX : ${myASTROPORT}/?salt=totodu56&pepper=totodu56&g1pub=_URL_&email=totodu56@yopmail.com"
echo
echo "TESTCRAFT ${myASTROPORT}/?salt=totodu56&pepper=totodu56&testcraft=on&dataid=QmPXhrqQrS1bePKJUPH9cJ2qe4RrNjaJdRXaJzSjxWuvDi"
echo "_________________________________________________________"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
@ -59,69 +49,89 @@ function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
#############################
while true; do
########################################################
## /ipfs/QmQ9MdCEY1aMmpxBqZKcHTLafRxRFeK1Ku1DES1LCPaimA
## TODO: STOP API ACCESS AFTER 20H12
start=`date +%s`
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
# EACH VISITOR RECEIVE COMMAND RESPONSE ON
## RANDOM PORT = RESPONSE SOCKET & IPNS SESSION TOKEN
PORT=$(cat ~/.zen/tmp/PORT) || PORT=45779
[ ${PORT} -le 12345 ] && PORT=$((PORT+${RANDOM:0:2})) || PORT=$((PORT-${RANDOM:0:2}))
## RANDOM PORT SWAPPINESS AVOIDING COLLISION
PORT=$((PORT+1)) && [ ${PORT} -ge 45791 ] && PORT=45780 ## WAN ASTROPORT 45780 45781 ... 45790
# ZIP (LAN Boostrap)
if [[ $(zIp) ]]; then
[ ${PORT} -ge 45782 ] && PORT=45780 ## ♥Box LAN Boostrap : OPEN FIREWALL 1234 12345 45780 45781
fi ## Use "nginx proxy manager" for SSL
echo ${PORT} > ~/.zen/tmp/PORT
## CHECK PORT IS FREE & KILL OLD ONE
pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p ${PORT}" | grep -v -E 'color=auto|grep' | awk '{gsub(/^ +| +$/,"")} {print $0}' | tail -n 1 | cut -d " " -f 1)
[[ $pidportinuse ]] && kill -9 $pidportinuse && echo "KILLING $pidportinuse" && continue
echo "SEARCHING FOR PORT ${PORT}"
ps axf --sort=+utime | grep -w "nc -l -p ${PORT}" | grep -v -E 'color=auto|grep'
pidportinuse=$(ps axf --sort=+utime | grep -w "nc -l -p ${PORT}" | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ $pidportinuse ]] && kill -9 $pidportinuse && echo "$(date) KILLING LOST $pidportinuse"
### START MAP STATION 12345
## CHECK 12345 PORT RUNNING (STATION FoF MAP)
maprunning=$(ps auxf --sort=+utime | grep -w '_12345.sh' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
maprunning=$(ps auxf --sort=+utime | grep -w '_12345.sh' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ ! $maprunning ]] \
&& echo '(ᵔ◡◡ᵔ) LAUNCHING '${myASTROPORT}:'12345 (ᵔ◡◡ᵔ)' \
&& echo '(ᵔ◡◡ᵔ) MAP LAUNCHING http://'${myIP}':12345 (ᵔ◡◡ᵔ)' \
&& exec $MY_PATH/_12345.sh &
############### ACTIVATE USE ON QUICK IPFS DRIVE
### CREATE IPNS KEY - ACTIVATE WHITH ENOUGH BOOTSTRAP
#~ echo
#~ ipfs key rm ${PORT} > /dev/null 2>&1
#~ SESSIONNS=$(ipfs key gen ${PORT})
#~ echo "IPNS SESSION ${myIPFS}/ipns/$SESSIONNS CREATED"
### # USE IT #
### MIAM=$(echo ${PORT} | ipfs add -q)
### ipfs name publish --allow-offline -t 180s --key=${PORT} /ipfs/$MIAM &
###############
###############
# RESET VARIABLES
CMD="" THAT="" AND="" THIS="" APPNAME="" WHAT="" OBJ="" VAL=""
############### ############### ############### ###############
# THIS SCRIPT STORES $i PARAMETER IN
# THOSE VARIABLES
CMD="" THAT="" AND="" THIS="" APPNAME="" WHAT="" OBJ="" VAL=""
############### ############### ############### ############### templates/index.http
# REPLACE myHOST in http response template (fixing next API meeting point)
echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.myHOST.http
myHtml >> ~/.zen/tmp/coucou/${MOATS}.myHOST.http
sed -i -e "s~\"${myIPFS}/\"~\"$(myIpfs)\"~g" \
-e "s~http://${myHOST}:12345~http://${myHOST}:${PORT}~g" \
~/.zen/tmp/coucou/${MOATS}.myHOST.http
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
myHtml >> ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
## REPLACE RESPONSE PORT
sed -i -e "s~http://127.0.0.1:12345~http://127.0.0.1:${PORT}~g" \
~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
## WAN REDIRECT TO HTTPS:// + /${PORT}
[ -z "$isLAN" ] \
&& sed -i -e "s~http://127.0.0.1:${PORT}~${myASTROPORT}/${PORT}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http \
&& echo "WAN STATION"
[ -n "$(zIp)" ]\
&& sed -i -e "s~http://127.0.0.1:${PORT}~$(zIp):${PORT}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http \
&& echo "COEURBOX STATION"
## UPLANET HOME LINK REPLACEMENT
sed -i -e "s~https://qo-op.com~${myUPLANET}~g" ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http
############################################################################
## SERVE LANDING REDIRECT PAGE ~/.zen/tmp/coucou/${MOATS}.myHOST.http on PORT 1234 (LOOP BLOCKING POINT)
## SERVE LANDING REDIRECT PAGE ~/.zen/tmp/${MOATS}/${PORT}.myHOST.http on PORT 1234 (LOOP BLOCKING POINT)
############################################################################
REQ=$(cat $HOME/.zen/tmp/coucou/${MOATS}.myHOST.http | nc -l -p 1234 -q 1) ## # WAIT FOR 1234 PORT CONTACT
############### ############### ############### ############### WAIT FOR
############### ############### ############### ############### 1234 KNOC
REQ=$(cat $HOME/.zen/tmp/${MOATS}/${PORT}.myHOST.http | nc -l -p 1234 -q 1 && rm $HOME/.zen/tmp/${MOATS}/${PORT}.myHOST.http) ## # WAIT FOR 1234 PORT CONTACT
############### ############### ############### ############### KNOC !!
############### ############### ############### ###############
URL=$(echo "$REQ" | grep '^GET' | cut -d ' ' -f2 | cut -d '?' -f2)
HOSTP=$(echo "$REQ" | grep '^Host:' | cut -d ' ' -f2 | cut -d '?' -f2)
AGENT=$(echo "$REQ" | grep '^User-Agent:') ### TODO : BAN LESS THAN 3 SEC REQUEST
HOST=$(echo "$HOSTP" | cut -d ':' -f 1)
## COOKIE RETRIEVAL ##
COOKIE=$(echo "$REQ" | grep '^Cookie:' | cut -d ' ' -f2)
echo "COOKIE=$COOKIE"
############### ############### ############### ###############
[[ $XDG_SESSION_TYPE == 'x11' ]] && espeak "Ding" >/dev/null 1>&2 &
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && espeak "Dong" >/dev/null 1>&2 &
############################################################################
[[ $URL == "/test" || $URL == "" ]] && continue
echo "************************************************************************* $(date)"
echo "ASTROPORT 1234 UP & RUNNING.......................... $myASTROPORT"
echo "${MOATS} NEXT COMMAND DELIVERY PAGE http://$myHOST:${PORT}"
echo "URL" > ~/.zen/tmp/coucou/${MOATS}.url ## LOGGING URL
echo "******* ${MOATS} ********************************** $(date)"
echo "ASTROPORT 1234 UP & RUNNING // API : $myASTROPORT // IPFS : $myIPFS"
echo "NEXT COMMAND DELIVERY PAGE http://$myHOST:${PORT}"
############################################################################
start=`date +%s`
@ -130,10 +140,20 @@ while true; do
## / CONTACT
if [[ $URL == "/" ]]; then
echo "/ CONTACT : $HOSTP"
echo "$HTTPCORS
DING : ${MOATS} : $(date)" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo " (‿/‿) $myHOST:$PORT / Execution time was "`expr $end - $start` seconds.
if [ -z "$isLAN" ]; then
mySalt | \
sed "s~http://127.0.0.1:12345~http://${myIP}:${PORT}~g" | \
sed "s~http://${myIP}:${PORT}~${myASTROPORT}/${PORT}~g" | \
sed "s~https://qo-op.com~${myUPLANET}~g" | \
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
else
mySalt | \
sed "s~http://127.0.0.1:12345~http://${myASTROPORT}:${PORT}~g" | \
sed "s~https://qo-op.com~${myUPLANET}~g" | \
( nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo " (‿/‿) $PORT CONSUMED in "`expr $(date +%s) - $start`" seconds." ) &
fi
continue
fi
@ -152,6 +172,7 @@ while true; do
if [[ ${arr[0]} == "poule" ]]; then
echo "UPDATING CODE git pull > ~/.zen/tmp/.lastpull"
echo "$HTTPCORS" > ~/.zen/tmp/.lastpull
cd ~/.zen/Astroport.ONE
git pull >> ~/.zen/tmp/.lastpull
rm ~/.zen/game/players/localhost/latest
(cat ~/.zen/tmp/.lastpull | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && continue
@ -180,15 +201,23 @@ while true; do
case $CMD in
"salt")
exec ${MY_PATH}/API/SALT.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" &
exec ${MY_PATH}/API/SALT.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;
"player")
exec ${MY_PATH}/API/PLAYER.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" &
exec ${MY_PATH}/API/PLAYER.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;
"qrcode")
exec ${MY_PATH}/API/QRCODE.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" &
exec ${MY_PATH}/API/QRCODE.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;
"uplanet")
exec ${MY_PATH}/API/UPLANET.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;
"amzqr")
exec ${MY_PATH}/API/AMZQR.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;
"")
@ -203,7 +232,7 @@ while true; do
[[ ! -s ${MY_PATH}/API/${CMD^^}.sh ]] \
&& ( echo "$HTTPCORS
ERROR UNKNOWN $CMD : ${MOATS} : $(date)" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & ) \
|| exec ${MY_PATH}/API/${CMD^^}.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" &
|| exec ${MY_PATH}/API/${CMD^^}.sh "$PORT" "$THAT" "$AND" "$THIS" "$APPNAME" "$WHAT" "$OBJ" "$VAL" "${MOATS}" "$COOKIE" &
;;

View File

@ -1,71 +1,197 @@
#!/bin/bash
########################################################################
# Version: 0.3
# Version: 0.4
# 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
. "$MY_PATH/tools/my.sh"
MY_PATH="`( cd \"${MY_PATH}\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/tools/my.sh"
start=`date +%s`
echo "20H12 (♥‿‿♥) $(hostname -f) $(date)"
espeak "Ding" > /dev/null 2>&1
## CLEANING ~/.zen/tmp
########################################################################
## IPFS DAEMON STATUS
LOWMODE=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START ONLY FOR SYNC -
[[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]] && LOWMODE="NO 5001" ## IPFS IS STOPPED
[[ ! $isLAN ]] && LOWMODE="" ## LOWMODE ONLY FOR LAN STATION
########################################################################
## CHECK IF IPFS NODE IS RESPONDING (ipfs name resolve ?)
########################################################################
ipfs --timeout=30s swarm peers 2>/dev/null > ~/.zen/tmp/ipfs.swarm.peers
[[ ! -s ~/.zen/tmp/ipfs.swarm.peers || $? != 0 ]] \
&& echo "---- SWARM COMMUNICATION BROKEN / RESTARTING IPFS DAEMON ----" \
&& sudo systemctl restart ipfs \
&& sleep 60
floop=0
while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do
sleep 10
((floop++)) && [ $floop -gt 36 ] \
&& echo "ERROR. IPFS daemon not restarting" \
&& ${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "IPFS RESTART ERROR 20H12" \
&& exit 1
done
########################################################################
# show ZONE.sh cache of the day
echo "TODAY UPlanet landings"
ls ~/.zen/tmp/ZONE_* 2>/dev/null
########################################################################
## REMOVE TMP BUT KEEP swarm, flashmem and coucou
mv ~/.zen/tmp/swarm ~/.zen/swarm
mv ~/.zen/tmp/coucou ~/.zen/coucou
mv ~/.zen/tmp/flashmem ~/.zen/flashmem
rm -Rf ~/.zen/tmp/*
mv ~/.zen/swarm ~/.zen/tmp/swarm
mv ~/.zen/coucou ~/.zen/tmp/coucou
mv ~/.zen/flashmem ~/.zen/tmp/flashmem
## RESTART IPFS DAEMON
# echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
[[ -s /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && sleep 5
########################################################################
### DELAY _12345 ASTROPORT DURING 20H12 UPDATE ###
if [[ "${LOWMODE}" == "" ]]; then
### NOT REFRESHING SWARM
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
MOATS_plus_5_hours=$(date -d "now + 5 hours" +"%Y%m%d%H%M%S%4N")
mkdir ~/.zen/tmp/${IPFSNODEID}
echo ${MOATS_plus_5_hours} > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
echo 9000 > ~/.zen/tmp/random.sleep
else
# REFRESHING SWARM
echo 0 > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
curl -s "http://127.0.0.1:12345"
sleep 300 ## WAIT FOR 5MN
fi
espeak "CODE git pull" > /dev/null 2>&1
########################################################################
## UPDATE G1BILLETS code
[[ -s ~/.zen/G1BILLET/G1BILLETS.sh ]] \
&& cd ~/.zen/G1BILLET/ && git pull \
&& rm -Rf ~/.zen/G1BILLET/tmp/*
## PROCESS TW BACKOFFICE TREATMENT
cd ~/.zen/Astroport.ONE/
########################################################################
## UPDATE Astroport.ONE code
cd ${MY_PATH}/
git pull
## SOON /ipns/ Address !!!
espeak "20 HOURS 12 MINUTES. START NU ONE UPDATE" > /dev/null 2>&1
########################################################################
## Updating yt-dlp
$MY_PATH/youtube-dl.sh
${MY_PATH}/youtube-dl.sh
sudo youtube-dl -U
# Refresh ~/.zen/game/world/G1VOEU
# NOW RUN FROM PLAYER.refresh.sh !! ~/.zen/Astroport.ONE/ASTROBOT/VOEUX.refresh.sh
########################################################################
## DRAGON SSH WOT
echo "DRAGONS WOT OFF"
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh off
espeak "Players refresh" > /dev/null 2>&1
# Refresh ~/.zen/game/players/PLAYER
~/.zen/Astroport.ONE/ASTROBOT/PLAYER.refresh.sh
########################################################################
## PING BOOSTRAP & SWARM NODES
${MY_PATH}/ping_bootstrap.sh > /dev/null 2>&1
## if [[ ! $isLAN ]]; then
## REFRESH BOOTSTRAP LIST (OFFICIAL SWARM)
########################################################################
######################################################### UPLANET ######
#####################################
# GeoKeys UMAP / SECTOR / REGION ...
#####################################
${MY_PATH}/RUNTIME/UPLANET.refresh.sh
#####################################
#####################################
# Players TW analyse & ASTROBOT run
#####################################
${MY_PATH}/RUNTIME/PLAYER.refresh.sh
#####################################
#####################################
# Node refreshing
#####################################
${MY_PATH}/RUNTIME/NODE.refresh.sh
#####################################
########################################################################
########################################################################
########################################################################
## REMOVE TMP BUT KEEP swarm, flashmem and coucou
mv ~/.zen/tmp/${IPFSNODEID} ~/.zen/${IPFSNODEID}
mv ~/.zen/tmp/swarm ~/.zen/swarm
mv ~/.zen/tmp/coucou ~/.zen/coucou
mv ~/.zen/tmp/flashmem ~/.zen/flashmem
rm -Rf ~/.zen/tmp/*
mv ~/.zen/${IPFSNODEID} ~/.zen/tmp/${IPFSNODEID}
mv ~/.zen/swarm ~/.zen/tmp/swarm
mv ~/.zen/coucou ~/.zen/tmp/coucou
mv ~/.zen/flashmem ~/.zen/tmp/flashmem
########################################################################
################################# updating ipfs bootstrap
espeak "bootstrap refresh" > /dev/null 2>&1
ipfs bootstrap rm --all > /dev/null 2>&1
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
[[ -s ${HOME}/.zen/game/MY_boostrap_nodes.txt ]] \
&& STRAPFILE="${HOME}/.zen/game/MY_boostrap_nodes.txt" \
|| STRAPFILE="${MY_PATH}/A_boostrap_nodes.txt"
for bootnode in $(cat ${STRAPFILE} | grep -Ev "#") # remove comments
do
ipfsnodeid=${bootnode##*/}
ipfs bootstrap add $bootnode
done
## fi
########################################################################
########################################################################
end=`date +%s`
dur=`expr $end - $start`
echo "20H12 (♥‿‿♥) Execution time was $dur" seconds.
hours=$((dur / 3600))
minutes=$(( (dur % 3600) / 60 ))
seconds=$((dur % 60))
echo "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds"
echo "20H12 (♥‿‿♥) Execution time was $dur seconds."
~/.zen/Astroport.ONE/tools/ipfs_P2P_forward.sh
## MAIL LOG : support@qo-op.com
$MY_PATH/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" &
## MAIL LOG : support@qo-op.com ##
${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "20H12"
espeak "20 12 Storm & Thunder duration was $dur seconds" > /dev/null 2>&1
espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/null 2>&1
espeak "Restarting Astroport Station API" > /dev/null 2>&1
## RESTART
# espeak "Restarting Astroport Services" > /dev/null 2>&1
## CLOSING API PORT
[[ -s ~/.zen/.pid ]] && kill -9 $(cat ~/.zen/.pid)
## OPEN API ENGINE
~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log &
PID=$!
echo $PID > ~/.zen/.pid
[[ -s ~/.zen/.pid ]] && kill -9 $(cat ~/.zen/.pid) > /dev/null 2>&1
## KILL ALL REMAINING nc
killall nc 12345.sh > /dev/null 2>&1
## SYSTEMD OR NOT SYSTEMD
if [[ ! -f /etc/systemd/system/astroport.service ]]; then
${MY_PATH}/12345.sh > ~/.zen/tmp/12345.log &
PID=$!
echo $PID > ~/.zen/.pid
else
sudo systemctl restart astroport
[[ -s ~/.zen/G1BILLET/G1BILLETS.sh ]] && sudo systemctl restart g1billet
echo "Astroport processes systemd restart"
fi
echo "IPFS DAEMON LEVEL"
######### IPFS DAMEON NOT RUNNING ALL DAY
## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT
[[ $LOWMODE != "" ]] \
&& echo "STOP IPFS $LOWMODE" \
&& sleep 3600 \
&& sudo systemctl stop ipfs \
&& exit 0
echo "HIGH. RESTART IPFS"
sleep 60
sudo systemctl restart ipfs
#################################
### DRAGON WOT : SSH P2P RING OPENING
#################################
sleep 30
echo "DRAGONS WOT ON"
${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh
exit 0

134
321_DU.md Normal file
View File

@ -0,0 +1,134 @@
# 3 2 1 DU
Comment utiliser le DU pour gérer et construire le commun?
*en cours de rédaction...*
# INTRO
L'aventure se déroule à la frontière entre l'ancien (UNL) et le nouveau monde (ML).
C'est un jeu de société qui s'adresse aux personnes qui possèdent un lieu et souhaitent l'ouvrir à une gestion aggradative démocratique.
Un lieu a pour fonction d'assurer gîte et couvert à ses visiteurs et résidents. Il acceuillera des ateliers de construction où seront transmis les savoir-faire.
# REGLES DU JEU
Il s'agit d'un jeu qui permet de réduire sa dépendance à l'UNL (Euro), il se base sur le réseau de confiance de la JUNE et active une dynamique de maintien et progrès.
Ici, "Le Lieu" possède un portefeuille et fait partie du jeu. Les paramètres du Jeu peuvent être adaptées selon la balance (UNL/ML) pour permettre à la partie de se dérouler.
Les règles du jeu sont Libres et "Open Source", elles décrivent la façon que nous avons mis en pratique lors du "Geconomicus Terraformation Forêt Jardin" il s'adaptera à un lieu collectif orienté vers l'autoconstruction, composé de 6 à 20 personnes. https://ipfs.asycn.io/ipfs/QmUtGpGeMZvwp47ftqebVmoFWCmvroy5wEtWsKvWvDWJpR/Foret%20Enchant%C3%A9e%20-%20PROJET%20ASTROPORT.pdf
### PARTICIPATION AUX FRAIS
Avant de démarrer le jeu, listez les frais de fonctionnement en UNL du Lieu. En fonction de la capacité d'accueil, définissez une estimation de la PAF / jour / pers.
Ce montant sert de balise. Il s'agira lors des cycles de réflexion du jeu de le réduire. Il définit les échanges à la frontière monétaire du Lieu.
En effet, un première règle du Lieu est qu'il n'existe aucun moyen de breveter ni faire valoir la propriété intellectuelle sur une idée, ou un processus la mettant en pratique (SOLUTIONS DIY ONLY).
https://www.levif.be/belgique/richard-stallman-la-propriete-intellectuelle-est-un-terme-de-propagande/
### PARTICIPANTS
Sur place, la Monnaie Libre est utilisée. Chaque joueur créé 1 DU par jour qui s'ajoute au jeu. On pourra selon la communauté souhaitant participer démarrer un nouveau DU ou accepter le DU d'autres monnaies libres (cf. TRM)
Afin de créer une dynamique entre le Lieu et ses visiteurs ou résidents, il est convenu que chaque participant doit verser dans une caisse propre au Lieu un certain nombre de DU.
#### NIVEAUX
Le barême du montant versé quotidiennement au Lieu par chaque participant est établi selon le "niveau" atteint par le joueur:
* Visiteur. 3 DU
* Acteur. 2 DU
* Batisseur. 1 DU
* Ordonateur. 0 DU
**Ordonateur** est le niveau du "Organisateur du Jeu", celui qui assure le bon respect des règles par les autres et/ou celui qui a ouvert sa propriété au Jeu.
**Batisseur** est le niveau atteint après avoir participé à un chantier participatif sur un des Lieux du Jeu et obtenu un Niveau de Confiance. Ces toiles de confiance seront normalisées et affinées au fur et à mesure du déroulement du Jeu.
**Acteur** désigne le niveau de base. Il s'appliquer à tous les individus qui participent à réaliser les Actions du Lieu.
**Visiteur** n'implique aucune participation aux actions, ni aux ateliers du Lieu, mais permet de profiter de l'accueil et des activités proposées sur place.
Les G1 échangées dans la blockchain permettent de dessiner de nouvelles toiles de confiances. En analysant les transactions portant certains commentaires à égalité comptable (jugement & aquitement).
Par exemple : https://forum.duniter.org/t/il-manque-une-tdc-a-notre-tdc/10500/22?u=frederic_renault (principe à fixer et normaliser)
## INITIALISATION
Pour commencer une partie.
Chaque joeur ajoute 30 DU répartis sur 10 jetons (max 12 DU, min 1 DU, moy 3 DU) dans une "**boite à gratitude**" dans laquelle ceux qui réalisent une action vont pouvoir piocher...
NB: Le montant ajouté par chacun correspond à "10 jours de tourisme", on pourra modifier les chiffres en conséquence du montant choisi pour ce niveau.
### ACTIONS
L'organisateur et les participants établissent la liste des actions à réaliser pour maintenir le lieu en bon état. ex: Ménage, vaisselle, ramassage de bois, collecte, rangement, etc...
Faire figurer la liste sur un tableau afin que tous puissent la voir (et éventuellement la modifier)
Le fait de réaliser une action fait passer le joeur du niveau Touriste au niveau "Coopérateur" et lui permet de tirer une "gratitude" (cf. G1Ronds ```/ipns/k51qzi5uqu5dmdjma9ew6vqrbqp3hrzh3aen1c37ahq4tm9tt738cpd19r86e4```).
A ce niveau, chaque joueur gagne en moyenne 1 DU par jour. On peut réaliser plusieurs actions par jour et les suivantes rapportent 3 DU en moyenne ;)
#### LIMITE
Afin de ne pas laisser se vider la boite à gratitude, on limite le nombre de DU que chacun peut gagner en réalisant des Actions à 12 DU. Une fois ce montant atteint, le joueur devra investir ses DU sur-numéraires dans les CrowdFunding du Lieu.
### VOEUX
Chaque joueur du niveau Acteur peut émettre un Voeu, et proposer un atelier pour ajouter une amélioration au Lieu.
ex: chambre en plus, nouvelles toilettes, système de chauffage, garage, etc ...
Les Voeux sont établis entre le Lieu et le Joeur et apparaissent dans le Jeu.
Chaque participant pourra verser ML ou UNL aux Voeux qu'il souhaite voir se réaliser.
#### VOTE QUADRATIQUE
Chaque joueur peut (doit) verser 1 DU / jour à au moins un Voeu qu'il souhaite se voir réaliser... Le Lieu publie la liste de ses "Voeux" qui voit monter leur financement avec le temps.
Lorsque qu'un joueur verse plusieurs DU à un Voeu, seule la racine carré du montant y est attribué. La différence est répartie à l'ensemble des autres voeux en fonction de leur niveau de DU respectivement atteint.
Exemple : https://www.wtfisqf.com/
https://ipfs.copylaradio.com/ipns/k51qzi5uqu5dgobi9ozzzvdftqfd3hd7a1488nzymky1edz8j779jov7sbemc0#Discussion%20avec%20ChatGPT%20au%20sujet%20de%20la%20G1%20et%20du%20vote%20quadratique
### CHANTIERS COLLECTIFS
https://forum.monnaie-libre.fr/t/les-explorateurs-du-libre-rencontre-et-partage-des-constructeurs-du-monde-libre/24040?u=qoop
Le Lieu possède un "Agenda". A certaines période il acceuille l'organisation d'ateliers pour réaliser certains des Voeux dont le niveau de crowdfunding motive la réalisation.
A chaque réalisation d'un Voeu (chantier collectif), les G1 de la cagnote sont distribuées aux participants.
On pensera à ajouter en commentaire des transactions :MIZ:NomDuVoeu:OK nous pourrons nous servir de ces informations pour construire des toiles de confiance qualitatives.
**Le Jeu établit une gestion démocratique de prise de décision collective.**
# Annexe
## Calcul du forfait "inter opérateur monétaire"
Le Lieu produit des valeurs qui sont mise à disposition selon 3 forfaits.
Le PAF correspond au prix pratiqué en UNL sur le marché UNL. Le PIF est le nombre de DU souhaité par unité.
Voici comment sont calculé les "Forfaits" :
* Le Forfait Cool : payer le PAF, et recevoir le PIF
* Le Forfait Juste : payer le 1/2 PAF + le PIF
* Le Forfait Carré : payer le 1/4 PAF + le PIF²
CALCULATEUR DE FORFAIT (PIF "ML" / PAF "UNL")
http://ipfs.asycn.io/ipfs/QmRm1NXy5DZS8ftxeTjHrWgFGuMzouzTJrjEHE4uuUbPX2
> Pour plus d'info, et si vous souhaitez lancer le Jeu chez vous, contactez support@qo-op.com

39
AI/Readme.md Normal file
View File

@ -0,0 +1,39 @@
# Pourquoi ?
## La Monnaie est Buggée !
Dans l'écosystème actuel, la notion de monnaie est sujette à des défauts.
La distinction entre une unité non libre et une monnaie libre révèle des imperfections
dans les échanges économiques.
## Blockchain = Registre Global
La blockchain, en tant que registre global, offre une opportunité de remédier aux lacunes du
système financier actuel. Elle peut être envisagée comme une carte d'identité pour le Web3,
offrant transparence et traçabilité.
## IA Apprentissage et Contrôle
La gestion de l'intelligence artificielle est cruciale. La comparaison entre un ChatGPT privé
et Mistral libre souligne la nécessité d'un contrôle plus étendu.
"The PILE", source d'information, demande une cohérence accrue pour garantir une
diffusion fiable des connaissances.
## Loi de Moore vs Industrie
La cadence effrénée de la Loi de Moore, avec une progression tous les 1,5 ans,
se heurte à la réalité industrielle où les cycles d'investissement s'étendent de 3 à 11 ans.
Les rendements sur investissements sont souvent compromis, créant des opportunités pour de nouveaux acteurs.
## Web2.0 Épileptique
Les soubresauts du Web2.0, caractérisés par l'instabilité des données et de leur localisation,
soulignent la nécessité d'une approche plus stable et cohérente.
# Comment ?
## UPlanet / Astroport.ONE
La solution réside dans UPlanet et Astroport.ONE, des initiatives axées sur la décentralisation et la régulation.
En adoptant une blockchain multi-grille sphérique et des clés géospatiales, ces plateformes créent un réseau de :
* stations index (300€)
* stations de stockage (1500€)
* stations IA avec GPU (5000€)
Ces stations, en synergie, visent à résoudre les problèmes évoqués, offrant une alternative innovante
pour les investisseurs souhaitant participer à la transformation du paysage technologique.

79
API/AMZQR.sh Executable file
View File

@ -0,0 +1,79 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: AMZQR
## An API to create QRCode with logo
# ?amzqr=URLENCODEDSTRING&logo=IMAGE
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
[[ "$PORT" == "" ]] && echo "$MY_PATH/AMZQR.sh '0' 'la chaine a mettre en QRCODE' 'et' 'TV'" && exit 1
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
[[ ${MOATS} == "" ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}/
##################################################
USTRING=$(urldecode "${THAT}")
IMAGE="${THIS}"
[[ ! -s ${MY_PATH}/../images/${IMAGE}.png || ${USTRING} == "" ]] \
&& echo "UNKNOW IMAGE ${IMAGE}" \
&& ( [[ $PORT != "0" ]] && echo "$HTTPCORS ERROR - BAD PARAMS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1
echo amzqr "${USTRING}" -l H -c -p ${MY_PATH}/../images/${IMAGE}.png -n ${MOATS}.png -d ~/.zen/tmp/${MOATS}/
## RUN AMZQR
amzqr "${USTRING}" -l H -c -p ${MY_PATH}/../images/${IMAGE}.png -n ${MOATS}.png -d ~/.zen/tmp/${MOATS}/
IPFSMG=$(ipfs add -q ~/.zen/tmp/${MOATS}/${MOATS}.png | tail -n 1)
echo "${myIPFS}/ipfs/${IPFSMG}"
echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}/ipfs/${IPFSMG}'\" />" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
if [[ $PORT == "0" ]]; then
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && xdg-open ${myIPFS}/ipfs/${IPFSMG}
LP=$(ls /dev/usb/lp* 2>/dev/null | head -n1)
if [[ $LP ]]; then
echo "IMPRESSION QRCODE"
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/${MOATS}/${MOATS}.png > ~/.zen/tmp/${MOATS}/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/${MOATS}/toprint.bin $LP
fi
fi
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(AMZQR) Operation time was "`expr $end - $start` seconds.
echo "/ipfs/${IPFSMG}"
exit 0

79
API/DRAGONS.sh Executable file
View File

@ -0,0 +1,79 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: DRAGONS
## Used by OSM2IPFS welcome.html
# ?zone=DEG&ulat=LAT&ulon=LON
## Search for TW numbers in received zone # >> return json
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
### transfer variables according to script
[[ $MOATS == "" ]] && echo "MISSING MOATS" && exit 1
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
# PREPARE HTTP RESPONSE (application/json)
mkdir -p ~/.zen/tmp/${MOATS}/
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}/http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/http
# ------------------------------------------------------------------- #
# GET/?dragons
# ------------------------------------------------------------------- #
## RUNNING UPLANET STATIONS GPS DETECTION
rm ~/.zen/tmp/DRAGONS.json
if [[ ! -s ~/.zen/tmp/DRAGONS.json ]]; then
echo " ## cat ***/GPS.json"
cat ~/.zen/tmp/${IPFSNODEID}/GPS.json 2>/dev/null | jq -c '.[] + {ipfsnodeid: "'$IPFSNODEID'"}' > ~/.zen/tmp/${MOATS}/gps.grid
cat ~/.zen/tmp/swarm/12D*/GPS.json 2>/dev/null | jq -c '.[] + {ipfsnodeid: "'$IPFSNODEID'"}' | sort -u >> ~/.zen/tmp/${MOATS}/gps.grid
cat ~/.zen/tmp/${MOATS}/gps.grid | jq -s '.' | sed -e 's/\[/[/' -e 's/\]/]/' -e 's/},{/},\n{/g' > ~/.zen/tmp/DRAGONS.json
fi
#~ jq 'unique_by(.umap)' ~/.zen/tmp/DRAGONS.json > ~/.zen/tmp/DRAGONS_no_duplicates.json
#~ mv ~/.zen/tmp/DRAGONS_no_duplicates.json ~/.zen/tmp/DRAGONS.json
echo " ***** WELCOME DRAGONS =========== "
cat ~/.zen/tmp/DRAGONS.json
### SEND RESPONSE ON PORT
cat ~/.zen/tmp/DRAGONS.json >> ~/.zen/tmp/${MOATS}/http
(
cat ~/.zen/tmp/${MOATS}/http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
rm -Rf ~/.zen/tmp/${MOATS} && echo "BLURP DRAGONS.json"
) &
## TIMING
end=`date +%s`
echo "(DRAGONS) Operation time was "`expr $end - $start` seconds.
exit 0

View File

@ -4,12 +4,30 @@
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: SALT & PEPPER
## API: PLAYER - PUBLIC KEY AUTH
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
PORT=$1 THAT=$2 ANDcyberD0G!
=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9 COOKIE=$10
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
### transfer variables according to script (TODO REMOVE THAT)
PORT=$1 PLAYER=$2 APPNAME=$3 OBJ=$5
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
@ -18,70 +36,80 @@ Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
start=`date +%s`
PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
### transfer variables according to script
PORT=$1 PLAYER=$2 APPNAME=$3 WHAT=$4 OBJ=$5 VAL=$6
echo "- $PLAYER - $APPNAME : $WHAT $OBJ $VAL"
ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && (echo "$HTTPCORS UNKNOWN PLAYER $PLAYER - EXIT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
##############################################
# PAY : /?player=PLAYER&pay=1&dest=G1PUB
##############################################
if [[ $APPNAME == "pay" ]]; then
echo "$HTTPCORS" > ~/.zen/tmp/$PLAYER.pay.$WHAT.http
if [[ $WHAT =~ ^[0-9]+$ ]]; then
echo "${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m"
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m 2>&1 >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "history" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -j >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "get" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey get >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "balance" ]]; then
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo "(G_G ) G1BANK Operation time was "`expr $end - $start` seconds.
exit 0
fi
[[ ! ${PLAYER} ]] && (echo "${HTTPCORS} BAD PLAYER - EXIT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] && (echo "${HTTPCORS} UNKNOWN PLAYER ${PLAYER} - EXIT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
##############################################
# MOATUBE : /?player=PLAYER&moa=json&tag=FILTER
##############################################
if [[ $APPNAME == "moa" ]]; then
if [[ ${APPNAME} == "moa" ]]; then
[[ ! $VAL ]] && VAL="G1CopierYoutube"
echo "EXPORT MOATUBE $PLAYER $VAL"
[[ ! ${WHAT} ]] && WHAT="G1CopierYoutube"
echo "EXPORT MOATUBE ${PLAYER} ${WHAT}"
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}.$PLAYER.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.$PLAYER.http
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/ --render '.' "${PLAYER}.moatube.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "[tag[${WHAT}]]"
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/ --render '.' "$PLAYER.moatube.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "[tag[$VAL]]"
if [[ ! ${THIS} || ${THIS} == "json" ]]; then
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.${PLAYER}.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.${PLAYER}.http
cat ~/.zen/tmp/${PLAYER}.moatube.json >> ~/.zen/tmp/${MOATS}.${PLAYER}.http
cat ~/.zen/tmp/${MOATS}.${PLAYER}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
fi
cat ~/.zen/tmp/$PLAYER.moatube.json >> ~/.zen/tmp/${MOATS}.$PLAYER.http
cat ~/.zen/tmp/${MOATS}.$PLAYER.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo "(TW) MOA Operation time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
# ATPASS : /?player=PLAYER&atpass=G1PUB&$VoeuName=ONELINE
##############################################
#~ if [[ ${APPNAME} == "atpass" ]]; then
#~ echo "CREATING @PASS"
#~ end=`date +%s`
#~ echo "(@PASS) creation time was "`expr $end - $start` seconds.
#~ exit 0
#~ fi
##############################################
# YOUTUBE : /?player=PLAYER&(youtube | pdf | image) =_URL_
##############################################
#~ if [[ ${APPNAME} == "youtube" || ${APPNAME} == "pdf" || ${APPNAME} == "image" ]]; then
#~ APPNAME=$(echo ${APPNAME} | sed -r 's/\<./\U&/g' | sed 's/ //g') ## First letter Capital
#~ [[ ! ${THIS} ]] && THIS="https://www.youtube.com/watch?v=BCl2-0HBJ2c"
#~ echo ">>> COPY ${APPNAME} for ${PLAYER} from ${THIS}"
#~ G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
#~ [[ ! ${G1PUB} ]] && espeak "NOT MY PLAYER " && echo "${PLAYER} IS NOT MY PLAYER" && exit 1
#~ echo "================================================"
#~ echo "${PLAYER} : ${myIPFS}/ipns/${ASTRONAUTENS}"
#~ echo " = /ipfs/${TW}"
#~ echo "================================================"
#~ ${MY_PATH}/../ajouter_media.sh "${THIS}" "${PLAYER}" "${APPNAME}" &
#~ echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.${PLAYER}.http
#~ echo "${myIPFS}/ipns/${ASTRONAUTENS}" >> ~/.zen/tmp/${MOATS}.${PLAYER}.http
#~ (
#~ cat ~/.zen/tmp/${MOATS}.${PLAYER}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
#~ rm ~/.zen/tmp/${MOATS}.${PLAYER}.http
#~ ) &
#~ # ### REFRESH CHANNEL COPY
#~ end=`date +%s`
#~ echo "(TW) MOA Operation time was "`expr $end - $start` seconds.
#~ exit 0
#~ fi
exit 1

View File

@ -4,12 +4,28 @@
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: SALT & PEPPER
## API: QRCODE - ANY/MULTI KEY OPERATIONS
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
### transfer variables according to script
QRCODE=$(echo "$THAT" | cut -d ':' -f 1) # G1nkgo compatible
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
@ -19,90 +35,667 @@ Content-Type: text/html; charset=UTF-8
"
start=`date +%s`
# function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
### transfer variables according to script
QRCODE=$THAT
URL=$THIS
TYPE=$WHAT
function urldecode() {
local string="${1//+/ }"
printf '%b' "${string//%/\\x}"
}
urlencode() {
local string="$1"
local length="${#string}"
local url_encoded=""
for ((i = 0; i < length; i++)); do
local c="${string:i:1}"
case "$c" in
[a-zA-Z0-9.~_-])
url_encoded+="$c"
;;
*)
printf -v hex_val "%02X" "'$c" # Uppercase hex values
url_encoded+="%$hex_val"
;;
esac
done
echo "$url_encoded"
}
## GET TW
mkdir -p ~/.zen/tmp/${MOATS}/
ASTRONAUTENS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${QRCODE})
[[ ! ${ASTRONAUTENS} ]] \
&& (echo "$HTTPCORS ERROR - ASTRONAUTENS !!" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& exit 1
echo "ipfs --timeout 120s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/${MOATS}/index.html"
ipfs --timeout 120s cat /ipns/$ASTRONAUTENS > ~/.zen/tmp/${MOATS}/index.html
if [[ -s ~/.zen/tmp/${MOATS}/index.html ]]; then
tiddlywiki --load ~/.zen/tmp/${MOATS}/index.html --output ~/.zen/tmp/${MOATS} --render '.' "MadeInZion.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json ]] \
&& ( echo "~~~ NO /ipns/$ASTRONAUTENS (☓‿‿☓) CREATE A TW ~~~" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & ) \
&& exit 1
GPLAYER=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
REPLACE="https://$myTUBE/ipns/${ASTRONAUTENS}" \
## REDIRECT TO TW OR GCHANGE PROFILE
sed "s~_TWLINK_~${REPLACE}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
echo "url='"${REPLACE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
################################################################################
## QRCODE IS HTTP LINK REDIRECT TO
###############################################################################
if [[ ${QRCODE:0:4} == "http" ]]; then
## THIS IS A WEB LINK
sed "s~_TWLINK_~${QRCODE}/~g" ${MY_PATH}/../templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
sed -i "s~Set-Cookie*~Set-Cookie: $COOKIE~" ~/.zen/tmp/${MOATS}/index.redirect
echo "url='"${QRCODE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
(
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
################################################################################
## QRCODE="station" : REFRESH STATION & OPEN G1PalPay INTERFACE
###############################################################################
if [[ ${QRCODE} == "station" ]]; then
## CHECK FOR ANY ALREADY RUNNING make_image_ipfs_index_carousel
carouselrunning=$(ps axf --sort=+utime | grep -w 'make_image_ipfs_index_carousel' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
if [[ ! -s ~/.zen/tmp/ISTATION ]]; then
if [[ $carouselrunning ]]; then
ISTATION="/ipfs/QmVTHH8sTXEqRBsvcKo5jDo16rvp7Q7ERyHZP5vmWUxeS6" ## G1WorldCrafting.jpg
else
## GENERATE PLAYER G1 TO ZEN ACCOUNTING
ISTATION=$($MY_PATH/../tools/make_image_ipfs_index_carousel.sh | tail -n 1)
echo $ISTATION > ~/.zen/tmp/ISTATION ## STATION G1WALLET CAROUSEL
fi
else
ISTATION=$(cat ~/.zen/tmp/ISTATION)
fi
## LOG IPFSNODEID : IPCity + Wheater + more...
${MY_PATH}/../tools/IPFSNODEID.weather.sh > ~/.zen/tmp/${IPFSNODEID}/weather.txt
echo "<meta http-equiv=\"refresh\" content=\"0; url='${ISTATION}'\" />" > ~/.zen/tmp/${IPFSNODEID}/_index.html
## SHOW ZenStation FRONT
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH~${WORLDG1PUB}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://127.0.0.1:8080~${myIPFS}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://127.0.0.1:33101~${myG1BILLET}~g" ~/.zen/tmp/${MOATS}/index.htm
sed -i "s~http://astroport.localhost:1234~${myASTROPORT}~g" ~/.zen/tmp/${MOATS}/index.htm
WSTATION="/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/index.htm)"
echo $WSTATION > ~/.zen/tmp/WSTATION
end=`date +%s`
echo "NEW WSTATION ${myIPFS}${WSTATION} Execution time was "`expr $end - $start` seconds.
##302 REDIRECT TO WSTATION IPFS
sed "s~_TWLINK_~${myIPFS}${WSTATION}/~g" ${MY_PATH}/../templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
sed -i "s~Set-Cookie*~Set-Cookie: $COOKIE~" ~/.zen/tmp/${MOATS}/index.redirect
echo "url='"${myIPFSW}${WSTATION}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
(
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
################################################################################
## QRCODE = PGP ENCRYPTED STRING
# /?qrcode=-----BEGIN%20PGP%20MESSAGE-----~~jA0ECQMC5iq8 [ ......... ] _Q%3D%3D~%3D9UIj~-----END%20PGP%20MESSAGE-----~
# &pass=coucou&history/read/pay/login=(1|email)&g1pub=_DESTINATAIRE_
################################################################################
if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
PASS=$(urldecode ${THIS})
echo "## THIS IS A PGP ENCRYPTED QRCODE ZENCARD - PASS ${PASS} - $APPNAME"
if [[ ${PASS} != "" ]]; then
echo "WHAT=${WHAT} VAL=${VAL}"
## Recreate GPG aes file
urldecode "${QRCODE}" | tr '_' '+' | tr '-' '\n' | tr '~' '-' > ~/.zen/tmp/${MOATS}/disco.aes
sed -i '$ d' ~/.zen/tmp/${MOATS}/disco.aes
# Decoding
echo "cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "${PASS}" --batch"
cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "${PASS}" --batch > ~/.zen/tmp/${MOATS}/decoded
# cat ~/.zen/tmp/${MOATS}/disco
## FORMAT IS "/?salt=${USALT}&pepper=${UPEPPER}"
DISCO=$(cat ~/.zen/tmp/${MOATS}/decoded | cut -d '?' -f2)
arr=(${DISCO//[=&]/ })
s=$(urldecode ${arr[0]} | xargs)
salt=$(urldecode ${arr[1]} | xargs)
p=$(urldecode ${arr[2]} | xargs)
pepper=$(urldecode ${arr[3]} | xargs)
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/disco
if [[ ${salt} != "" && ${pepper} != "" ]]; then
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/secret.key "$salt" "$pepper"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/secret.key | grep 'pub:' | cut -d ' ' -f 2)
echo "COINScheck.sh ${G1PUB}"
${MY_PATH}/../tools/COINScheck.sh ${G1PUB} > ~/.zen/tmp/${G1PUB}.curcoin
CURCOINS=$(cat ~/.zen/tmp/${G1PUB}.curcoin | tail -n 1 | xargs | cut -d '.' -f 1)
CURZEN=$(echo "($CURCOINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "= $CURCOINS G1 / $CURZEN ZEN"
[[ ${WHAT} == "" ]] && echo "<br> Missing WHAT <br>" >> ~/.zen/tmp/${MOATS}/disco
[[ ${VAL} == "" || ${VAL} == "undefined" ]] && echo "<br> Missing Destination PublicKey <br>" >> ~/.zen/tmp/${MOATS}/disco
G1DEST=$(echo "$VAL" | cut -d ':' -f 1) ## G1PUB:CHK format
CHK=$(echo "$VAL" | cut -d ':' -f 2) ## G1 CHECKSUM or ZEN
[[ ${CHK::3} == "ZEN" ]] && echo "ZENCARD $VAL"
## GET DESTINATION ACCOUNT AMOUNT
DESTM=$(${MY_PATH}/../tools/COINScheck.sh ${G1DEST} | tail -n 1)
DESTMZEN=$(echo "($DESTM - 1) * 10" | bc | cut -d '.' -f 1)
echo "DEST WALLET = $DESTM G1 / $DESTMZEN ZEN"
if [[ ${APPNAME} == "pay" ]]; then
if [[ ${WHAT} != "" && ${G1DEST} != "" && ${CURCOINS} != "null" && ${CURCOINS} != "" && ${CURCOINS} > ${WHAT} ]]; then
## COMMAND PAYMENT MAX : 999.99
if [[ ${WHAT} =~ ^-?[0-9]{1,3}(\.[0-9]{1,2})?$ ]]; then
${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/secret.key "${WHAT}" "${G1DEST}" "ZEN:${MOATS}"
echo "<h1>OK</h1><h2>PAYMENT PROCESSING</h2>ZEN:${MOATS}" >> ~/.zen/tmp/${MOATS}/disco
else
echo "<h2>${WHAT} FORMAT ERROR</h2>" >> ~/.zen/tmp/${MOATS}/disco
fi
else
echo "<h2> ERROR - ${G1DEST} ? ${CURCOINS} < ${WHAT} ? - ERROR </h2>" >> ~/.zen/tmp/${MOATS}/disco
fi
fi
if [[ ${APPNAME} == "flipper" ]]; then
## Open OSM2IPF "getreceiver" App
BASE="qrcode=${QRCODE}&pass=${PASS}"
LINK="${myIPFS}${FLIPPERCID}/?${BASE}&coins=${CURCOINS}"
echo "LINK:$LINK"
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/disco
echo "<script>window.location.href = '${LINK}';</script>" >> ~/.zen/tmp/${MOATS}/disco
fi
if [[ ${APPNAME} == "history" || ${APPNAME} == "read" ]]; then
## history & read ## CANNOT USE jaklis CLI formated output (JSON output)
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/disco
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/disco
# cp ~/.zen/tmp/${MOATS}/secret.key ~/.zen/tmp/
echo "${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/secret.key $APPNAME -j"
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/secret.key $APPNAME -j >> ~/.zen/tmp/${MOATS}/disco
fi
if [[ ${APPNAME} == "balance" ]]; then
## history & read
# cp ~/.zen/tmp/${MOATS}/secret.key ~/.zen/tmp/
qrencode -s 6 -o "${HOME}/.zen/tmp/${MOATS}/disco.qr.png" "${G1PUB}"
QRURL=${myIPFS}/ipfs/$(ipfs add -q ~/.zen/tmp/${MOATS}/disco.qr.png)
ONVADIRE="<h1> ${CURZEN} ẐEN </h1>${G1PUB}<br><br><img src=${QRURL} />"
echo "${ONVADIRE}" >> ~/.zen/tmp/${MOATS}/disco
fi
if [[ ${APPNAME} == "friend" ]]; then
# CHECK IF ${G1DEST} HAS A PROFILE
${MY_PATH}/../tools/timeout.sh -t 5 \
curl -s ${myDATA}/user/profile/${G1DEST} > ~/.zen/tmp/${MOATS}/gchange.json
## Send ॐ★ॐ
[[ -s ~/.zen/tmp/${MOATS}/gchange.json ]] \
&& ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/secret.key stars -p ${G1DEST} -n ${WHAT} >> ~/.zen/tmp/${MOATS}/disco \
&& rm ~/.zen/tmp/${MOATS}/gchange.json \
|| echo "/${G1DEST} profile is not existing yet..." >> ~/.zen/tmp/${MOATS}/disco
fi
##############################################
# LOGIN / LOGOUT
##############################################
if [[ ${APPNAME} == "logout" ]]; then
player=$(echo "${salt}" | cut -d '_' -f 1 | cut -d ' ' -f 1) ## EMAIL_dice_words kind
## REMOVE PLAYER IPNS KEY FROM STATION
[[ "${player}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${player} \
|| PLAYER=${WHAT}
ISTHERE=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
if [[ ! ${ISTHERE} ]]; then
(
echo "$HTTPCORS
<h1>LOGOUT ERROR</h1><h2>${PLAYER} keys not found on ZEN Station</h2>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 \
&& echo "SLURP PLAYER ERROR ${player}"
) &
exit 0
fi
echo "<h1><a href='$myIPFS/ipns/${ISTHERE}'>TW</a></h1>" > ~/.zen/tmp/${MOATS}/${MOATS}.log
echo "<h2>$PLAYER LOGOUT ...</h2>removing keys : " >> ~/.zen/tmp/${MOATS}/${MOATS}.log
ipfs key rm ${G1PUB} >> ~/.zen/tmp/${MOATS}/${MOATS}.log
ipfs key rm ${PLAYER} >> ~/.zen/tmp/${MOATS}/${MOATS}.log
ipfs key rm "${PLAYER}_feed" >> ~/.zen/tmp/${MOATS}/${MOATS}.log
echo "$HTTPCORS $(cat ~/.zen/tmp/${MOATS}/${MOATS}.log)"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo $APPNAME "(☉_☉ ) Execution time was "`expr $end - $start` seconds.
rm ~/.zen/tmp/${MOATS}/${MOATS}.*
exit 0
fi
if [[ ${APPNAME} == "login" ]]; then
player=$(echo "${salt}" | cut -d '_' -f 1 | cut -d ' ' -f 1) ## EMAIL_dice_words kind
[[ "${player}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${player} \
|| PLAYER=${WHAT}
ISTHERE=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
echo "IS THERE ? $ISTHERE"
[[ ${ISTHERE} == "" ]] \
&& ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/secret.ipns "$salt" "$pepper" \
&& ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/secret.ipns \
&& ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/secret.ipns \
&& ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1) \
|| ASTRONAUTENS=${ISTHERE}
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/feed.ipfskey "$salt" "$G1PUB"
FEEDNS=$(ipfs key import "${PLAYER}_feed" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/feed.ipfskey)
( ## 1 HOUR SESSION
[[ ${ISTHERE} == "" ]] \
&& echo "${PLAYER} SESSION STARTED" \
&& sleep 3600 \
&& echo "${PLAYER} SESSION ENDED" \
&& ipfs key rm ${PLAYER} \
&& ipfs key rm ${PLAYER}_feed \
&& ipfs key rm ${G1PUB}
) &
REPLACE=${myIPFS}/ipns/${ASTRONAUTENS}
echo "${PLAYER} LOGIN - TW : ${REPLACE}"
sed "s~_TWLINK_~${REPLACE}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}.index.redirect
echo "url='"${REPLACE}"'" >> ~/.zen/tmp/${MOATS}.index.redirect
(
cat ~/.zen/tmp/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP " && rm -Rf ~/.zen/tmp/${MOATS} && rm ~/.zen/tmp/${MOATS}/${MOATS}*
) &
exit 0
fi
else
echo "<br><h1>${PASS} : MAUVAIS PASS</h1>" >> ~/.zen/tmp/${MOATS}/disco
echo "<br><img src='http://127.0.0.1:8080/ipfs/QmVnQ3GkQjNeXw9qM7Fb1TFzwwxqRMqD9AQyHfgx47rNdQ/your-own-data-cloud.svg' />" >> ~/.zen/tmp/${MOATS}/disco
fi
else
echo "<br>DATA MISSING" >> ~/.zen/tmp/${MOATS}/disco
fi
(
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP ~~ $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
### THIS QRCODE IS EMAIL/PASS/PIN STYLE
#~ if [[ ${QRCODE:0:5} == "&&&&&" ]]; then
#~ PASS=$(urldecode ${THIS})
#~ echo "ZENCARD UPlanet QRCODE : PIN=${PASS}"
#~ fi
################################################################################
## QRCODE = G1Milgram G1Missive PGP ENCRYPTED STRING
# /?qrcode=@@@@@BEGIN%20PGP%20MESSAGE@@@@@~~jA0ECQM...............
# &pass=YYYYMM&milgram=NEWLINE&email=DESTMAIL
################################################################################
if [[ ${QRCODE:0:5} == "@@@@@" ]]; then
PASS=$(urldecode ${THIS})
NEWLINE=$(urldecode ${WHAT})
DESTMAIL=$(urldecode ${VAL,,}) # lowercase
echo "## G1BILLET+ - @PASS ${PASS} - $APPNAME"
if [[ ${PASS} != "" ]]; then
## Recreate GPG aes file
urldecode ${QRCODE} | tr '_' '+' | tr '-' '\n' | tr '@' '-' > ~/.zen/tmp/${MOATS}/disco.aes
sed -i '$ d' ~/.zen/tmp/${MOATS}/disco.aes
# Decoding
echo "cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "${PASS}" --batch"
cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "${PASS}" --batch > ~/.zen/tmp/${MOATS}/decoded
## ASTROID COULD BE UP TO 12 MONTH OLD
if [[ ! -s ~/.zen/tmp/${MOATS}/decoded ]]; then
for ((i = 1; i < 13; i++)); do
UPASS=$(date -d "$i months ago" +"%Y%m")
cat ~/.zen/tmp/${MOATS}/disco.aes | gpg -d --passphrase "${UPASS}" --batch > ~/.zen/tmp/${MOATS}/decoded
[[ -s ~/.zen/tmp/${MOATS}/decoded ]] && WARNING="=== CARD IS ${i} MONTH OLD ===" && CAGE=${i} && break
done
fi
# cat ~/.zen/tmp/${MOATS}/disco
## FORMAT IS "/?salt=${USALT}&pepper=${UPEPPER}"
## MADE by tools/VOEUX.print.sh WITH USALT="EMAIL(_SEC1_SEC2)" UPEPPER="G1VoeuName OriG1PUB"
DISCO=$(cat ~/.zen/tmp/${MOATS}/decoded | cut -d '?' -f2)
arr=(${DISCO//[=&]/ })
s=$(urldecode ${arr[0]} | xargs)
salt=$(urldecode ${arr[1]} | xargs)
p=$(urldecode ${arr[2]} | xargs)
pepper=$(urldecode ${arr[3]} | xargs)
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/disco
if [[ ${salt} != "" && ${pepper} != "" ]]; then
echo "secret1=$salt" ## CONTAINS "EMAIL(_SEC1_SEC2)"
player=$(echo $salt | cut -d '_' -f 1 | cut -d ' ' -f 1 | grep '@')
echo "player=$player"
# # G1BILLET+ interlinked ? ## POSSIBLE BUG WITH EMAIL CONTAINING "_" # TODO
[[ $(echo "$salt" | grep '_') ]] \
&& echo "G1BILLET+ interlinked : salt pepper refining" \
&& murge=($(echo $salt | cut -d '_' -f 2- | sed 's/_/ /g' | xargs)) \
&& echo "${#murge[@]} dice words" && i=$(( ${#murge[@]} / 2 )) && i=$(( i + 1 )) \
&& extra1=$(echo "${murge[@]}" | rev | cut -d ' ' -f $i- | rev) \
&& extra2=$(echo "${murge[@]}" | cut -d ' ' -f $i-) \
&& VoeuName="G1BILLET+" \
&& billkeyname=$(echo "${extra1} ${extra2}" | sha512sum | awk '{print $1}')
echo "salt=$salt" ## CONTAINS "EMAIL"
echo "pepper=$pepper" ## CONTAINS "G1VoeuName ORIGING1PUB" or G1BILLET+ secret2
[[ ${pepper:0:2} == "G1" ]] \
&& VoeuName=$(echo $pepper | cut -d ' ' -f 1 | cut -c 3-) \
&& PLAYERORIG1=$(echo $pepper | rev | cut -d ' ' -f 1 | rev) \
&& echo "$VoeuName $PLAYERORIG1 @PASS"
## CHECK PLAYERORIG1 WALLETS
echo "${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${PLAYERORIG1}"
PLAYERCOINS=$(${MY_PATH}/../tools/COINScheck.sh ${PLAYERORIG1} | tail -n 1)
echo "<br><b>${player} $PLAYERCOINS G1</b>" >> ~/.zen/tmp/${MOATS}/disco
### IF EMPTY ??? WHAT TODO
orikeyname="${player}_${VoeuName}"
destkeyname="${DESTMAIL}_${VoeuName}"
echo "@PASS KEYS :
ORIGIN=$orikeyname
DEST=$destkeyname
BILL=$billkeyname"
## REVEAL THE KEYS
# G1VOEU & IPNS KEY
[[ ${player} != "" ]] \
&& ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/playersecret.ipfs "${player}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}" \
&& ${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/player.secret.key "${player}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}" \
&& G1VOEUPUB=$(cat ~/.zen/tmp/${MOATS}/player.secret.key | grep 'pub:' | cut -d ' ' -f 2)
# INSTALL orikeyname IPNS KEY ON NODE
IK=$(ipfs key list -l | grep -w "${orikeyname}" | cut -d ' ' -f 1 )
[[ ! $IK ]] && ipfs key import ${orikeyname} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/playersecret.ipfs
## IS IT A TRANSFER ? MILGRAM G1MISSIVE
[[ ${DESTMAIL} != "" ]] \
&& echo "MILGRAM :: ${player} :: ${DESTMAIL}"
#~ && DESTG1=$(${MY_PATH}/../tools/keygen "${DESTMAIL}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}") \
#~ && ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/destsecret.ipfs "${DESTMAIL}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}"
# INSTALL orikeyname IPNS KEY ON NODE
IK=$(ipfs key list -l | grep -w "${orikeyname}" | cut -d ' ' -f 1 )
[[ ! $IK ]] && ipfs key import ${orikeyname} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/playersecret.ipfs
## IS IT LINKED WITH extra G1BILLET+
[[ ${extra1} != "" && ${extra2} != "" ]] \
&& echo "@PASS LINK TO G1BILLET+ :: ${extra1} :: ${extra2}" \
&& EXTRAG1=$(${MY_PATH}/../tools/keygen "${extra1}" "${extra2}") \
&& ${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/extrasecret.ipfs "${extra1}" "${extra2}" \
&& EXTRAG1COINS=$(${MY_PATH}/../tools/COINScheck.sh ${EXTRAG1} | tail -n 1) \
&& echo "<br><b>EXTRA ${VoeuName} $EXTRAG1COINS G1</b>" >> ~/.zen/tmp/${MOATS}/disco
# Don't care if ORIGIN PLAYER is THERE
#~ ISTHERE=$(ipfs key list -l | grep -w ${player} | cut -d ' ' -f1)
#~ echo "<h1>$player G1MISSIVE<h1> $ISTHERE" >> ~/.zen/tmp/${MOATS}/disco
echo "${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${G1VOEUPUB}"
G1VOEUCOINS=$(${MY_PATH}/../tools/COINScheck.sh ${G1VOEUPUB} | tail -n 1)
echo "<br><b>${VoeuName} $G1VOEUCOINS G1</b>" >> ~/.zen/tmp/${MOATS}/disco
echo ${WARNING} >> ~/.zen/tmp/${MOATS}/disco
#CONVERT TO IPNS KEY
G1VOEUNS=$(${MY_PATH}/../tools/g1_to_ipfs.py ${G1VOEUPUB})
## RETRIEVE IPNS CONTENT
echo "${myIPFS}/ipns/$G1VOEUNS"
if [[ ! -s ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt ]]; then
HELLO="@PASS :: G1BILLET+ :: ${G1VOEUPUB} :: $(date) :: ${player} :: ${PLAYERORIG1}"
echo "${HELLO}"
avanla=$(ps axf --sort=+utime | grep -w 'ipfs cat /ipns/$G1VOEUNS' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ ! $avanla ]] \
&& ( ipfs cat /ipns/$G1VOEUNS > ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt \
&& [[ ! -s ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt ]] \
&& echo "@PASS G1BILLET+ INIT" \
&& echo "${HELLO}" > ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt \
&& MILGRAM=$(ipfs add -q ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt) \
&& ipfs name publish -k ${player}_${VoeuName} /ipfs/${MILGRAM} &
) &
echo "<br>PLEASE RETRY IN 30 SECONDS GETTING MESSAGE FROM IPFS<bipfsr>" >> ~/.zen/tmp/${MOATS}/disco
(
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
echo "<br><br>" >> ~/.zen/tmp/${MOATS}/disco
cat ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt >> ~/.zen/tmp/${MOATS}/disco
[[ ${NEWLINE} == "" || ${NEWLINE} == "undefined" ]] && echo "<br> NO NEW LINE <br>" >> ~/.zen/tmp/${MOATS}/disco
[[ ${DESTMAIL} == "" || ${DESTMAIL} == "undefined" ]] && echo "<br> Missing Destination EMAIL <br>" >> ~/.zen/tmp/${MOATS}/disco
## CHECK VALID EMAIL FORMAT
[[ "${DESTMAIL}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& echo "<br> GOOD $DESTMAIL <br>" >> ~/.zen/tmp/${MOATS}/disco \
&& GOMAIL=1
if [[ $APPNAME == "milgram" && ${GOMAIL} == 1 ]]; then
# SEARCH FOR DESTMAIL IN SWARM
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${DESTMAIL}) ## export ASTROTW and more
echo "export ASTROTW=${ASTROTW} ASTROG1=${ASTROG1} ASTROMAIL=${DESTMAIL} ASTROFEED=${FEEDNS}"
# Create Next G1 & IPNS KEY
DESTG1PUB=$(${MY_PATH}/../tools/keygen"${DESTMAIL}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}")
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/newsecret.ipfs "${DESTMAIL}${UPLANETNAME}" "G1${VoeuName} ${PLAYERORIG1}${UPLANETNAME}"
orikeyname="${DESTMAIL}_${VoeuName}"
# INSTALL NEXT IPNS KEY ON NODE
IK=$(ipfs key list -l | grep -w "${orikeyname}" | cut -d ' ' -f 1 )
[[ ! $IK ]] && ipfs key import ${orikeyname} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/newsecret.ipfs
## CREATE NEXT G1Missive !
NEWIMAGIC=$(${MY_PATH}/../tools/VOEUX.print.sh "${DESTMAIL}" "${VoeuName}" "${MOATS}" "${PLAYERORIG1}" | tail -n 1)
## ADD NEWLINE TO MESSAGE
if [[ ${NEWLINE} != "" ]]; then
CLINE=$(echo "${NEWLINE}" | detox --inline)
echo "$CLINE" >> ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt ## NB: File could still being into "ipfs cat" process... TODO MAKE BETTER
fi
echo "UPDATED" >> ~/.zen/tmp/${MOATS}/disco
cat ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt >> ~/.zen/tmp/${MOATS}/disco
echo "<br><img src=/ipfs/$NEWIMAGIC />" >> ~/.zen/tmp/${MOATS}/disco
MILGRAM=$(ipfs add -q ~/.zen/tmp/${MOATS}/${PLAYERORIG1}.${VoeuName}.missive.txt)
(
ipfs name publish -k ${DESTMAIL}_${VoeuName} /ipfs/${MILGRAM}
echo "${VoeuName} ${PASS} G1Milgram emitted ${DESTMAIL}"
) &
fi
else
## TODO : EMPTY WALLET BACK TO ORIGIN
echo "<br><h1>${PASS} ${UPASS} ARE BAD</h1>" >> ~/.zen/tmp/${MOATS}/disco
echo "<br><img src='/ipfs/QmVnQ3GkQjNeXw9qM7Fb1TFzwwxqRMqD9AQyHfgx47rNdQ/your-own-data-cloud.svg' />" >> ~/.zen/tmp/${MOATS}/disco
fi
else
echo "<br>DATA MISSING" >> ~/.zen/tmp/${MOATS}/disco
fi
(
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP @@ $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
###################################################################################################
###################################################################################################
# API TWO : ?qrcode=G1PUB&url=____&type=____
## Astroport.ONE local use QRCODE Contains ${WHAT} G1PUB
g1pubpath=$(grep $QRCODE ~/.zen/game/players/*/.g1pub | cut -d ':' -f 1 2>/dev/null)
PLAYER=$(echo "$g1pubpath" | rev | cut -d '/' -f 2 | rev 2>/dev/null)
################################################################################
## QRCODE = G1* : MODE G1VOEU : RETURN WISHNS - IPNS App link - or direct tw tag selected json
# ~/?qrcode=G1Tag&tw=_IPNS_PLAYER_(&json)
################################################################################
if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then
## FORCE LOCAL USE ONLY. Remove to open 1234 API
[[ ! -d ~/.zen/game/players/${PLAYER} || ${PLAYER} == "" ]] \
&& (echo "$HTTPCORS ERROR - QRCODE - NO ${PLAYER} ON BOARD !!" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& exit 1
VOEU=${QRCODE:2} ## "G1G1Voeu" => "G1Voeu"
# THIS is TW IPNS
ASTROPATH=$(grep -r ${THIS} ~/.zen/game/players/*/ipfs/moa | tail -n 1 | xargs | cut -d ':' -f 1 | rev | cut -d '/' -f 2- | rev 2>/dev/null)
echo "ASTROPATH=${ASTROPATH}"
## Demande de copie d'une URL reçue.
if [[ $URL ]]; then
[[ ${TYPE} ]] && CHOICE="${TYPE}" || CHOICE="Youtube"
INDEX=${ASTROPATH}/index.html
echo $INDEX
## CREATION TIDDLER "G1Voeu" G1CopierYoutube
# CHOICE = "Video" Page MP3 Web
~/.zen/Astropor.ONE/ajouter_media.sh "${URL}" "$PLAYER" "$CHOICE" &
if [[ -s ${INDEX} ]]; then
echo "## Insertion tiddler : G1CopierYoutube"
echo '[
{
"title": "'${MOATS}'",
"type": "'text/vnd.tiddlywiki'",
"text": "'${URL}'",
"tags": "'CopierYoutube ${WHAT}'"
}
]
' > ~/.zen/tmp/${WHAT}.${MOATS}.import.json
echo "OK FOUND TW: ${INDEX}"
## TODO ASTROBOT "G1AstroAPI" READS ~/.zen/tmp/${WHAT}.${MOATS}.import.json
if [[ ${APPNAME} == "json" ]]; then
##############################################
echo "DIRECT Tag = ${VOEU} OUTPUT"
## DIRECT JSON OUTPUT
tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${MOATS} \
--render '.' "g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag['${VOEU}']]'
(echo "$HTTPCORS OK - ~/.zen/tmp/${WHAT}.${MOATS}.import.json WORKS IF YOU MAKE THE WISH voeu 'AstroAPI'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 0
else
(echo "$HTTPCORS ERROR - ${AND} - ${THIS} UNKNOWN" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/index.redirect
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/index.redirect
cat ~/.zen/tmp/${MOATS}/g1voeu.json >> ~/.zen/tmp/${MOATS}/index.redirect
(
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP g1voeu.json $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
##############################################
echo "## IPNS G1Voeu APP REDIRECT"
tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${MOATS}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]'
cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq -r 'map(select(.wish != null)) | .[].wish' > ~/.zen/tmp/${MOATS}.g1wishes.txt
cat ~/.zen/tmp/${MOATS}.g1wishes.txt
while read WISH
do
[[ ${WISH} == "" || ${WISH} == "null" ]] && echo "BLURP. EMPTY WISH" && continue
WISHNAME=$(cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .title')
WISHNS=$(cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .wishns')
[[ ${WISHNS} == null ]] && WISHNS="/ipns/"$(cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .ipns') ## KEEP OLD PROTOCOL COMPATIBLE
echo "${WISHNAME} : ${WISHNS} "
[[ "G1${WISHNAME}" == "$VOEU" ]] \
&& echo "FOUND" \
&& LINK=${myIPFS}${WISHNS} \
&& break
done < ~/.zen/tmp/${MOATS}.g1wishes.txt
fi
[[ $LINK == "" ]] && LINK="$myIPFS/ipfs/QmWUZr62SpriLPuqauMbMxvw971qnu741hV8EhrHmKF2Y4" ## 404 LOST IN CYBERSPACE
## REDIRECT TO G1VOEU IPNS ADDRESS
echo "#>>> DISPLAY WISHNS >>>> # $VOEU : $LINK"
sed "s~_TWLINK_~${LINK}~g" ${MY_PATH}/../templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect
sed -i "s~Set-Cookie*~Set-Cookie: $COOKIE~" ~/.zen/tmp/${MOATS}/index.redirect
echo "url='"${LINK}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
(
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP ${LINK} $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0
fi
################################################################################
## QRCODE = IPNS or G1PUB ? Can be ASTRONAUTENS or G1PUB format
ZCHK="$(echo $THAT | cut -d ':' -f 2-)" # ChK or ZEN
[[ $ZCHK == $THAT ]] && ZCHK=""
QRCODE="${QRCODE%%:*}" ## TRIM :ChK
################################################################################
################################################################################
## QRCODE IS IPNS FORMAT "12D3Koo" ( try ipfs_to_g1 )
IPNS2G1=$(${MY_PATH}/../tools/ipfs_to_g1.py ${QRCODE} 2>/dev/null)
echo "IPNS2G1=${IPNS2G1} ZCHK=${ZCHK}"
[[ ${ZCHK} == "" && ${#IPNS2G1} -ge 40 && ${QRCODE::4} == "12D3" ]] \
&& echo "${PORT} QRCODE IS IPNS ADDRESS : ${myIPFS}/ipns/${QRCODE}" \
&& (echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}/ipns/${QRCODE}'\" />Loading from IPFS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "GLUPS /ipns/${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 0
## TEST G1 TYPE ( try g1_to_ipfs )
ASTROTOIPNS=$(${MY_PATH}/../tools/g1_to_ipfs.py ${QRCODE} 2>/dev/null)
[[ ! ${ASTROTOIPNS} ]] \
&& echo "${PORT} INVALID QRCODE : ${QRCODE}" \
&& (echo "$HTTPCORS ERROR - INVALID QRCODE : ${QRCODE}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "GLUPS INVALID ${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 1
################################################################################
echo "############################################################################"
echo ">>> ${QRCODE} g1_to_ipfs $ASTROTOIPNS"
## GET VISITOR G1 WALLET AMOUNT : VISITORCOINS
echo "${ZCHK} COINScheck ${QRCODE}"
VISITORCOINS=$(${MY_PATH}/../tools/COINScheck.sh ${QRCODE} | tail -n 1)
COINSFILE=$HOME/.zen/tmp/${MOATS}/${QRCODE}.COINS
[[ ${VISITORCOINS} != "null" ]] \
&& ZEN=$(echo "($VISITORCOINS - 1) * 10" | bc | cut -d '.' -f 1) \
|| ZEN="-10"
DISPLAY="<h1>$VISITORCOINS G1</h1>"
## WALLET VIERGE
###########################################
if [[ $VISITORCOINS == "null" || ${ZEN} -lt 10 ]]; then
DISPLAY="$DISPLAY
<h2>!! LOW ZEN WALLET ZEN=${ZEN}<h2>"
DISPLAY="$DISPLAY<h3>LOW ZEN WARNING</h3>
PLEASE CHARGE... ${ZEN} ZEN"
fi
## WE SEND WALLET AMOUNT DISPLAY
(
echo "$HTTPCORS ${QRCODE}:${ZCHK}:${DISPLAY}<h2><a href='$myUPLANET/g1gate/?pubkey="$QRCODE"'>SCAN WALLET</a><h2>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP ${DISPLAY} $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) &
exit 0

View File

@ -4,12 +4,18 @@
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: SALT & PEPPER
## API: SALT & PEPPER - PRIVATE KEY AUTH
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
SALT=$THAT
PEPPER=$THIS
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
@ -18,147 +24,197 @@ Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
mkdir -p ~/.zen/tmp/${MOATS}/
start=`date +%s`
[[ ! $APPNAME || $SALT == "pepper" ]] \
&& echo "NO APPNAME - BAD APP - CONTINUE" \
&& (echo "$HTTPCORS ERROR - BAD CREDENTIALS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& exit 1
PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
SALT=$THAT
PEPPER=$THIS
############################################################################
# WRITING API # SALT # PEPPER # MAKING THE KEY EXIST #########
################### KEY GEN ###################################
echo ">>>>>>>>>>>>>> Application LaBureautique >><< APPNAME = $APPNAME <<<<<<<<<<<<<<<<<<<<"
[[ ! $APPNAME || $SALT == "pepper" ]] && echo "NO APPNAME - BAD APP - CONTINUE" && exit 1
############################################################################
# WRITING API # SALT # PEPPER # MAKING THE KEY EXIST #########
################### KEY GEN ###################################
echo ">>>>>>>>>>>>>> Application LaBureautique >><< APPNAME = $APPNAME <<<<<<<<<<<<<<<<<<<<"
[[ ! $SALT ]] && (echo "$HTTPCORS ERROR - SALT MISSING" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
[[ ! $PEPPER || ${PEPPER:0:2} == "G1" ]] && (echo "$HTTPCORS ERROR - BAD OR PEPPER MISSING" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
[[ ! $SALT ]] && (echo "$HTTPCORS ERROR - SALT MISSING" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
[[ ! $PEPPER ]] && (echo "$HTTPCORS ERROR - PEPPER MISSING" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
## SAVE "salt" "pepper" DEBUG REMOVE OR PASS ENCRYPT FOR SECURITY REASON
echo "PLAYER : \"$SALT\" \"$PEPPER\" : $APPNAME ($WHAT)"
echo "\"$SALT\" \"$PEPPER\"" > ~/.zen/tmp/${MOATS}/${MOATS}.secret.june
## SAVE "salt" "pepper" DEBUG REMOVE OR PASS ENCRYPT FOR SECURITY REASON
echo "PLAYER : \"$SALT\" \"$PEPPER\" : $APPNAME ($WHAT)"
echo "\"$SALT\" \"$PEPPER\"" > ~/.zen/tmp/coucou/${MOATS}.secret.june
# CALCULATING ${MOATS}.secret.key + G1PUB
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${MOATS}.secret.key "$SALT" "$PEPPER"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/${MOATS}.secret.key | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - KEYGEN COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
echo "G1PUB : ${G1PUB}"
# CALCULATING ${MOATS}.secret.key + G1PUB
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/coucou/${MOATS}.secret.key "$SALT" "$PEPPER"
G1PUB=$(cat ~/.zen/tmp/coucou/${MOATS}.secret.key | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - KEYGEN COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
echo "G1PUB : ${G1PUB}"
## CALCULATING ${MOATS}.${G1PUB}.ipns.key ADDRESS
ipfs key rm ${G1PUB} > /dev/null 2>&1
rm -f ~/.zen/tmp/${MOATS}/${MOATS}.${G1PUB}.ipns.key
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${MOATS}.${G1PUB}.ipns.key "$SALT" "$PEPPER"
ASTRONAUTENS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${MOATS}.${G1PUB}.ipns.key )
[[ ! ${ASTRONAUTENS} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - ASTRONAUTENS COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
## CALCULATING ${MOATS}.${G1PUB}.ipns.key ADDRESS
ipfs key rm ${G1PUB} > /dev/null 2>&1
rm -f ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key "$SALT" "$PEPPER"
ASTRONAUTENS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key )
[[ ! ${ASTRONAUTENS} ]] && (echo "$HTTPCORS ERROR - (╥☁╥ ) - ASTRONAUTENS COMPUTATION DISFUNCTON" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
echo "TW ADDRESS : $myIPFS/ipns/${ASTRONAUTENS}"
echo
################### KEY GEN ###################################
# Get PLAYER wallet amount
( ## SUB PROCESS
COINS=$(${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key balance)
echo "+++ WALLET BALANCE _ $COINS (G1) _"
[[ $COINS == "" || $COINS == "null" ]] && ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key send -d "${G1PUB}" -t "BRO" -m "0 G1 (ᵔ◡◡ᵔ) FLASH TON G1VISA"
end=`date +%s`
echo "G1WALLET (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
) &
########################################
########################################
## ARCHIVE TOCTOC ${WHAT}S KEEP LOG (TODO : ERASE)
########################################
mkdir -p ~/.zen/game/players/.toctoc/
ISTHERE=$(ls -t ~/.zen/game/players/.toctoc/*.${G1PUB}.ipns.key 2>/dev/null | tail -n 1 | cut -d '.' -f 1)
TTIME=$(echo $ISTHERE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
if [[ ! $ISTHERE ]]; then
echo "${APPNAME} 1ST TOCTOC : ${MOATS}"
cp ~/.zen/tmp/coucou/${MOATS}.* ~/.zen/game/players/.toctoc/
else ## KEEP 1ST CONTACT ONLY
OLDONE=$(ls -t ~/.zen/tmp/coucou/*.${G1PUB}.ipns.key | tail -n 1)
DTIME=$(echo $OLDONE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
[[ $DTIME != ${MOATS} ]] && rm ~/.zen/tmp/coucou/$DTIME.*
fi
echo "TW ADDRESS : $myIPFS/ipns/${ASTRONAUTENS}"
echo
########################################
## APPNAME SELECTION ########################
########################################
##############################################
# MESSAGING
# MESSAGING : GET MESSAGE FROM GCHANGE+
##############################################
if [[ $APPNAME == "messaging" ]]; then
if [[ $APPNAME == "messaging" ]]; then
( ## & SUB PROCESS
( ## & SUB PROCESS
echo "Extracting ${G1PUB} messages..."
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j > ~/.zen/tmp/coucou/messin.${G1PUB}.json
[[ ! -s ~/.zen/tmp/coucou/messin.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messin.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messin.${G1PUB}.json
echo "Extracting ${G1PUB} messages..."
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key read -n 10 -j > ~/.zen/tmp/${MOATS}/messin.${G1PUB}.json
[[ ! -s ~/.zen/tmp/${MOATS}/messin.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/${MOATS}/messin.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/${MOATS}/messin.${G1PUB}.json
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j -o > ~/.zen/tmp/coucou/messout.${G1PUB}.json
[[ ! -s ~/.zen/tmp/coucou/messout.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messout.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messout.${G1PUB}.json
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key read -n 10 -j -o > ~/.zen/tmp/${MOATS}/messout.${G1PUB}.json
[[ ! -s ~/.zen/tmp/${MOATS}/messout.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/${MOATS}/messout.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/${MOATS}/messout.${G1PUB}.json
echo "Creating messages In/Out JSON ~/.zen/tmp/coucou/${MOATS}.messaging.json"
echo '[' > ~/.zen/tmp/coucou/${MOATS}.messaging.json
cat ~/.zen/tmp/coucou/messin.${G1PUB}.json >> ~/.zen/tmp/coucou/${MOATS}.messaging.json
echo "," >> ~/.zen/tmp/coucou/${MOATS}.messaging.json
cat ~/.zen/tmp/coucou/messout.${G1PUB}.json >> ~/.zen/tmp/coucou/${MOATS}.messaging.json
echo ']' >> ~/.zen/tmp/coucou/${MOATS}.messaging.json
echo "Creating messages In/Out JSON ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json"
echo '[' > ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json
cat ~/.zen/tmp/${MOATS}/messin.${G1PUB}.json >> ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json
echo "," >> ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json
cat ~/.zen/tmp/${MOATS}/messout.${G1PUB}.json >> ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json
echo ']' >> ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json
## ADDING HTTP/1.1 PROTOCOL HEADER
echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
sed -i "s~text/html~application/json~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
## ADDING HTTP/1.1 PROTOCOL HEADER
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
cat ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json >> ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
## SEND REPONSE PROCESS IN BACKGROUD
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
#~ ( ## USING IPNS SESSION KEY
#~ REPONSE=$(cat ~/.zen/tmp/coucou/${MOATS}.messaging.json | ipfs add -q)
#~ ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE
#~ echo "SESSION ${myIPFS}/ipns/$SESSIONNS "
#~ ) &
## SEND REPONSE PROCESS IN BACKGROUD
( cat ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && rm ~/.zen/tmp/${MOATS}/${MOATS}* ) &
#~ ( ## USING IPNS SESSION KEY
#~ REPONSE=$(cat ~/.zen/tmp/${MOATS}/${MOATS}.messaging.json | ipfs add -q)
#~ ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE
#~ echo "SESSION ${myIPFS}/ipns/$SESSIONNS "
#~ ) &
end=`date +%s`
dur=`expr $end - $start`
echo ${MOATS}:${G1PUB}:${PLAYER}:${APPNAME}:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
end=`date +%s`
dur=`expr $end - $start`
echo ${MOATS}:${G1PUB}:${PLAYER}:${APPNAME}:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
) & ## & SUB PROCESS
) & ## & SUB PROCESS
end=`date +%s`
echo " Messaging launch (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
exit 0
end=`date +%s`
echo " Messaging launch (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
exit 0
fi
######################## MESSAGING END
########################################
# G1PUB : REDIRECT TO GCHANGE OR TW + EMAIL => CREATE PLAYER !
########################################
if [[ "$APPNAME" == "g1pub" ]]; then
if [[ "$OBJ" != "email" ]]; then
## WITH NO EMAIL -> Open Gchange Profile & Update TW cache
[[ ${WHAT} == "astro" ]] && REPLACE="https://$myTUBE/ipns/${ASTRONAUTENS}" \
|| REPLACE="$myGCHANGE/#/app/user/${G1PUB}"
echo ${REPLACE}
## REDIRECT TO TW OR GCHANGE PROFILE
sed "s~_TWLINK_~${REPLACE}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
## USED BY https://git.p2p.legal/La_Bureautique/zeg1jeux/src/branch/main/lib/Fred.class.php#L81
echo "url='"${REPLACE}"'" >> ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
### REPONSE=$(echo $myGCHANGE/#/app/user/${G1PUB}/ | ipfs add -q)
### ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE
### echo "SESSION ${myIPFS}/ipns/$SESSIONNS "
(
cat ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
${MY_PATH}/../tools/TW.cache.sh ${ASTRONAUTENS} ${MOATS}
rm ~/.zen/tmp/${MOATS}/${MOATS}*
) &
end=`date +%s`
echo $APPNAME" (0‿‿0) ${WHAT} Execution time was "`expr $end - $start` seconds.
exit 0
else
# CREATE PLAYER : ?salt=PHRASE%20UNE&pepper=PHRASE%20DEUX&g1pub=on&email=EMAIL&pseudo=PROFILENAME
# WHAT can contain urlencoded FullURL
EMAIL="${VAL,,}" # lowercase
[[ ! ${EMAIL} ]] && (echo "$HTTPCORS ERROR - MISSING ${EMAIL} FOR ${WHAT} CONTACT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
## CHECK WHAT IS EMAIL
if [[ "${EMAIL}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
echo "VALID EMAIL OK"
else
echo "BAD EMAIL"
(echo "$HTTPCORS KO ${EMAIL} : bad '" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 0
fi
######################## MESSAGING END
########################################
# G1PUB WITH NO EMAIL -> Open Gchange Profile & Update TW cache
########################################
if [[ "$APPNAME" == "g1pub" && "$OBJ" != "email" ]]; then
## CREATE PSEUDO FROM
if [[ ! $PSEUDO ]]; then
PSEUDO=$(echo ${EMAIL} | cut -d '@' -f 1)
PSEUDO=${PSEUDO,,}; PSEUDO=${PSEUDO%%[0-9]*}${RANDOM:0:4}
fi
[[ ${WHAT} == "astro" ]] && REPLACE="https://$myTUBE/ipns/${ASTRONAUTENS}" \
|| REPLACE="$myGCHANGE/#/app/user/${G1PUB}"
echo ${REPLACE}
if [[ ! -d ~/.zen/game/players/${EMAIL} ]]; then
## REDIRECT TO TW OR GCHANGE PROFILE
sed "s~_TWLINK_~${REPLACE}/~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/coucou/${MOATS}.index.redirect
## USED BY https://git.p2p.legal/La_Bureautique/zeg1jeux/src/branch/main/lib/Fred.class.php#L81
echo "url='"${REPLACE}"'" >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
echo "# ASTRONAUT NEW VISA Create VISA.new.sh in background (~/.zen/tmp/email.${EMAIL}.${MOATS}.txt)"
### REPONSE=$(echo $myGCHANGE/#/app/user/${G1PUB}/ | ipfs add -q)
### ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE
### echo "SESSION ${myIPFS}/ipns/$SESSIONNS "
(
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
${MY_PATH}/../tools/TW.cache.sh ${ASTRONAUTENS} ${MOATS}
) &
startvisa=`date +%s`
[[ "$SALT" == "0" && "$PEPPER" == "0" ]] && SALT="" && PEPPER="" # "0" "0" means random salt pepper
#~ echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${WHAT}\"" > ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
${MY_PATH}/../RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
#~ ${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt "LOG ZenCard creation" ## Send VISA.new log to EMAIL
echo "ASTROID PIN=${PASS}, operate on all La♥Box Web3 ẐenStation (WWW : https://astroport.copylaradio.com)"
## :: TRICK :: EXECUTE LAST VISA.new.sh output LINE : export above VARs
$(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt | tail -n 1)
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
BILLETNAME=$(echo "$SALT" | sed 's/ /_/g')
#~ mpack -a -s "La♥Box : ASTROID :+: TW :+: " -d ~/.zen/tmp/${MOATS}/intro.txt \
#~ ~/.zen/G1BILLET/tmp/g1billet/${PASS}/${BILLETNAME}.BILLET.jpg ${PLAYER}
end=`date +%s`
echo $APPNAME" (0‿‿0) ${WHAT} Execution time was "`expr $end - $start` seconds.
dur=`expr $end - $startvisa`
echo ${MOATS}:${G1PUB}:${PLAYER}:VISA:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
) &
echo "$HTTPCORS
<meta http-equiv='refresh' content='30; url=\""${myIPFS}"/ipns/"${ASTRONAUTENS}"\"'/>
<h1>ASTRONAUTE $PSEUDO</h1>
<br>KEY : $SALT:$PEPPER:${EMAIL}
<br>TW : ${myIPFS}/ipns/${ASTRONAUTENS}
<br>STATION : ${myIPFS}/ipns/$IPFSNODEID<br><br>please wait....<br>
export ASTROTW=/ipns/${ASTRONAUTENS} ASTROG1=${G1PUB} ASTROMAIL=${EMAIL} ASTROIPFS=${myIPFS}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
exit 0
fi
else
# ASTRONAUT EXISTING ${EMAIL}
CHECK=$(cat ~/.zen/game/players/${EMAIL}/secret.june | grep -w "$SALT")
[[ $CHECK ]] && CHECK=$(cat ~/.zen/game/players/${EMAIL}/secret.june | grep -w "$PEPPER")
[[ ! $CHECK ]] && (echo "$HTTPCORS - WARNING - PLAYER ${EMAIL} ALREADY HERE" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
fi
###################################################################################################
end=`date +%s`
echo " (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
fi
fi
########################################
########################################
@ -166,210 +222,294 @@ PEPPER=$THIS
#TESTCRAFT=ON nodeid dataid
########################################
########################################
if [[ "$APPNAME" == "testcraft" ]]; then
if [[ "$APPNAME" == "testcraft" ]]; then
( # testcraft & SUB PROCESS
( # testcraft & SUB PROCESS
start=`date +%s`
## RECORD DATA MADE IN BROWSER (JSON)
OBJID=$OBJ
DATAID=$VAL
start=`date +%s`
## RECORD DATA MADE IN BROWSER (JSON)
OBJID=$OBJ
DATAID=$VAL
## export PLAYER
${MY_PATH}/../tools/TW.cache.sh ${ASTRONAUTENS} ${MOATS}
## export PLAYER
${MY_PATH}/../tools/TW.cache.sh ${ASTRONAUTENS} ${MOATS}
## IS IT INDEX JSON
echo "${PLAYER} $APPNAME IS ${WHAT}"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}
## IS IT INDEX JSON
echo "${PLAYER} $APPNAME IS ${WHAT}"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}
[[ $WHAT == "on" ]] && WHAT="json" # data mimetype (default "on" = json)
[[ $WHAT == "on" ]] && WHAT="json" # data mimetype (default "on" = json)
## TODO : modify timeout if isLAN or NOT
[[ $isLAN ]] && WAIT=3 || WAIT=12
echo "1ST TRY : ipfs --timeout ${WAIT}s cat /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}"
ipfs --timeout ${WAIT}s cat /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}
## TODO : modify timeout if isLAN or NOT
[[ $isLAN ]] && WAIT=3 || WAIT=12
echo "1ST TRY : ipfs --timeout ${WAIT}s cat --progress=false /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}"
ipfs --timeout ${WAIT}s cat --progress=false /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}
echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
if [[ ! -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]]; then
if [[ ! -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]]; then
echo "IPFS TIMEOUT >>> (°▃▃°) $DATAID STILL MISSING GATEWAY BANGING FOR IT (°▃▃°)"
array=(${myIPFSGW}/ipfs/:hash https://ipns.co/:hash https://dweb.link/ipfs/:hash https://ipfs.io/ipfs/:hash https://ipfs.fleek.co/ipfs/:hash https://ipfs.best-practice.se/ipfs/:hash https://gateway.pinata.cloud/ipfs/:hash https://gateway.ipfs.io/ipfs/:hash https://cf-ipfs.com/ipfs/:hash https://cloudflare-ipfs.com/ipfs/:hash)
# size=${#array[@]}; index=$(($RANDOM % $size)); echo ${array[$index]} ## TODO CHOOSE RANDOM
echo "IPFS TIMEOUT >>> (°▃▃°) $DATAID STILL MISSING GATEWAY BANGING FOR IT (°▃▃°)"
array=(${myIPFSGW}/ipfs/:hash https://ipns.co/:hash https://dweb.link/ipfs/:hash https://ipfs.io/ipfs/:hash https://ipfs.fleek.co/ipfs/:hash https://ipfs.best-practice.se/ipfs/:hash https://gateway.pinata.cloud/ipfs/:hash https://gateway.ipfs.io/ipfs/:hash https://cf-ipfs.com/ipfs/:hash https://cloudflare-ipfs.com/ipfs/:hash)
# size=${#array[@]}; index=$(($RANDOM % $size)); echo ${array[$index]} ## TODO CHOOSE RANDOM
# official ipfs best gateway from https://luke.lol/ipfs.php
for nicegw in ${array[@]}; do
# official ipfs best gateway from https://luke.lol/ipfs.php
for nicegw in ${array[@]}; do
[[ $(cat ~/.zen/tmp/.ipfsgw.bad.twt | grep -w $nicegw) ]] && echo "<<< BAD GATEWAY >>> $nicegw" && exit 0
gum=$(echo "$nicegw" | sed "s~:hash~$DATAID~g")
echo "LOADING $gum"
curl -m 5 -so ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} "$gum"
[[ $? != 0 ]] && echo "(✜‿‿✜) BYPASSING"
[[ $(cat ~/.zen/tmp/.ipfsgw.bad.twt | grep -w $nicegw) ]] && echo "<<< BAD GATEWAY >>> $nicegw" && exit 0
gum=$(echo "$nicegw" | sed "s~:hash~$DATAID~g")
echo "LOADING $gum"
curl -m 5 -so ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} "$gum"
[[ $? != 0 ]] && echo "(✜‿‿✜) BYPASSING"
if [[ -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]]; then
if [[ -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]]; then
MIME=$(mimetype -b ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT})
GOAL=$(ipfs add -q ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT})
MIME=$(mimetype -b ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT})
GOAL=$(ipfs add -q ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT})
if [[ ${GOAL} != ${DATAID} ]]; then
echo " (╥☁╥ ) - BAD ${WHAT} FORMAT ERROR ${MIME} - (╥☁╥ )"
ipfs pin rm /ipfs/${GOAL}
rm ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}
# NOT A JSON AVOID BANISHMENT
echo $nicegw >> ~/.zen/tmp/.ipfsgw.bad.twt
exit 0
if [[ ${GOAL} != ${DATAID} ]]; then
echo " (╥☁╥ ) - BAD ${WHAT} FORMAT ERROR ${MIME} - (╥☁╥ )"
ipfs pin rm /ipfs/${GOAL}
rm ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT}
# NOT A JSON AVOID BANISHMENT
echo $nicegw >> ~/.zen/tmp/.ipfsgw.bad.twt
exit 0
else
## GOT IT !! IPFS ADD
ipfs pin add /ipfs/${GOAL}
## + TW ADD (new_file_in_astroport.sh)
else
## GOT IT !! IPFS ADD
ipfs pin add /ipfs/${GOAL}
## + TW ADD (new_file_in_astroport.sh)
echo "(♥‿‿♥) FILE UPLOAD OK"; echo
break
echo "(♥‿‿♥) FILE UPLOAD OK"; echo
break
fi
fi
else
else
echo " (⇀‿‿↼) - NO FILE - (⇀‿‿↼)"
exit 0
echo " (⇀‿‿↼) - NO FILE - (⇀‿‿↼)"
exit 0
fi
fi
done
done
fi ## NO DIRECT IPFS - GATEWAY TRY
fi ## NO DIRECT IPFS - GATEWAY TRY
## REALLY NO FILE FOUND !!!
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]] && \
echo "$HTTPCORS ERROR (╥☁╥ ) - $DATAID TIMEOUT - (╥☁╥ )" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
## REALLY NO FILE FOUND !!!
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ]] && \
echo "$HTTPCORS ERROR (╥☁╥ ) - $DATAID TIMEOUT - (╥☁╥ )" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
## SPECIAL index.[json/html/...] MODE.
[[ ${WHAT} == "index" ]] && cp ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/index.json
## SPECIAL index.[json/html/...] MODE.
[[ ${WHAT} == "index" ]] && cp ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/index.json
## TODO MAKE MULTIFORMAT DATA & INDEX
# RWHAT=$(echo "$WHAT" | cut -d '.' -f 1)
# TWHAT=$(echo "$WHAT" | cut -d '.' -f 2)
# cp ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${RWHAT}.${TWHAT}
## REPONSE ON PORT
echo "$HTTPCORS" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
sed -i "s~text/html~application/json~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
cat ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
## REPONSE ON PORT
echo "$HTTPCORS" > ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
cat ~/.zen/tmp/${IPFSNODEID}/${APPNAME}/${PLAYER}/${MOATS}.data.${WHAT} >> ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
## REPONSE ON IPFSNODEID
(
start=`date +%s`
echo "¯\_༼<O͡〰o>༽_/¯ $IPFSNODEID $PLAYER SIGNALING"
ROUTING=$(ipfs add -rwq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish --allow-offline /ipfs/$ROUTING
echo "DONE"
end=`date +%s`
dur=`expr $end - $start`
echo ${MOATS}:${G1PUB}:${PLAYER}:SELF:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
) &
(cat ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && rm ~/.zen/tmp/${MOATS}/${MOATS}.* ) &
## REPONSE ON IPFSNODEID
(
start=`date +%s`
echo "¯\_༼<O͡〰o>༽_/¯ $IPFSNODEID $PLAYER SIGNALING"
ROUTING=$(ipfs add -rwq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish /ipfs/$ROUTING
echo "DONE"
end=`date +%s`
dur=`expr $end - $start`
echo ${MOATS}:${G1PUB}:${PLAYER}:${APPNAME}:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
echo ${MOATS}:${G1PUB}:${PLAYER}:SELF:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
) &
) & # testcraft & SUB PROCESS
end=`date +%s`
dur=`expr $end - $start`
echo ${MOATS}:${G1PUB}:${PLAYER}:${APPNAME}:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
end=`date +%s`
echo "(☓‿‿☓) Execution time was "`expr $end - $start` seconds.
exit 0
fi
) & # testcraft & SUB PROCESS
end=`date +%s`
echo "(☓‿‿☓) Execution time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
# PAY : /?salt=SALT&pepper=PEPPER&pay=1&dest=G1PUB APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
##############################################
if [[ $APPNAME == "pay" ]]; then
(
echo "$HTTPCORS" > ~/.zen/tmp/$PLAYER.pay.$WHAT.http
if [[ $WHAT =~ ^[0-9]+$ ]]; then
echo "${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${MOATS}.secret.key pay -a ${WHAT} -p ${VAL} -c 'Bro'"
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/tmp/${MOATS}/${MOATS}.secret.key" "${WHAT}" "${VAL}" "Bro"
echo "PAY4SURE " >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "history" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key history -j >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "get" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key get >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "balance" ]]; then
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key balance >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http
(cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && rm ~/.zen/tmp/$PLAYER.pay.$WHAT.http ) &
end=`date +%s`
echo "(G_G ) G1BANK Operation time was "`expr $end - $start` seconds.
exit 0
) &
fi
##############################################
# FRIEND ★ &friend=G1PUB&stars=1 // APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9
##############################################
if [[ $APPNAME == "friend" ]]; then
## CHECK IF ASKING FRIEND TW EXISTS
#~ ipfs --timeout 60s ls /ipns/${ASTRONAUTENS}
#~ [ $? != 0 ] && echo "BAD VISITOR" && exit 0
g1friend=${WHAT}
stars=${VAL:-1} // Default 1
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${MOATS}.secret.key stars -p $g1friend -n $stars > ~/.zen/tmp/${MOATS}/${MOATS}.log
(
echo "$HTTPCORS $(cat ~/.zen/tmp/${MOATS}/${MOATS}.log)"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1
) &
rm ~/.zen/tmp/${MOATS}/${MOATS}.*
end=`date +%s`
echo $APPNAME "(☉_☉ ) ${MESTAR} Execution time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
# GETIPNS
##############################################
if [[ $APPNAME == "getipns" ]]; then
echo "$HTTPCORS /ipns/${ASTRONAUTENS}"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo $APPNAME "(☉_☉ ) /ipns/${ASTRONAUTENS} Execution time was "`expr $end - $start` seconds.
exit 0
fi
if [[ $APPNAME == "getipns" ]]; then
( echo "$HTTPCORS
url='"${ASTRONAUTENS}"'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo "SLURP getipns : ${ASTRONAUTENS}" ) &
end=`date +%s`
echo $APPNAME "(☉_☉ ) /ipns/${ASTRONAUTENS} Execution time was "`expr $end - $start` seconds.
rm ~/.zen/tmp/${MOATS}/${MOATS}.*
exit 0
fi
##############################################
# GETG1PUB
##############################################
if [[ $APPNAME == "getg1pub" ]]; then
(
echo "$HTTPCORS
url='"${G1PUB}"'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo "SLURP getg1pub : ${G1PUB}"
echo "BLURP ${PORT}"
) &
end=`date +%s`
echo $APPNAME "(☉_☉ ) /ipns/${ASTRONAUTENS} Execution time was "`expr $end - $start` seconds.
rm ~/.zen/tmp/${MOATS}/${MOATS}*
exit 0
fi
##############################################
# LOGIN
##############################################
if [[ $APPNAME == "login" ]]; then
## INSTALL PLAYER IPNS KEY ON STATION
[[ "${SALT}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${SALT} \
|| PLAYER=${WHAT}
ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${MOATS}.${G1PUB}.ipns.key
ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
#~ WSTATION=$(cat ~/.zen/tmp/WSTATION 2>/dev/null)
#~ [[ $WSTATION != "" ]] \
#~ && REPLACE=${myIPFS}${WSTATION} \
#~ || REPLACE=${myIPFS}/ipns/${ASTRONAUTENS}
REPLACE=${myIPFS}/ipns/${ASTRONAUTENS}
USALT=$(echo "$SALT" | jq -Rr @uri)
UPEPPER=$(echo "$PEPPER" | jq -Rr @uri)
echo "/?salt=${USALT}&pepper=${UPEPPER} IS LOGIN - OPEN TW -"
sed "s~_TWLINK_~${REPLACE}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
## SET COOKIE
#~ sed -i "s~_USALT_~${USALT}~g" ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
#~ sed -i "s~_UPEPPER_~${UPEPPER}~g" ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
echo "url='"${REPLACE}"'" >> ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
(
cat ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP ${PORT}"
) &
rm ~/.zen/tmp/${MOATS}/${MOATS}*
end=`date +%s`
echo $APPNAME "(☉_☉ ) Execution time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
# LOGOUT
##############################################
if [[ $APPNAME == "logout" ]]; then
## REMOVE PLAYER IPNS KEY FROM STATION
[[ "${SALT}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] \
&& PLAYER=${SALT} \
|| PLAYER=${WHAT}
echo "<h1>$PLAYER LOGOUT OK</h1>" > ~/.zen/tmp/${MOATS}/${MOATS}.log
ipfs key rm ${G1PUB} >> ~/.zen/tmp/${MOATS}/${MOATS}.log
ipfs key rm ${PLAYER} >> ~/.zen/tmp/${MOATS}/${MOATS}.log
echo "$HTTPCORS $(cat ~/.zen/tmp/${MOATS}/${MOATS}.log)"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo $APPNAME "(☉_☉ ) Execution time was "`expr $end - $start` seconds.
rm ~/.zen/tmp/${MOATS}/${MOATS}.*
exit 0
fi
###################################################################################################
###################################################################################################
# API ONE : ?salt=PHRASE%20UNE&pepper=PHRASE%20DEUX&g1pub=on&email=EMAIL&pseudo=PROFILENAME
if [[ ${OBJ} == "email" && "${VAL}" != "" ]]; then
[[ $APPNAME != "g1pub" ]] && (echo "$HTTPCORS ERROR - BAD COMMAND $APPNAME" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
# WHAT can contain urlencoded FullURL
EMAIL="${VAL}"
[[ ! ${EMAIL} ]] && (echo "$HTTPCORS ERROR - MISSING ${EMAIL} FOR ${WHAT} CONTACT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
## CHECK WHAT IS EMAIL
if [[ "${EMAIL}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
echo "VALID EMAIL OK"
else
echo "BAD EMAIL"
(echo "$HTTPCORS KO ${EMAIL} : bad '" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 0
fi
## CREATE PSEUDO FROM
if [[ ! $PSEUDO ]]; then
PSEUDO=$(echo ${EMAIL} | cut -d '@' -f 1)
PSEUDO=${PSEUDO,,}; PSEUDO=${PSEUDO%%[0-9]*}${RANDOM:0:4}
fi
if [[ ! -d ~/.zen/game/players/${EMAIL} ]]; then
echo "# ASTRONAUT NEW VISA Create VISA.new.sh in background (~/.zen/tmp/email.${EMAIL}.${MOATS}.txt)"
(
startvisa=`date +%s`
[[ "$SALT" == "0" && "$PEPPER" == "0" ]] && SALT="" && PEPPER="" # "0" "0" means random salt pepper
echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${WHAT}\"" > ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
${MY_PATH}/../tools/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt ## Send VISA.new log to EMAIL
end=`date +%s`
dur=`expr $end - $startvisa`
echo ${MOATS}:${G1PUB}:${PLAYER}:VISA:$dur >> ~/.zen/tmp/${IPFSNODEID}/_timings
cat ~/.zen/tmp/${IPFSNODEID}/_timings | tail -n 1
) &
echo "$HTTPCORS
<meta http-equiv='refresh' content='30; url=\""${myIPFS}"/ipns/"${ASTRONAUTENS}"\"'/>
<h1>ASTRONAUTE $PSEUDO</h1>
<br>KEY : $SALT:$PEPPER:${EMAIL}
<br>TW : ${myIPFS}/ipns/${ASTRONAUTENS}
<br>STATION : ${myIPFS}/ipns/$IPFSNODEID<br><br>please wait....<br>
export ASTROTW=/ipns/${ASTRONAUTENS} ASTROG1=${G1PUB} ASTROMAIL=${EMAIL} ASTROIPFS=${myIPFS}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
exit 0
else
# ASTRONAUT EXISTING ${EMAIL}
CHECK=$(cat ~/.zen/game/players/${EMAIL}/secret.june | grep -w "$SALT")
[[ $CHECK ]] && CHECK=$(cat ~/.zen/game/players/${EMAIL}/secret.june | grep -w "$PEPPER")
[[ ! $CHECK ]] && (echo "$HTTPCORS - WARNING - PLAYER ${EMAIL} ALREADY HERE" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
fi
###################################################################################################
end=`date +%s`
echo " (☓‿‿☓) Execution time was "`expr $end - $start` seconds.
fi
###################################################################################################
###################################################################################################
## RESPONDING
[[ ! -s ~/.zen/tmp/coucou/${MOATS}.index.redirect ]] && echo "$HTTPCORS PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > ~/.zen/tmp/coucou/${MOATS}.official.swallow &
echo "HTTP 1.1 PROTOCOL DOCUMENT READY"
echo "${MOATS} -----> PAGE AVAILABLE -----> http://${myHOST}:${PORT}"
end=`date +%s`
echo $type" (J‿‿J) Execution time was "`expr $end - $start` seconds.
## END RESPONDING
[[ ! -s ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect ]] \
&& echo "$HTTPCORS PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9 url=/user/$G1PUB" \
> ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect
cat ~/.zen/tmp/${MOATS}/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > ~/.zen/tmp/${MOATS}/${MOATS}.official.swallow &
echo "HTTP 1.1 PROTOCOL DOCUMENT READY"
echo "${MOATS} -----> PAGE AVAILABLE -----> http://${myHOST}:${PORT}"
end=`date +%s`
echo $type" (J‿‿J) Execution time was "`expr $end - $start` seconds.
rm ~/.zen/tmp/${MOATS}/${MOATS}.*
exit 0

205
API/UPLANET.sh Executable file
View File

@ -0,0 +1,205 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: UPLANET
## Dedicated to OSM2IPFS & UPlanet Client App
# ?uplanet=EMAIL&zlat=LAT&zlon=LON&g1pub=PASS
## https://git.p2p.legal/qo-op/OSM2IPFS
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
### transfer variables according to script
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: ${myASTROPORT}
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
## CHECK FOR NOT PUBLISHING ALREADY (AVOID IPNS CRUSH)
alreadypublishing=$(ps axf --sort=+utime | grep -w 'ipfs name publish --key=' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
if [[ ${alreadypublishing} ]]; then
echo "$HTTPCORS ERROR - (╥☁╥ ) - IPFS ALREADY PUBLISHING RETRY LATER" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
exit 1
fi
## START MANAGING UPLANET LAT/LON & PLAYER
mkdir -p ~/.zen/tmp/${MOATS}/
## GET & VERIFY PARAM
PLAYER=${THAT}
[[ ${PLAYER} == "zlat" ]] && PLAYER="@"
[[ ${AND} != "zlat" ]] \
&& (echo "$HTTPCORS ERROR - BAD PARAMS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
[[ ${APPNAME} != "zlon" ]] \
&& (echo "$HTTPCORS ERROR - BAD PARAMS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 0
ZLAT=${THIS}
ZLON=${WHAT}
LAT=$(makecoord ${ZLAT})
LON=$(makecoord ${ZLON})
#~ ## RECEIVED VAL ## CAN BE USED TO SELECT TW TEMPLATE
VAL="$(echo ${VAL} | detox --inline)" ## DETOX VAL
############################################
#### TODO USE THIS PARAMETER TO SELECT TW TEMPLATE
### CHECK PLAYER EMAIL
EMAIL="${PLAYER,,}" # lowercase
[[ ! ${EMAIL} ]] \
&& (echo "$HTTPCORS ERROR - MISSING ${EMAIL} FOR UPLANET LANDING" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "(☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. \
&& exit 0
## CHECK WHAT IS EMAIL
if [[ "${EMAIL}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
echo "VALID ${EMAIL} EMAIL OK"
## CHECK if PLAYER exists in SWARM
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${EMAIL}) ## export ASTROTW and more
echo "export ASTROPORT=${ASTROPORT} ASTROTW=${ASTROTW} ASTROG1=${ASTROG1} ASTROMAIL=${EMAIL} ASTROFEED=${FEEDNS}"
## YES = OPEN TW
[[ ${ASTROTW} ]] \
&& (echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}${ASTROTW}'\" />" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& exit 0
else
echo "BAD EMAIL $EMAIL $LAT $LON"
### GET ENV FOR "$LAT" "$LON"
$(${MY_PATH}/../tools/getUMAP_ENV.sh "${LAT}" "${LON}" | tail -n 1)
REDIR="${myIPFS}${UMAPIPNS}"
echo "Umap : $REDIR"
if [[ ${UMAPIPNS} != "/ipns/" ]]; then
echo "$HTTPCORS <html>BAD EMAIL $EMAIL $LAT $LON <a href=${REDIR}> - OPEN UMAP LINK - </a></html>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
else
echo "$HTTPCORS <html>BAD EMAIL $EMAIL ($LAT $LON)</html>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
fi
exit 0
fi
# UPLANET #############################################
## OCCUPY COMMON CRYPTO KEY CYBERSPACE
## LAT="$LAT" LON="$LON"
######################################################
echo "UMAP = $LAT:$LON"
echo "# GET UMAP ENV"
${MY_PATH}/../tools/getUMAP_ENV.sh "${LAT}" "${LON}"
## ALL TEST PASSED -> CREATE ZENCARD + ASTROID
#~ choose salt pepper with variable words count
PPASS=$(${MY_PATH}/../tools/diceware.sh $(( $(${MY_PATH}/../tools/getcoins_from_gratitude_box.sh) + 3 )) | xargs)
NPASS=$(${MY_PATH}/../tools/diceware.sh $(( $(${MY_PATH}/../tools/getcoins_from_gratitude_box.sh) + 3 )) | xargs)
## CREATE ASTRONAUTE TW ON CURRENT ASTROPORT
(
echo VISA.new.sh "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "${VAL}" "${LAT}" "${LON}"
##### (☉_☉ ) #######
${MY_PATH}/../RUNTIME/VISA.new.sh "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "${VAL}" "${LAT}" "${LON}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
end=`date +%s`
echo "(TW REGISTRATION) Operation time was "`expr $end - $start` seconds.
) &
########################################
## Calculating TW IPNS ADDRESS
TWADD=$(${MY_PATH}/../tools/keygen -t ipfs "${PPASS}" "${NPASS}")
IMGTW=$(${MY_PATH}/../API/AMZQR.sh '0' "${myIPFS}/ipns/${TWADD}" 'et' 'TV' | tail -n 1)
## HTTP nc ON PORT RESPONSE
echo "$HTTPCORS
<html>
<head>
<title>[Astroport] $LAT $LON + ${EMAIL} </title>
<meta http-equiv=\"refresh\" content=\"100; url='${myIPFS}/ipns/${TWADD}#AstroID'\" />
<style>
#countdown { display: flex; justify-content: center; align-items: center; color: #0e2c4c; font-size: 20px; width: 60px; height: 60px; background-color: #e7d9fc; border-radius: 50%;}
</style>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f0f0f0;
padding: 20px;
}
h1 {
color: #0077cc;
}
h2 {
color: #333;
}
img {
cursor: pointer;
}
</style>
</head><body>
<h1>UPlanet Registration</h1>
${EMAIL} (⌐■_■)<br>
<br>Check your mailbox ! Relevez votre boite mail !
<hr>
<h2><a target=\"_new\" href=\"${myIPFS}/ipns/${TWADD}\">TW5</a></h2>
<h1><center><div id='countdown'></div></center></h1>
<script>
var timeLeft = 90;
var elem = document.getElementById('countdown');
var timerId = setInterval(countdown, 1000);
function countdown() {
if (timeLeft == -1) {
clearTimeout(timerId);
doSomething();
} else {
elem.innerHTML = timeLeft + ' s';
timeLeft--;
}
}
</script>
---
<br>( ⚆_⚆) TW5 MOBILE APP<br>
<img src='${myIPFSGW}${IMGTW}'\>
<br>CONSOLE<br>
$(cat ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt 2>/dev/null)
<br>(☉_☉ ) use above credentials... utilisez les identiants ci-dessus<br>
<br><br>${EMAIL} REGISTERED on UPlanet UMAP($LAT/$LON) : ${MOATS} : $(date)
</body>
</html>" > ~/.zen/tmp/${MOATS}/http.rep
(
cat ~/.zen/tmp/${MOATS}/http.rep | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
end=`date +%s`
echo "(UPLANET) Operation time was "`expr $end - $start` seconds.
) &
exit 0

195
API/ZONE.sh Executable file
View File

@ -0,0 +1,195 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
################################################################################
## API: ZONE
## Used by OSM2IPFS map_render.html & other UPlanet Client App
# ?zone=DEG&ulat=LAT&ulon=LON
## Search for TW numbers in received zone # >> return json
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
start=`date +%s`
echo "PORT=$1
THAT=$2
AND=$3
THIS=$4
APPNAME=$5
WHAT=$6
OBJ=$7
VAL=$8
MOATS=$9
COOKIE=$10"
PORT="$1" THAT="$2" AND="$3" THIS="$4" APPNAME="$5" WHAT="$6" OBJ="$7" VAL="$8" MOATS="$9" COOKIE="$10"
### transfer variables according to script
HTTPCORS="HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport.ONE
Content-Type: text/html; charset=UTF-8
"
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
## RUNNING UPLANET LAT/LON TW DETECTION
mkdir -p ~/.zen/tmp/${MOATS}/
# PREPARE HTTP RESPONSE (application/json)
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.http
sed -i "s~text/html~application/json~g" ~/.zen/tmp/${MOATS}.http
# ------------------------------------------------------------------- #
# GET/?zone=0.001&ulat=0.02&ulon=0.01
# ------------------------------------------------------------------- #
DEG="${THAT}"
[[ -z ${DEG} ]] && DEG=1
# DEG=$(echo "${DEG} * 10" | bc -l )
LAT="${THIS}"
[[ -z $LAT ]] && LAT=0.00
LON="${WHAT}"
[[ -z $LON ]] && LON=0.00
LAT=$(makecoord ${LAT})
LON=$(makecoord ${LON})
JSON="ZONE_${LAT}_${LON}_${DEG}.json"
$(${MY_PATH}/../tools/getUMAP_ENV.sh "${LAT}" "${LON}" | tail -n 1)
echo "UMAPG1PUB=$UMAPG1PUB UMAPIPNS=$UMAPIPNS
SECTORG1PUB=$SECTORG1PUB SECTORIPNS=$SECTORIPNS
REGIONG1PUB=$REGIONG1PUB REGIONIPNS=$REGIONIPNS
LAT=$LAT LON=$LON SLAT=$SLAT SLON=$SLON RLAT=$RLAT RLON=$RLON"
## SECTOR LEVEL
if [[ ${DEG} == "0.01" ]]; then
SLAT="${LAT::-1}"
SLON="${LON::-1}"
SECTOR="_${SLAT}_${SLON}"
echo "SECTOR = ${SECTOR}"
ZONEINDEX=$SECTORIPNS
[[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/_*_*/SECTORNS | tail -n 1)
[[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/_*_*/SECTORNS | tail -n 1)
ZONEG1PUB=$SECTORG1PUB
[[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/_*_*/SECTORG1PUB | tail -n 1)
[[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}*_${SLON}*/_*_*/SECTORG1PUB | tail -n 1)
LAT=${SLAT}
LON=${SLON}
JSON="ZONE${SECTOR}_${DEG}.json"
fi
## REGION & ABOVE LEVEL
if [[ ${DEG} == "0.1" || ${DEG} == "1" ]]; then
RLAT="$(echo ${LAT} | cut -d '.' -f 1)"
RLON="$(echo ${LON} | cut -d '.' -f 1)"
REGION="_${RLAT}_${RLON}"
echo "REGION = ${REGION}"
ZONEINDEX=$REGIONIPNS
[[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_${RLAT}*_${RLON}*/_*_*/_*_*/REGIONNS | tail -n 1)
[[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}*_${RLON}*/_*_*/_*_*/REGIONNS | tail -n 1)
ZONEG1PUB=$REGIONG1PUB
[[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_${RLAT}*_${RLON}*/_*_*/_*_*/REGIONG1PUB | tail -n 1)
[[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${RLAT}*_${RLON}*/_*_*/_*_*/REGIONG1PUB | tail -n 1)
LAT=${RLAT}
LON=${RLON}
JSON="ZONE${REGION}_${DEG}.json"
fi
echo " JSON = ${JSON}"
if [[ ! -s ~/.zen/tmp/${JSON} ]]; then
## UMAP LEVEL
if [[ ${DEG} == "0.001" ]]; then
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
echo " ## UMAP _${LAT}_${LON} = ${totnum} PLAYERs"
UMAPNS=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TODATENS | tail -n 1)
[[ ! $UMAPNS ]] && UMAPNS=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TODATENS | tail -n 1)
G1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/G1PUB | tail -n 1)
[[ ! $G1PUB ]] && G1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/G1PUB | tail -n 1)
echo '{ "gridNumbers": [ {"lat": '${LAT}', "lon": '${LON}', "number": "(_'${LAT}'_'${LON}') = '${totnum}'", "ipns": "'${myIPFS}/ipns/${UMAPNS}/_index.html'" } ] }' \
> ~/.zen/tmp/${MOATS}/http.grid
cp ~/.zen/tmp/${MOATS}/http.grid ~/.zen/tmp/${JSON}
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
rm -Rf ~/.zen/tmp/${MOATS}/
end=`date +%s`
echo "(UMAP)_${LAT}_${LON} $UMAPNS Operation time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
## SEARCH FOR UPLANET TW NUMBERS IN THAT ZONE
echo '{ "gridNumbers": [' >> ~/.zen/tmp/${MOATS}/http.grid
for i in $(seq 0 9);
do
ZLAT=$(echo "$LAT + ${DEG} * $i" | bc -l)
[[ -z ${ZLAT} ]] && ZLAT=0
for j in $(seq 0 9); do
ZLON=$(echo "$LON + ${DEG} * $j" | bc -l)
[[ -z ${ZLON} ]] && ZLON=0
echo " ## SEARCH UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*"
swarmnum=$(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
nodenum=$(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${ZLAT}*_${ZLON}*/TW/* 2>/dev/null | wc -l )
totnum=$(( swarmnum + nodenum ))
[[ $totnum -gt 9 ]] && displaynum="X" || displaynum=$totnum
[[ $displaynum != "0" ]] && echo '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${displaynum}'", "ipns": "'${ZONEINDEX}'" }
,' >> ~/.zen/tmp/${MOATS}/http.grid \
&& echo "${DEG} :" '{"lat": '${ZLAT}', "lon": '${ZLON}', "number": "'${totnum}'", "ipns": "'${ZONEINDEX}'" }'
done
done
[[ ! $(cat ~/.zen/tmp/${MOATS}/http.grid | tail -n 1 | grep 'gridNumbers' ) ]] \
&& sed -i '$ d' ~/.zen/tmp/${MOATS}/http.grid ## REMOVE LAST ','
echo ']}' >> ~/.zen/tmp/${MOATS}/http.grid
echo "## ADD TO CACHE ~/.zen/tmp/${JSON}"
cp ~/.zen/tmp/${MOATS}/http.grid ~/.zen/tmp/${JSON}
fi
cat ~/.zen/tmp/${JSON} | jq -c
### SEND RESPONSE ON PORT
cat ~/.zen/tmp/${JSON} >> ~/.zen/tmp/${MOATS}.http
(
cat ~/.zen/tmp/${MOATS}.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}/http.grid 2>/dev/null
rm ~/.zen/tmp/${MOATS}.http && echo "BLURP ${JSON}"
) &
## CLEANING
rm -Rf ~/.zen/tmp/${MOATS}/
## TIMING
end=`date +%s`
echo "(ZONE) Operation time was "`expr $end - $start` seconds.
exit 0

46
APY/addfile.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# Usage: bash addfile.sh <filename> <mime_type> <file_type>
filename="$1"
mime_type="$2"
file_type="$3"
echo "Processing file: $filename"
echo "MIME type: $mime_type"
echo "File type: $file_type"
# Check file type and perform corresponding treatment
case $file_type in
"video")
if [[ $mime_type == *"video"* ]]; then
# Video processing logic
echo "Video processing..."
# Add more processing steps as needed
else
echo "Invalid file type for video processing"
fi
;;
"audio")
if [[ $mime_type == *"audio"* ]]; then
# Audio processing logic
echo "Audio processing..."
# Add more processing steps as needed
else
echo "Invalid file type for audio processing"
fi
;;
"text")
if [[ $mime_type == *"text"* ]]; then
# Text processing logic
echo "Text processing..."
# Add more processing steps as needed
else
echo "Invalid file type for text processing"
fi
;;
*)
echo "Unknown file type: $file_type"
;;
esac
echo "File processing complete."

170
APY/upload_video.10101.py Executable file
View File

@ -0,0 +1,170 @@
#!/usr/bin/python3
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
from fastapi.responses import HTMLResponse, JSONResponse
import subprocess
import os
import magic
app = FastAPI()
# HTML form for file upload
html_form = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Upload and Processing</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f5f5f5;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
#upload-container {
background-color: #ffffff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 20px;
border-radius: 8px;
text-align: center;
}
h1 {
color: #333333;
}
form {
margin-top: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
input[type="file"] {
margin-bottom: 10px;
}
input[type="button"] {
background-color: #4caf50;
color: white;
border: none;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
border-radius: 4px;
}
#result-container {
margin-top: 20px;
}
#loading-indicator {
display: none;
margin-top: 20px;
}
</style>
</head>
<body>
<div id="upload-container">
<h1>File Upload and Processing</h1>
<form id="upload-form" enctype="multipart/form-data" method="post">
<input type="file" id="file" accept="video/*,audio/*,text/*" required>
<br>
<label for="convert_to">Choose file type:</label>
<input type="radio" id="video" name="convert_to" value="video" checked>
<label for="video">Video</label>
<input type="radio" id="audio" name="convert_to" value="audio">
<label for="audio">Audio</label>
<input type="radio" id="text" name="convert_to" value="text">
<label for="text">Text</label>
<br>
<input type="button" value="Upload" onclick="uploadFile()">
<div id="loading-indicator">Loading...</div>
</form>
<div id="result-container"></div>
</div>
<script>
async function uploadFile() {
const fileInput = document.getElementById('file');
const file = fileInput.files[0];
const fileType = document.querySelector('input[name="convert_to"]:checked').value;
const formData = new FormData();
formData.append('file', file);
formData.append('convert_to', fileType);
// Show loading indicator
const loadingIndicator = document.getElementById('loading-indicator');
loadingIndicator.style.display = 'block';
try {
const response = await fetch('/upload', {
method: 'POST',
body: formData
});
const result = await response.json();
document.getElementById('result-container').innerHTML = JSON.stringify(result, null, 2);
} catch (error) {
console.error('Error uploading file:', error);
} finally {
// Hide loading indicator after response or error
loadingIndicator.style.display = 'none';
}
}
</script>
</body>
</html>
"""
@app.get("/")
async def read_root():
return HTMLResponse(content=html_form, status_code=200)
def get_mime_type(file: UploadFile):
mime = magic.Magic()
mime_type = mime.from_buffer(file.file.read(1024))
return mime_type
@app.post("/upload")
async def create_upload_file(file: UploadFile = File(...), convert_to: str = Form(...)):
# Validate file size
max_file_size = 100 * 1024 * 1024 # 100MB
if file.file.__sizeof__() > max_file_size:
raise HTTPException(status_code=400, detail="File size exceeds the limit of 100MB")
# Check the file type
mime_type = get_mime_type(file)
print(f"Detected MIME type: {mime_type}")
# Save the uploaded file to a temporary location
with open(file.filename, "wb") as f:
f.write(file.file.read())
# Continue with the processing logic
# Run the post-treatment Bash script
logs = subprocess.run(["bash", "addfile.sh", file.filename, mime_type, convert_to], capture_output=True, text=True).stdout
# Optionally, you can remove the temporary file
os.remove(file.filename)
return JSONResponse(content={"filename": file.filename, "mime_type": mime_type, "convert_to": convert_to, "message": "File processed successfully.", "logs": logs})
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=10101)

View File

@ -1,17 +1,23 @@
::: :::::::: ::::::::::: ::::::::: :::::::: ::::::::: :::::::: ::::::::: :::::::::::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++#++: +#++:++#++ +#+ +#++:++#: +#+ +:+ +#++:++#+ +#+ +:+ +#++:++#: +#+
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
### ### ######## ### ### ### ######## ### ######## ### ### ###
cat << "EOF"
_____/\/\_____ ____________ ___/\/\_____ ____________ ____________ ____________ ____________ ____________ ___/\/\_____
___/\/\/\/\___ ___/\/\/\/\_ _/\/\/\/\/\_ _/\/\__/\/\_ ___/\/\/\___ _/\/\/\/\___ ___/\/\/\___ _/\/\__/\/\_ _/\/\/\/\/\_
_/\/\____/\/\_ _/\/\/\/\___ ___/\/\_____ _/\/\/\/\___ _/\/\__/\/\_ _/\/\__/\/\_ _/\/\__/\/\_ _/\/\/\/\___ ___/\/\_____
_/\/\/\/\/\/\_ _______/\/\_ ___/\/\_____ _/\/\_______ _/\/\__/\/\_ _/\/\/\/\___ _/\/\__/\/\_ _/\/\_______ ___/\/\_____
_/\/\____/\/\_ _/\/\/\/\___ ___/\/\/\___ _/\/\_______ ___/\/\/\___ _/\/\_______ ___/\/\/\___ _/\/\_______ ___/\/\/\___
_____/\/\_____ ____________ ___/\/\_____ ____________ ____________ ____________ ____________ ____________ ___/\/\_____
___/\/\/\/\___ ___/\/\/\/\_ _/\/\/\/\/\_ _/\/\__/\/\_ ___/\/\/\___ _/\/\/\/\___ ___/\/\/\___ _/\/\__/\/\_ _/\/\/\/\/\_
_/\/\____/\/\_ _/\/\/\/\___ ___/\/\_____ _/\/\/\/\___ _/\/\__/\/\_ _/\/\__/\/\_ _/\/\__/\/\_ _/\/\/\/\___ ___/\/\_____
_/\/\/\/\/\/\_ _______/\/\_ ___/\/\_____ _/\/\_______ _/\/\__/\/\_ _/\/\/\/\___ _/\/\__/\/\_ _/\/\_______ ___/\/\_____
_/\/\____/\/\_ _/\/\/\/\___ ___/\/\/\___ _/\/\_______ ___/\/\/\___ _/\/\_______ ___/\/\/\___ _/\/\_______ ___/\/\/\___
______________ ____________ ____________ ____________ ____________ _/\/\_______ ____________ ____________ ____________
_ __________ _,
_.-(_)._ ." ". .--""--. _.-{__}-._
.'________'. | .--------. | .' '. .:-'`____`'-:.
[____________] /` |________| `\ / .'``'. \ /_.-"`_ _`"-._\
/ / .\/. \ \| / / .\/. \ \ || .'/.\/.\'. | /` / .\/. \ `\
| \__/\__/ |\_/ \__/\__/ \_/| : |_/\_| ; | | \__/\__/ |
\ / \ / \ '.\ /.' / .-\ /-.
/'._ -- _.'\ /'._ -- _.'\ /'. `'--'` .'\/ '._-.__--__.-_.' \
/_ `""""` _\/_ `""""` _\ /_ `-./\.-' _\'. `""""""""` .'`\
(__/ '| \ _)_| |_)_/ \__)| ' | |
|_____'|_____| \__________/ | |;`_________'________`;-'
'----------' '----------' '--------------'`--------------------`
EOF

View File

@ -1,54 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.03.24
# 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
start=`date +%s`
YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1
G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) || ( echo "noipfsid" && exit 1 )
########################################################################
########################################################################
# This script could be used to manage .current Astronaut Friendships
# But thinking about it. Is is better to keep Gchange as confidence level collector.
########################################################################
echo "# Script needs enhancement or better a dedicated 'AApp' acting on IPFS directly."
########################################################################
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
# Check who is currently current connected PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
# Astroport Station "Captain" connected?
source ~/.zen/ipfs.sync; echo "CAPTAIN is $CAPTAIN $(${MY_PATH}/face.sh cool)"
echo
echo "$PLAYER bon parcours amical (N+2)"
echo
echo
for player in $(ls ~/.zen/game/players/); do
# $player g1pub
g1pub=$(cat ~/.zen/game/players/$player/.g1pub) || continue
ipfsnodeid=$(cat ~/.zen/game/players/$player/.ipfsnodeid) || continue
echo "Listing FRIENDS from $player"
ls ~/.zen/game/players/$player/ipfs/.$ipfsnodeid/FRIENDS/
echo
sleep 1
for g1 in $(ls ~/.zen/game/players/$player/ipfs/.$ipfsnodeid/FRIENDS/); do
echo "$g1 est le player..."
cat ~/.zen/game/players/$player/ipfs/.$ipfsnodeid/FRIENDS/$g1/player 2>/dev/null || echo "???"
done
done
# TODO USE WEB INTERFACE

View File

@ -1,6 +1,6 @@
#!/bin/bash
########################################################################
# Version: 0.4
# Version: 1.2
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
@ -11,22 +11,23 @@ ME="${0##*/}"
echo "-----"
echo "$ME RUNNING"
# ASTROBOT FIRST SPECIFIC PROCESS
# "Copier youtube" + (voeu) => CopierYoutube (G1Voeu G1CopierYoutube) = ASTROBOT copy Ŋ1 "(G1CopierYoutube)"
#######################################################################
# ASTROBOT SUBKEY PROGRAM : [G1]CopierYoutube "tag"
# Ce script se déclenche si le tiddler "voeu" "CopierYoutube" a été formulé dans le TW du PLAYER
# Il active l'extraction des liens (compatibles yt-dlp) trouvés dans les tiddlers portant le tag "CopierYoutube"
# Les vidéos (mp4) ou audio (mp3) (+tag "CopierYoutube MP3") sont inscrites dans un json puis importés dans le TW.
#######################################################################
INDEX="$1"
[[ ! ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2"
[[ ! $PLAYER ]] && echo "ERROR - Please provide IPFS publish key" && exit 1
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide IPFS publish key" && exit 1
ASTONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
[[ ! $ASTONAUTENS ]] && echo "ERROR - Clef IPNS $PLAYER introuvable!" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
# Extract tag=tube from TW
MOATS="$3"
@ -35,229 +36,314 @@ MOATS="$3"
###################################################################
## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
###################################################################
mkdir -p $HOME/.zen/tmp/$IPFSNODEID/G1CopierYoutube/$PLAYER/
mkdir -p $HOME/.zen/game/players/$PLAYER/G1CopierYoutube/
mkdir -p ${HOME}/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/${PLAYER}/
mkdir -p ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/
###################################################################
## tag[CopierYoutube] EXTRACT ~/.zen/tmp/CopierYoutube.json FROM TW
###################################################################
rm -f ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json
rm -f ~/.zen/game/players/${PLAYER}/G1CopierYoutube/CopierYoutube.json
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/$PLAYER/G1CopierYoutube \
--output ~/.zen/game/players/${PLAYER}/G1CopierYoutube \
--render '.' 'CopierYoutube.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[CopierYoutube]]'
echo "DEBUG : cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json | jq -r"
echo "DEBUG : cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/CopierYoutube.json | jq -r"
## CHEK FOR MP3 TAG
TAGS=()
TAGS=($(cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/CopierYoutube.json | jq -r .[].tags))
echo "TAGS :${#TAGS[@]}: ${TAGS[@]}"
isMP3=$(echo ${TAGS[@]} | grep -w "MP3")
BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser
## GET USER BROWSER for YOUTUBE COOKIES
BZER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser
[[ $BZER ]] && BROWSER="--cookies-from-browser $BZER " || BROWSER=""
[[ ! $isLAN ]] && BROWSER=""
###################################################################
## URL EXTRACTION & yt-dlp.cache.$PLAYER upgrade
for YURL in $(cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do
## URL EXTRACTION & yt-dlp.cache.${PLAYER} upgrade
for YURL in $(cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do
[[ ! $(echo $YURL | grep "http" ) ]] && echo "$YURL error" && continue
echo "G1CopierYoutube : $YURL"
echo "Extracting video playlist into yt-dlp.cache.$PLAYER"
echo "Extracting video playlist into yt-dlp.cache.${PLAYER}"
### yt-dlp.command
CMD=$(cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command 2>/dev/null | grep "$YURL" | tail -n 1)
CMD=$(cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.command 2>/dev/null | grep -- "$YURL" | tail -n 1)
if [[ ! $CMD ]]; then
echo "$PLAYER&$YURL:$MOATS" >> ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command
echo "NOUVEAU CANAL $PLAYER&$YURL:$MOATS"
echo "${PLAYER}&$YURL:$MOATS" >> ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.command
echo "NOUVEAU CANAL ${PLAYER}&$YURL:$MOATS"
lastrun=$MOATS
duree=604800000
else
lastrun=$(echo "$CMD" | rev | cut -d ':' -f 1 | rev) && echo "$CMD"
duree=$(expr ${MOATS} - $lastrun)
fi
# ONE WEEK NEW SCAN
if [[ $duree -ge 604800000 || ! -s ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.cache.$PLAYER ]]; then
yt-dlp --cookies-from-browser $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" >> ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.cache.$PLAYER
sed -i "s~$lastrun~$MOATS~g" ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command # UPDATE LASTRUN
fi
# ONE WEEK NEW SCAN
if [[ $duree -ge 604800000 || ! -s ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER} ]]; then
/usr/local/bin/yt-dlp $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" 2>/dev/null >> ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER}
sed -i "s~$lastrun~$MOATS~g" ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.command # UPDATE LASTRUN
fi
done # FINISH YURL loop
## CREATE SORT UNIQ SHUFFLED ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER (12345 ONLINE)
cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.cache.$PLAYER 2>/dev/null | sort | uniq | shuf > ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER
## CREATE SORT UNIQ SHUFFLED ~/.zen/tmp/${IPFSNODEID}/yt-dlp.cache.${PLAYER} (12345 ONLINE)
cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/yt-dlp.cache.${PLAYER} 2>/dev/null | sort | uniq | shuf > ~/.zen/tmp/${IPFSNODEID}/yt-dlp.cache.${PLAYER}
###################################################################
[[ ! -s ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER ]] && echo "AUCUN YOUTUBEID pour CopierYoutube" && exit 0
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/yt-dlp.cache.${PLAYER} ]] && echo "AUCUN YOUTUBEID pour CopierYoutube" && exit 0
###################################################################
boucle=0
tot=0
###################################################################
# PROCESS YOUTUBEID VIDEO DOWNLOAD AND CREATE TIDDLER in TW
###################################################################
while read LINE;
do
boucle=$((boucle+1))
echo "_____ $LINE _____ $boucle"
YID="$(echo "$LINE" | cut -d '&' -f 1)"
do
boucle=$((boucle+1))
echo "_____ $LINE _____ $boucle"
YID="$(echo "$LINE" | rev | cut -d '=' -f 1 | rev )"
#~ [[ $boucle -gt 50 ]] && break ## TODO SCAN FOR ABROAD SAME COPY DONE
### MAKE BETTER THAN RANDOM !! CONNECT TO THE WARM...
###################################################################
## Search for $YID.TW.json TIDDLER in local & MySwarm cache
echo "--- CACHE SEARCH FOR $YID ---" && TIDDLER=$(ls -t "$HOME/.zen/game/players/"*"/G1CopierYoutube/$YID.TW.json" 2>/dev/null | head -n 1)
[[ ! $TIDDLER ]] && TIDDLER=$(ls -t "$HOME/.zen/tmp/$IPFSNODEID/G1CopierYoutube/"*"/$YID.TW.json" 2>/dev/null | head -n 1)
[[ ! $TIDDLER ]] && TIDDLER=$(ls -t "$HOME/.zen/tmp/swarm/"*"/G1CopierYoutube/"*"/$YID.TW.json" 2>/dev/null | head -n 1)
[[ $TIDDLER ]] && echo "Tiddler Found in CACHE : $TIDDLER" || echo "EMPTY."
#~ echo "--- CACHE SEARCH FOR $YID ---"
TIDDLER=$(ls -t "${HOME}/.zen/game/players/"*"/G1CopierYoutube/$YID.TW.json" 2>/dev/null | head -n 1)
## TODO CORRECT - CACHE CHANGED -
[[ ! $TIDDLER ]] && TIDDLER=$(ls -t "${HOME}/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/"*"/$YID.TW.json" 2>/dev/null | head -n 1)
[[ ! $TIDDLER ]] && TIDDLER=$(ls -t "${HOME}/.zen/tmp/swarm/"*"/G1CopierYoutube/"*"/$YID.TW.json" 2>/dev/null | head -n 1)
#~ [[ $TIDDLER ]] && echo "Tiddler Found in CACHE : $TIDDLER" \
#~ || echo "EMPTY."
###################################################################
if [[ ! ${TIDDLER} ]]; then
###################################################################
# COPY VIDEO AND MAKE TIDDLER
###################################################################
if [[ ! ${TIDDLER} ]]; then
###################################################################
# COPY VIDEO AND MAKE TIDDLER
###################################################################
ZYURL=$(echo "$LINE" | cut -d '&' -f 2-)
echo "COPIE : $ZYURL"
## LIMIT TO 12 MAXIMUM COPY PER DAY PER PLAYER
[[ $boucle == 13 ]] && echo "MAXIMUM COPY REACHED FOR TODAY" && continue
## LIMIT TO 2 MAXIMUM COPY PER DAY PER PLAYER
[[ $tot == 3 ]] && echo "MAXIMUM COPY REACHED FOR TODAY" && break
## TODO ACCEPT MORE WITH COINS
TITLE="$(yt-dlp --cookies-from-browser $BROWSER --print "%(title)s" "${ZYURL}" | detox --inline)"
TITLE="$(/usr/local/bin/yt-dlp $BROWSER --print "%(title)s" "${ZYURL}" | detox --inline)"
[[ ! $TITLE ]] && echo "NO TITLE" && continue
start=`date +%s`
echo ".... Downloading $TITLE.mp4"
echo ".... Downloading $TITLE ${isMP3}"
# https://github.com/yt-dlp/yt-dlp#format-selection-examples
# SUBS ? --write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs
# (bv*[height<=720][vcodec~='^((he|a)vc|h26[45])']+ba)
# TODO : DELAY COPY OPERATION... Astro can download quicker at 03:00 AM
echo "yt-dlp -f \"(bv*[ext=mp4][height<=720]+ba/b[height<=720])\" --no-mtime --embed-thumbnail --add-metadata -o \"$HOME/.zen/tmp/yt-dlp/$TITLE.%(ext)s\" ${ZYURL}"
echo "/usr/local/bin/yt-dlp -f \"(bv*[ext=mp4][height<=720]+ba/b[height<=720])\" --no-mtime --embed-thumbnail --add-metadata -o \"${HOME}/.zen/tmp/yt-dlp/$TITLE.%(ext)s\" ${ZYURL}"
#############################################################################
## COPY FROM YOUTUBE (TODO DOUBLE COPY & MKV to MP4 OPTIMISATION)
## EXTRA PARAM TO TRY
# --write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs
yt-dlp -f "(bv*[ext=mp4][height<=720]+ba/b[height<=720])" \
--cookies-from-browser $BROWSER \
--download-archive $HOME/.zen/.yt-dlp.list \
-S res,ext:mp4:m4a --recode mp4 --no-mtime --embed-thumbnail --add-metadata \
-o "$HOME/.zen/tmp/yt-dlp/$TITLE.%(ext)s" ${ZYURL}
if [[ ${isMP3} == "" ]]; then
# copying video
/usr/local/bin/yt-dlp -q -f "(bv*[ext=mp4][height<=720]+ba/b[height<=720])" \
$BROWSER \
--download-archive ${HOME}/.zen/.yt-dlp.list \
-S res,ext:mp4:m4a --recode mp4 --no-mtime --embed-thumbnail --add-metadata \
-o "${HOME}/.zen/tmp/yt-dlp/$TITLE.%(ext)s" "${ZYURL}"
ZFILE="$TITLE.mp4"
################################################################################
### ADAPT TO TW RYTHM (DELAY COPY?)
echo
ZFILE="$TITLE.mp4"
############################################################################
### CHECK RESULT CONVERT MKV TO MP4
[[ -s "${HOME}/.zen/tmp/yt-dlp/$TITLE.mkv" ]] \
&& ffmpeg -loglevel quiet -i "${HOME}/.zen/tmp/yt-dlp/$TITLE.mkv" -c:v libx264 -c:a aac "${HOME}/.zen/tmp/yt-dlp/$TITLE.mp4" \
&& rm "${HOME}/.zen/tmp/yt-dlp/$TITLE.mkv"
############################################################################
### CHECK RESULT CONVERT MKV TO MP4
[[ -s "$HOME/.zen/tmp/yt-dlp/$TITLE.mkv" ]] && ffmpeg -loglevel quiet -i "$HOME/.zen/tmp/yt-dlp/$TITLE.mkv" -c:v libx264 -c:a aac "$HOME/.zen/tmp/yt-dlp/$TITLE.mp4" # TRY TO CONVERT MKV TO MP4
if [[ ! -s "${HOME}/.zen/tmp/yt-dlp/${ZFILE}" ]]; then
echo "No FILE -- TRYING TO RESTORE CACHE FROM TW -- ${ZFILE}"
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/${PLAYER}/G1CopierYoutube \
--render '.' "$YID.TW.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${ZFILE}"
if [[ ! -s "$HOME/.zen/tmp/yt-dlp/$ZFILE" ]]; then
echo "No FILE -- TRYING TO RESTORE CACHE FROM TW --"
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/$PLAYER/G1CopierYoutube \
--render '.' "'$YID.TW.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "$ZFILE" \
&& ln -s "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$YID.TW.json" "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$ZFILE.json"
continue
if [[ -s ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${YID}.TW.json ]]; then
rm "${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/${ZFILE}.json" 2>/dev/null
cd ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/
ln -s "./${YID}.TW.json" "${ZFILE}.json"
cd -
else
## REMOVE FILE FROM .yt-dlp.list - RETRY NEXT TIME
grep -v -- "$YID" ${HOME}/.zen/.yt-dlp.list > /tmp/.yt-dlp.list
mv /tmp/.yt-dlp.list ${HOME}/.zen/.yt-dlp.list
fi
continue
fi
else
# copying mp3
echo "COPYING MP3 (!-q)"
/usr/local/bin/yt-dlp -x --no-mtime --audio-format mp3 --embed-thumbnail --add-metadata \
$BROWSER \
--download-archive ${HOME}/.zen/.yt-dlp.mp3.list \
-o "${HOME}/.zen/tmp/yt-dlp/$TITLE.%(ext)s" "${ZYURL}"
ZFILE="$TITLE.mp3"
fi
echo
####################################################
echo "FOUND : ~/.zen/tmp/yt-dlp/$ZFILE"
FILE_BSIZE=$(du -b "$HOME/.zen/tmp/yt-dlp/$ZFILE" | awk '{print $1}')
####################################################
[[ -s ~/.zen/tmp/yt-dlp/${ZFILE} ]] \
&& echo "FOUND : ~/.zen/tmp/yt-dlp/${ZFILE}"
FILE_BSIZE=$(du -b "${HOME}/.zen/tmp/yt-dlp/${ZFILE}" | awk '{print $1}')
[[ ! $FILE_BSIZE ]] && echo "SIZE ERROR" && continue
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] }')
echo "$boucle - $ZFILE - FILE SIZE = $FILE_SIZE ($FILE_BSIZE octets)"
echo "$boucle - ${ZFILE} - FILE SIZE = $FILE_SIZE ($FILE_BSIZE octets)"
echo
espeak "GOOD! Video Number $boucle = $FILE_SIZE" > /dev/null 2>&1
### CREATE GIF ANIM : make_video_gifanim_ipfs.sh
[[ ${isMP3} == "" ]] \
&& $(${MY_PATH}/../tools/make_video_gifanim_ipfs.sh "${HOME}/.zen/tmp/yt-dlp" "${ZFILE}" | tail -n 1) \
&& echo "HOP=$HOP
ANIMH=$ANIMH
PROBETIME=$PROBETIME
DURATION=$DURATION
DUREE=$DUREE
RES=$RES
MIME=$MIME
VTRATIO=$VTRATIO
file=$file"
### CREATE GIF ANIM
$(${MY_PATH}/../tools/make_video_gifanim_ipfs.sh "$HOME/.zen/tmp/yt-dlp" "$ZFILE" | tail -n 1) ## export ANIMH
echo "/ipfs/$ANIMH"
## Create gifanime ## TODO Search for similarities BEFORE ADD
echo "Adding to IPFS"
ILINK=$(ipfs add -q "$HOME/.zen/tmp/yt-dlp/$ZFILE" | tail -n 1)
echo "/ipfs/$ILINK === $ZFILE"
ILINK=$(ipfs add -q "${HOME}/.zen/tmp/yt-dlp/${ZFILE}" | tail -n 1)
echo "/ipfs/$ILINK === ${ZFILE}"
MIME=$(file --mime-type -b "$HOME/.zen/tmp/yt-dlp/$ZFILE")
[[ $ILINK == "" ]] && echo ">>>>> BIG PROBLEM PAPA. NO IPFS " && continue
MIME=$(file --mime-type -b "${HOME}/.zen/tmp/yt-dlp/${ZFILE}")
## ADD TAGS
SEC=$(yt-dlp --cookies-from-browser $BROWSER --print "%(duration)s" "${ZYURL}")
CHANNEL=$(yt-dlp --cookies-from-browser $BROWSER --print "%(channel)s" "${ZYURL}" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
PLAYLIST=$(yt-dlp --cookies-from-browser $BROWSER --print "%(playlist)s" "${ZYURL}" | sed -r 's/\<./\U&/g' | sed 's/ //g')
SEC=$(/usr/local/bin/yt-dlp $BROWSER --print "%(duration)s" "${ZYURL}")
CHANNEL=$(/usr/local/bin/yt-dlp $BROWSER --print "%(channel)s" "${ZYURL}" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
PLAYLIST=$(/usr/local/bin/yt-dlp $BROWSER --print "%(playlist)s" "${ZYURL}" | sed -r 's/\<./\U&/g' | sed 's/ //g')
EXTRATAG="$CHANNEL $PLAYLIST"
if [[ ${isMP3} == "" ]]; then
## PREPARE VIDEO HTML5 CODE
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${ILINK}"' type='"${MIME}"'></video>
<br>{{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}})<br>
<h1><a href='"${ZYURL}"'>"${TITLE}"</a></h1>"
TEXT="<video controls width=100% poster='/ipfs/"${ANIMH}"'>
<source src='/ipfs/"${ILINK}"' type='"${MIME}"'>
Your browser does not support the video element.
</video>
<br>
{{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}})
<br>
<h1><a target='_blank' href='"${ZYURL}"'>Web2.0 Origin</a></h1>"
else
TEXT="<audio controls>
<source src='/ipfs/"${ILINK}"' type='"${MIME}"'>
Your browser does not support the audio element.
</audio>
<br>
{{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}})
<br>
<h1><a target='_blank' href='"${ZYURL}"'>Web2.0 Origin</a></h1>"
fi
end=`date +%s`
dur=`expr $end - $start`
echo "Creating Youtube \"${YID}\" tiddler : G1CopierYoutube !"
CTITLE=$(echo ${ZFILE} | sed 's~_~ ~g' | sed 's~\.~ ~g')
## WAN ADD <<hide tiddler-controls>> TO text jq 'map(.text += "<<hide tiddler-controls>>")'
[[ ! isLAN ]] && TEXT="$TEXT <<hide tiddler-controls>>"
echo $TEXT
mkdir -p ${HOME}/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/${PLAYER} ## MISSING FOR FIRST RUN
TIDDLER="${HOME}/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/${PLAYER}/${YID}.TW.json"
echo '[
{
"created": "'${MOATS}'",
"resolution": "'${RES}'",
"duree": "'${DUREE}'",
"duration": "'${DURATION}'",
"giftime": "'${PROBETIME}'",
"gifanime": "'/ipfs/${ANIMH}'",
"modified": "'${MOATS}'",
"title": "'$ZFILE'",
"type": "'text/vnd.tiddlywiki'",
"vtratio": "'${VTRATIO}'",
"text": "'$TEXT'",
"g1pub": "'${G1PUB}'",
"mime": "'${MIME}'",
"size": "'${FILE_BSIZE}'",
"filesize": "'${FILE_SIZE}'",
"sec": "'${SEC}'",
"dur": "'${dur}'",
"ipfs": "'/ipfs/${ILINK}'",
"youtubeid": "'${YID}'",
"zurl": "'${ZYURL}'",
"tags": "'ipfs G1CopierYoutube ${PLAYER} ${EXTRATAG} ${MIME}'"
}
]
' > "$HOME/.zen/tmp/$IPFSNODEID/G1CopierYoutube/$PLAYER/$YID.TW.json"
{
"created": "'${MOATS}'",
"resolution": "'${RES}'",
"duree": "'${DUREE}'",
"duration": "'${DURATION}'",
"giftime": "'${PROBETIME}'",
"gifanime": "'/ipfs/${ANIMH}'",
"modified": "'${MOATS}'",
"title": "'${ZFILE}'",
"type": "'text/vnd.tiddlywiki'",
"vtratio": "'${VTRATIO}'",
"text": "'$TEXT'",
"g1pub": "'${G1PUB}'",
"mime": "'${MIME}'",
"size": "'${FILE_BSIZE}'",
"filesize": "'${FILE_SIZE}'",
"sec": "'${SEC}'",
"dur": "'${dur}'",
"ipfs": "'/ipfs/${ILINK}'",
"youtubeid": "'${YID}'",
"zurl": "'${ZYURL}'",
"issuer": "'${PLAYER}'",
"tags": "'ipfs G1CopierYoutube ${PLAYER} ${EXTRATAG} ${MIME} ${CTITLE}'"
}
]
' > ${TIDDLER}
TIDDLER="$HOME/.zen/tmp/$IPFSNODEID/G1CopierYoutube/$PLAYER/$YID.TW.json"
tot=$((tot+1))
else
###################################################################
echo '# TIDDLER WAS IN CACHE'
###################################################################
## TODO : ADD EMAIL TAG ( TIMESTAMP & ADD SIGNATURE over existing ones)
continue
fi
else
###################################################################
#~ echo "${TIDDLER} FOUND"
###################################################################
## TODO : ADD EMAIL TAG ( TIMESTAMP & ADD SIGNATURE over existing ones)
continue
fi
cp -f "${TIDDLER}" "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/"
cp -f "${TIDDLER}" "${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/"
#################################################################
### ADDING $YID.TW.json to ASTONAUTENS INDEX.html
### ADDING $YID.TW.json to ASTRONAUTENS INDEX.html
#################################################################
echo "=========================="
echo "Adding $YID tiddler to TW /ipns/$ASTONAUTENS "
echo "=========================="
echo "Adding $YID tiddler to TW /ipns/$ASTRONAUTENS "
rm -f ~/.zen/tmp/$IPFSNODEID/newindex.html
rm -f ~/.zen/tmp/${IPFSNODEID}/newindex.html
echo ">>> Importing $HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$YID.TW.json"
echo ">>> Importing ${TIDDLER}"
tiddlywiki --load ${INDEX} \
--import "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$YID.TW.json" "application/json" \
--output ~/.zen/tmp/$IPFSNODEID --render "$:/core/save/all" "newindex.html" "text/plain"
tiddlywiki --load ${INDEX} \
--import "${TIDDLER}" "application/json" \
--output ~/.zen/tmp/${IPFSNODEID} --render "$:/core/save/all" "newindex.html" "text/plain"
# --deletetiddlers '[tag[CopierYoutube]]' ### REFRESH CHANNEL COPY
if [[ -s ~/.zen/tmp/${IPFSNODEID}/newindex.html ]]; then
if [[ -s ~/.zen/tmp/$IPFSNODEID/newindex.html ]]; then
## COPY JSON TIDDLER TO PLAYER
cd ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/
ln -s "./$YID.TW.json" "${ZFILE}.json"
cd -
## COPY JSON TIDDLER TO PLAYER
ln -s "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$YID.TW.json" "$HOME/.zen/game/players/$PLAYER/G1CopierYoutube/$ZFILE.json"
[[ $(diff ~/.zen/tmp/${IPFSNODEID}/newindex.html ${INDEX} ) ]] \
&& mv ~/.zen/tmp/${IPFSNODEID}/newindex.html ${INDEX} \
&& echo "===> Mise à jour ${INDEX}"
[[ $(diff ~/.zen/tmp/$IPFSNODEID/newindex.html ${INDEX} ) ]] && cp ~/.zen/tmp/$IPFSNODEID/newindex.html ${INDEX} && echo "===> Mise à jour ${INDEX}"
else
echo "Problem with tiddlywiki command. Missing ~/.zen/tmp/${IPFSNODEID}/newindex.html"
echo "XXXXXXXXXXXXXXXXXXXXXXX"
break
fi
else
echo "Problem with tiddlywiki command. Missing ~/.zen/tmp/$IPFSNODEID/newindex.html"
echo "XXXXXXXXXXXXXXXXXXXXXXX"
fi
done < ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER # FINISH YID loop 1
done < ~/.zen/tmp/${IPFSNODEID}/yt-dlp.cache.${PLAYER} # FINISH YID loop 1
## COPY PLAYER CACHE TO STATION SWARM CACHE
cp -r ${HOME}/.zen/game/players/${PLAYER}/G1CopierYoutube/* \
~/.zen/tmp/${IPFSNODEID}/G1CopierYoutube/${PLAYER}/
exit 0

View File

@ -1,27 +0,0 @@
#!/bin/bash
########################################################################
# Version: 0.4
# 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##*/}"
echo "-----"
echo "$ME RUNNING"
# Need TW index.html path + IPNS publication Key (available in IPFS keystore)
# Search for "G1DessinDeMoa" tagged tiddlers to get URL
INDEX="$1"
[[ ! $INDEX ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -f $INDEX ]] && echo "ERROR - Fichier TW absent. $INDEX" && exit 1
WISHKEY="$2" ## IPNS KEY NAME - G1PUB - PLAYER ...
[[ ! $WISHKEY ]] && echo "ERROR - Please provide IPFS publish key" && exit 1
TWNS=$(ipfs key list -l | grep -w $WISHKEY | cut -d ' ' -f1)
[[ ! $TWNS ]] && echo "ERROR - Clef IPNS $WISHKEY introuvable!" && exit 1
# Extract tag=tube from TW into ~/.zen/tmp/$WISHKEY/DessinDeMoa.json
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
echo "TODO. Use 'moa' 'G1DessinDeMoa' Tiddlers to control Ŋ1 Network"
exit 0

297
ASTROBOT/G1Kodi.sh Executable file
View File

@ -0,0 +1,297 @@
#!/bin/bash
########################################################################
# Version: 0.5
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# PAD COCODING : https://pad.p2p.legal/s/G1Kodi
# KODI SERVICE : Publish and Merge Friends Kodi Movies into RSS Stream
########################################################################
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
echo "(✜‿‿✜) G1Kodi
Insert G1Kodi Tiddlers from Kodi database from ~/.kodi/userdata/Database/MyVideos116.db
should export movie to RSS (ex : http://ipfs.localhost:8080/ipfs/QmSJYf4uTj3NmqovSFZpBZuUhSS8j9FXKKnAjUMuVE896k)"
echo "$ME RUNNING"
## EXTRACT MOVIES FROM KODI
[[ ! -s ~/.kodi/userdata/Database/MyVideos116.db ]] && echo "KODI MOVIE SQLITE DB MISSING - EXIT -" && exit 1
## CREATE 1ST ONLY TIDDLER INTO TW
########################################################################
########################################################################
INDEX="$1"
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
ORIGININDEX=${INDEX}
PLAYER="$2"
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
MOATS="$3"
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
echo "${PLAYER} ${INDEX} ${ASTRONAUTENS} ${G1PUB} "
#~ ###################################################################
#~ ## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
#~ ###################################################################
mkdir -p $HOME/.zen/tmp/${MOATS} && echo $HOME/.zen/tmp/${MOATS}
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1Kodi/
echo "EXPORT Kodi Wish for ${PLAYER}"
rm -f ~/.zen/game/players/${PLAYER}/G1Kodi/Kodi.json
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/${PLAYER}/G1Kodi \
--render '.' 'Kodi.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]tag[G1Kodi]]'
[[ $(cat ~/.zen/game/players/${PLAYER}/G1Kodi/Kodi.json ) == "[]" ]] \
&& echo "AUCUN VOEU G1KODI - EXIT -" \
&& rm -Rf $HOME/.zen/game/players/${PLAYER}/G1Kodi \
&& exit 0
WISH=$(cat ~/.zen/game/players/${PLAYER}/G1Kodi/Kodi.json | jq -r '.[].wish')
WISHNS=$(cat ~/.zen/game/players/${PLAYER}/G1Kodi/Kodi.json | jq -r '.[].wishns')
echo "G1KODI: $WISH ${myIPFS}$WISHNS"
## Export already in TW movies
rm -f ~/.zen/game/players/${PLAYER}/G1Kodi/TWmovies.json
tiddlywiki --load ${INDEX} \
--output ~/.zen/game/players/${PLAYER}/G1Kodi \
--render '.' 'TWmovies.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Kodi]!tag[G1Voeu]]'
[[ $(cat ~/.zen/game/players/${PLAYER}/G1Kodi/TWmovies.json) == "[]" ]] && echo "AUCUN FILM G1KODI"
#~ ## TW G1Kodi deletetiddlers CODE
#~ tiddlywiki --load ${INDEX} \
#~ --deletetiddlers '[tag[G1Kodi]!Kodi]' \
#~ --output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "cleanindex.html" "text/plain"
#~ [[ -s ~/.zen/tmp/${MOATS}/cleanindex.html ]] && cp -f ~/.zen/tmp/${MOATS}/cleanindex.html ~/.zen/tmp/${MOATS}/index.html
echo "=========== ( ◕‿◕) EXTRACT KODI MyVideos DB (◕‿◕ ) =============="
## EXTRACT MOVIE FILES LIST TO CSV
echo "\"titre\",\"desc\",\"sub\",\"source\",\"cat\",\"extrait\",\"prem\"" > ~/.zen/tmp/${MOATS}/${PLAYER}.movie.csv
sqlite3 -csv ~/.kodi/userdata/Database/MyVideos116.db 'select c00, c01, c03, c22, c14, c19, premiered from movie' >> ~/.zen/tmp/${MOATS}/${PLAYER}.movie.csv
[[ ! -s ~/.zen/tmp/${MOATS}/${PLAYER}.movie.csv ]] && echo "EMPTY KODI MOVIE DATABASE - EXIT -" && exit 0
#################################
### CONVERT TO JSON
## Use "miller" to convert csv into json
mlr --c2j --jlistwrap cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.csv > ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json
## SHUFFLE TITRE LIST
cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq -r .[].titre | shuf > ~/.zen/tmp/${MOATS}/${PLAYER}.movie.id
boucle=0
while read TITRE; do
DESC=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .desc')
SUB=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .sub')
SOURCE=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .source')
IPFSONE=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .ipfs_one')
CAT=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .cat' | tail -n 1)
YID=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .extrait' | rev | cut -d '=' -f 1 | rev)
PREM=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.movie.json | jq --arg v "${TITRE}" -r '.[] | select(.titre==$v) | .prem')
MIME=$(file --mime-type -b "$SOURCE" )
YEAR=$(echo "${PREM}" | cut -f1 -d '-' )
TITLE=$(echo "${TITRE}" | detox --inline ) ## TITLE SANITY
TAGS="${YEAR} G1Kodi ${TITLE} ${PLAYER} $(echo "${CAT}" | detox --inline | sed 's~_~\ ~g')"
echo "${boucle} > ${TITLE}"
echo "($MIME)" "$SOURCE"
## ADD MOVIE TO IPFS
#~ <item>
#~ <title>Delicatessen</title>
#~ <description>La vie des étranges habitants d'un immeuble de banlieue qui se dresse dans un immense terrain vague et qui tous vont se fournir chez le boucher-charcutier, à l'enseigne « Delicatessen ».</description>
#~ <link>http://ipfs.localhost:8080/ipfs/QmfVuhDo4kEk5eh5EULfZGxiWqrrCcHBehojgPF6kiq8r3/Delicatessen.mp4</link>
#~ <pubDate>Sun, 6 Sep 2022 16:20:00 +0000</pubDate>
#~ </item>
if [[ ! -s ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json ]]; then
echo "CHECKING Kodi_${TITLE} IN TW"
tiddlywiki --load ${ORIGININDEX} \
--output ~/.zen/game/players/${PLAYER}/G1Kodi \
--render '.' "${TITLE}.dragdrop.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "'"Kodi_${TITLE}"'"
fi ## CHECK PLAYER G1KODI CACHE. QUICKER.
if [[ $(cat ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json) == "[]" ]]; then
if [[ $MIME == "video/mp4" ]]; then
echo "$MIME. GOOD. RECORDING TO TW"
# MAKE PAYMENT QRCODE
# sha256 Kodi_TITLE + G1PUB encrypt = comment
THASH=$(echo "Kodi_${TITLE}" | sha256sum | cut -d ' ' -f 1) # && echo ${THASH} > ~/.zen/tmp/${MOATS}/thash
# WANA DO MORE SECURE ?
## ENCRYPT THASH with G1PUB (so you are sure it is a link from your TW).
#~ ~/.zen/Astroport.ONE/tools/natools.py encrypt -p ${G1PUB} -i ~/.zen/tmp/${MOATS}/thash -o ~/.zen/tmp/${MOATS}/thash.enc
#~ THASHSEC=$(cat ~/.zen/tmp/${MOATS}/thash.enc | base16)
#~ Then update THASH with THASHSEC next
## CREATE june:// QRCODE put it in IPFS
PAYCOM="june://${G1PUB}?comment=N1Kodi:${THASH}&" ## comment=N1Kodi:TiddlerTiltleHash
echo "${PAYCOM}"
amzqr "${PAYCOM}" -l H -c -p ${MY_PATH}/../images/TV.png -n VOD_${TITLE}.png -d ~/.zen/tmp/${MOATS}/
convert -gravity northwest -pointsize 20 -fill black -draw "text 30,3 \"${TITRE} (${YEAR})\"" ~/.zen/tmp/${MOATS}/VOD_${TITLE}.png ~/.zen/tmp/${MOATS}/VOD.png
PV=$(ipfs add -q ~/.zen/tmp/${MOATS}/VOD.png)
echo "VOD QR = ${myIPFS}/ipfs/${PV}"
## ADD TO IPFS
echo "ADD ${SOURCE} TO IPFS"
IPFSMOVIE=$(ipfs add -q "$SOURCE")
echo "/ipfs/${IPFSMOVIE}" > ~/.zen/tmp/${MOATS}/source
~/.zen/Astroport.ONE/tools/natools.py encrypt -p ${G1PUB} -i ~/.zen/tmp/${MOATS}/source -o ~/.zen/tmp/${MOATS}/source.enc
ENCODING=$(cat ~/.zen/tmp/${MOATS}/source.enc | base16)
echo "MOVIE ADDED /ipfs/${IPFSMOVIE} :NATOOLS16: ${ENCODING}"
# CREATE TEXT AREA
TEXT="<h1>{{!!titre}} ({{!!year}})</h1><h2>{{!!sub}}</h2>
{{!!desc}}<br>
<a target='youtube' href='https://youtu.be/"${YID}"'>Bande Annonce</a>
<br>
<h3>Voir ce Film:</h3>
<h4>Installez Cesium+</h4>
<table><tr>
<td>
<img width='240' src='/ipfs/QmXExw6Sh4o4rSjBQjU9PGU7BCGwb1jybrKEeaZGUNRCRE'>
</td><td>
<img width='240' src='/ipfs/QmP3qwEnVX9zSsyKAwuH6nhDPfrRoMbAfszrtdkLGgo7LQ'>
</td>
</tr>
<tr>
<td>
<h4>Flashez, envoyez un don...</h4>
<br>ce soir,<br>recevez le lien dans votre messagerie.
</td><td>
<img width='300' src='/ipfs/"${PV}"'>
</td>
</tr>
</table>
"
## MAKING TIDDLER
echo "## Creation json tiddler ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json"
echo '[
{
"created": "'${MOATS}'",
"title": "'Kodi_${TITLE}'",
"text": "'${TEXT}'",
"thash": "'${THASH}'",
"year": "'${YEAR}'",
"mime": "'${MIME}'",
"prem": "'${PREM}'",
"sub": "'${SUB}'",
"desc": "'${DESC}'",
"yid": "'${YID}'",
"cat": "'${CAT}'",
"g1pub": "'${G1PUB}'",
"source": "'${SOURCE}'",
"ipfs_one": "''",
"titre": "'${TITRE}'",
"modified": "'${MOATS}'",
"issuer": "'${PLAYER}'",
"tags": "'${TAGS}'"
}
]
' > ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json
## ADD ipfs_one to JSON file (Just to show jq in action)
cat ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json | jq --arg v "${ENCODING}" '.[].ipfs_one = $v' \
> ~/.zen/game/players/${PLAYER}/G1Kodi/ipfs_one.json
[[ -s ~/.zen/game/players/${PLAYER}/G1Kodi/ipfs_one.json ]] \
&& cp -f ~/.zen/game/players/${PLAYER}/G1Kodi/ipfs_one.json ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json \
&& rm ~/.zen/game/players/${PLAYER}/G1Kodi/ipfs_one.json
## TO ALLOW DECODING FOR MY FRIENDS
## jq FORMULA TO ADD ipfs_FG1PUB = ACODING
#~ cat ~/.zen/tmp/${MOATS}/atiddler.json | jq '.[] |= .+ {"_IPUB_":"_ICOD_"}' \
#~ > ~/.zen/tmp/${MOATS}/atiddler.json.tmp \
#~ && sed -i "s~_IPUB_~ipfs_${AG1PUB}~g" ~/.zen/tmp/${MOATS}/atiddler.json.tmp \
#~ && sed -i "s~_ICOD_~${ACODING}~g" ~/.zen/tmp/${MOATS}/atiddler.json.tmp \
#~ && mv ~/.zen/tmp/${MOATS}/atiddler.json.tmp ~/.zen/tmp/${MOATS}/atiddler.json
echo "ipfs_one : ${ENCODING}"
## ADD TO TW
echo "ADD G1KODI IN TW ${PLAYER} : $myIPFS/ipns/$ASTRONAUTENS"
rm -f ~/.zen/tmp/newindex.html
tiddlywiki --load ${INDEX} \
--import ~/.zen/game/players/${PLAYER}/G1Kodi/${TITLE}.dragdrop.json "application/json" \
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
## UPDATE ${INDEX}
if [[ -s ~/.zen/tmp/newindex.html ]]; then
cp -f ~/.zen/tmp/newindex.html ~/.zen/tmp/${MOATS}/index.html
INDEX="$HOME/.zen/tmp/${MOATS}/index.html"
echo "NEWINDEX : ${INDEX}"
boucle=$((boucle+1)) ## COUNT HOW MANY MOVIES GOING TO IPFS
else
echo "CANNOT UPDATE TW - FATAL ERROR -"
exit 1
fi
echo "MOVIE IN TW ($YID)"
echo "~~~~~~~~"
else
echo "${TITLE} MIME TYPE NOT COMPATIBLE.
MUST BE CONVERTED TO MP4"
fi
else
echo "ALREADY IN TW : Kodi_${TITLE}
https://youtu.be/${YID}"
fi
## BOUCLE BREAK - choose how many movies are added per day ? - G1STATION PARAM -
[[ ${boucle} == 1 ]] && echo "IPFS ADD ${boucle} TODAY - BREAK -" && break
done < ~/.zen/tmp/${MOATS}/${PLAYER}.movie.id
## VERIFY, COULD BE DONE IN PLAYER REFRESH
if [[ $(diff ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${INDEX}) ]]; then
cp ${INDEX} ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
echo "CHANGED TW"
fi
echo "=========== ( ◕‿◕) (◕‿◕ ) =============="
#~ rm -Rf $HOME/.zen/tmp/${MOATS}
exit 0
## ./userdata/mediasources.xml
## ./userdata/sources.xml

View File

@ -1,223 +0,0 @@
#!/bin/bash
########################################################################
# Version: 0.5
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# PAD COCODING : https://pad.p2p.legal/s/G1PalPay
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
CESIUM="https://g1.data.le-sou.org"
GCHANGE="https://data.gchange.fr"
echo "(✜‿‿✜) G1PalPay : Receiving & Relaying payments to emails found in comment"
echo "$ME RUNNING"
########################################################################
# PALPAY SERVICE
########################################################################
# CHECK TODAY INCOMING PAYMENT
# IF COMMENT CONTAINS EMAIL ADDRESSES
# THEN CREATE VISA+TW AND SEND PAIMENT REMOVING FIRST FROM LIST
########################################################################
# this couls lead in several account creation sharing % of incomes each time
########################################################################
INDEX="$1"
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2"
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! $ASTONAUTENS ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
MOATS="$3"
[[ ! $MOATS ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
###################################################################
## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
###################################################################
mkdir -p $HOME/.zen/tmp/${IPFSNODEID}/G1PalPay/${PLAYER}/
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1PalPay/
mkdir -p $HOME/.zen/tmp/${MOATS}
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -n 10 -j > $HOME/.zen/game/players/${PLAYER}/G1PalPay/$PLAYER.history.json
[[ ! -s $HOME/.zen/game/players/${PLAYER}/G1PalPay/$PLAYER.history.json ]] \
&& echo "NO PAYMENT HISTORY" \
&& exit 1
## DEBUG ## cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/$PLAYER.history.json | jq -r
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/$PLAYER.history.json | jq -rc .[] | grep '@' > ~/.zen/tmp/${MOATS}/myPalPay.json
## GET @ in JSON INLINE
while read LINE; do
echo "MATCHING IN COMMENT"
JSON=$LINE
IDATE=$(echo $JSON | jq -r .date)
IPUBKEY=$(echo $JSON | jq -r .pubkey)
IAMOUNT=$(echo $JSON | jq -r .amount)
IAMOUNTUD=$(echo $JSON | jq -r .amountUD)
COMMENT=$(echo $JSON | jq -r .comment)
[[ $(cat ~/.zen/game/players/${PLAYER}/.idate) -ge $IDATE ]] && echo "PalPay $IDATE from $IPUBKEY ALREADY TREATED - continue" && continue
## GET EMAILS FROM COMMENT
ICOMMENT=($(echo "$COMMENT" | grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
## DIVIDE INCOMING AMOUNT TO SHARE
echo "N=${#ICOMMENT[@]}"
N=${#ICOMMENT[@]}
SHARE=$(echo "$IAMOUNT / $N" | bc -l | cut -d '.' -f 1) ## INTEGER ROUNDED VALUE
echo $IDATE $IPUBKEY $IAMOUNT [$IAMOUNTUD] $ICOMMENT % $SHARE %
for EMAIL in "${ICOMMENT[@]}"; do
[[ $EMAIL == $PLAYER ]] && echo "My PalPay" && continue
echo "EMAIL : ${EMAIL}"
ASTROTW="" STAMP="" ASTROG1="" ASTROIPFS="" ASTROFEED=""
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${EMAIL}) ## export ASTROTW and more
if [[ ! ${ASTROTW} ]]; then
echo "# NEW VISA $(date)"
SALT="" && PEPPER=""
echo "VISA.new : \"$SALT\" \"$PEPPER\" \"${EMAIL}\" \"$PSEUDO\" \"${URL}\""
if [[ ! $isLAN || $USER == "zen" ]]; then
$(${MY_PATH}/../tools/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${URL}" | tail -n 1)
# export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$EMAIL ASTROFEED=$FEEDNS
else
## CREATE new PLAYER IN myASTROTUBE
echo "https://astroport.cancer.copylaradio.com/?salt=0&pepper=0&g1pub=_URL_&email=${EMAIL}"
curl -so ~/.zen/tmp/${MOATS}/astro.port "https://astroport.cancer.copylaradio.com/?salt=0&pepper=0&g1pub=_URL_&email=${EMAIL}"
TELETUBE=$(cat ~/.zen/tmp/${MOATS}/astro.port | grep "(◕‿‿◕)" | cut -d ':' -f 2 | cut -d '/' -f 3)
TELEPORT=$(cat ~/.zen/tmp/${MOATS}/astro.port | grep "(◕‿‿◕)" | cut -d ':' -f 3 | cut -d '"' -f 1)
sleep 30
curl -so ~/.zen/tmp/${MOATS}/astro.rep "http://$TELETUBE:$TELEPORT"
$(cat ~/.zen/tmp/${MOATS}/astro.rep | tail -n 1) ## SOURCE LAST LINE (SEE SALT PEPPER EMAIL API RETURN)
fi
######################################################
${MY_PATH}/../tools/mailjet.sh "${EMAIL}" "BRO. $PLAYER VOUS A OFFERT CE TW : $(myIpfsGw)/$ASTROTW" ## WELCOME NEW PLAYER
fi
## MAKE FRIENDS & SEND G1
echo "Hello PalPay Friend $ASTROMAIL
TW : $ASTROTW
G1 : $ASTROG1
ASTROIPFS : $ASTROIPFS
RSS : $ASTROFEED"
[[ ! $ASTROG1 ]] \
&& echo "MISSING ASTROG1" \
&& continue
if [[ ${ASTROG1} != ${G1PUB} ]]; then
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${SHARE} -p ${ASTROG1} -c "PalPay:$N:$IPUBKEY" -m > /dev/null 2>&1
STAMP=$?
else
STAMP=0
fi
## DONE STAMP IT
[[ $STAMP == 0 ]] && echo "$IDATE" > ~/.zen/game/players/${PLAYER}/.idate ## MEMORIZE LAST IDATE
done
done < ~/.zen/tmp/${MOATS}/myPalPay.json
#################################################################
#################################################################
### NEXT #####
### TIDDLERS with EMAIL in TAGS treatment
#################################################################
## SEARCH FOR TODAY MODIFIED TIDDLERS WITH MULTIPLE EMAILS IN TAG
#################################################################
echo "# EXTRACT TODAY TIDDLERS"
tiddlywiki --load $INDEX \
--output ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/ \
--render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-1]]'
## FILTER MY OWN EMAIL
cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/today.${PLAYER}.tiddlers.json | sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' > ~/.zen/tmp/${MOATS}/@tags.json 2>/dev/null
[[ $? != 0 ]] && echo "NO EXTRA TIDDLERS TODAY" && exit 0
echo "******************TIDDLERS with EMAIL in TAGS treatment"
#~ cat ~/.zen/game/players/${PLAYER}/G1CopierYoutube/${G1PUB}/${PLAYER}.tiddlers.json | sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' > ~/.zen/tmp/${MOATS}/@tags.json
## EXTRACT NOT MY EMAIL
while read LINE; do
echo "---------------------------------- PalPAY for Tiddler"
TCREATED=$(echo $LINE | jq -r .created)
TTITLE=$(echo $LINE | jq -r .title)
TTAGS=$(echo $LINE | jq -r .tags)
echo "$TTITLE"
## Count emails found
emails=($(echo "$TTAGS" | grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
nb=${#email[@]}
## Get first zmail
ZMAIL="${email}"
MSG="+ $nb G1 TO ${email[@]}"
echo $MSG
ASTROTW="" STAMP="" ASTROG1="" ASTROIPFS="" ASTROFEED=""
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${ZMAIL}) ## export ASTROTW and more
if [[ ${ASTROG1} && ${ASTROG1} != ${G1PUB} ]]; then
## SEND nb JUNE TO ALL
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a $nb -p ${ASTROG1} -c "${email[@]} $TTITLE" -m > /dev/null 2>&1 ## PalPay $nb G1
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "OK PalPay : $MSG"
echo "PAYMENT SENT"
else
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "ERREUR PalPay : ${TTITLE} : IMPOSSIBLE DE TROUVER ${email[@]}"
echo "NO ACCOUNT FOUND"
fi
done < ~/.zen/tmp/${MOATS}/@tags.json
echo "****************************************"
rm -Rf $HOME/.zen/tmp/${MOATS}
exit 0

View File

@ -1,203 +0,0 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
# Create G1VOEU TW for PLAYER
# Mon Titre => G1MonTitre => PEPPER
## PARAM : "TITRE DU VOEU" "PLAYER" "INDEX"
################################################################################
TITRE="$1"
PLAYER="$2"
INDEX="$3"
[[ $PLAYER == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ $PLAYER == "" ]] && echo "Second paramètre PLAYER manquant" && exit 1
PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null)
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null)
[[ $G1PUB == "" ]] && echo "Troisième paramètre G1PUB manquant" && exit 1
[[ ! $INDEX ]] && INDEX="$HOME/.zen/game/players/$PLAYER/ipfs/moa/index.html"
[[ ! -s $INDEX ]] && echo "TW $PLAYER manquant" && exit 1
echo "Working on $INDEX"
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
[[ $ASTRONAUTENS == "" ]] && echo "CLEF IPNS ASTRONAUTE MANQUANTE - EXIT -" && exit 1
echo "Bienvenue $PSEUDO ($PLAYER) : $G1PUB"
echo
######################################################################
#####################################################
# CREATION DU TW G1VOEU
#####################################################
SALT=$(${MY_PATH}/../tools/diceware.sh 3 | xargs)
echo "$SALT"
echo "## TITRE DE VOTRE VOEU ? CapitalGluedWords"
[[ ! $TITRE ]] && read TITRE
PEPPER=$(echo "$TITRE" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
echo "$PEPPER" && [[ ! $PEPPER ]] && echo "EMPTY PEPPER - ERROR" && exit 1
echo "## keygen CLEF DE VOEUX"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/qrtw.dunikey "$SALT" "$PEPPER"
WISHKEY=$(cat ~/.zen/tmp/qrtw.dunikey | grep "pub:" | cut -d ' ' -f 2)
echo "WISHKEY (G1PUB) = $WISHKEY"
echo "# NOUVEAU VOEU"
mkdir -p ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey "$SALT" "$PEPPER"
ipfs key import $WISHKEY -f pem-pkcs8-cleartext ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/qrtw.ipfskey
VOEUNS=$(ipfs key list -l | grep -w "$WISHKEY" | cut -d ' ' -f 1 )
echo "/ipns/$VOEUNS"
## TEST IPFS
ipfs --timeout=30s cat /ipns/$VOEUNS > ~/.zen/tmp/$VOEUNS.json
[[ -s ~/.zen/tmp/$VOEUNS.json ]] && echo "HEY !!! UN CHANNEL EXISTE DEJA POUR CE VOEU ! ~/.zen/tmp/$VOEUNS.json - EXIT -" && exit 1
echo "# UPGRADING WORLD WHISHKEY DATABASE"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/game/world/$WISHKEY/
## A la fois Titre du tag et Pepper construction de clef
echo $PEPPER > ~/.zen/game/world/$WISHKEY/.pepper
echo "# CREATION QR CODE"
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png" "$LIBRA/ipns/$VOEUNS"
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.ASTROLINK.png" "$LIBRA/ipns/$ASTRONAUTENS"
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1ASTRO.png" "$G1PUB"
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png" "$WISHKEY"
qrencode -s 12 -o "$HOME/.zen/game/world/$WISHKEY/QR.IPNS.png" "/ipns/$VOEUNS"
#################################
# PREMIER TYPE ~/.zen/tmp/player.png
convert $HOME/.zen/game/world/$WISHKEY/QR.WISHLINK.png -resize 300 ~/.zen/tmp/QRWISHLINK.png
convert ${MY_PATH}/../images/logoastro.png -resize 220 ~/.zen/tmp/ASTROLOGO.png
composite -compose Over -gravity NorthWest -geometry +350+10 ~/.zen/tmp/ASTROLOGO.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
convert -gravity northwest -pointsize 20 -fill black -draw "text 320,250 \"$PLAYER\"" ~/.zen/tmp/one.png ~/.zen/tmp/hop.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 20,320 \"$PEPPER\"" ~/.zen/tmp/hop.png ~/.zen/tmp/pseudo.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"$SALT\"" ~/.zen/tmp/pseudo.png ~/.zen/tmp/salt.png
convert -gravity northwest -pointsize 33 -fill black -draw "text 320,350 \"$PEPPER\"" ~/.zen/tmp/salt.png ~/.zen/tmp/player.png
#################################
# SECOND TYPE ~/.zen/tmp/voeu.png
convert $HOME/.zen/game/world/$WISHKEY/QR.G1WISH.png -resize 300 ~/.zen/tmp/G1WISH.png
convert ${MY_PATH}/../images/logojeu.png -resize 260 ~/.zen/tmp/MIZLOGO.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/G1WISH.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +300+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
composite -compose Over -gravity NorthWest -geometry +320+280 ~/.zen/tmp/MIZLOGO.png ~/.zen/tmp/one.png ~/.zen/tmp/two.png
convert -gravity northwest -pointsize 28 -fill black -draw "text 32,350 \"Ğ1 VOEU\"" ~/.zen/tmp/two.png ~/.zen/tmp/pep.png
convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"$PEPPER\"" ~/.zen/tmp/pep.png ~/.zen/tmp/voeu.png
# IMAGE DANS IPFS
IVOEUPLAY=$(ipfs add -Hq ~/.zen/tmp/player.png | tail -n 1)
IVOEU=$(ipfs add -Hq ~/.zen/tmp/voeu.png | tail -n 1)
# TEXT="<a target='_blank' href='"/ipns/${VOEUNS}"'><img src='"/ipfs/${IVOEUPLAY}"'></a><br><br><a target='_blank' href='"/ipns/${VOEUNS}"'>"${PEPPER}"</a>"
#:[tag[G1CopierYoutube]] [tag[pdf]]
# Contains QRCode linked to G1VoeuTW and BUTTON listing G1Voeux
TEXT="<a target='_blank' href='#:[tag[G1"$PEPPER"]]' ><img src='"/ipfs/${IVOEUPLAY}"'></a>
<br><a target='_blank' href='"/ipns/${VOEUNS}"'>TW G1Voeu "$PLAYER"</a><br><br>
<\$button class='tc-tiddlylink'>
<\$list filter='[tag[G1"${PEPPER}"]]'>
<\$action-navigate \$to=<<currentTiddler>> \$scroll=no/>
</\$list>
Afficher tous vos G1"${PEPPER}"
</\$button>"
# NEW IVEU TIDDLER
echo "## Creation json tiddler : G1${PEPPER} /ipfs/${IVOEU}"
echo '[
{
"created": "'${MOATS}'",
"title": "'${PEPPER}'",
"type": "'text/vnd.tiddlywiki'",
"astronautens": "'/ipns/${ASTRONAUTENS}'",
"wishns": "'/ipns/${VOEUNS}'",
"qrcode": "'/ipfs/${IVOEUPLAY}'",
"decode": "'/ipfs/${IVOEU}'",
"wish": "'${WISHKEY}'",
"g1pub": "'${G1PUB}'",
"text": "'${TEXT}'",
"tags": "'G1Voeu G1${PEPPER} ${PLAYER}'"
}
]
' > ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json
rm -f ~/.zen/tmp/newindex.html
echo "Nouveau Voeu $PEPPER dans MOA $PSEUDO : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
tiddlywiki --verbose --load $INDEX \
--deletetiddlers '[tag[voeu]]' \
--import ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json "application/json" \
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
echo "PLAYER TW Update..."
if [[ -s ~/.zen/tmp/newindex.html ]]; then
echo "$$$ Mise à jour $INDEX"
cp -f ~/.zen/tmp/newindex.html $INDEX
else
echo "ERROR INTO ~/.zen/game/world/$WISHKEY/${PEPPER}.voeu.json"
fi
# PRINTING
LP=$(ls /dev/usb/lp* | head -n1)
if [[ ! $LP ]]; then
echo "NO PRINTER FOUND - Plug a Brother QL700 or Add your printer"
else
echo "IMPRESSION VOEU"
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/player.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/voeu.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
fi
# COPY QR CODE TO PLAYER ZONE
cp ~/.zen/tmp/player.png ~/.zen/tmp/voeu.png ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
echo "$PEPPER" > ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/.title
echo "$LIBRA/ipns/$VOEUNS" > ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/.link
cp ~/.zen/game/world/$WISHKEY/QR.WISHLINK.png ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/
# PUBLISHING
banner="## ${PLAYER} YOUR WISH IS READY TO MAKE Ŋ1 TW FLUX for G1$PEPPER"
echo "ipfs name publish --key=${WISHKEY} $banner"
IPUSH=$(echo "$banner" | ipfs add -q)
ipfs name publish --key=${WISHKEY} /ipfs/$IPUSH 2>/dev/null
echo $IPUSH > ~/.zen/game/players/$PLAYER/voeux/$WISHKEY/.$MOATS.chain
echo
echo "Astronaute TW : $LIBRA/ipns/$ASTRONAUTENS"
echo "Nouveau G1Voeu : $PEPPER (document de contrôle de copie Ŋ1)"
echo "TW $PEPPER : $LIBRA/ipns/$VOEUNS"
echo "## TO RECEIVE G1RONDS Creating Cesium+ Profil #### timeout long ... patience ...."
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/tmp/qrtw.dunikey set --name "G1Voeu $PEPPER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logojune.jpg" --site "$LIBRA/ipns/$VOEUNS" #CESIUM+
[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED !!!!"
echo "************************************************************"
echo "Hop, UNE JUNE pour le Voeu $PEPPER"
echo $MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey pay -a 1 -p $WISHKEY -c \'"$VOEUNS G1Voeu $PEPPER"\' -m
echo "************************************************************"
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey pay -a 1 -p $WISHKEY -c "$VOEUXNS G1Voeu $PEPPER" -m
echo "************************************************************"
exit 0

157
ASTROBOT/N1Kodi.sh Executable file
View File

@ -0,0 +1,157 @@
#!/bin/bash
########################################################################
# Version: 0.5
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# PAD COCODING : https://pad.p2p.legal/s/G1Kodi
# KODI SERVICE : Publish and Merge Friends Kodi Movies into RSS Stream
########################################################################
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
echo "$ME RUNNING"
########################################################################
## LOOK IN TW INDEX for THASH
## DECODE ipfs_one
## SEND MESSAGE TO SOURCEG1PUB
########################################################################
## THIS SCRIPT IS RUN WHEN A WALLET RECEIVED A TRANSACTION WITH COMMENT STARTING WITH N1Kodi:
########################################################################
INDEX="$1"
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2"
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
MOATS="$3"
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPUBKEY="$4"
[[ ! ${IPUBKEY} ]] && echo "ERROR - MISSING COMMAND ISSUER !" && exit 1
TH="$5"
[[ ! ${TH} ]] && echo "ERROR - MISSING COMMAND TITLE HASH ADDRESS !" && exit 1
echo "${PLAYER} : ${IPUBKEY} SEEKING FOR ${TH}
${ASTRONAUTENS} ${G1PUB} "
#~ ###################################################################
#~ ## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
#~ ###################################################################
mkdir -p $HOME/.zen/tmp/${MOATS} && echo $HOME/.zen/tmp/${MOATS}
## EXTRACT TIDDLER
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'TH.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[thash['${TH}']]'
if [[ $(cat ~/.zen/tmp/${MOATS}/TH.json) != "[]" ]]; then
# FOUND GETTING CYPHERED IPFS LINK
TITLE=$(cat ~/.zen/tmp/${MOATS}/TH.json | jq -r '.[].title')
IPFSONE=$(cat ~/.zen/tmp/${MOATS}/TH.json | jq -r '.[].ipfs_one')
echo "${IPFSONE}" | base16 -d > ~/.zen/tmp/${MOATS}/source.one.enc
## DECRYPTING ipfs_one
~/.zen/Astroport.ONE/tools/natools.py decrypt -f pubsec \
-k ~/.zen/game/players/${PLAYER}/secret.dunikey \
-i ~/.zen/tmp/${MOATS}/source.one.enc -o $HOME/.zen/tmp/${MOATS}/source.one
DECIPFS=$(cat $HOME/.zen/tmp/${MOATS}/source.one)
echo "${TITLE} = ${DECIPFS}"
## TODO CREATE A TEMP IPNS KEY ?!
## SENDING GCHANGE & CESIUM+ MESSAGE
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n ${myDATA} send -d "${IPUBKEY}" -t "${TITLE}" -m "N1Kodi : https://${myTUBE}${DECIPFS}"
$MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n ${myCESIUM} send -d "${IPUBKEY}" -t "${TITLE}" -m "N1Kodi : https://${myTUBE}${DECIPFS}"
else
echo "NO TIDDLER WITH ${TH}"
exit 1
fi
exit 0
## TODO CREATE FROM FRIEND LOCAL KODI RSS
#~ echo '<?xml version="1.0" encoding="UTF-8" ?>
#~ <rss version="2.0">
#~ <channel>
#~ <title>RSS ASTROPORT</title>
#~ <description>Astroport Kodi RSS feed</description>
#~ <link>https://www.copylaradio.com</link>
#~ <copyright>2020 Astroport.com FOSS</copyright>
#~ <lastBuildDate>Mon, 6 Sep 2020 00:01:00 +0000</lastBuildDate>
#~ <pubDate>Sun, 6 Sep 2020 16:20:00 +0000</pubDate>
#~ <ttl>1800</ttl>
#~ ' > ~/.zen/tmp/${MOATS}/movie.rss
#~ find ~/.zen/game/players/${PLAYER}/FRIENDS -mindepth 1 -maxdepth 1 -type d | rev | cut -f 1 -d '/' | rev > ~/.zen/tmp/${MOATS}/twfriends
#~ ## SCAN ALL "_APLAYER.tiddlers.json"
#~ for FILE in $(ls ${N1PATH}/*.tiddlers.json); do
#~ APLAYER=$(echo "$FILE" | rev | cut -d '.' -f 3- | cut -d '_' -f 1 | rev )
#~ [[ ${APLAYER} == ${PLAYER} ]] && echo "My Movie List" && continue
#~ ## EXTRACT all titles to do JQ LOOP
#~ cat ${FILE} | jq -r .[].title > ~/.zen/tmp/${MOATS}/${APLAYER}.movie.id
#~ while read TITLE; do
#~ ## GET AG1PUB FROM FRIEND TW
#~ ## BUG !!!
#~ TITRE=$(cat ${FILE} | jq -r .[].titre)
#~ SUB=$(cat ${FILE} | jq -r .[].sub)
#~ IPFSONE=$(cat ${FILE} | jq -r .[].ipfs_one)
#~ echo "${IPFSONE}" | base16 -d > ~/.zen/tmp/${MOATS}/source.one.enc
#~ ~/.zen/Astroport.ONE/tools/natools.py decrypt -f pubsec \
#~ -k ~/.zen/game/players/${PLAYER}/secret.dunikey \
#~ -i ~/.zen/tmp/${MOATS}/source.one.enc -o $HOME/.zen/tmp/${MOATS}/source.one
#~ SOURCE=$(cat ${FILE} | jq -r .[].source)
#~ IPFS_ME=$(cat ${FILE} | jq -r .[].ipfs_${player})
#~ echo '
#~ <item>
#~ <title>'${TITRE}'</title>
#~ <description>'${SUB}'</description>
#~ <link>http://ipfs.localhost:8080/ipfs/QmQwYpoHX6Fw26nd3KFfLj71Uv34riT4F5X2RFy2rmHekW</link>
#~ <pubDate>Sun, 6 Sep 2022 16:20:00 +0000</pubDate>
#~ </item>' >> ~/.zen/tmp/${MOATS}/movie.rss
#~ done < ~/.zen/tmp/${MOATS}/${APLAYER}.movie.id
#~ done
#~ ## EXTRACT and DECODE ipfs_AG1PUB from FRIENDS json's
#~ echo '
#~ </channel>
#~ </rss>
#~ ' >> ~/.zen/tmp/${MOATS}/movie.rss
#~ ## UPDATE LOCAL KODI WITH
#~ ## ./userdata/mediasources.xml
#~ ## ./userdata/sources.xml

View File

@ -1,220 +0,0 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## Publish All PLAYER TW,
# Run TAG subprocess: tube, voeu
############################################
echo "## RUNNING PLAYER.refresh"
PLAYERONE="$1"
[[ $isLAN ]] && PLAYERONE=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ! $PLAYERONE ]] && PLAYERONE=($(ls -t ~/.zen/game/players/ | grep -Ev "localhost" 2>/dev/null))
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
[[ ! -d ~/.zen/game/players/$PLAYER ]] && echo "BAD $PLAYERONE" && continue
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
[[ ! $(echo "$PLAYER" | grep '@') ]] && continue
mkdir -p ~/.zen/tmp/${MOATS}
echo "##################################################################"
echo ">>>>> PLAYER : $PLAYER >>>>>>>>>>>>> REFRESHING TW STATION"
echo "##################################################################"
# Get PLAYER wallet amount
COINS=$($MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey balance)
echo "+++ WALLET BALANCE _ $COINS (G1) _"
#~ ## IF WALLET IS EMPTY : WHAT TODO ?
echo "##################################################################"
echo "##################################################################"
echo "################### REFRESH ASTRONAUTE TW ###########################"
echo "##################################################################"
PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/$PLAYER/.playerns 2>/dev/null)
## REFRESH ASTRONAUTE TW
ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "WARNING No $PLAYER in keystore --" && ASTRONAUTENS=$ASTRONS
## VISA EMITER STATION MUST ACT ONLY
[[ ! -f ~/.zen/game/players/$PLAYER/secret.dunikey ]] && echo "$PLAYER secret.dunikey NOT HERE CONTINUE -- " \
&& mv ~/.zen/game/players/$PLAYER ~/.zen/game/players/.$PLAYER && continue
## MY PLAYER
ipfs key export $G1PUB -o ~/.zen/tmp/${MOATS}/$PLAYER.key
[[ ! $(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) ]] && ipfs key import $PLAYER ~/.zen/tmp/${MOATS}/$PLAYER.key
rm -f ~/.zen/tmp/${MOATS}/$PLAYER.key
## REFRESH CACHE
rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
echo "Getting latest online TW..."
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
echo "/ipns/$ASTRONAUTENS ON $LIBRA"
ipfs --timeout 60s get -o ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html /ipns/$ASTRONAUTENS \
|| curl -m 60 -so ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$LIBRA/ipns/$ASTRONAUTENS" \
|| cp ~/.zen/game/players/$PLAYER/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
## PLAYER TW IS ONLINE ?
if [ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ]; then
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "ERROR_PLAYERTW_OFFLINE : /ipns/$ASTRONAUTENS"
echo "------------------------------------------------"
echo "MANUAL PROCEDURE NEEDED"
echo "------------------------------------------------"
echo "$myIPFS/ipfs/"
echo "/ipfs/"$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.chain.* | tail -n 1)
echo "ipfs name publish -t 24h --key=$PLAYER ..."
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
continue
else
## FOUND TW
#############################################################
## CHECK WHO IS ACTUAL OFFICIAL GATEWAY
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json ]] && echo "${PLAYER} MadeInZion : BAD TW (☓‿‿☓) " && continue
player=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
[[ $player == $PLAYER ]] \
&& echo "$PLAYER OFFICIAL TW - (⌐■_■) -" \
|| ( echo "BAD PLAYER=$player in TW" && continue)
fi
#############################################################
## GWIP == myIP or TUBE !!
#############################################################
# Connect_PLAYER_To_Gchange.sh : Sync FRIENDS TW
##############################################################
echo "##################################################################"
echo "## GCHANGE+ & Ŋ1 EXPLORATION: Connect_PLAYER_To_Gchange.sh"
${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "$PLAYER"
# VOEUX.create.sh
##############################################################
## SPECIAL TAG "voeu" => Creation G1Voeu (G1Titre) makes AstroBot TW G1Processing
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$PLAYER"
# VOEUX.refresh.sh
##############################################################
## RUN ASTROBOT G1Voeux SUBPROCESS (SPECIFIC Ŋ1 COPY)
##############################################################
${MY_PATH}/VOEUX.refresh.sh "$PLAYER" "$MOATS" ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
##############################################################
## CHECK G1PALPAY TO MAKE
${MY_PATH}/G1PalPay.sh ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$PLAYER"
##################################
echo "# TW : GW API + LightBeam Feed + Friends"
TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
[[ ! $FEEDNS ]] && FEEDNS=$(ipfs key gen "${PLAYER}_feed")
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
###########################
# Modification Tiddlers de contrôle de GW & API
#~ echo '[{"title":"$:/ipfs/saver/api/http/localhost/5001","tags":"$:/ipfs/core $:/ipfs/saver/api","text":"'$(myPlayerApiGw)'"}]' > ~/.zen/tmp/${MOATS}/5001.json
#~ echo '[{"title":"$:/ipfs/saver/gateway/http/localhost","tags":"$:/ipfs/core $:/ipfs/saver/gateway","text":"'$myIPFS'"}]' > ~/.zen/tmp/${MOATS}/8080.json
FRIENDSFEEDS=$(cat ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/FRIENDSFEEDS 2>/dev/null)
echo "FRIENDS qo-op FEEDS : "${FRIENDSFEEDS}
## export FRIENDSFEEDS from Gchange stars
echo '[{"title":"$:/plugins/astroport/lightbeams/state/subscriptions","text":"'${FRIENDSFEEDS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/friends.json
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
--import "$HOME/.zen/tmp/${MOATS}/friends.json" "application/json" \
--output ~/.zen/tmp/${IPFSNODEID}/${PLAYER} --render "$:/core/save/all" "newindex.html" "text/plain"
[[ -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/newindex.html
###########################
####################
## ANY CHANGES ?
##############################################################
DIFF=$(diff ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html)
if [[ $DIFF ]]; then
echo "DIFFERENCE DETECTED !! "
echo "Backup & Upgrade TW local copy..."
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
fi
##############################################################
##################################################
##################################################
################## UPDATING PLAYER MOA
[[ $DIFF ]] && cp ~/.zen/game/players/$PLAYER/ipfs/moa/.chain \
~/.zen/game/players/$PLAYER/ipfs/moa/.chain.$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.moats)
TW=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1)
ipfs name publish --allow-offline -t 24h --key=$PLAYER /ipfs/$TW
[[ $DIFF ]] && echo $TW > ~/.zen/game/players/$PLAYER/ipfs/moa/.chain
echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/moa/.moats
echo "================================================"
echo "$PLAYER : $myIPFS/ipns/$ASTRONAUTENS"
echo " = /ipfs/$TW"
echo "================================================"
######################### PLAYER_feed
IFRIENDHEAD="$(cat ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/IFRIENDHEAD 2>/dev/null)"
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
echo "IFRIENDHEAD :" ${IFRIENDHEAD}
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
# cp -f ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ~/.zen/game/players/$PLAYER/FRIENDS/${FPLAYER}.rss.json
[[ -d ~/.zen/game/players/$PLAYER/FRIENDS ]] \
&& cat ${MY_PATH}/../www/iframe.html | sed "s~_ME_~/ipns/${ASTRONAUTENS}~g" | sed "s~_IFRIENDHEAD_~${IFRIENDHEAD}~g" > ~/.zen/game/players/$PLAYER/FRIENDS/index.html
[[ -s ~/.zen/game/players/$PLAYER/FRIENDS/index.html ]] \
&& FRAME=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/FRIENDS/index.html | tail -n 1) \
&& ipfs name publish --allow-offline -t 24h --key="${PLAYER}_feed" /ipfs/$FRAME
done
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
# Scan local cache
if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
## Merge actual online version
ipfs get -o ~/.zen/tmp/${IPFSNODEID} /ipns/${IPFSNODEID}/
## MAP CACHE CLEANING
rm -f ~/.zen/tmp/${IPFSNODEID}/*TW.json
############################################
NSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
[[ $BSIZE != $NSIZE ]] \
&& ROUTING=$(ipfs add -rwHq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 ) \
&& echo "PUBLISH BALISE STATION /ipns/${IPFSNODEID} = $NSIZE octets" \
&& ipfs name publish --allow-offline -t 24h /ipfs/$ROUTING
fi
echo "PLAYER.refresh DONE."
exit 0

View File

@ -1,15 +0,0 @@
#!/bin/bash
########################################################################
# Version: 0.4
# 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##*/}"
## AUTONOMOUS BOT
# SEARCH FOR "voeu" TAG to create "g1voeu" TW
# PLAYER G1VOEU NAME is considered as "tag" searh in Ŋ1
# PARAM = tag / PLAYER
# Search for "g1tag"

View File

@ -1,136 +0,0 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
# Inspect game wishes, refresh latest IPNS version
# SubProcess Backup and chain
PLAYER="$1" ## IPNS KEY NAME - G1PUB - PLAYER ...
[[ ! ${PLAYER} ]] && echo "Please provide IPFS publish key" && exit 1
MOATS="$2"
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
## REFRESH ASTRONAUTE TW
ASTRONAUTENS=$(ipfs key list -l | grep ${PLAYER} | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "WARNING No ${PLAYER} in keystore --" && ASTRONAUTENS=$ASTRONS
[[ ! $ASTRONAUTENS ]] && echo "Missing ${PLAYER} IPNS KEY - CONTINUE --" && exit 1
INDEX="$3"
[[ ! $INDEX ]] && INDEX="$HOME/.zen/game/players/${PLAYER}/ipfs/moa/index.html"
[[ ! -s $INDEX ]] && echo "TW ${PLAYER} manquant" && exit 1
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
###############################
## EXTRACT G1Voeu from PLAYER TW
echo "Exporting ${PLAYER} TW [tag[G1Voeu]]"
rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json
tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu --render '.' "${PLAYER}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]'
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] && echo "AUCUN G1VOEU - EXIT -" && exit 0
cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
echo "VOEUX : ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt "$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt | wc -l)
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
## GET VoeuTitle LIST
while read WISH
do
[[ ${WISH} == "" || ${WISH} == "null" ]] && continue
echo "==============================="
echo "G1Voeu ${WISH}"
## Get ${WISHNAME} TW
WISHNAME=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .title')
[[ ! ${WISHNAME} ]] && echo "WISH sans NOM - CONTINUE -" && continue
VOEUNS=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .wishns')
VOEUKEY=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .wish')
## SIGNALING WISH G1PUB
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${WISH}
##########################################################################
##########################################################################
## RUN SPECIFIC G1Voeu ASTROBOT PROGRAM (like G1CopierYoutube.sh)
if [[ -s $MY_PATH/G1${WISHNAME}.sh ]]; then
echo "........................ Astrobot G1${WISHNAME}.sh program found !"
echo "________________________________ Running it *****"
${MY_PATH}/G1${WISHNAME}.sh "$INDEX" "${PLAYER}" "$MOATS"
echo "________________________________ Finished ******"
else
echo "......................... G1${WISHNAME} REGULAR Ŋ1 RSS JSON"
fi
##########################################################################
##########################################################################
## RUN TW Ŋ1 search & copy treatment
echo "*********************************"
##################################
## Search for [tag[G1${WISHNAME}]] in all Friends TW.
## Copy tiddlers ...
##################################
echo "NOW SEARCH Ŋ1 FRIENDS TW's FOR tag=G1${WISHNAME}"
echo "ls ~/.zen/game/players/${PLAYER}/FRIENDS/*/index.html"
echo "*********************************"
## Search in Local World (NB! G1Voeu TW copied by Connect_PLAYER_To_Gchange.sh)
FINDEX=($( ls $HOME/.zen/game/players/${PLAYER}/FRIENDS/*/index.html))
for FRIENDTW in ${FINDEX[@]};
do
[[ ! -s $FRIENDTW ]] && echo "$FRIENDTW VIDE (AMI SANS TW)" && continue
APLAYER=$(ls $FRIENDTW | cut -d '/' -f 7)
rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${APLAYER}.tiddlers.json
echo "TRY EXPORT [tag[G1${WISHNAME}]] FROM $FRIENDTW"
tiddlywiki --load $FRIENDTW \
--output ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME} --render '.' ${APLAYER}'.tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]]'
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${APLAYER}.tiddlers.json ]] && echo "NO ${WISHNAME} - CONTINUE -" && continue
[[ $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${APLAYER}.tiddlers.json) == "[]" ]] && echo "EMPTY ${WISHNAME} - CONTINUE -" && continue
echo "## TIDDLERS FOUND ;) MIAM >>> (◕‿‿◕) <<<"
echo ">>> RSS YEAH § ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${APLAYER}.tiddlers.json"
done
##################################
echo ">>> MOA § ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${PLAYER}.tiddlers.json"
tiddlywiki --load $INDEX \
--output ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME} \
--render '.' ${PLAYER}'.tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]]'
### PREPARE WISHNAME index.html
cat $MY_PATH/../templates/index_gif4.html \
| sed -e "s~_LIBRA_~$(myIpfsGw)~g" -e "s~_G1VOEU_~${WISHNAME}~g" -e "s~_PLAYER_~${PLAYER}~g" -e "s~_VOEUNS_~${VOEUNS}~g" \
> ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/index.html
### ADD TO IPFS
echo "++WISH PUBLISHING++ ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/*"
JSONIPFS=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* | tail -n 1) # ADDING JSONS TO IPFS
ipfs name publish -k $VOEUKEY /ipfs/$JSONIPFS # PUBLISH $VOEUKEY
## MOVE INTO PLAYER AREA
echo "Ŋ1 FLUX $(myIpfsGw)${VOEUNS}"
echo "~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}"
mv -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/
done < ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
############################################
exit 0

320
ASTROBOT/_ForkUPlanetZERO.sh Executable file
View File

@ -0,0 +1,320 @@
#!/bin/bash
########################################################################
# 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##*/}"
. "${MY_PATH}/../tools/my.sh"
## IT SEARCH FOR CURRENT TW ForkUPlanetZERO tag
## IT MAKES $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key
## IT CHECKS FOR SAME UPNAME WISH IN FRIENDS TW
#~ echo "(✜‿‿✜) CURRENT Fork UPlanet
#~ This program makes Player generate or join a private IPFS swarm
#~ All friends with the same wish will share the SECRET
#~ then any can activate a new ipfs daemon connected to that private ZONE
## TIDDLER can contain parameters for UPlanet activation
echo "$ME RUNNING"
CURRENT=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
########################################################################
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
ORIGININDEX=${INDEX}
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
echo "${PLAYER} ${INDEX} ${ASTRONAUTENS} ${G1PUB} "
mkdir -p $HOME/.zen/tmp/${MOATS}
PLAYERPUB=$(cat $HOME/.zen/game/players/${PLAYER}/secret.dunikey | grep pub | cut -d ' ' -f 2)
[[ "${PLAYERPUB}" == "" ]] && echo "FATAL ERROR PLAYER KEY MISSING" && exit 1
###################################################################
## tag[ForkUPlanetZERO] TW EXTRACTION
###################################################################
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'G1ForkUPlanetZERO.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[ForkUPlanetZERO]]'
## KEEP ONLY ONE tag[ForkUPlanetZERO] WISH !
echo "PREPARE INLINE JSON : cat ~/.zen/tmp/${MOATS}/G1ForkUPlanetZERO.json | jq -rc .[]"
cat ~/.zen/tmp/${MOATS}/G1ForkUPlanetZERO.json \
| jq -rc .[] | head -n 1 > ~/.zen/tmp/${MOATS}/ONEuplanet.json
JSONUPLANET="${HOME}/.zen/tmp/${MOATS}/ONEuplanet.json"
[[ ! -s ${JSONUPLANET} ]] \
&& echo "NO tag[ForkUPlanetZERO] for $PLAYER" && exit 0
UPNAME=$(cat ${JSONUPLANET} | jq -r ".title") # What name is given ?
[[ "${UPNAME}" == "null" || "${UPNAME}" == "" ]] \
&& echo "NO FORK UPLANET NAME .title MISSING" && exit 1
HASH=$(cat ${JSONUPLANET} | jq -r ".hash") ## What text hash it has ?
SECRET=$(cat ${JSONUPLANET} | jq -r ".secret") ## What is secret ?
CONTRACT=$(cat ${JSONUPLANET} | jq -r ".text") ## What contract is applying ?
[[ "${CONTRACT}" == "null" || "${CONTRACT}" == "" ]] && CONTRACT="☼☼☼☼☼ floating points ☼☼☼☼☼"
AHAH=$(echo $CONTRACT | sha512sum | cut -d ' ' -f 1)
echo "%%% CONTRACT HASH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "$AHAH"
echo "$HASH"
[[ $AHAH != $HASH ]] && echo " - WARNING - CONTRACT CHANGED - WARNING -"
## CHECK EXISTING ${UPNAME}.swarm.key
[[ ! -s $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key ]] \
&& MSG=$MSG" ${PLAYER}/.ipfs/${UPNAME}.swarm.key NOT FOUND" && ERR="NO LOCAL KEY"
## CREATE 32 octets swarm.key ( maximum individual Fork : octal 8^32 = decimal 7,922816251×10^28 )
echo -e '/key/swarm/psk/1.0.0/\n/base16/' > $HOME/.zen/tmp/${MOATS}/swarm.key
head -c 32 /dev/urandom | od -t x1 -A none - | tr -d '\n ' >> $HOME/.zen/tmp/${MOATS}/swarm.key
echo '' >> $HOME/.zen/tmp/${MOATS}/swarm.key
## EXTRACT CURRENT SECRET FROM JSONUPLANET
# which is PLAYER pub encrypted base16 of swarm.key
###################################################
## check if we have a player slot with cyphered key
IN16=$(cat ${JSONUPLANET} | jq -r '."${PLAYER}"')
## secret is only decrypted by wish source player
[[ ${IN16} == "" || ${IN16} == "null" ]] \
&& IN16=$(cat ${JSONUPLANET} | jq -r ".secret") && echo "get IN16 from secret field"
if [[ ${IN16} == "" || ${IN16} == "null" ]]; then
echo "NO SECRET FOUND" \
&& echo ">> 🔑 ${UPNAME} SECRET SWARM.KEY GENERATION 🔑" \
&& cat $HOME/.zen/tmp/${MOATS}/swarm.key \
&& cp $HOME/.zen/tmp/${MOATS}/swarm.key $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key \
&& echo "------- KEY LOADED -----> ${PLAYER}/.ipfs/${UPNAME}.swarm.key"
## THIS IS A PRIMAL TIDDLER
else
echo "VERIFICATION ${IN16}"
## DEBASE16
echo "${IN16}" | base16 -d \
> ~/.zen/tmp/${MOATS}/swarmkey.crypted
echo ">> natools.py decrypt "
## DECODING with PLAYER secret.dunikey
${MY_PATH}/../tools/natools.py decrypt \
-f pubsec \
-k $HOME/.zen/game/players/${PLAYER}/secret.dunikey \
-i ~/.zen/tmp/${MOATS}/swarmkey.crypted \
-o ~/.zen/tmp/${MOATS}/swarmkey.decrypted
echo ">> comparing decrypted key"
## CHEK KEY WITH ACTUAL ONE
[[ $(diff ~/.zen/tmp/${MOATS}/swarmkey.decrypted $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key) ]] \
&& echo "- 📸 WARNING 📸 - UPDATING ${UPNAME}.swarm.key ..." && ERR="TW SWARM CHANGED"
## UPDATE PLAYER LOCAL SWARMKEY FROM VALUE FOUND IN HIS OWN WISH TIDDLER !
[[ -s ~/.zen/tmp/${MOATS}/swarmkey.decrypted ]] \
&& cp ~/.zen/tmp/${MOATS}/swarmkey.decrypted \
$HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key \
&& echo "PLAYER ${UPNAME}.swarm.key IS VALID" \
|| { echo "ERROR PLAYER ${UPNAME}.swarm.key IS NOT VALID"; exit 1; }
fi
#~ (RE)CREATE SECRET
${MY_PATH}/../tools/natools.py encrypt \
-p ${PLAYERPUB} \
-i $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key \
-o $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key.enc
ENCODING=$(cat $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key.enc | base16)
rm $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key.enc
echo "==> base16 ${PLAYER} encrypted swarm.key is secret"
#~ echo "${SECRET}"
#~ echo "${ENCODING}"
#################################################################
## MAKE KEY ENCODING FOR FRIENDS
friends=($(ls ~/.zen/game/players/${PLAYER}/FRIENDS | grep "@" 2>/dev/null))
for f in ${friends[@]};
do
## Extract FRIENDG1PUB from TW (Astroport Tiddler)
ftw=${HOME}/.zen/game/players/${PLAYER}/FRIENDS/${f}/index.html
[[ ! -s ${ftw} ]] && echo "FRIENDS/${f} : $(cat "$HOME/.zen/game/players/${PLAYER}/FRIENDS/${f}")" && continue
## Check if "f=PRESIDENT" in my friend "email" TW
tiddlywiki --load ${ftw} --output ~/.zen/tmp/${MOATS} --render '.' "${f}_.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${f}"
PRESIDENT=$(cat ~/.zen/tmp/${MOATS}/${f}_.json | jq -r .[].president)
[[ ${PRESIDENT} != ${f} ]] && echo "${f} Astroport is run by ${PRESIDENT}... No fork..." && continue
## Check if Astroport is different from my node
tiddlywiki --load ${ftw} --output ~/.zen/tmp/${MOATS} --render '.' "${f}_Astroport.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
FRIENDG1PUB=$(cat ~/.zen/tmp/${MOATS}/${f}_Astroport.json | jq -r .[].g1pub)
echo "___________________"
echo "$f : $FRIENDG1PUB"
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/${f}_Astroport.json | jq -r .[].astroport)
[[ ${ASTROPORT} != "/ipns/${IPFSNODEID}" ]] \
&& echo "FOREIGN ASTROPORT=${ASTROPORT}" \
&& foreign="YES" \
&& ASTROPORTS=("${ASTROPORTS[@]}" "${ASTROPORT}")
if [[ ${FRIENDG1PUB} && ${FRIENDG1PUB} != "null" ]]; then
#~ CHECK IF player ALREADY IN JSON
echo "cat ${JSONUPLANET} | jq -r '.\"${f}\"'"
FRIENDIN=$(cat ${JSONUPLANET} | jq -r '."${f}"')
[[ "${FRIENDIN}" != "null" && "${FRIENDIN}" != "" ]] \
&& echo "${FRIENDIN} ALREADY IN FORK ${UPNAME} TIDDLER." \
&& continue
echo "#~ Create FRIENDG1PUB encrypted version of swarm.key"
${MY_PATH}/../tools/natools.py encrypt \
-p ${FRIENDG1PUB} \
-i $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key \
-o $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.${f}.swarm.key.enc
FENCODING=$(cat $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.${f}.swarm.key.enc | base16)
rm $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.${f}.swarm.key.enc
echo "## Addd email=crypt(swarmkey) field to ${JSONUPLANET} tiddler."
cat ${JSONUPLANET} | jq '. | ."_f_" = "_FENCODING_"' > ~/.zen/tmp/${MOATS}/json.up \
&& sed -i 's/_f_/'"$f"'/g; s/_FENCODING_/'"$FENCODING"'/g' ~/.zen/tmp/${MOATS}/json.up \
&& mv ~/.zen/tmp/${MOATS}/json.up ${JSONUPLANET}
else
echo "- FATAL ERROR - Friend TW ${ftw} is broken !!"
continue
fi
if [[ ${foreign} == "YES" ]]; then
echo "## Check if friend have an ${UPNAME} tiddler and that secret is the same"
## SEARCH FOR ${UPNAME} tiddler IN FRIEND TW
tiddlywiki --load ${ftw} --output ~/.zen/tmp/${MOATS} \
--render '.' "${f}_${UPNAME}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${UPNAME}"
## CONTROL SWARMKEY DECODING (must be equal)
OUT16=$(cat ~/.zen/tmp/${MOATS}/${f}_${UPNAME}.json | jq -r '[]."'${PLAYER}'"')
echo "${IN16}"
echo "${OUT16}"
[[ ${IN16} == ${OUT16} ]] \
&& echo "OK STATIONS +1 : TW sharing the same wish. " \
&& OKSTATIONS=("${OKSTATIONS[@]}" "${ASTROPORT}") \
|| echo "NO GOOD! TW not synchronized."
foreign=""
fi
done
ZENSTATIONS=($(echo "${OKSTATIONS[@]}" | tr ' ' '\n' | sort -u)) ## REMOVE DUPLICATE
echo "<<< My Friends are located in ${#ASTROPORTS[@]} ASTROPORT(s) : ${#ZENSTATIONS[@]} are OK >>>"
## IPFSNODEID IS FORKING TO NEW UPLANET
if [[ ${#ZENSTATIONS[@]} -ge 3 ]]; then
echo "UPlanet.ZERO /// ENTERING WARPING ZONE /// ${UPNAME} ACTIVATION"
## HERE each PLAYER share the same wish
# only secret field is "!=" in each, as it is self encoding key
# we must find our email="The same" in each friends TW
## CONTROL
# round looking in friends TW... Can be done before...
## APPLY ?!
##################################################
# Let's engage Astroport.ONE code mutation...
# tools/my.sh
SECRETNAME=$(cat $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key | tail -n 1)
echo "SECRETNAME=$SECRETNAME"
#######################################################################
echo "# UPlanet Swarm Bootstrap Stations #
# https://ipfs.${UPNAME} ipfs.${UPNAME}
#################################################################
" > ~/.zen/tmp/${MOATS}/new_straps.list
# Prepare "new_straps.list" from WAN only
for station in ${ZENSTATIONS[@]}; do
[[ ! -s ~/.zen/tmp/swarm/${station}/myIPFS.txt ]] \
&& echo "Missing swarm/${station}/myIPFS.txt" \
&& continue
bootnode=$(cat ~/.zen/tmp/swarm/${station}/myIPFS.txt)
echo "${bootnode}"
iptype=$(echo ${bootnode} | cut -d '/' -f 2)
nodeip=$(echo ${bootnode} | cut -d '/' -f 3)
isnodeipLAN=$(echo $nodeip | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
echo " ${iptype} address :: ${nodeip} (= ${isnodeipLAN})"
[[ ${nodeip} == ${isnodeipLAN} ]] && echo "LAN NODE... no good for bootstrap" && continue
echo "### OK adding to new_straps.list"
echo "${bootnode}" >> ~/.zen/tmp/${MOATS}/new_straps.list
done
## INTRODUCE NEW BOOSTRAP LIST
cp ~/.zen/tmp/${MOATS}/new_straps.list ~/.zen/game/MY_boostrap_nodes.txt
#######################################################################
# make G1PalPay refuse not from "UPlanet Master Key" primal TX
# STABLE COIN : activate OpenCollective sync
# and adapt 20H12.process.sh
## UPNAME = domain.tld
# PACTHING Astroport.ONE code
grep -rl --exclude-dir='.git*' 'copylaradio.com' ~/.zen | xargs sed -i "s~copylaradio.com~${UPNAME,,}~g"
rm ~/.zen/game/myswarm_secret.dunikey
# now we add key into ~/.ipfs/swarm.key
#~ cp $HOME/.zen/game/players/${PLAYER}/.ipfs/${UPNAME}.swarm.key ~/.ipfs/swarm.key
# it will make IPFSNODEID restarting in private mode
fi
## UPDATE JSONUPLANET
cat ${JSONUPLANET} | jq '. | ."UPname" = "_UPNAME_"' > ~/.zen/tmp/${MOATS}/json.up \
&& sed -i 's/_UPNAME_/'"$UPNAME"'/g' ~/.zen/tmp/${MOATS}/json.up \
&& mv ~/.zen/tmp/${MOATS}/json.up ${JSONUPLANET}
cat ${JSONUPLANET} | jq '. | ."hash" = "_HASH_"' > ~/.zen/tmp/${MOATS}/json.up \
&& sed -i 's/_HASH_/'"$AHAH"'/g' ~/.zen/tmp/${MOATS}/json.up \
&& mv ~/.zen/tmp/${MOATS}/json.up ${JSONUPLANET}
cat ${JSONUPLANET} | jq '. | ."secret" = "_SECRET_"' > ~/.zen/tmp/${MOATS}/json.up \
&& sed -i 's/_SECRET_/'"$ENCODING"'/g' ~/.zen/tmp/${MOATS}/json.up \
&& mv ~/.zen/tmp/${MOATS}/json.up ${JSONUPLANET}
jq '.[] + {created: $MOATS, modified: $MOATS}' --arg MOATS "$MOATS" "${JSONUPLANET}" > ~/.zen/tmp/${MOATS}/json.up \
&& mv ~/.zen/tmp/${MOATS}/json.up ${JSONUPLANET}
### PUT BACK IN TW
tiddlywiki --load ${INDEX} \
--import ${JSONUPLANET} "application/json" \
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "newindex.html" "text/plain"
if [[ -s ~/.zen/tmp/${MOATS}/newindex.html ]]; then
[[ $(diff ~/.zen/tmp/${MOATS}/newindex.html ${INDEX} ) ]] \
&& mv ~/.zen/tmp/${MOATS}/newindex.html ${INDEX} \
&& echo "===> Mise à jour ${INDEX}"
cat ${JSONUPLANET} | jq
else
echo "Problem with tiddlywiki command. Missing ~/.zen/tmp/${MOATS}/newindex.html"
echo "XXXXXXXXXXXXXXXXXXXXXXX"
fi
rm -Rf ~/.zen/tmp/${MOATS}
exit 0

View File

@ -0,0 +1,18 @@
curl -sX POST 'https://data.gchange.fr/user/profile/_search' -d '{
"_source": [
"title",
"avatar._content_type",
"time",
"address",
"city",
"creationTime",
"description",
"_source.pubkey"
],
"from": 0,
"size": 10,
"sort": {
"creationTime": "desc"
}
}' | jq

View File

@ -54,9 +54,9 @@ for VUID in $(cat ~/.zen/bunkerbox/crowd.json | jq -r '.posts | .[] | .video.id'
echo ">>>>>>>>>>>>>>>> Downloading VIDEO"
# Choose 360p or 480p or 240p
VSIZE=360 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
[[ "$VIDEOSRC" == "" ]] && VSIZE=480 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
[[ "$VIDEOSRC" == "" ]] && VSIZE=240 &&VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
VSIZE=360 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | xargs | cut -f 1 -d '.')
[[ "$VIDEOSRC" == "" ]] && VSIZE=480 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | xargs | cut -f 1 -d '.')
[[ "$VIDEOSRC" == "" ]] && VSIZE=240 &&VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | xargs | cut -f 1 -d '.')
VTHUMB="$(cat ~/.zen/bunkerbox/$VUID/$VUID.json | jq -r --arg VSIZE "$VSIZE" '.video.thumbnails[] | select(.height == $VSIZE) | .url')"
echo ">>>>>>>>>>>>>>>> Downloading Video $VSIZE Thumbnail"

View File

@ -33,7 +33,7 @@ g1pub=$(cat ~/.zen/game/players/$PLAYER/secret.dunikey | grep 'pub:' | cut -d '
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/gchange --render '.' 'carte.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Carte'
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/gchange --render '.' 'gchange.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Gchange'
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/gchange --render '.' 'g1visa.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'G1Visa'
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/gchange --render '.' 'g1visa.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'ZenCard'
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html --output ~/.zen/tmp/gchange --render '.' 'MOA.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[moa]]'
GPS=$(cat ~/.zen/tmp/gchange/carte.json | jq -r .[].gps)

View File

@ -1,17 +1,11 @@
# CONTAINS Address of 1st Bootstrap Stations (24/24 Public IP) - DO NOT EDIT MANUALY -
# UPlanet Swarm Bootstrap Stations # Adapt for your domain #
# https://ipfs.copylaradio.com ipfs.copylaradio.com
#################################################################
# astroport.libra.copylaradio.com
/ip4/149.102.158.67/udp/4001/quic/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u
/ip4/149.102.158.67/tcp/4001/p2p/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u
# astroport.cancer.copylaradio.com
/ip4/185.202.238.69/tcp/4001/p2p/12D3KooWDYpPdfCFf3CbKpcLNmyA2vmJs4JY55k8yje9R1MxSgdB
# astroport.aries.copylaradio.com
/ip4/37.187.127.175/tcp/4001/p2p/12D3KooWSQYTxeoZZ39SNosEKxi7RUdGTtAQAqpKeZJxjzqqrZTx
# astroport.sonic.copylaradio.com
/ip4/161.97.174.60/tcp/4001/p2p/12D3KooWJki74EkJ8YUhrAfr2UwtQiJKBY94PYLmVnEQe9jo3aqC
# scorpio.copylaradio.com
/dnsaddr/scorpio.copylaradio.com/p2p/12D3KooWS8EiLNay8qVnFaULpxW1X9sGZZz4wV8E6E3QEwCRktry
#################################################################
###### WISHING TO ADD YOUR NODE TO OFFICIAL ASTROPORT BOOSTRAP LIST ?

6
A_boostrap_ssh.txt Normal file
View File

@ -0,0 +1,6 @@
## SSH PUBLIC KEYS
## SEEDS OF THE DRAGONS WOT
## https://pad.p2p.legal/keygen
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEtg3SlRxtzsQnsBSeU83W0tvUyBTUvOU5lhjlbZVPCZ support@qo-op.com
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILTzTegcBD3WwIyTwT3kIh6jGqyLZzEzXhcuF6IhAjlc
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJBG6lim4ZmSmpU+GbOKJXO9arfRCP5TdKlhGa4CLJp

48
BOOKS/HowTo_natools.py.md Normal file
View File

@ -0,0 +1,48 @@
To use `natools` for message encryption (to destination) and signature (from sender), you would typically follow these steps:
### 1. Generate Key Pairs:
- Both the sender and the recipient need to generate their key pairs (public and private keys). You can use the `natools` script to generate keys.
```bash
# Sender generate keys
python3 natools.py privkey -k ~/.zen/game/sender_secret.dunikey -f cred
python3 natools.py pubkey -k ~/.zen/game/sender_secret.dunikey -o sender_public_key
# Recipient generates keys
python3 natools.py privkey -k ~/.zen/game/myswarm_secret.dunikey -f cred
python3 natools.py pubkey -k ~/.zen/game/myswarm_secret.dunikey -o recipient_public_key
```
### 2. Encrypt the Message:
- The sender uses the recipient's public key to encrypt the message.
```bash
python3 natools.py encrypt -i plaintext.txt -k recipient_public_key -o encrypted_message.bin
```
### 3. Sign the Message:
- The sender signs the original message using their private key.
```bash
python3 natools.py sign -i plaintext.txt -k sender_private_key -o signature.bin
```
### 4. Verify the Signature:
- The recipient uses the sender's public key to verify the signature.
```bash
python3 natools.py verify -i plaintext.txt -p sender_public_key
```
- The script will output "Signature OK!" if the verification is successful.
### 5. Decrypt the Message:
- The recipient uses their private key to decrypt the message.
```bash
python3 natools.py decrypt -i encrypted_message.bin -k recipient_private_key -o decrypted_message.txt
```
Now you have successfully performed message encryption to the destination and signature from the sender using the `natools` script. Adjust the file paths and content as needed for your specific use case.
Note: Ensure that both sender and recipient securely store their private keys. Public keys can be shared openly. The encrypted message, signature, and decrypted message are intermediate files used for illustration; adjust as needed in your application.

14
BOOKS/OC_API.md Normal file
View File

@ -0,0 +1,14 @@
# UPlanet OC App
https://docs.opencollective.com/help/developers/oauth#3.-use-the-access-token-to-access-the-api
HOWTO GRAPHQLv2
https://medium.com/open-collective/open-collective-graphql-api-preview-3b42ed1d55ff
https://til.simonwillison.net/graphql/graphql-with-curl
https://opencollective.com/made-in-zen/members/all.json?limit=10&offset=0
https://opencollective.com/oauth/authorize?client_id=e95ce84b6df50f7e554f&response_type=code
https://ipfs.copylaradio.com/ipns/copylaradio.com/?code=16fd94e0d84ce55afaab42b2006e7cef591e6f391d764030be5351220671cfae&state=null
https://opencollective.com/oauth/token?grant_type=authorization_code&client_id=e95ce84b6df50f7e554f&client_secret=0eb246d4d2afe21154a83f42201b7d0ecf1e8a36&code=16fd94e0d84ce55afaab42b2006e7cef591e6f391d764030be5351220671cfae&https://opencollective.com/oauth/token?grant_type=authorization_code&client_id=e95ce84b6df50f7e554f&client_secret=0eb246d4d2afe21154a83f42201b7d0ecf1e8a36&code=16fd94e0d84ce55afaab42b2006e7cef591e6f391d764030be5351220671cfaehttps://opencollective.com/oauth/token?grant_type=authorization_code&client_id=e95ce84b6df50f7e554f&client_secret=0eb246d4d2afe21154a83f42201b7d0ecf1e8a36&code=16fd94e0d84ce55afaab42b2006e7cef591e6f391d764030be5351220671cfaehttps://opencollective.com/oauth/token?grant_type=authorization_code&client_id=e95ce84b6df50f7e554f&client_secret=0eb246d4d2afe21154a83f42201b7d0ecf1e8a36&code=16fd94e0d84ce55afaab42b2006e7cef591e6f391d764030be5351220671cfae&redirect_uri=https://ipfs.copylaradio.com/ipns/copylaradio.com

129
BOOKS/Readme.md Normal file
View File

@ -0,0 +1,129 @@
# THE ART OF BOOSTRAPING
"Blockchain" has special treatment during "heart beats" making evolve change of "State".
As we use IPFS, we can record any data structure as a "blockchain" by just copying last CID into new update.
IPNS key publishes evolving "Solid State" (like archive.org). Any ECC key is an IPNS key.
So Duniter/Cesium, GChange, SSH, PGP, ... can benefit a side shared storage onto IPFS.
Astroport.ONE is collecting is map through the bootstrap nodes in ~/.zen/Astroport.ONE/A_boostrap_nodes.txt
A new list makes a new "Station Tribe". Some bootstrap scenario could initiate automatic key creation & cross signatures
(ex: Create 25 PLAYERs to start a 5x5 document emitting with random cross signature)
THIS IS ALREADY THE CASE WITH PGP.
Instead you can convert your SSH key and benefit from Astroport Data Layer Protocol
```
## SEE EXERCICE
keygen --help
```
PLAYER key & wishes can be controled through : ```~/.zen/Astroport.ONE/command.sh``` or directly through TW (Tag="voeu")
Each wish, is a derivated key, it has an IPNS publishing and can be associated to its own ASTROBOT program to take care about Friends data collect & merge.
VISA.new.sh is creating TW from ```templates/twdefault.html``` and ```templates/twuplanet.html```
This script is important as it initialize PLAYER and connect him to STATION... You can add more different templates...
Visit https://tiddlywiki.com to understand all the capacities this tools have inside.
## 20H12
Every day (20H12.process.sh) activates automation.
Sequence is run every night :
1. PLAYER.refresh (distributed USERs key management)
2. UPLANET.refresh (UPlanet key refresh only Station in Boostrap list)
## _12345.sh : The MAP maintainer
This process is run almost every hour. Stations are getting and publishing
Each time MAP.refresh.sh is running it takes data from PLAYERs caches (~/.zen/game/players/.../) and publish it on Station IPNS key.
Boostrap Stations gets LANCoeurBOX through 12345 client call, asking for IPNS retrieval so SWARM data are collected.
## REVERSE CODE
You can use ~/.zen/Astroport.ONE/search command to search the code for "EXPRESSIONS"
For exemple, if you want to know from where VISA.new.sh is called run
```
~/.zen/Astroport.ONE$ ./search VISA.new.sh
------------------------------------------------------------------------------
Searching for VISA.new.sh recursively. Please Wait...
------------------------------------------------------------------------------
./command.sh: ${MY_PATH}/RUNTIME/VISA.new.sh
./command.sh: ${MY_PATH}/RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "$EMAIL"
./API/SALT.sh: echo "# ASTRONAUT NEW VISA Create VISA.new.sh in background (~/.zen/tmp/email.${EMAIL}.${MOATS}.txt)"
./API/SALT.sh: ${MY_PATH}/../RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "${EMAIL}" "$PSEUDO" "${WHAT}" >> ~/.zen/tmp/email.${EMAIL}.${MOATS}.txt
./TODO.list:./RUNTIME/VISA.new.sh:######### TODO Ajouter d'autres clefs IPNS, GPG ?
./TODO.list:./RUNTIME/VISA.new.sh:WID="https://ipfs.$CLYUSER$YOMAIN.$(myHostName)/api" ## Next Generation API # TODO PLAYER IPFS Docker entrance
./TODO.list:./RUNTIME/VISA.new.sh: ############ TODO améliorer templates, sed, ajouter index.html, etc...
./TODO.list:./RUNTIME/VISA.new.sh: ## TODO : FOR STRONGER SECURITY REMOVE THIS LINE
./TODO.list:./RUNTIME/VISA.new.sh:# !! TODO !! # DEMO MODE. REMOVE FOR PRODUCTION - RECALCULATE AND RENEW AFTER EACH NEW KEY DELEGATION
./TODO.list:./RUNTIME/VISA.new.sh:# TODO : Allow Astronaut PASS change ;)
------------------------------------------------------------------------------
```
## EXERCICE
“keygen” peut fabriquer la clef duniter et ipfs à partir du keygen ssh (avec clef à courbe elliptique: ECC) et les convertir en clef duniter (secret.dunikey) et ipfs (IPNS)
```
ssh-keygen -t ed25519 -C "userA"
keygen -i ~/.ssh/id_ed25519 -t duniter -o ~/.zen/Asecret.dunikey
keygen -i ~/.ssh/id_ed25519 -t ipfs -o ~/.zen/Asecret.ipns
```
On va utiliser “natools” pour faire voyager les données en sécurité dans IPFS :wink:
```
natools.py encrypt -p $UserBPubKey -i ~/.zen/file.clear -o ~/.zen/file.toB.enc
```
“jaklis” va servir distribuer la toile de confiance.
On envoi entre 1 et 100 G1 aux UserXPubKey des clefs SSH avec lesquelles ont veut signifier un niveau de confiance.
UserB devra faire de même avec le même montant (ou pas, on verra plus tard ce cas…)
```
MACHINE A
jaklis.py -k ~/.zen/secretA.dunikey pay -a 100 -p ${UserBPubKey} -c "ASTRO#SSH" -m
MACHINE B
jaklis.py -k ~/.zen/secretB.dunikey pay -a 100 -p ${UserAPubKey} -c "ASTRO#SSH" -m
```
Maintenant.
Il reste à maintenir à jour et appliquer la ToileDeConfiance ASTRO#SSH
Pour cela, jaklis va extraire lhistorique des transactions reçues qui portent le tag ASTRO#SSH
```
jaklis.py history -p UserAPubKey
+---------------------------------------------------------------------------------------------------------------------------------------
| Date | De / À | Ḡ1 | DU/ḡ1 | Commentaire |
|---------------------------------------------------------------------------------------------------------------------------------------
| 04/04/2023 à 20:01 | HV7o…jG61:Bu6 | 100.00 | ~~~ | ASTRO#SSH
|---------------------------------------------------------------------------------------------------------------------------------------
| 04/04/2023 à 20:01 | 54yA…UvJm:3px | 70.00 | ~~~ | ASTRO#SSH
```
Extraire et vérifier quau moins une TX entrante et sortante existent (leur somme fait 0)… (“jq”)
Puis pour établir le droit de se connecter en SSH par exemple, UserA et UserB peuvent inscrire leur clef publique SSH dans ~/.ssh/authorized_keys et ~/.ssh/known_hosts.
Pour agrémenter cette phase on peut utiliser IPFS (et natools)
```
# Récup les paquets pour A depuis les machines SSH comptabilisé à 0
ipfs cat /ipns/IPNSUserB/file.toA.enc
ipfs cat /ipns/IPNSUserC/file.toA.enc
```
Voila le principe pour utiliser la G1 et établir une nouvelle “toile de confiance”, et faire passer des fichiers ou des messages entre les clefs. On étendre ce principe à dautres “toiles de confiance” en définissant une nomenclature pour les ASTRO#TAG…
Qui est intéressé par ce programme (de distribution de clef SSH ou autre)?
Voila ma clef
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEtg3SlRxtzsQnsBSeU83W0tvUyBTUvOU5lhjlbZVPCZ support@qo-op.com
* “keygen” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/tools/keygen
* “natools” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/tools/natools.py
* “jaklis” https://git.p2p.legal/axiom-team/jaklis
* “ipfs” https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/install.kubo_v0.20.0_linux.sh
## ASTROPORT CREW GILET https://astroport.myspreadshop.fr/create?product=a68ad31e-d554-4c75-821d-97b00d6ad13f&view=2

BIN
BOOKS/TheNetworkState.pdf Normal file

Binary file not shown.

5
ME.md Normal file
View File

@ -0,0 +1,5 @@
A Ynov depuis la B1, je code en principalement Python
j'ai des compétences en Docker, git, en gestion de bdd et traitement des donné
J'aime faire du piano

BIN
OpenPORTS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -1,5 +1,19 @@
# TW : TiddlyWiki
Clarifions quelques points concernant TiddlyWiki :
* Les Tiddlers peuvent contenir n'importe quelle donnée (notes, tâches, numéros de téléphone, photos, vidéos musicales, recettes, produits, membres de la famille, ...).
* Les dossiers peuvent avoir des étiquettes
* Les tags peuvent être utilisés pour "étiqueter" les tiddlers afin de les catégoriser (tout comme les hashtags).
* Les étiquettes peuvent être utilisées pour créer des hiérarchies, des arbres (table des matières) en ajoutant l'étiquette parent à l'étiquette actuelle.
* Les tiddlers peuvent avoir des champs
* Les champs peuvent contenir des données arbitraires (date, valeur numérique, texte, voire une liste d'autres tiddlers) qui caractérisent le tiddler.
* Les tags sont stockés dans le champ tags du tiddler.
* Comme les balises ne sont pas différentes des autres champs, n'importe quel champ peut être utilisé comme balises.
* Les liens dans le texte forment également un arbre
# Ŋ1 PROTOCOL
L'utilisation du cryptosystème signifie que tout hôte possédant une clé privée peut modifier "quelque chose", la clé publique étant l'adresse de cette "chose". Quand on se concentre sur le hachage des données comme le fait IPFS, on peut stocker n'importe quoi partout.
Astroport.ONE attache une clé (2 pass phrase NaCl generattion) et un email à un modèle TW. Chaque ordinateur sert l'API sur le port 1234. Il peut héberger plusieurs clés PLAYER et gérer leurs TW.

86
README.en.md Normal file
View File

@ -0,0 +1,86 @@
# Preamble
Are you ready to be part of an exciting technological adventure? Do you want to contribute to an innovative project that aims to protect freedom of expression and promote uncensored information sharing? If so, Astroport is the perfect fit for you!
Astroport is much more than just software; it's a groundbreaking platform that leverages peer-to-peer (P2P) and IPFS technology to enable users to share information, particularly videos, securely and without fear of censorship. We are committed to defending freedom of expression and combating potential restrictions imposed by fact-checking laws advanced by the European Union.
But Astroport doesn't stop there. We go even further by creating a network that identifies resources around you, whether it's food, friends, services, or goods. Imagine being able to easily find what you need, locally and in a decentralized manner. With Astroport, you'll never be alone when it comes to meeting your needs.
Moreover, we offer a revolutionary tool called the "build guide," inspired by Minecraft but for real life. You'll be able to follow detailed tutorials to build or produce anything you desire. And to facilitate your projects, we've integrated the marketplace of the Ğ1 libre currency (gchange.fr), allowing you to order the necessary basic materials for your creations.
To make all this possible, we need talented and passionate developers like you! Join our team and contribute to the creation of a revolutionary platform that unleashes the power of knowledge and fosters unhindered collaboration.
As a developer at Astroport, you'll have the opportunity to work with cutting-edge technologies such as P2P, IPFS, and the Ğ1 libre currency. You'll push the boundaries of innovation and contribute to a project that will change the way we share information and interact with our environment.
Join us now and be part of a passionate team working to make the world better, freer, and more connected. Together, we will build a future where censorship has no place and the sharing of knowledge becomes a reality for all.
Join Astroport and make a difference today!
## https://astroport.com
With this technology, we each become host and provider, monetary and media sovereign.
With this technology, we establish the "Crypto Department 96" whose map connects territories beyond borders and countries.
Astroport ONE is the embassy of a world made of interconnected algorithmic webs of trust.
# Astroport.ONE
It is a life-size board game that consists in listing, inventing, teaching, and disseminating the best ways to inhabit the planet Earth.
This program introduces multimedia data (web page, audio, video) as data chains (blockchain) registered in the IPFS network
network that players exchange through TW and Oasis.
## Fred Story
In 2018, when most of my job oportunies were about Blockchain and IoT aiming to monitor anything... I understood that we should go with great advice in this new age. So.
I decided to refuse to have a profession to get € to live, and thanks to the RSA, transformed my apartment in Toulouse into a "G1FabLab" to realize several prototypes and experiments around the use and practice of G1.
Several prototypes developed on small computers (RaspberryPi ZeroW, 3B and 4B) appeared.
We used the G1BILLET to discover that it is only a "bearer voucher written on paper" which, contrary to the habit to which the bank accustomed us, must be destroyed when it returns to its issuer.
When I launched the G1SMS service (to make payments between cell phone numbers), all this was working on a Raspberry Pi (without UPS) and a phone in my apartment located in Toulouse.
I became aware that I was becoming a "trusted third party" who had to guarantee the functioning of the service 24h/24. Becoming the manager of everyone's "login" and "keys", to make them "operate" through a software on a blockchain-type database confers a great responsibility!
The design of the software and the federative architecture that I had just experimented with used a wallet account to create the operator of the service, who then controlled the keys of other wallets and could take a share of each transaction that could be paid for each "branch".
And it is in front of this company that I wished to stop the G1SMS service.
Indeed, cryptography is an art that expressed in the cyberspace provides powers, the one to send "registered mails unreadable except by the public key that has been used as address", the one where having a private key offers a "safe" for each one. A new "cryptopunk" world is revealed... A place where a crazy race takes place between those who imagine the best encryption (to maintain their secret activity? or their private life?) and those who wish to break this encryption (for? many reasons surely?).
Finally, behind the advantageous action of making all our usernames and passwords disappear, another game is actually hidden. The one that links our accounts. Our Avatar and the UNiverse where it is delivered is composed of chains and keys... Of contracts?!
With G1SMS, and the exploration of the G1, I had put my finger on the role of the Trusted Third Party, who puts himself forward and offers his services. And this was the job of the Banker, the Insurer too... And finally that of the State since it imposes the currency of the game to the players and issues your identity card.
These structures were not invented by us. They are constantly discussed, remodeled, imposing laws to make up for a lack of rules that cannot be respected by all. This is a difficult challenge, especially when one can have multiple identities.
For practical reasons, we will delegate our trust. And from now on, in these times, our encryption keys. Certified by the issuer of the tokens of the game that became software. The set of keys that will make our future software work, depends on what we do with them. The entire Internet is being redesigned.
So with some friends at RSA, we have undertaken this journey into the future of JUNE, an imagined country. A Game capable of organizing a commune. 100% FREE. The one where our keys belong to us!
Stopped by the authorities. We were able to build in the forest, as an extension to the models of self-built autonomous habitats explored by the "MadeInZion" foundation, the prototype of a decentralized Internet "SolarPunk" that can work OnLine and OffLine.
Personally this exploration will have allowed me to understand and to deconstruct the contracts linking "Fred" and/or "Frédéric RENAULT" to the board game. To discover the Administrative Inquisition, the harassments undergone by "Frédéric RENAULT", until inflicting to this "player" one of the "legal entities" of the chain of parental authority that I had just broken, the prohibition to meet neither Emma, nor Tim if they were called "RENAULT--PREVOST". What he testified he did not wish to wear during our meetings. It was enough to vaporize the injunctions towards my person.
A sacred adventure! Where my national identity card and my key member of the June face each other. Where the CAF claims the reimbursement of the RSA. Where my bank account is blocked next month... I know I am curious. Curious to understand the world I live in.
At this point, I might as well continue.
By pooling our computers with the right free software, We can become together a datacenter without any address, that stores and shares our data "with each other".
🥥 A Free Internet. Why? How? With whom?
The keys of modern encryption (remember ed25519) lead to the same place, a decimal sequence located in the decimals of "π". It is in this great infinite spiral that our data are installed. And it is in this circle that our keys define sequences that serve as keys (that we link to other keys)
With @aya the creator of Olympe Network, we are aware of this mutation. We have invested in IPFS, the global disk where everything we write on it is readable by everyone, provided that he has the keys to dispose of it.
From this association has just been born "THE ♥BOX", a software and network service that allows you to save your favorite "Youtube" channel or playlist. All these data are saved in "The Claude", a hybrid software using our keys so we can host and own the data we publish.
To try online with an email and a link to keep...
```
# Manipulate TW with tiddlywiki
~/.zen/game/players/*/ipfs/moa/index.html
# Makes your G1Wishes collide : merge and fork. G1Voeu derivated keys system)
~/.zen/game/world/*/.pepper
```
https://astroport.copylaradio.com

517
README.md
View File

@ -1,109 +1,299 @@
# Préambule
Quand pourrons nous sortir de ce Méchant Cloud qui nous profile, nous scrute, nous analyse... Pour au final nous faire consommer.
Je n'ai pas suivi la formation dingénieur réseau pour fabriquer ça!
Alors j'ai fait autre chose.
# Introduction
Astroport est contruit sur IPFS pour former nos Cloud personnels échangés entre amis d'amis à labri des algorithmes de l'IA et du datamining sauvage qui règne ici bas.
L'avantage de ce système, une consommation énergétique divisé par 100, une répartition des données qui permet de fonctionner déconnecté, un système d'information pair à pair inaltérable, inviolable.
S'il vous plaît arrêtons cet Internet Supermarché de nous même...
C'est une bibliothèque du savoir à la base.
[Astroport DEV Journal](https://pad.p2p.legal/s/AstroportDEVJournal#)
**Embark on a Cosmic Journey with AstroID & ZenCard System and Astroport.ONE**
Are you weary of the constraints of traditional payment systems and concerned about the reliability
of your distributed storage solutions? Look no further! Our revolutionary ZenCard QRCode based Payment System
and Astroport.ONE v1.0 seamlessly blend cutting-edge blockchain technology with interplanetary storage,
offering you a commission-free and secure solution.
**Astroport.ONE v1.0: Decentralized Storage Beyond Borders**
Astroport.ONE isn't just a distributed storage software; it's a reimagining of data management.
Utilizing IPFS and introducing a master boot record (MBR) and allocation table to Tiddlywiki data,
Astroport.ONE organizes information with unprecedented precision. In the UPlanet format system,
the planet is sliced into 0.01° segments, ensuring locally registered Tiddlers with unique signatures.
As a network engineer and system administrator committed to the Common Good, join us in constructing
Astroport.ONE and shaping the future of secure and reliable distributed storage.
**Station Extra-Terrestre Astroport.ONE: Where Innovation Meets Tranquility**
In the midst of this technological revolution, discover the Station Extra-Terrestre Astroport.ONE.
A haven for volunteers striving to live in peace and harmony within a spaceship turned garden,
it unveils a new "Jeu de Société" developed by and for the Astronauts of MadeInZion.
Embark on an exploration of "Voeux," wishes funded collaboratively through donations in the Libre currency G1.
These wishes encapsulate ideas, plans, explanations, and even mistakes, marking the journey toward their realization.
In this digital game manifesting in real life, your digital identity is in your hands, and a new Internet unfolds,
built according to our "Toiles de confiance" (Webs of Trust)!
Join us in this cosmic journey where peace, harmony, and the spirit of exploration reign supreme.
Send your love to the Extraordinary Earthlings at https://qo-op.com.
Welcome to a universe where wishes become reality, and the possibilities are boundless.
[BASH ENGINE FOR A CRYPTO PLAYGROUND](https://pad.p2p.legal/p/G1Fablab#)
## https://astroport.com
Avec cette technologie, nous devenons chacun hébergeur et fournisseur d'accès, souverain monétaire et médiatique.
Avec cette technologie, nous établissons une "Crypto Nation" dont la carte relie les territoires au delà des frontières et des pays.
With this technology, we each become host and access provider and media sovereign.
Astroport ONE est l'ambassade d'un monde fait de toiles confiances interconnectées.
**Astroport ONE propels a digital world of interconnected trust webs**.
# Astroport.ONE
Each "Astroport.ONE" station is a digital embassy that communicates and synchronizes with its peers.
Users can "move their account". The last one used during the day becomes the "official station".
Il s'agit d'un Jeu de société grandeur nature qui consiste à répertorier, inventer, enseigner, diffuser les meilleures façons d'habiter la planète Terre.
Ce programme introduit des données multimédia (page web, audio, vidéo) en tant que chaines de données (blockchain) inscrites dans le réseau IPFS
que les joueurs échangent au travers des TW et Oasis.
The architecture attached to each public key is deployed in the form of "flower petals" according to the circles of trust Ŋ1 and Ŋ2 and the data flows produced by the derived keys.
![N.ONE.2](https://www.copylaradio.com/web/image/6038/ASTROPORT_multiWoTNet.png)
ASTROBOT "Intelligent contract in BASH"
Programs are triggered by "G1Tag" (derived keys) ensures extraction of "G1WordClefs" from "surrounding" Tiddlers.
To trigger the execution of a "personal intelligent contract", simply create a "wish" (Tag=voeu)
At this point, if it exists "ASTROBOT/G1Tag.sh" program will publish the data relating to the Tag concerned on a new "personal IPNS derived key", if not a default "json from all with same wish" is created (see RUNTIME/VOEUX.refresh.sh)
# INSTALLATION (Linux Mint / Ubuntu / DEBIAN)
Tested on "Linux Mint" (Debian like distro compatible), the **hacker way for using & buidling new blockchain services** ...
INSTALL COMMAND
```
# GIT.P2P.LEGAL
bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.sh)
# GITHHUB
bash <(wget -qO- https://raw.githubusercontent.com/papiche/Astroport.ONE/master/install.sh)
```
> TODO: MORE MODULAR INSTALL.
> CREATE adventure explaining it
## DRAGONS WOT
Once you install Astroport.ONE...
If all has gone well, you should find these processes running...
```
/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub
/bin/bash /home/fred/.zen/G1BILLET/G1BILLETS.sh daemon
\_ /bin/bash /home/fred/.zen/G1BILLET/G1BILLETS.sh daemon
\_ nc -l -p 33101 -q 1
/bin/bash /home/fred/.zen/Astroport.ONE/12345.sh
\_ /bin/bash /home/fred/.zen/Astroport.ONE/12345.sh
\_ nc -l -p 1234 -q 1
/bin/bash /home/fred/.zen/Astroport.ONE/_12345.sh
\_ nc -l -p 12345 -q 1
```
# LANCEMENT
> Become Official REGIONAL Station
> - follow "PGP/SSH/IPFSNODEID" linking procedure -
> https://pad.p2p.legal/keygen
## MODE AVENTURE : Activez une Ambassade "Astroport" !
```
~/.zen/Astroport.ONE/adventure/adventure.sh
```
# DESKTOP
Trouvez le moyen d'accéder à une "Station Astroport" installée en forêt...
After installation, you should have 3 new shortcuts on your desktop
NB: Une Station branchée sur un panneau solaire et une batterie adéquate, peut fonctionner OnGrid et OffGrid
* Astroport", which opens your station portal: http://astroport.localhost:1234
* REC" allows you to save your files on IPFS and publish their Capusle in your TW.
* G1BILLET" lets you create ZenCards and other useful QRCodes
## ./start.sh
NB : If you use "Nemo" as file manager. You can "ipfs add" any file (with no space in file name) by right click it.
Gestion des VISA PLAYER (et gestion des VOEUX) en mode CLI
> TODO : detect OS and FILE MANAGER to adapt desktop linking and right clic action
## How to manage your "Astroport"!
You need to create a "PLAYER".
It is defined by email, salt, pepper, lat, lon and PASS
```
~/.zen/Astroport.ONE/command.sh
```
Browse available functions
# Activer "myos" MODE OLYMPE (Docker)
A Station can host multiple "PLAYERs and TiddlyWikis".
```
sudo apt install git make docker.io
sudo adduser $USER docker
---
## REBOOT
cd ~/.zen/Astroport.ONE
make
make install
```
USER devient un PLAYER, avec son propre démon IPFS, installé dans un Docker.
Chaque STATION (nœud Astroport) accessible en WAN peut héberger un à plusieurs autres "JOUEURS".
IPFS relie les clefs et les données.
Nous mettons un TW dans une clef.
# API : "Sauve qui Peut"
# "BASH API" : "♥BOX"
## http://astroport.localhost:1234
Une fois votre Station Astroport démarrée (```~/.start.sh```):
* le port 1234 publie API
* le port 12345 publie MAP(*)
Once your Astroport Station is started:
* port 1234 publishes API (REPONSE PORT TCP 45780 45781 ( up to ... 45790 )
* port 12345 publishes MAP(*) (ESSAIM MAP - BOOSTRAP / STATIONS)
* port 33101 publishes G1BILLETS (REPLY TCP PORT 33102)
* port 8080, 4001 and 5001 are IPFS gateway ports.
List of ports to activate.
### PRIVATE ZONE (fonctionne sur toutes les Stations. Mode coucou)
![](https://ipfs.asycn.io/ipfs/QmWzwL9fZKDGuqsvDjkA8v9sAcU4zQ4BvjKDRwnZQBT97y)
To add your Station to our swarm, enter the IP of your BOX in the file ``~/.zen/♥Box ````.
exemple
```
frd@scorpio:~ $ cat ~/.zen/♥Box
86.210.184.173
```
⚠ API ASTROPORT = NETCAT SYSTEM ⚠
**Astroport doesn't need a web server to work**. We use the simplest network tool, **netcat**.
Operation gives access to an "API BASH" (classified by the same name as the first GET parameter received in the API directory).
Requests are made in HTTP GET on port 1234, with the response PORT in the loaded page.
Perform a regexp on "url=ADRESSE:PORT" or (♥‿‿♥) to find out which.
Here are some examples of how to do it.
## ANSWER PORT RECOVERY API : (♥‿‿♥)
### CLI (BASH)
```
# OPEN ASTROPORT HOME PAGE
curl -so ~/.zen/tmp/${MOATS}/astro.port "http://astroport.localhost:1234/?salt=0&pepper=0&g1pub=_URL_&email=${EMAIL}"
# GREP NEXT PORT IN PAGE CODE
TELETUBE=$(cat ~/.zen/tmp/${MOATS}/astro.port | grep "(♥‿‿♥)" | cut -d ':' -f 2 | cut -d '/' -f 3)
TELEPORT=$(cat ~/.zen/tmp/${MOATS}/astro.port | grep "(♥‿‿♥)" | cut -d ':' -f 3 | cut -d '"' -f 1)
sleep 30
# ACCESS TO FINAL RESULT
curl -so ~/.zen/tmp/${MOATS}/astro.rep "http://$TELETUBE:$TELEPORT"
```
### JS
Exemple :
```
var myURL = 'http://astroport.localhost:1234/?' + query;
async function fetchAstroport(myURL) {
try {
let one = await fetch(myURL); // Gets a promise
var doc = await one.text();
var regex = /url='([^']+)/i; // Get response PORT
var redirectURL = doc.match(regex)[1]
console.log(redirectURL)
setTimeout(function() {
// let two = await fetch(redirectURL);
// document.mydiv.innerHTML = await two.text(); // Replaces body with response
window.open( redirectURL, "AstroTab");
}, 5000);
} catch (err) {
console.log('Fetch error:' + err); // Error handling
}
}
```
USE "[astro.js](templates/ZenStation/G1PalPay_fichiers/astro.js)"
```
<script src="https://ipfs.asycn.io/ipfs/Qmae5v9zydax9u6C9ceDijURu5PYdd5avmv4NkenCw7RFv/astro.js"></script>
```
## ➤ SALT API
### ```/?salt=${SALT}&pepper=${PEPPER}&${APPNAME}=${WHAT}&${OBJ}=${VAL}...```
* Créer son TW <3BOX
### Créer (ou téléporter) un PLAYER TW : OFFICIAL <3BOX :
```http
GET /?salt=${SALT}&pepper=${PEPPER}&g1pub=${URLENCODEDURL}&email=${PLAYER}
```
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=${URLENCODEDURL}&email=${PLAYER}```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `g1pub` | `string` | **Required**. Your prefered _URL_ to copy video from |
| `email` | `email` | **Required**. Your email token |
* Lire sa Messagerie Gchange
### LOGOUT PLAYER (remove IPNS keys from Station)
```http
GET /?salt=${SALT}&pepper=${PEPPER}&logout=${PLAYER}
```
```/?salt=${SALT}&pepper=${PEPPER}&messaging=on```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `logout` | `string` | **Required**. Your email token |
* Convertir vers adresse IPNS
### LOGIN PLAYER (Activate IPNS keys on Station)
```http
GET /?salt=${SALT}&pepper=${PEPPER}&login=${PLAYER}
```
```/?salt=${SALT}&pepper=${PEPPER}&getipns=on```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `login` | `string` | **Required**. Your email token |
* AppName=testcraft : Enregistrer JSON
### Définir le niveau ★ accordé à un "g1friend"
```http
GET /?salt=${SALT}&pepper=${PEPPER}&friend=${G1PUB}&stars=${1:5}
```
```/?salt=${SALT}&pepper=${PEPPER}&testcraft=json&nodeid=_&dataid=$QRHASH```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `friend` | `string` | **Required**. G1PUB token of friend |
| `stars` | `number` | **Required**. Number between 1 to 5 |
Redirections
### Lire Messagerie de la base "GChange"
```http
GET /?salt=${SALT}&pepper=${PEPPER}&messaging=on
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `messaging` | `string` | **Required**. (on=json) output type |
### Conversion vers adresse IPNS
```http
GET /?salt=${SALT}&pepper=${PEPPER}&getipns=on
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `getipns` | `string` | **Required** on |
### AppName=testcraft : Enregistrer JSON
```http
GET /?salt=${SALT}&pepper=${PEPPER}&testcraft=json&nodeid=_&dataid=$QRHASH
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `testcraft` | `string` | **Required** AppNAME subcommand |
| `${OBJ}` | `${VAL}` | depends on App |
This IPFS object transfer needs that the client is using well configured WebRTC/IPFS relays
Look for example in ```www/upload_to_astroport.html```
```
'/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star',
'/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star'
```
### Redirections
* vers Gchange
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=on```
@ -112,24 +302,196 @@ Redirections
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=astro```
### PLAYER (fonctionne uniquement sur la Station qui héberge votre PLAYER)
### Déclencher un Payement de Ğ1 à une G1PUB
```http
GET /?salt=${SALT}&pepper=${PEPPER}&pay=1&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech
```
* Déclencher un Payement de 99 Ğ1 à Fred
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `salt` | `string` | **Required**. Your passphrase one token |
| `pepper` | `string` | **Required**. Your passphrase two token |
| `pay` | `integer` | **Required** G1 AMOUNT |
| `g1pub` | `G1PUB` | **Required** destination "wallet key" |
```/?player=${PLAYER}&pay=99&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech```
## ➤ PLAYER (works only on LAN Station)
### ```/?player=${PLAYER}&${APPNAME}=${WHAT}&${OBJ}=${VAL}...```
* Exporter Tiddlers.json depuis son TW selon valeur des "tags" ( ici TAG=G1CopierYoutube)
### Exporter Tiddlers.json depuis son TW selon valeur des "tags" ( ici TAG=G1CopierYoutube)
```http
GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube
```
```/?player=${PLAYER}&moa=json&tag=G1CopierYoutube```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `player` | `string` | **Required**. Your EMAIL token |
| `moa` | `string` | **Required** APP = output format |
| `tag` | `${VAL}` | TW filtering default G1CopierYoutube |
> CAN BE EXTENDED
## ➤ AMZQR : Create a QRCode with "amzqr"
```http
GET /?amzqr=${URLENCODEDSTRING}&logo=${IMAGE}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `amzqr` | `string` | **Required** the qrcode string |
| `logo` | `string` | **Required** ./images/${IMAGE}.png |
check available "logo.png" in [./images](./images)
## ➤ UPLANET : Create Umap, AstroID & ZenCard for PLAYER (email)
```http
GET /?uplanet=${PLAYER}&zlat=${LAT}&zlon=${LON}&g1pub=${PASS}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `uplanet` | `email` | **Required** Your EMAIL token |
| `zlat` | `decimal` | **Required** LATITUDE with 2 decimals digits |
| `zlon` | `decimal` | **Required** LONGITUDE with 2 decimals digits |
| `g1pub` | `string` | **Facultative** choose Umap AstroID PASS |
Create à Umap key (LAT/LON), then a PLAYER TW with GPS as Umap IPNS reference
This API is used by OSM2IPFS code.
* [UPlanet Entrance](https://qo-op.com)
### ➤ QRCODE (API SandBox)
```http
GET /?qrcode=${G1PUB} | ${ASTRONAUTENS} | ${PGP_ASTROID_STRING}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `qrcode` | `string` | **Required**. Your G1PUB or ASTRONAUTENS or PGP_ASTROID token |
> Look for details & extend as you like in [~/.zen/Astroport.ONE/API/QRCODE.sh](API/QRCODE.sh)
## The Art of key derivation, chaining & use
In order to make (a little) clear how we use cryptography,
We choose to use "NaCl" (secret1 / secret) 2 key generation, so it is easy to understand Web3 mechanism.
**(SECRET1/SECRET2) mixing**
* If PLAYER key is (SECRET1 / SECRET2) and G1PUB and EMAIL + TW
* feed key (SECRET1 / SECRET2 G1PUB)
* wishes keys are (SECRET2 / WishName EMAIL)
* sub-wishes are (EMAIL / G1WishName G1PUB)
* wish-billets are (EMAIL_dice_words / G1WishName G1PUB)
This way PLAYER TW capable of retrieving and never loose its data.
It is writen into IPFS... So recreate the key anywhere makes you get your data from friends you shared it with.
**Cross (G1PUB) keys**
Between PlayerA (AG1PUB) & PlayerB (BG1PUB) obvious communication channel keys are existing :
(AG1PUB / AG1PUB) - A knock on the door
(AG1PUB / BG1PUB) - From A to B channel
(BG1PUB / AG1PUB) - From B to A channel
(BG1PUB / BG1PUB) - B knock on the door
We can use this to implement protocols, for exemple :
To ollow PlayerA / PlayerB to become friends
A write a KNOCK.AG1PUB file + signature using (BG1PUB / BG1PUB) keygen IPNS key,
Then B reply with the same KNOCK at (AG1PUB / AG1PUB) address
A/B - B/A keys can be used as bidirectionnal encrypted data channels.
In a well formed IPFS swarm, we could even send video... Check code in ```/tools/streaming/```
### PUBLIC (fonctionne par tout, pour tous)
### ```/?qrcode=$G1PUB/$IPNS/$...```
**(LON / LAT) keys**
NaCl keys can be initiated with GPS Geoloc and receive shared informations.
Using the same A/B swapping method, any A place have also a communication channel with B place ;)
**(COUNTRY / ZIP) keys**
For a town key, we could use country code + ZIP code, ... etc
Many public application can be easily addressed like that
As these keys are discoverable, the channel can be hijacked by anyone.
So ASTROBOT while applying ScuttleButt replications will ".chain.ts" data and check for protocol respect.
Data can't be lost, but protocol chain can be break !
In case of some annoyance, we can monitor IPFS protocol to identify which IPFSNODEID key is acting badly and apply reaction based on DEFCON level (look into astrXbian code)
### MAILJET & GPS
In order for "Boostrap Station" to send emails to PLAYERs, we use [mailjet service](https://mailjet.com/).
```
## CREDENTIALS FILE
~/.zen/MJ_APIKEY
# IS USED BY
~/.zen/Astroport.ONE/tools/mailjet.sh
```
Boostrap location is specified in ~/.zen/GPS
```
cat ~/.zen/GPS
48.87039, 2.31673
```
### LOW RESSOURCE STATION CAN ACTIVATE LOW MODE (disable ipfs daemon)
```
~/.zen/Astroport.ONE/tools/cron_VRFY.sh LOW
sudo systemctl restart astroport.service
sudo systemctl restart g1billet.service
```
### STATION : Show Station PLAYER's G1 investments levels
```http
GET /?qrcode=station
```
### STATION MAP & PLAYER DATA PROPAGATION
Chaque Station collecte et publie sur sa clef "self" (/ipns/$IPFSNODEID) les liens vers le cache de l'ensemble de l'essaim
http://localhost:12345 renvoi un json
```
{
"created" : "202304111854481040",
"hostname" : "kitty.localhost",
"myIP" : "192.168.1.14",
"ipfsnodeid" : "12D3KooWK1ACupF7RD3MNvkBFU9Z6fX11pKRAR99WDzEUiYp5t8j",
"astroport" : "http://192.168.1.14:1234",
"g1station" : "http://ipfs.localhost:8080/ipns/12D3KooWK1ACupF7RD3MNvkBFU9Z6fX11pKRAR99WDzEUiYp5t8j",
"g1swarm" : "http://ipfs.localhost:8080/ipns/k51qzi5uqu5djv0qz9wkl8i94opzm62csh56mnp9zove8i543e4vv4cy9gvr1o"
}
```
| Parameter | Description |
| :-------- | :------- |
| created | date de creation du document |
| hostname | nom de la station |
| myIP | adresse IP de la station |
| ipfsnodeid | Clef publique, balise de la station |
| astroport | Lien vers l'API de la station |
| g1station | Lien vers la carte PLAYER de la Station |
| g1swarm | Lien vers la carte des cartes des Stations de l'essaim |
Afin de propager la carte chaque station lors de son raffraichissement de cache
envoi aux Boostrap une requête pour upload (```/ipns/${IPFSNODEID}```)
```
STATION MAP UPSYNC : http://$nodeip:12345/?${GNODEID}=${IPFSNODEID}
```
# 20H12
Chaque jour, les ASTROBOTs captent les :star: de leurs PLAYERs puis exécutent le protocole de synchronisation Ŋ1
Chaque jour, les ASTROBOTs captent les :star: (tiddler 'email') de leurs PLAYERs puis exécutent le protocole de synchronisation Ŋ1
[20H12.sh](/qo-op/Astroport.ONE/src/branch/master/20h12.sh)
@ -137,13 +499,15 @@ Ils analysent les données et extraient des flux json selon les G1Voeu présent
Le niveau informationnel de confiance exploré permet de proposer des alertes issues du niveau Ŋ2.
## FLUX TW :
## EXEMPLE DE FLUX TW :
[![TW FEEDS](https://ipfs.copylaradio.com/ipfs/Qma9zvrYHGcUPisLKBcG9U9sktThX5VfVci8jfM8D9RspT)](https://pad.p2p.legal/s/G1TWFeed#)
# IPFS : UN STOCKAGE INALTERABLE ET INTELLIGENT
[![](https://ipfs.asycn.io/ipfs/QmafsWdAeB5W9HcNPQWK2yjTgcW8eTxHoSD7bzE55mtrdP)
### "The Barefoot Architect" de Johan Van Lengen.
Lignes de commandes
@ -154,7 +518,7 @@ ipfs cat QmbfVUAyX6hsxTMAZY7MhvUmB3AkfLS7KqWihjGfu327yG > /tmp/vdoc.pub_the-bare
```
Après un passage par [ajouter_media.sh](/qo-op/Astroport.ONE/src/branch/master/ajouter_media.sh)
Vos données son stockées [dans des Tiddlers](https://ipfs.copylaradio.com/ipns/k51qzi5uqu5dioeckikst5f8jw1tbljom6acjbw9zerl3671921krs4nm1531r#:[tag[G1Films]])
Les données sont stockées [dans des Tiddlers](https://ipfs.copylaradio.com/ipns/k51qzi5uqu5dgobi9ozzzvdftqfd3hd7a1488nzymky1edz8j779jov7sbemc0#Foret_Enchantee-PROJET_ASTROPORT)
### Foret Enchantée - PROJET ASTROPORT.pdf
@ -172,3 +536,16 @@ https://ipfs.copylaradio.com/ipfs/QmUtGpGeMZvwp47ftqebVmoFWCmvroy5wEtWsKvWvDWJpR
## Stargazers over time
[![Stargazers over time](https://starchart.cc/papiche/Astroport.ONE.svg)](https://starchart.cc/papiche/Astroport.ONE)
## CREDITS
This "digital art" structure is a selection of some of the most valuable Free & OpenSource Software I ever had in my hand.
Credits is going to all the kindness and care provided to make valuable and secure software available for all
Do you know [G1](https://monnaie-libre.fr) ? The best crypto coin you could ever dream about...
Thanks for contributions on [Swarm BUDGET](https://opencollective.com/monnaie-libre#category-BUDGET)
## IPFS Ecosystem Directory Submission Form
https://airtable.com/appLWiIrg9SQaEtEq/shrjwvk9pAeAk0Ci7

141
RUNTIME/DRAGON_p2p_ssh.sh Executable file
View File

@ -0,0 +1,141 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
# Activate SUPPORT MODE: open ssh over IPFS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/../tools/my.sh"
########################################################################
YOU=$(myIpfsApi) || er+=" ipfs daemon not running"
[[ "$YOU" == "" || "${IPFSNODEID}" == "" ]] && echo "ERROR : $er " && exit 1
########################################################################
## THIS SCRIPT COPY BOOSTRAP PUBKEY
### AND OPEN IPFS P2P SSH FORWARD ON CHANNEL
# Make Station publish SSH port on "/x/ssh-$(IPFSNODEID)"
########################################################################
## use STOP or OFF to finish forwarding
PARAM="$1"
if [[ "${PARAM,,}" == "off" || "${PARAM,,}" == "stop" ]]; then
ipfs p2p close --all
rm ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh 2>/dev/null
rm ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub 2>/dev/null
echo "STOP" && exit 0
fi
############################################
## DISTRIBUTE DRAGON SSH WOT SEED
# A_boostrap_ssh.txt
############################################
while IFS= read -r line
do
LINE=$(echo "$line" | grep "ssh-ed25519" | grep -Ev "#") # Remove # & not ssh-ed25519
[[ ! ${LINE} ]] && continue
if [[ ! $(cat ~/.ssh/authorized_keys | grep "${LINE}") ]]
then
echo "# ADDING ${LINE} to ~/.ssh/authorized_keys"
mkdir -p ~/.ssh && echo "${LINE}" >> ~/.ssh/authorized_keys
else
echo "TRUSTING ${LINE}"
fi
done < ${MY_PATH}/../A_boostrap_ssh.txt
############################################
## PUBLISH SSH PUBKEY OVER IPFS
## KITTY ssh-keygen style
[[ -s ~/.ssh/id_ed25519.pub ]] && cp ~/.ssh/id_ed25519.pub ~/.zen/tmp/${IPFSNODEID}/y_ssh.pub
## DRAGONz PGP/SSH style (https://pad.p2p.legal/keygen)
gpg --export-ssh-key $(cat ~/.zen/game/players/.current/.player) 2>/dev/null > ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub ]] && rm ~/.zen/tmp/${IPFSNODEID}/z_ssh.pub # remove empty file
############################################
### FORWARD SSH PORT over /x/ssh-${IPFSNODEID}
############################################
echo "Lanching /x/ssh-${IPFSNODEID}"
[[ ! $(ipfs p2p ls | grep "/x/ssh-${IPFSNODEID}") ]] \
&& ipfs p2p listen /x/ssh-${IPFSNODEID} /ip4/127.0.0.1/tcp/22
ipfs p2p ls
echo
############################################
## PREPARE x_ssh.sh
## REMOTE ACCESS COMMAND FROM DRAGONS
############################################
PORT=22000
PORT=$((PORT+${RANDOM:0:3}))
#######################################################################
## Adapt $USER for the UPlanet /home/$USER Private Swarm specific one
#######################################################################
echo '#!/bin/bash
if [[ ! $(ipfs p2p ls | grep x/ssh-'${IPFSNODEID}') ]]; then
ipfs --timeout=10s ping -n 4 /p2p/'${IPFSNODEID}'
[[ $? == 0 ]] \
&& ipfs p2p forward /x/ssh-'${IPFSNODEID}' /ip4/127.0.0.1/tcp/'${PORT}' /p2p/'${IPFSNODEID}' \
&& ssh \$USER@127.0.0.1 -p '${PORT}' \
|| echo "CONTACT IPFSNODEID FAILED - ERROR -"
fi
' > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
cat ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh
echo "
/| /\\
/^^^/ |^\Z / |
| \Z / |
/ @ \Z / / \_______
( \ _ / \Z / / /
( ---- /G |\ |Z / / /
( / ---- \ /---'/\ |Z / / /
\/--' /--/ /Z / /
| /--/ |Z / / \_______
/ /--/ |Z \ / /
--/ /--/ \Z | / /
/ /--/ \Z / /
|--| \Z/ /
|---| / /----'
\---| /^^^^^^^^^^^^\Z
\-/ \Z
/ / | \Z
\---' |\________| |_______ |Z
\--' /\/ \|_|_|_|| |_|_|_|_|\_ |Z
'------' / / / |_ /Z
\---' | / `````` /Z
\--' /\/ \ _____________/Z
'------' \
"
############################################
echo "CONNECT WITH THIS COMMAND"
echo "ipfs cat /ipns/${IPFSNODEID}/x_ssh.sh | bash"
############################################
## PROMETHEUS NODE
if [[ -s ~/.zen/prometheus/prometheus ]]; then
echo "UPDATING ~/.zen/prometheus/prometheus.yml"
## ADD ALL SWARM NODES TO MONITORING LIST for prometheus (GRAFANA) node
ncrunning=$(ps axf --sort=+utime | grep -w 'prometheus' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ $ncrunning ]] \
&& echo "RESTARTING" && kill -HUP $ncrunning \
|| { cd ~/.zen/prometheus/; ./prometheus & }
fi
## LAUNCHING node_exporter
ncrunning=$(ps axf --sort=+utime | grep -w 'node_exporter' | grep -v -E 'color=auto|grep' | tail -n 1 | xargs | cut -d " " -f 1)
[[ $ncrunning ]] \
&& echo "RESTARTING" && kill -HUP $ncrunning \
|| { /usr/local/bin/node_exporter & }
exit 0

373
RUNTIME/G1PalPay.sh Executable file
View File

@ -0,0 +1,373 @@
#!/bin/bash
########################################################################
# Version: 1.0
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# PAD COCODING : https://pad.p2p.legal/s/G1PalPay
# This script monitors G1 Blockchain
########################################################################
# TODO : CHECK RX coming from UPlanet Wallet
## meaning an initial 3.1G1 from a ZenStation admin wallet
## if not relay payment to ZenStation admin
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/../tools/my.sh"
CESIUM=${myCESIUM}
GCHANGE=${myGCHANGE}
echo "$ME RUNNING (•‿‿•)"
########################################################################
# PALPAY SERVICE : MONITOR INCOMING TX & NEW TIDDLERS
########################################################################
########################################################################
INDEX="$1" ## TW file
[[ ! ${INDEX} ]] && INDEX="$HOME/.zen/game/players/.current/ipfs/moa/index.html"
[[ ! -s ${INDEX} ]] && echo "ERROR - Please provide path to source TW index.html" && exit 1
[[ ! -s ${INDEX} ]] && echo "ERROR - Fichier TW absent. ${INDEX}" && exit 1
PLAYER="$2" ## PLAYER
[[ ! ${PLAYER} ]] && PLAYER="$(cat ~/.zen/game/players/.current/.player 2>/dev/null)"
[[ ! ${PLAYER} ]] && echo "ERROR - Please provide PLAYER" && exit 1
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1) ## TW /ipns/
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR - Clef IPNS ${PLAYER} introuvable!" && exit 1
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub) ## PLAYER WALLET
[[ ! $G1PUB ]] && echo "ERROR - G1PUB ${PLAYER} VIDE" && exit 1
# Extract tag=tube from TW
MOATS="$3"
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
###################################################################
## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
###################################################################
mkdir -p $HOME/.zen/game/players/${PLAYER}/G1PalPay/
mkdir -p $HOME/.zen/tmp/${MOATS}
echo "=====(•‿‿•)====== ( ◕‿◕) (◕‿◕ ) =======(•‿‿•)======= ${PLAYER}
${INDEX}"
echo "(✜‿‿✜) G1PalPay : CHECK LAST 30 TX comment"
# CHECK LAST 30 INCOMING PAYMENTS
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -n 30 -j \
> $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json
[[ ! -s $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json ]] \
&& echo "NO PAYMENT HISTORY.........................."
##############################
## CONTROL WALLET
########################################################################################
if [[ ${UPLANETNAME} != "" ]]; then
echo "UPLANET ORIGIN CONTROL"
while read LINE; do
echo "${LINE}"
JSON=${LINE}
TXIDATE=$(echo $JSON | jq -r .date)
TXIPUBKEY=$(echo $JSON | jq -r .pubkey)
TXIAMOUNT=$(echo $JSON | jq -r .amount)
COMMENT=$(echo $JSON | jq -r .comment)
lastTXdate=$(cat ~/.zen/game/players/${PLAYER}/.uplanet.check)
[[ -z lastTXdate ]] && lastTXdate=0
[[ $(cat ~/.zen/game/players/${PLAYER}/.uplanet.check) -ge $TXIDATE ]] \
&& continue
[[ $(echo "$TXIAMOUNT < 0" | bc) -eq 1 ]] \
&& echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.uplanet.check \
&& continue
echo "# CHECK FOR PRIMAL REGULAR TX in INCOMING PAYMENTS"
# silkaj money history DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech | tail -n 3 | head -n 1
# │ 2017-11-25 │ 5nk2qdh1…:GWD │ 200 │ 18.332 │ │
line=$(silkaj money history $TXIPUBKEY | tail -n 3 | head -n 1)
pub8=$(echo $line | awk -F'│' '{gsub(/[[:space:]]*/, "", $3); split($3, a, ":"); print substr(a[1], 1, 8)}')
# pub8=$(echo $line | cut -d '│' -f 3 | cut -c 1-8)
# PUB8= UPLANET WALLET
done < $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json
fi
##########################################################
############# CHECK FOR N1COMMANDs IN PAYMENT COMMENT
#################################################################
# LOG / cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[]
## TREAT ANY COMMENT STARTING WITH N1: exemple : N1Kodi.sh
## EXTRACT /ASTROBOT/N1ProgramNames
ls ${MY_PATH}/../ASTROBOT/ | grep "N1" | cut -d "." -f 1 > ~/.zen/tmp/${MOATS}/N1PROG
while read prog; do
echo "# SCAN FOR N1 COMMAND : $prog"
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[] | grep "$prog" >> ~/.zen/tmp/${MOATS}/myN1.json
done < ~/.zen/tmp/${MOATS}/N1PROG
# got N1 incoming TX
while read NLINE; do
## COMMENT FORMAT = N1$CMD:$TH:$TRAIL
TXIDATE=$(echo ${NLINE} | jq -r .date)
TXIPUBKEY=$(echo ${NLINE} | jq -r .pubkey)
COMMENT=$(echo ${NLINE} | jq -r .comment)
CMD=$(echo ${COMMENT} | cut -d ':' -f 1 | cut -c -12 ) # Maximum 12 characters CMD
# Verify last recorded acting date (avoid running twice)
[[ $(cat ~/.zen/game/players/${PLAYER}/.ndate) -ge $TXIDATE ]] \
&& echo "$CMD $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
&& continue
TH=$(echo ${COMMENT} | cut -d ':' -f 2)
TRAIL=$(echo ${COMMENT} | cut -d ':' -f 3-)
if [[ -s ${MY_PATH}/../ASTROBOT/${CMD}.sh ]]; then
echo "RECEIVED CMD=${CMD} from ${TXIPUBKEY}"
${MY_PATH}/../ASTROBOT/${CMD}.sh ${INDEX} ${PLAYER} ${MOATS} ${TXIPUBKEY} ${TH} ${TRAIL}
## WELL DONE .
[[ $? == 0 ]] && echo "${CMD} DONE" && echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.ndate ## MEMORIZE LAST TXIDATE
else
echo "NOT A N1 COMMAND ${COMMENT}"
fi
done < ~/.zen/tmp/${MOATS}/myN1.json
########################################################################################
echo "# CHECK FOR EMAILs IN PAYMENT COMMENT"
## DEBUG ## cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -r
#################################################################
cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json | jq -rc .[] | grep '@' \
> ~/.zen/tmp/${MOATS}/myPalPay.json
# IF COMMENT CONTAINS EMAIL ADDRESSES
# SPREAD & TRANSFER AMOUNT TO NEXT (REMOVING IT FROM LIST)...
## Other G1PalPay will continue the transmission...
########################################################################
## GET @ in JSON INLINE
while read LINE; do
echo "${LINE}"
JSON=${LINE}
TXIDATE=$(echo $JSON | jq -r .date)
TXIPUBKEY=$(echo $JSON | jq -r .pubkey)
TXIAMOUNT=$(echo $JSON | jq -r .amount)
TXIAMOUNTUD=$(echo $JSON | jq -r .amountUD)
COMMENT=$(echo $JSON | jq -r .comment)
lastTXdate=$(cat ~/.zen/game/players/${PLAYER}/.atdate)
[[ -z lastTXdate ]] && lastTXdate=0
[[ $(cat ~/.zen/game/players/${PLAYER}/.atdate) -ge $TXIDATE ]] \
&& echo "PalPay $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
&& continue
## GET EMAILS FROM COMMENT
TXIMAILS=($(echo "$COMMENT" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
[[ $(echo "$TXIAMOUNT < 0" | bc) -eq 1 ]] \
&& echo "TX-OUT :: ${LINE}" \
&& echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate \
&& continue
## DIVIDE INCOMING AMOUNT TO SHARE
echo "N=${#TXIMAILS[@]}"
N=${#TXIMAILS[@]}
SHAREE=$(echo "scale=2; $TXIAMOUNT / $N" | bc)
SHARE=$(makecoord ${SHAREE})
## SHARE is received AMOUT divided by numbers of EMAILS in comment
echo "% ${#TXIMAILS[@]} % $SHARE % $TXIDATE $TXIPUBKEY $TXIAMOUNT [$TXIAMOUNTUD] $TXIMAILS"
# let's loop over TXIMAILS
for EMAIL in "${TXIMAILS[@]}"; do
[[ ${EMAIL} == $PLAYER ]] \
&& echo "ME MYSELF" \
&& echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate \
&& continue
echo "EMAIL : ${EMAIL}"
ASTROTW="" STAMP="" ASTROG1="" ASTROIPFS="" ASTROFEED="" # RESET VAR
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${EMAIL}) ## export ASTROTW and more
[[ ${ASTROTW} == "" ]] && ASTROTW=${ASTRONAUTENS}
echo "export ASTROPORT=${ASTROPORT} ASTROTW=${ASTROTW} ASTROG1=${ASTROG1} ASTROMAIL=${EMAIL} ASTROFEED=${FEEDNS}"
if [[ ! ${ASTROTW} ]]; then
echo "# PLAYER ${EMAIL} INCONNU $(date)"
continue
fi
if [[ ! ${ASTROG1} ]]; then
echo "<html><head><meta charset='UTF-8'>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head><body>" > ~/.zen/tmp/palpay.bro
echo "<h1>BRO.<h1>
$PLAYER wants to send you ${SHARE} G1...<br>
<br>(♥‿‿♥)... on <a href='https://qo-op.com'>UPlanet</a>
</body></html>" >> ~/.zen/tmp/palpay.bro
${MY_PATH}/../tools/mailjet.sh "${EMAIL}" ~/.zen/tmp/palpay.bro "BRO. $PLAYER INVITATION"
continue
fi
sleep 3
## SEND G1
echo "PalPay____________
SEND ${SHARE} G1 to $ASTROMAIL
TW : $ASTROTW
G1 : ${ASTROG1}"
echo PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${SHARE}" "${ASTROG1}" "UPLANET:PALPAY"
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${SHARE}" "${ASTROG1}" "UPLANET:PALPAY"
STAMP=$?
## DONE STAMP IT
[[ $STAMP == 0 ]] \
&& echo "REDISTRIBUTION DONE" \
&& echo "$TXIDATE" > ~/.zen/game/players/${PLAYER}/.atdate
done
done < ~/.zen/tmp/${MOATS}/myPalPay.json
echo "====(•‿‿•)======= %%%%% (°▃▃°) %%%%%%% ======(•‿‿•)========"
########################################################################################
## SEARCH FOR TODAY MODIFIED TIDDLERS WITH MULTIPLE EMAILS IN TAG
# This can could happen in case Tiddler is copied OR PLAYER manualy adds an email tag to Tiddler to share with someone...
#################################################################
echo "# EXTRACT [days[-1]] DAYS TIDDLERS"
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \
--render '.' "today.${PLAYER}.tiddlers.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days[-1]]'
# cat ~/.zen/tmp/${MOATS}/today.${PLAYER}.tiddlers.json | jq -rc # LOG
## FILTER MY OWN EMAIL
cat ~/.zen/tmp/${MOATS}/today.${PLAYER}.tiddlers.json \
| sed "s~${PLAYER}~ ~g" | jq -rc '.[] | select(.tags | contains("@"))' \
> ~/.zen/tmp/${MOATS}/@tags.json 2>/dev/null ## Get tiddlers with not my email in it
[[ ! -s ~/.zen/tmp/${MOATS}/@tags.json ]] \
&& echo "NO EXTRA @tags.json TIDDLERS TODAY"
# LOG
cat ~/.zen/tmp/${MOATS}/@tags.json
echo "******************TIDDLERS with new EMAIL in TAGS treatment"
################################
## detect NOT MY EMAIL in TODAY TIDDLERS
################################
while read LINE; do
echo "---------------------------------- Sava PalPé mec"
echo "${LINE}"
echo "---------------------------------- PalPAY for Tiddler"
TCREATED=$(echo ${LINE} | jq -r .created)
TTITLE=$(echo ${LINE} | jq -r .title)
TTEXT=$(echo ${LINE} | jq -r '.text | match("/ipfs/[^\"\\s]+") | .string | first')
TTAGS=$(echo ${LINE} | jq -r .tags)
## Extract "/ipfs/CID" from Tiddler - to pin TOPIN -
TOPIN=$(echo ${LINE} | jq -r .ipfs) ## Tiddler produced by "Astroport Desktop"
[[ ! $(echo ${TOPIN} | grep '/ipfs') ]] && TOPIN=$(echo ${LINE} | jq -r ._canonical_uri) ## Tiddler is exported to IPFS
[[ ! $(echo ${TOPIN} | grep '/ipfs') ]] && TOPIN=$(echo ${LINE} | jq -r '.text | match("/ipfs/[^\"\\s]+") | .string | first') ## Ket first /ipfs/ link from text field
[[ ! $(echo ${TOPIN} | grep '/ipfs') ]] && echo "NOT COMPATIBLE ${TOPIN}" && TOPIN=""
echo "$TTITLE"
## Count extra emails found
emails=($(echo "$TTAGS" | sed "s~${PLAYER}~ ~g" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
nb=${#emails[@]}
#~ zen=$(echo "scale=2; $nb / 10" | bc) ## / divide by 10 = 1 ZEN each
## Get first zmail
ZMAIL="${emails}"
MSG="SEND + $nb JUNE TO BROs : ${emails[@]}"
echo $MSG
ASTROTW="" STAMP="" ASTROG1="" ASTROIPFS="" ASTROFEED=""
#### SEARCH FOR PALPAY ACOUNTS : USING PALPAY RELAY - COULD BE DONE BY A LOOP ?? §§§
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${ZMAIL}) ## export ASTROTW and more
echo "export ASTROPORT=${ASTROPORT} ASTROTW=${ASTROTW} ASTROG1=${ASTROG1} ASTROMAIL=${EMAIL} ASTROFEED=${FEEDNS}"
[[ ${ASTROTW} == "" ]] && ASTROTW=${ASTRONAUTENS}
echo "TOPIN=${TOPIN}"
if [[ ${TOPIN} && ${ASTROG1} && ${ASTROG1} != ${G1PUB} ]]; then
##############################
### GET PAID & GET PINNED !!
##############################
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${nb}" "${ASTROG1}" "${emails[@]} /ipfs/${TOPIN}"
echo "<html><head><meta charset='UTF-8'>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head><body><h1>BRO ${PLAYER}</h1> : $MSG" > ~/.zen/tmp/${MOATS}/g1message
## PINNING IPFS MEDIA - PROOF OF COPY SYSTEM -
[[ ! -z $TOPIN ]] \
&& ipfs pin add $TOPIN \
&& echo "<br> <a href='${myIPFSGW}'/ipns/${ASTROTW}#${TTITLE}>${TTITLE}</a>
<br>( ${emails[@]} )<br>
<h2>PIN: <a href='${myIPFSGW}'$TOPIN>$TOPIN</a></h2>(☼‿‿☼)" >> ~/.zen/tmp/${MOATS}/g1message
## lazy mode... NOT FINISHING HTML TAGGING... browser shoud display html page ;)
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/g1message "BRO. ${ZMAIL} TW5 PIN"
else
## ${ZMAIL} NOT A PLAYER YET
## SEND MESSAGE TO INFORM ${ZMAIL} OF THIS EXISTING TIDDLER
echo "<html><head><meta charset='UTF-8'>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head><body>
<h1>BRO. </h1>
<br> <a href='${myIPFSGW}'/ipns/${ASTROTW}#${TTITLE}>${TTITLE}</a>
<br>( ${emails[@]} )<br>
<br><b>${TTITLE}</b><br>(✜‿‿✜)
... Join <a href='https://qo-op.com'>UPlanet</a>
</body></html>" > ~/.zen/tmp/palpay.bro
${MY_PATH}/../tools/mailjet.sh "${ZMAIL}" ~/.zen/tmp/palpay.bro "BRO. ${PLAYER} TW5 link"
fi
done < ~/.zen/tmp/${MOATS}/@tags.json
echo "=====(•‿‿•)====== ( ◕‿◕) (◕‿◕ ) =======(•‿‿•)======="
# rm -Rf $HOME/.zen/tmp/${MOATS}
ls $HOME/.zen/tmp/${MOATS}
exit 0

264
RUNTIME/G1Voeu.sh Executable file
View File

@ -0,0 +1,264 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# 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
. "${MY_PATH}/../tools/my.sh"
################################################################################
# Create G1VOEU TW for PLAYER
# Mon Titre => G1MonTitre
## PARAM : "TITRE DU VOEU" "PLAYER" "INDEX"
################################################################################
TITRE="$1"
PLAYER="$2"
INDEX="$3"
[[ ${PLAYER} == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ${PLAYER} == "" ]] && echo "Second paramètre PLAYER manquant" && exit 1
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
[[ $G1PUB == "" ]] && echo "Troisième paramètre G1PUB manquant" && exit 1
[[ ! $INDEX ]] && INDEX="$HOME/.zen/game/players/${PLAYER}/ipfs/moa/index.html"
echo $INDEX
[[ ! -s $INDEX ]] && echo "TW ${PLAYER} manquant" && exit 1
echo "Working on $INDEX"
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
[[ $ASTRONAUTENS == "" ]] && echo "CLEF IPNS ASTRONAUTE MANQUANTE - EXIT -" && exit 1
echo "Bienvenue $PSEUDO (${PLAYER}) : $G1PUB"
echo
######################################################################
MOATS="$4"
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
#####################################################
# CREATION DE LA CLEF DERIVEE "G1VOEU"
#####################################################
source ~/.zen/game/players/${PLAYER}/secret.june ## LE PEPPER DU PLAYER DEVIENT LE SECRET1 DU G1VOEU
[[ ${PEPPER} ]] && echo "Using PLAYER PEPPER AS WISH SALT" && SECRET1="${PEPPER}" ##
[[ ! ${SECRET1} ]] && SECRET1=$(${MY_PATH}/../tools/diceware.sh 12 | xargs)
#~ echo "${SECRET1}"
echo "## TITRE DU G1VOEU ? CapitalGluedWords please"
[[ ! ${TITRE} ]] && read TITRE
VoeuName=$(echo "${TITRE}" | sed -r 's/\<./\U&/g' | sed 's/ //g') # VoeuName EST LE TITRE DU VOEU : CapitalGluedWords + EMAIL
SECRET2="${VoeuName} ${PLAYER} ${SALT}" ## SECRET2 est "TitreDuVoeu PLAYER SALT"
echo "${SECRET2}" && [[ ! ${SECRET2} ]] && echo "EMPTY SECRET2 - ERROR" && exit 1
echo "## keygen PLAYER DERIVATE WISH KEY"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/wish.dunikey "${SECRET1}${UPLANETNAME}" "${SECRET2}${UPLANETNAME}"
WISHG1PUB=$(cat ~/.zen/tmp/${MOATS}/wish.dunikey | grep "pub:" | cut -d ' ' -f 2)
echo "WISHG1PUB (G1PUB) = ${WISHG1PUB}"
[[ ${WISHG1PUB} == "" ]] && echo "EMPTY WISHG1PUB G1PUB - ERROR" && exit 1
mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
mv ~/.zen/tmp/${MOATS}/wish.dunikey ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey
echo "# NOUVEAU VOEU"
mkdir -p ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey "${SECRET1}${UPLANETNAME}" "${SECRET2}${UPLANETNAME}"
ipfs key import ${WISHG1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey
VOEUNS=$(ipfs key list -l | grep -w "${WISHG1PUB}" | cut -d ' ' -f 1 )
echo "/ipns/${VOEUNS}"
## NATOOLS ENCRYPT
echo "# NATOOLS ENCODING qrtw.ipfskey "
${MY_PATH}/../tools/natools.py encrypt -p $G1PUB -i $HOME/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/qrtw.ipfskey -o $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc
ENCODING=$(cat $HOME/.zen/tmp/${MOATS}/qrtw.ipfskey.$G1PUB.enc | base16)
#~ echo $ENCODING
## TEST IPFS
#~ ipfs --timeout=30s cat --progress=false /ipns/${VOEUNS} > ~/.zen/tmp/${VOEUNS}.json
#~ [[ -s ~/.zen/tmp/${VOEUNS}.json ]] \
#~ && echo "HEY !!! UN CHANNEL EXISTE DEJA POUR CE VOEU ! ~/.zen/tmp/${VOEUNS}.json - EXIT -" \
#~ && exit 1
echo "# UPGRADING WORLD WHISHKEY DATABASE"
mkdir -p ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
## A la fois Titre du tag et Pepper construction de clef
echo ${VoeuName} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.pepper
echo ${WISHG1PUB} > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/.wish
echo "# CREATION QR CODE"
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | xargs | cut -d ' ' -f 2)
qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png" "$LIBRA/ipns/${VOEUNS}"
#################################################################
## MAKING SPECIAL amrzqr => G1Milgram TICKET
## LE QRCODE CORRESPOND A LA CLEF DERIVE "${PLAYER} :: G1${VoeuName} ${PLAYERG1PUB}" avec PASS=YYYYMM
IMAGIC=$(${MY_PATH}/../tools/VOEUX.print.sh "${PLAYER}" "${VoeuName}" "${MOATS}" "${G1PUB}" | tail -n 1)
cp ~/.zen/tmp/${MOATS}/START.png ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.ASTROLINK.png" "$LIBRA/ipns/$ASTRONAUTENS"
qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1ASTRO.png" "${G1PUB}"
qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png" "${WISHG1PUB}:ZEN"
qrencode -s 12 -o "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.IPNS.png" "/ipns/${VOEUNS}"
#################################
# PREMIER TYPE ~/.zen/tmp/player.png
convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.WISHLINK.png -resize 300 ~/.zen/tmp/QRWISHLINK.png
convert ${MY_PATH}/../images/logoastro.png -resize 220 ~/.zen/tmp/ASTROLOGO.png
composite -compose Over -gravity NorthWest -geometry +350+10 ~/.zen/tmp/ASTROLOGO.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
convert -gravity northwest -pointsize 20 -fill black -draw "text 320,250 \"${PLAYER}\"" ~/.zen/tmp/one.png ~/.zen/tmp/hop.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 20,320 \"${VoeuName}\"" ~/.zen/tmp/hop.png ~/.zen/tmp/pseudo.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"*****\"" ~/.zen/tmp/pseudo.png ~/.zen/tmp/salt.png
convert -gravity northwest -pointsize 33 -fill black -draw "text 320,350 \"${VoeuName}\"" ~/.zen/tmp/salt.png ~/.zen/tmp/player.png
#################################
# SECOND TYPE ~/.zen/tmp/voeu.png
convert $HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/QR.G1WISH.png -resize 300 ~/.zen/tmp/G1WISH.png
convert ${MY_PATH}/../images/logojeu.png -resize 260 ~/.zen/tmp/MIZLOGO.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/G1WISH.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +300+0 ~/.zen/tmp/QRWISHLINK.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
composite -compose Over -gravity NorthWest -geometry +320+280 ~/.zen/tmp/MIZLOGO.png ~/.zen/tmp/one.png ~/.zen/tmp/two.png
convert -gravity northwest -pointsize 28 -fill black -draw "text 32,350 \"Ğ1 VOEU\"" ~/.zen/tmp/two.png ~/.zen/tmp/pep.png
convert -gravity northwest -pointsize 50 -fill black -draw "text 30,300 \"${VoeuName}\"" ~/.zen/tmp/pep.png ~/.zen/tmp/voeu.png
# IMAGE DANS IPFS
IVOEUPLAY=$(ipfs add -Hq ~/.zen/tmp/player.png | tail -n 1)
IVOEU=$(ipfs add -Hq ~/.zen/tmp/voeu.png | tail -n 1)
### G1VOEU LIGHTBEAM :: ${PLAYER}_${VoeuName} :: /ipns/${VOEUNS}
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_${VoeuName}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key-'${VoeuName}'","text":"'${VOEUNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-key-'${VoeuName}'","text":"'${WISHG1PUB}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-g1.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/g1/lightbeam-natools-'${VoeuName}'","text":"'${ENCODING}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-natools.json
# TEXT="<a target='_blank' href='"/ipns/${VOEUNS}"'><img src='"/ipfs/${IVOEUPLAY}"'></a><br><br><a target='_blank' href='"/ipns/${VOEUNS}"'>"${VoeuName}"</a>"
#:[tag[G1CopierYoutube]] [tag[pdf]]
# Contains QRCode linked to G1VoeuTW and BUTTON listing G1Voeux
# <img width='600' src='"/ipfs/${IMAGIC}"'><br>
TEXT="<a target='_blank' href='#:[tag[G1"${VoeuName}"]]' ><img src='"/ipfs/${IVOEUPLAY}"'></a><br>\n
<a target='_blank' href='"/ipns/${VOEUNS}"'>TW G1Voeu "${PLAYER}"</a><br><br>\n\n
<\$button class='tc-tiddlylink'>\n
<\$list filter='[tag[G1"${VoeuName}"]]'>\n
<\$action-navigate \$to=<<currentTiddler>> \$scroll=no/>\n
</\$list>\n
ALL G1"${VoeuName}"\n
</\$button>"
# NEW IVEU TIDDLER
echo "## Creation json tiddler : G1${VoeuName} /ipfs/${IVOEU}"
echo '[
{
"created": "'${MOATS}'",
"title": "'${VoeuName}'",
"type": "'text/vnd.tiddlywiki'",
"astronautens": "'/ipns/${ASTRONAUTENS}'",
"wishns": "'/ipns/${VOEUNS}'",
"qrcode": "'/ipfs/${IVOEUPLAY}'",
"decode": "'/ipfs/${IVOEU}'",
"wish": "'${WISHG1PUB}'",
"g1pub": "'${G1PUB}'",
"text": "'${TEXT}'",
"tags": "'G1Voeu G1${VoeuName} ${PLAYER}'",
"asksalt": "'${HPass}'",
"junesec" : "'${ENCODING}'"
}
]
' > ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json
rm -f ~/.zen/tmp/newindex.html
echo "Nouveau Voeu ${VoeuName} dans MOA $PSEUDO : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
tiddlywiki --load $INDEX \
--deletetiddlers '[tag[voeu]]' \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-g1.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-natools.json "application/json" \
--import ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json "application/json" \
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
echo "PLAYER TW Update..."
if [[ -s ~/.zen/tmp/newindex.html ]]; then
echo "___ Mise à jour $INDEX"
cp -f ~/.zen/tmp/newindex.html $INDEX
else
echo "ERROR INTO ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/${VoeuName}.voeu.json"
fi
# PRINTING
LP=$(ls /dev/usb/lp* | head -n1)
if [[ ! $LP ]]; then
echo "NO PRINTER FOUND - Plug a Brother QL700 or Add your printer"
else
echo "IMPRESSION VOEU"
brother_ql_create --model QL-700 --label-size 62 ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/result.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/player.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/voeu.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
fi
# COPY QR CODE TO PLAYER ZONE
cp ~/.zen/tmp/player.png ~/.zen/tmp/voeu.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
echo "${SECRET1}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.salt
echo "${VoeuName}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.title
echo "$LIBRA/ipns/${VOEUNS}" > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link
cp ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.link ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/
cp ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/*.png ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/
# PUBLISHING
echo "ipfs name publish --key=${WISHG1PUB}"
banner="## ${PLAYER} G1WISH READY :: G1${VoeuName}
<img src=/ipfs/$IMAGIC>
G1Voeu Astronaute (TW) : $LIBRA/ipns/$ASTRONAUTENS
${VoeuName} FLUX Ŋ1
G1${VoeuName} : $LIBRA/ipns/${VOEUNS}
WISH G1PUB : ${WISHG1PUB}"
IPUSH=$(echo "$banner" | ipfs add -q | tail -n 1)
ipfs name publish --key=${WISHG1PUB} /ipfs/$IPUSH 2>/dev/null
echo $IPUSH > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/.chain.${MOATS}
echo $banner > ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
cat ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/banner
#~ echo "## TO RECEIVE G1RONDS Creating Cesium+ Profil #### timeout long ... patience ...."
#~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB}/wish.dunikey set --name "G1Voeu ${VoeuName}" --avatar "$HOME/.zen/game/world/${VoeuName}/${WISHG1PUB}/result_qrcode.png" --site "$LIBRA/ipns/${VOEUNS}" #CESIUM+
#~ [[ ! $? == 0 ]] && echo "G1VOEU CESIUM WALLET PROFILE CREATION FAILED !!!!"
echo "************************************************************"
#~ echo "COULD LIMIT ON JUNE pour le Voeu ${VoeuName}"
#~ echo ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c \'"${VOEUNS} G1Voeu ${VoeuName}"\' -m
#~ echo "************************************************************"
#~ echo "************************************************************"
#~ ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a 1 -p ${WISHG1PUB} -c "$VOEUXNS G1Voeu ${VoeuName}" -m
#~ [[ ! $? == 0 ]] \
#~ && echo "SOOOOOOOOOOOORRRRRRRY GUY. YOU CANNOT PAY A G1 A NEW WISH - THIS IS FREE TO CHANGE -"
#~ && rm -Rf ~/.zen/game/players/${PLAYER}/voeux/${VoeuName}/${WISHG1PUB} \
#~ && rm -Rf ~/.zen/game/world/${VoeuName}/${WISHG1PUB}/ \
#~ && ipfs key rm ${WISHG1PUB} \
#~ && tiddlywiki --load ${INDEX} \
#~ --deletetiddlers '${VoeuName}' \
#~ --output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain" \
#~ && cp -f ~/.zen/tmp/newindex.html $INDEX \
#~ && echo "G1${VoeuName} FLUX REMOVED"
echo "************************************************************"
exit 0

103
RUNTIME/GEOKEYS_refresh.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/bash
########################################################################
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
## EXPLORE SWARM MAPNS
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "$MY_PATH/../tools/my.sh"
## LOG into ~/.zen/tmp/_12345.log
exec 2>&1 >> ~/.zen/tmp/_12345.log
echo "=========================="
echo "(◕‿◕ ) ${ME} (◕‿◕ ) "
#~ ## CHECK IF ALREADY MErunning
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
echo "(◕‿◕ ) ${ME} starting UPlanet Key Scan _______________________________"
## LOCAL
LWKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#LWKEYS[@]} " local UMAPS"
LSKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#LSKEYS[@]} " local SECTORS"
LRKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#LRKEYS[@]} " local REGIONS"
## SWARM
WKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#WKEYS[@]} " swarm UMAPS"
SKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/SECTORS/_*_*/_*.?_*.?/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#SKEYS[@]} " swarm SECTORS"
RKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf ))
echo ${#RKEYS[@]} " swarm REGIONS"
## COMBINE & SHUFFLE KEYS
combined=("${LWKEYS[@]}" "${LSKEYS[@]}" "${LRKEYS[@]}" "${WKEYS[@]}" "${SKEYS[@]}" "${RKEYS[@]}")
UKEYS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u | shuf ))
echo "SYNC ${#UKEYS[@]} GEOKEYS..."
## STORAGE FOR IPFS GET UplanetKeyS
mkdir -p ~/.zen/tmp/flashmem
## Refresh flashmem/UplanetKey every 3 hours => DATA SHAKER
find ~/.zen/tmp/flashmem -mmin +180 -exec rm -rf {} +
floop=0
medo=0
for key in ${UKEYS[@]}; do
[[ -d ~/.zen/tmp/flashmem/$key ]] \
&& echo "$key already copied" && medo=$((medo +1)) && continue
echo "SYNC $key"
floop=$((floop +1))
mkdir -p ~/.zen/tmp/flashmem/$key
echo "ipfs --timeout 180s get -o ~/.zen/tmp/flashmem/$key /ipns/$key"
ipfs --timeout 180s get --progress=false -o ~/.zen/tmp/flashmem/$key /ipns/$key
[[ $? == 0 ]] \
&& medo=$((medo +1)) && floop=$((floop -1)) \
|| rm -Rf ~/.zen/tmp/flashmem/$key # GOT IT or NOT ?
[ $floop -gt 33 ] && break
done
echo "=========================="
echo "(◕‿◕ ) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#UKEYS[@]} GEOKEYS"
echo "=========================="
## Search for TW /ipfs/ and refresh
TWS=($(cat ~/.zen/tmp/flashmem/*/TWz/*/_index.html | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf))
echo "SYNC ${#TWS[@]} TWs..."
floop=0
medo=0
for tw in ${TWS[@]}; do
[[ -d ~/.zen/tmp/flashmem/tw/$tw ]] \
&& echo "$key already copied" && medo=$((medo +1)) && continue
echo "SYNC $key"
floop=$((floop +1))
mkdir -p ~/.zen/tmp/flashmem/tw/$tw
ipfs --timeout 180s get --progress=false -o ~/.zen/tmp/flashmem/tw/$tw/index.html /ipns/$tw
[[ $? == 0 ]] \
&& medo=$((medo +1)) && floop=$((floop -1)) \
|| rm -Rf ~/.zen/tmp/flashmem/tw/$tw
[ $floop -gt 33 ] && break
done
echo "=========================="
echo "(✜‿‿✜) ${ME} :: $medo SUCCESS missing $floop KEYS from ${#TWS[@]} TWS"
echo "=========================="
exit 0

81
RUNTIME/NODE.refresh.sh Executable file
View File

@ -0,0 +1,81 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## MAP REFRESH
# LOAD EXTRA DATA TO CACHE ~/.zen/tmp/${IPFSNODEID}/
# PUBLISH STATION BALISE
############################################
echo "## RUNNING NODE.refresh"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
# UDATE STATION BALISE
if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
# ONLY FRESH DATA HERE
BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | xargs | cut -f 1)
## Getting actual online version
#~ ipfs get -o ~/.zen/tmp/${IPFSNODEID} /ipns/${IPFSNODEID}/
## COPY STATION yt-dlp.list
cp $HOME/.zen/.yt-dlp.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.list
cp $HOME/.zen/.yt-dlp.mp3.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.mp3.list
## COPY COINS VALUE OF THE DAY
rm -Rf ~/.zen/tmp/${IPFSNODEID}/COINS/
mkdir -p ~/.zen/tmp/${IPFSNODEID}/COINS/
cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/
## COPY 20h12.log
rm -f ~/.zen/tmp/${IPFSNODEID}/20h12.log ## TODO REMOVE
cp -f /tmp/20h12.log ~/.zen/tmp/${IPFSNODEID}/20h12.txt
## COPY FRIENDS
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
echo "FOUND : ${PLAYERONE[@]}"
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
echo "${PLAYER} GCHANGE FRIENDS"
[[ -d ~/.zen/tmp/${IPFSNODEID}/${PLAYER} && ${PLAYER} != "" ]] \
&& rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
done
## STOP GCHANGE SWARM SHARING --- too big data --- deprecated
rm -Rf ~/.zen/tmp/${IPFSNODEID}/GCHANGE ## UGGLY PATCH
## INFORM GPS LOCATION
[[ -s ~/.zen/game/players/.current/GPS.json ]] \
&& cp ~/.zen/game/players/.current/GPS.json ~/.zen/tmp/${IPFSNODEID}/ \
&& LAT=$(cat ~/.zen/tmp/${IPFSNODEID}/GPS.json | jq -r .[].lat) \
&& LON=$(cat ~/.zen/tmp/${IPFSNODEID}/GPS.json | jq -r .[].lon) \
&& echo "LAT=${LAT}; LON=${LON}" > ~/.zen/GPS
## REFRESH TIMESTAMPING
echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats
echo "$(date -u)" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.staom
echo "############################################ MY MAP "
ls ~/.zen/tmp/${IPFSNODEID}/
echo "############################################"
NSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | xargs | cut -f 1)
ROUTING=$(ipfs add -rwHq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish /ipfs/${ROUTING}
echo ">> $NSIZE Bytes STATION BALISE > ${myIPFS}/ipns/${IPFSNODEID}"
fi
echo "## CLEANING SWARM 3 DAYS OLD"
find ~/.zen/tmp/swarm/ -mtime +3 -type d -exec rm -Rf '{}' \;
exit 0

687
RUNTIME/PLAYER.refresh.sh Executable file
View File

@ -0,0 +1,687 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## Publish All PLAYER TW,
# Run TAG subprocess: tube, voeu
############################################
echo "## RUNNING PLAYER.refresh
_..._
.' '. _
/ .-°°-\ _/ \\
.-| /:. | | |
| \ |:. /.-'-./
| .-'-;:__.' =/
.'= A=|STRO _.='
/ _. | ;
;-.-'| \ |
/ | \ _\ _\\
"
PLAYERONE="$1"
# [[ $isLAN ]] && PLAYERONE=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ! ${PLAYERONE} ]] && PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
echo "FOUND ${#PLAYERONE[@]} ASTRONAUTS : ${PLAYERONE[@]}"
CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev)
echo "RENEWING LOCAL UPLANET REPOSITORY (ADMIN=${CURRENT})
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??"
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
[[ ! -d ~/.zen/game/players/${PLAYER:-undefined} ]] && echo "BAD ${PLAYERONE}" && continue
[[ ! $(echo "${PLAYER}" | grep '@') ]] && continue
start=`date +%s`
# CLEAN LOST ACCOUNT
[[ ! -s ~/.zen/game/players/${PLAYER}/secret.dunikey ]] \
&& rm -Rf ~/.zen/game/players/${PLAYER} \
&& echo "WARNING - ERASE ${PLAYER} - BADLY PLUGGED" \
&& continue
YOUSER=$($MY_PATH/../tools/clyuseryomail.sh "${PLAYER}")
### UPGRADE PLAYER for myos IPFS API ### DOUBLON WITH VISA.new (TO REMOVE)
mkdir -p ~/.zen/game/players/${PLAYER}/.ipfs # Prepare PLAYER datastructure
echo "/ip4/127.0.0.1/tcp/5001" > ~/.zen/game/players/${PLAYER}/.ipfs/api
######## WORK IN PROGRESS #### myos integration
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
echo "##### ${YOUSER} ################################ ~/.zen/tmp/${MOATS}"
echo "##################################################################"
echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW "
echo "################################################ $(date)"
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
# Get PLAYER wallet amount
$MY_PATH/../tools/COINScheck.sh ${G1PUB} > ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck
cat ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck ###DEBUG MODE
COINS=$(cat ~/.zen/tmp/${MOATS}/${PLAYER}.COINScheck | tail -n 1)
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "+++ WALLET BALANCE _ $COINS (G1) _ / $ZEN ZEN /"
#~ ## ZENCARD ARE ACTIVATED WITH 1 G1 + 10 ZEN (= 10 €/OC) ?
echo "## >>>>>>>>>>>>>>>> REFRESH ASTRONAUTE TW"
## REFRESH ASTRONAUTE TW
ASTRONAUTENS=$(ipfs key list -l | grep -w ${G1PUB} | cut -d ' ' -f1)
############### CANNOT FIND PLAYER KEY ###########
if [[ ! ${ASTRONAUTENS} ]]; then
echo "${PLAYER} TW IS DISCONNECTED... RECREATING IPNS KEYS"
## TODO : EXTRACT & DECRYPT secret.june FROM TW
ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player
ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player
source ~/.zen/game/players/${PLAYER}/secret.june
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/feed.ipfskey "$SALT" "$G1PUB"
FEEDNS=$(ipfs key import "${PLAYER}_feed" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/feed.ipfskey)
## IF ASTRONS="" KEY WILL BE DELETED AFTER REFRESH
ASTRONAUTENS=$ASTRONS && ASTRONS=""
fi
[[ ! ${ASTRONAUTENS} ]] && echo "ERROR BAD ${PLAYER} - CONTINUE" && continue
echo ">>> $myIPFS/ipns/${ASTRONAUTENS}"
## ACTIVATE PLAYER TW IN STATION CACHE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/
################### GET LATEST TW
rm -f ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
echo "GETTING TW..."
####################################################################################################
ipfs --timeout 480s get --progress=false -o ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html /ipns/${ASTRONAUTENS}
####################################################################################################
## PLAYER TW IS ONLINE ?
if [ ! -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ]; then
NOWCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain)
LASTCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.* | tail -n 1)
try=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.try 2>/dev/null) || try=3
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "$myIPFS/ipns/${ASTRONAUTENS}'>TW REFRESH FAILED"
echo ">> %%% WARNING TRY LEFT : $try %%%"
echo "------------------------------------------------"
echo " * <a href='${myIPFS}/ipfs/${LASTCHAIN}'>LAST</a>"
echo " * <a href='${myIPFS}/ipfs/${NOWCHAIN}'>NOW</a>"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
## SEND AN EMAIL ALERT TO PLAYER
echo "<html><head><meta charset='UTF-8'>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head><body><a href='$myIPFS/ipns/${ASTRONAUTENS}'>TW LOADING TIMEOUT</a>" > ~/.zen/tmp/result
echo "<br>------------------------------------------------" >> ~/.zen/tmp/result
echo "<br>" >> ~/.zen/tmp/result
echo "<br><a href='${myIPFS}/ipfs/${LASTCHAIN}'>[yesterday]</a>: /ipfs/${LASTCHAIN}" >> ~/.zen/tmp/result
echo "<br><a href='${myIPFS}/ipfs/${NOWCHAIN}'>[today]</a>: /ipfs/${NOWCHAIN}" >> ~/.zen/tmp/result
echo "<br>" >> ~/.zen/tmp/result
echo "<br> %%% WARNING %%% $try TRY LEFT %%%" >> ~/.zen/tmp/result
echo "<br>------------------------------------------------" >> ~/.zen/tmp/result
echo "<br>ipfs name publish --key=${PLAYER} /ipfs/${NOWCHAIN}" >> ~/.zen/tmp/result
echo "</body></html>" >> ~/.zen/tmp/result
[[ $try == 0 && "${CURRENT}" != "${PLAYER}" ]] \
&& echo "PLAYER ${PLAYER} UNPLUG" \
&& ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL" \
&& continue
try=$((try-1))
echo "$try" > ~/.zen/game/players/${PLAYER}/ipfs/moa/.try
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/result "TW LOADING TIMEOUT"
continue
fi
#############################################################
## FOUND TW
err=""
#############################################################
## CHECK "GPS" Tiddler
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
[[ ! -s ~/.zen/tmp/${MOATS}/GPS.json || $(cat ~/.zen/tmp/${MOATS}/GPS.json) == "[]" ]] \
&& msg="${PLAYER} GPS : BAD TW (☓‿‿☓) " && err="(☓‿‿☓)"
#############################################################
## CHECK MadeInZion
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion' ## MadeInZion Tiddler
[[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json || $(cat ~/.zen/tmp/${MOATS}/MadeInZion.json) == "[]" ]] \
&& msg="${PLAYER} MadeInZion : BAD TW (☓‿‿☓) " && err="(☓‿‿☓)" && player="" \
|| player=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
lang=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json 2>/dev/null | jq -r .[].dao)
[[ ${lang} == "null" ]] && lang="fr"
#############################################################
## CHECK "AstroID" Tiddler
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'AstroID.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID' ## AstroID Tiddler
[[ $(cat ~/.zen/tmp/${MOATS}/AstroID.json 2>/dev/null) == "[]" ]] && rm ~/.zen/tmp/${MOATS}/AstroID.json
########################################## used by Astroport :: Lasertag :: TW plugin ##
## CHECK "$:/config/NewTiddler/Tags"
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'TWsign.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '$:/config/NewTiddler/Tags' ## $:/config/NewTiddler/Tags Tiddler
signature=$(cat ~/.zen/tmp/${MOATS}/TWsign.json | jq -r .[].text)
echo "${player} SIGNATURE = $signature"
#############################################################
## CHECK "Astroport" TIDDLER
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' ## Astroport Tiddler
[[ ! -s ~/.zen/tmp/${MOATS}/Astroport.json || $(cat ~/.zen/tmp/${MOATS}/Astroport.json) == "[]" ]] \
&& msg="${PLAYER} Astroport : BAD TW (☓‿‿☓) " && err="(☓‿‿☓)"
############################################################ BAD TW SIGNATURE
[[ ( ${player} != ${PLAYER} || ${PLAYER} != ${signature} || "${err}" == "(☓‿‿☓)" ) && ${PLAYER} != ${CURRENT} ]] \
&& echo "> (☓‿‿☓) BAD PLAYER=$player in TW (☓‿‿☓) $msg" \
&& ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ALL" \
&& continue \
|| echo "${PLAYER} OFFICIAL TW - (⌐■_■) -"
BIRTHDATE=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].birthdate)
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport) ## ZenStation IPNS address
CURCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain | rev | cut -f 1 -d '/' | rev) # Remove "/ipfs/" part
[[ ${CURCHAIN} == "" || ${CURCHAIN} == "null" ]] \
&& CURCHAIN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # AVOID EMPTY
SBIRTH=$(${MY_PATH}/../tools/MOATS2seconds.sh ${BIRTHDATE})
SNOW=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
DIFF_SECONDS=$(( SNOW - SBIRTH ))
days=$((DIFF_SECONDS / 60 / 60 / 24))
################################################## ANOTHER ASTROPORT !!
IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
########### ASTROPORT is not IPFSNODEID => EJECT TW
if [[ ${IPNSTAIL} != ${IPFSNODEID} || ${IPNSTAIL} == "_ASTROPORT_" ]]; then
echo "> PLAYER MOVED TO ${IPNSTAIL} : UNPLUG "
${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ONE" "Now TW is plugged to ${ASTROPORT}"
echo ">>>> CIAO ${PLAYER}"
continue
fi
################ VERIFICATIONS DONE ######################
echo "ASTROPORT ZenStation : ${ASTROPORT}"
echo "CURCHAIN=${CURCHAIN}"
echo "================================== TW $days days old"
############################################## +2 DAYS & AstroID = UNPLUG !!
## REMOVE TW OLDER THAN 2 DAYS WITH AstroID
[[ -s ~/.zen/tmp/${MOATS}/AstroID.json && $days -gt 2 && "${CURRENT}" != "${PLAYER}" ]] \
&& ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ALL" "TW EJECTION. Found an AstroID in your TW." \
&& echo "(#__#) AstroID +2 DAYS = SECURITY ERROR (#__#)" && continue
####################################################################### RTFM DUMB FIREWALL
############################################################################################
######################################
#### UPLANET GEO COORD EXTRACTION
## GET "GPS" TIDDLER - 0.00 0.00 (if empty: null)
ZLAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
[[ $ZLAT == "null" || $ZLAT == "" ]] && ZLAT="0.00"
ZLON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
[[ $ZLON == "null" || $ZLON == "" ]] && ZLON="0.00"
LAT=$(makecoord ${ZLAT})
LON=$(makecoord ${ZLON})
### GET UMAP ENV
$(${MY_PATH}/../tools/getUMAP_ENV.sh "${LAT}" "${LON}" | tail -n 1)
echo "UMAPG1PUB=$UMAPG1PUB UMAPIPNS=$UMAPIPNS SECTORG1PUB=$SECTORG1PUB SECTORIPNS=$SECTORIPNS REGIONG1PUB=$REGIONG1PUB REGIONIPNS=$REGIONIPNS LAT=$LAT LON=$LON SLAT=$SLAT SLON=$SLON RLAT=$RLAT RLON=$RLON"
UMAPNS=$(echo $UMAPIPNS | cut -d '/' -f 3)
#############################################
# MAKE "GPS" TIDDLER
cat ${MY_PATH}/../templates/data/GPS.json \
| sed -e "s~_MOATS_~${MOATS}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
-e "s~_LAT_~${LAT}~g" \
-e "s~_LON_~${LON}~g" \
-e "s~_UMAPNS_~${UMAPNS}~g" \
-e "s~_SECTORTW_~${SECTORIPNS}/TW~g" \
> ~/.zen/tmp/${MOATS}/GPS.json
## UPDATE PLAYER CACHE
echo "_${LAT}_${LON}" > ~/.zen/game/players/${PLAYER}/.umap
cp ~/.zen/tmp/${MOATS}/GPS.json ~/.zen/game/players/${PLAYER}/
################# PERSONAL VDO.NINJA PHONEBOOTH
if [[ "${days}" == "3" ]]; then
YOUSER=$($MY_PATH/../tools/clyuseryomail.sh "${PLAYER}")
_USER=$(echo $YOUSER | sed "s~\.~_~g")
# MAKE "VISIO" TIDDLER
cat ${MY_PATH}/../templates/data/VISIO.json \
| sed -e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
-e "s~_PHONEBOOTH_~${_USER}~g" \
> ~/.zen/tmp/${MOATS}/VISIO.json
else
echo "[]" > ~/.zen/tmp/${MOATS}/VISIO.json
fi
#####################################################################
# MAKE "CESIUM" TIDDLER
if [[ "${days}" == "4" ]]; then
echo "Create CESIUM Tiddler"
cat ${MY_PATH}/../templates/data/CESIUM.json \
| sed -e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
> ~/.zen/tmp/${MOATS}/CESIUM.json
else
echo "[]" > ~/.zen/tmp/${MOATS}/CESIUM.json
fi
#####################################################################
########## $:/moa picture ## CREATE EMAIL from email tiddler ########
## GET $:/moa Tiddlers ####################################### START
echo "GET $:/moa Tiddlers"
###################################################### [tag[$:/moa]] used for "DID" declaration
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'FRIENDS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[$:/moa]]' ## $:/moa EMAIL Tiddlers
#####################################################################
fplayers=($(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq -rc .[].title))
echo "${fplayers[@]}"
UPLAYERSTIDS=()
for fp in ${fplayers[@]}; do
[[ ! "${fp}" =~ ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]] && echo "BAD ${fp} FORMAT" && continue
[[ "${fp}" == "${PLAYER}" ]] && echo "IT'S ME - CONTINUE" && continue
FPLAYER=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .player')
[[ $FPLAYER == 'null' || $FPLAYER == '' ]] \
&& echo "FPLAYER null - NOGOOD${fp} -" \
&& continue
# AUTO CORRECT : sed -i "s~${fp}~NOGOOD${fp}~g" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
FTW=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .tw')
[[ ${FTW} == "/ipns/" || ${FTW} == "null" || ${FTW} == "" ]] && echo "WEIRD FTW ${FTW} - CONTINUE" && continue
FG1PUB=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .g1pub')
[[ $FG1PUB == 'null' || $FG1PUB == '' ]] && echo "FG1PUB null - CONTINUE" && continue
IHASH=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .text' | sha256sum | cut -d ' ' -f 1)
echo ":: coucou :: $FPLAYER :: (ᵔ◡◡ᵔ) ::"
echo "TW: $FTW"
echo "G1: $FG1PUB"
echo "IHASH: $IHASH"
UPLAYERSTIDS=("${UPLAYERSTIDS[@]}" "[[${FPLAYER^^}|${FPLAYER^^}]]")
## GET ORIGINH FROM LAST KNOWN TW STATE
mkdir -p ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}
## CHECK ALREADY IN ${FPLAYER^^} IHASH
rm -f ~/.zen/tmp/${MOATS}/finside.json
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'finside.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${FPLAYER^^}" ## ${FPLAYER^^} autoload Tiddlers
INSIDEH=$(cat ~/.zen/tmp/${MOATS}/finside.json | jq -rc '.[].ihash')
echo "INSIDEH: $INSIDEH"
if [[ -s ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html ]]; then
tiddlywiki --load ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' "${FPLAYER}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${FPLAYER}" ## GET ORIGIN
ORIGINH=$(cat ~/.zen/tmp/${MOATS}/${FPLAYER}.json | jq -r '.[].text' | sha256sum | cut -d ' ' -f 1)
## CAN USE IPFSH=$(cat ~/.zen/tmp/${MOATS}/${FPLAYER}.json | jq -r '.[].text' | ipfs add -q)
## TODO MICROLEDGER TIDDLER...
# we are monitoring email tiddler image change (the G1BILLET background can be made of).
echo "ORIGINH: $ORIGINH"
else
ORIGINH="$INSIDEH"
fi
( ## REFRESH LOCAL PLAYER CACHE with FRIEND ACTUAL TW (&) will be used TOMORROW
ipfs --timeout 480s cat --progress="false" ${FTW} > ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}/index.html
) &
## UPDATE IF IHASH CHANGED -> New drawing => Friend get informed
if [[ -z $INSIDEH || $INSIDEH != $IHASH || $ORIGINH != $INSIDEH ]]; then
cat ${MY_PATH}/../templates/data/_UPPERFPLAYER_.json \
| sed -e "s~_UPPERFPLAYER_~${FPLAYER^^}~g" \
-e "s~_FPLAYER_~${FPLAYER}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_IHASH_~${IHASH}~g" \
-e "s~_FRIENDTW_~${FTW}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
> ~/.zen/tmp/${MOATS}/${FPLAYER^^}.json
echo "Insert New ${FPLAYER^^}.json"
#~ cat ~/.zen/tmp/${MOATS}/${FPLAYER^^}.json | jq
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--import ${HOME}/.zen/tmp/${MOATS}/${FPLAYER^^}.json 'application/json' \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
--render "$:/core/save/all" "newindex.html" "text/plain"
[[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \
|| echo "ERROR - CANNOT IMPORT ${FPLAYER^^}.json - ERROR"
if [[ $ORIGINH != $INSIDEH && $ORIGINH != "" ]]; then
echo "ORIGINH Update"
rm -f ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--import ${HOME}/.zen/tmp/${MOATS}/${FPLAYER}.json 'application/json' \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
--render "$:/core/save/all" "newindex.html" "text/plain"
[[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \
|| echo "ERROR - CANNOT IMPORT ${FPLAYER}.json - ERROR"
fi
fi
done
## GET $:/moa Tiddlers ####################################### END
################## PREPARE LIST TO INSERT IN SECTORTW_NEWS TID
echo "${UPLAYERSTIDS[@]}"
UPLAYERSTIDS_STR=""
for item in "${UPLAYERSTIDS[@]}"; do
UPLAYERSTIDS_STR+="\n* $item"
done
# Trim leading space
UPLAYERSTIDS_STR="${UPLAYERSTIDS_STR# }"
######################################
# (RE)MAKE "SECTORTW_NEWS" TIDDLER
cat ${MY_PATH}/../templates/data/SECTORTW_NEWS.json \
| sed -e "s~_SECTOR_~${SECTOR}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_UPLANET_~https://qo-op.com~g" \
-e "s~_UPLAYERSTIDS_~${UPLAYERSTIDS_STR}~g" \
-e "s~_SECTORTW_~${SECTORIPNS}/TW~g" \
> ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json
echo "SECTORTW_NEWS $SECTOR SECTORTW=${SECTORIPNS}/TW :: ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json"
${MY_PATH}/TW/import_tiddler.sh \
~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json
#############################################################
# Connect_PLAYER_To_Gchange.sh : Sync FRIENDS TW - TODO : REWRITE
######################################### BETTER USE json FILE IN /ipns/$IPFSNODEID/COINS
#~ echo "##################################################################"
[[ -s ~/.zen/tmp/coucou/${G1PUB}.gchange.json ]] \
&& echo "## Connect_PLAYER_To_Gchange.sh (★★★★★)" \
&& ${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}" \
|| echo "NO Gchange account found"
##############################################################
# G1PalPay - 2 G1 mini -> Check for G1 TX incoming comments #
##############################################################
if [[ $(echo "$COINS >= 2" | bc -l) -eq 1 ]]; then
##############################################################
# G1PalPay.sh #
##############################################################
echo "## RUNNING G1PalPay Wallet Monitoring "
${MY_PATH}/G1PalPay.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}"
##############################################################
# VOEUX.create.sh #
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "${PLAYER}" "${G1PUB}"
##############################################################
# VOEUX.refresh.sh #
##############################################################
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "${MOATS}" ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
else
echo "> ZenCard not activated ($ZEN ZEN)"
fi
##################################
## PATCH : RESTORE PLAYER GPS.json (protect cache erased by WISH treatment)
cp -f ~/.zen/game/players/${PLAYER}/GPS.json ~/.zen/tmp/${MOATS}/
## WRITE TIDDLERS IN TW SECTORTW_NEWS.json
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--import ~/.zen/tmp/${MOATS}/SECTORTW_NEWS.json "application/json" \
--import ~/.zen/tmp/${MOATS}/GPS.json "application/json" \
--import ~/.zen/tmp/${MOATS}/VISIO.json "application/json" \
--import ~/.zen/tmp/${MOATS}/CESIUM.json "application/json" \
--output ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} --render "$:/core/save/all" "newindex.html" "text/plain"
## CHECK IT IS OK
[[ -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ]] \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
&& rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/newindex.html \
&& echo "TW UPlanet tiddlers updated" \
|| echo "ERROR - CANNOT CREATE TW NEWINDEX - ERROR"
###########################
########################
## SEND TODAY ZINE
#### UPlanetZINE/day${days}/index.${lang}.html
TODAYZINE="${MY_PATH}/../templates/UPlanetZINE/day${days}/index.${lang}.html"
[[ ! -s ${TODAYZINE} ]] && TODAYZINE="${MY_PATH}/../templates/UPlanetZINE/day${days}/index.html"
[[ -s ${TODAYZINE} && ${days} -gt 0 ]] \
&& echo "SENDING TODAYZINE DAY ${days} + mailjet TW import " \
&& ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ${TODAYZINE} "ZINE #${days}" "${HOME}/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html" \
|| echo "NO ZINE FOR DAY ${days}"
####################
## TW NEWINDEX .... #####
##############################################################
echo "LOCAL BACKUP + MICROLEDGER TW"
cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
[[ -s ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain ]] \
&& ZCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain) \
&& echo "# CHAIN : ${CURCHAIN} -> ${ZCHAIN}" \
&& [[ ${CURCHAIN} != "" && ${ZCHAIN} != "" ]] \
&& sed -i "s~${CURCHAIN}~${ZCHAIN}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
##################################################
######## UPDATING ${PLAYER}/ipfs/moa/.chain
cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
## CLEAN .chain CACHE
find ~/.zen/game/players/${PLAYER}/ipfs/moa/ -mtime +30 -type f -exec rm -f '{}' \;
##########################################
## TW IPFS ADD & PUBLISH
##########################################
TW=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
ipfs --timeout 720s name publish --key=${PLAYER} /ipfs/${TW}
## LOCAL PLAYER CACHING
echo ${TW} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain
echo ${MOATS} > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
echo "================================================"
echo " NEW TW ${PLAYER} : = ${myIPFS}/ipfs/${TW}"
echo " $myIPFSGW/ipns/${ASTRONAUTENS}"
echo "================================================"
ipfs pin rm ${CURCHAIN}
######################### REPLACE TW with REDIRECT to latest IPFS or IPNS (reduce 12345 cache size)
[[ ! -z ${TW} ]] && TWLNK="/ipfs/${TW}" || TWLNK="/ipns/${ASTRONAUTENS}"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${TWLNK}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
#########################################################
##### TW JSON RSS EXPORT
###################
# REFRESH PLAYER_feed KEY
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) RSS"
#########################################################################################
## CREATING 30 DAYS JSON RSS STREAM
# [days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]]
#########################################################################################
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/game/players/${PLAYER}/ipfs \
--render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]]'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ]] \
&& echo "NO ${PLAYER} RSS - BAD "
echo "~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json"
########################################################
#### PLAYER ACCOUNT HAVE NEW TIDDLER or NOT #########
if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" && "${CURRENT}" != "${PLAYER}" ]]; then
echo "ALERT -- RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN -- $days DAYS"
## DEAD PLAYER ??
if [[ ${days} -eq 27 ]]; then
echo "<html><head><meta charset='UTF-8'>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head><body><h1>🔋WARNING</h1>" > ~/.zen/tmp/alert
echo "<br><h3><a href=$(myIpfsGw)/ipfs/${CURCHAIN}> ${PLAYER} TW 🔌📺 </a></h3> 🌥 $ZEN ZEN 🌥 </body></html>" >> ~/.zen/tmp/alert
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ZEN ALERT"
echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days"
fi
if [[ ${days} -gt 29 ]]; then
#################################### UNPLUG ACCOUNT
echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN"
${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL"
continue
fi
## PAY 1 ZEN TO UMAPG1PUB
[[ "${UMAPG1PUB}" != "" ]] \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "0.1" "${UMAPG1PUB}" "UPLANET:TW:${YOUSER}:/ipfs/${TW}"
else
### PLAYER ALIVE PUBLISH RSS &
FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
[[ ${FEEDNS} ]] \
&& IRSS=$(ipfs add --pin=false -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
&& echo "Publishing ${PLAYER}_feed: /ipns/${FEEDNS} => /ipfs/${IRSS}" \
&& ipfs --timeout 300s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \
|| echo ">>>>> WARNING ${PLAYER}_feed IPNS KEY PUBLISHING CUT - WARNING"
fi
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${IRSS}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html
#########################################################
## TODO CREATING 30 DAYS XML RSS STREAM ???
## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26
# tiddlywiki.js --load my-wiki.html --render "[[$:/plugins/sq/feeds/templates/rss]]" "feed.xml" "text/plain" "$:/core/templates/wikified-tiddler"
### $:/plugins/sycom/atom-feed/atom.xml
#~ tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
#~ --output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${PLAYER}.rss.xml" 'text/plain' "$:/core/templates/wikified-tiddler" 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]]'
#################################################
################### COPY DATA TO UP LEVEL GRIDS
#################################################
## SECTOR BANK COORD
SLAT="${LAT::-1}"
SLON="${LON::-1}"
## REGION
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
echo "(⌐■_■) /UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}"
## IPFSNODEID 12345 CACHE UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/RSS/
cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/RSS/
#### CREATE ALL JSON COMPILATION
${MY_PATH}/../tools/json_dir.all.sh \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/RSS/
## IPFS PLAYER TW #
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TW/${PLAYER}
# /ipfs/${TW} = /TW/${PLAYER}/index.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${TW}'\" />${TODATE}:${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TW/${PLAYER}/index.html
# /ipns/${ASTRONAUTENS} = /TW/${PLAYER}/_index.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${ASTRONAUTENS}'\" />${PLAYER}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TW/${PLAYER}/_index.html
## IPNS UMAP _index.html ##
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${UMAPNS}'\" />${TODATE}:_${LAT}_${LON}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/_index.html
ls -al ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON} 2>/dev/null
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
#####################################################################
## DAY=7 : SEND ${G1LEVEL1} G1 to PLAYER
[[ ${days} -eq 7 && "${CURRENT}" != "${PLAYER}" && "${CURRENT}" != "" ]] \
&& echo "7 DAY. PLAYER STEP ONE SUCCEED." \
&& MIUSER=$(${MY_PATH}/../tools/clyuseryomail.sh "${CURRENT}") \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/.current/secret.dunikey" "${G1LEVEL1}" "${G1PUB}" "UPLANET:WELCOME:${MIUSER}:${YOUSER}" \
&& echo "UPLANET:WELCOME:${MIUSER}:${YOUSER}" && echo "(⌐■_■) ~~~ OFFICIAL ~~ _${LAT}_${LON} ~~~ $ASTRONAUTENS"
#####################################################################
############ CURRENT #################### _ForkUPlanetZERO ?
if [[ $(echo "$COINS > 100" | bc -l) -eq 1 ]]; then
[[ ${CURRENT} == ${PLAYER} ]] && ${MY_PATH}/../ASTROBOT/_ForkUPlanetZERO.sh
fi
#################################### NEED > 100 G1 ##################
#####################################################################
#####################################################################
## MAINTAIN R/RW TW STATE
[[ ${ASTRONS} == "" ]] \
&& echo "${PLAYER} DISCONNECT" \
&& ipfs key rm ${PLAYER} \
&& ipfs key rm ${PLAYER}_feed \
&& ipfs key rm ${G1PUB}
## CLEANING CACHE
rm -Rf ~/.zen/tmp/${MOATS}
echo
end=`date +%s`
dur=`expr $end - $start`
echo "${PLAYER} refreshing took $dur seconds (${MOATS})"
done
echo "============================================ PLAYER.refresh DONE."
exit 0

89
RUNTIME/PLAYER.unplug.sh Executable file
View File

@ -0,0 +1,89 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## UNPLUG A PLAYER FROM ASTROPORT STATION
############################################
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
INDEX="$1"
[[ ! -s ${INDEX} ]] && echo "INDEX ${INDEX} NOT FOUND - EXIT -" && exit 1
PLAYER="$2"
[[ ! -s ~/.zen/game/players/${PLAYER}/secret.dunikey ]] && echo "PLAYER ${PLAYER} NOT FOUND - EXIT -" && exit 1
ONE="$3"
## EXPLAIN WHY !
SHOUT="$4"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
## PLAYER UMAP ?
## GET "GPS" TIDDLER
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
TWMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
[[ $LAT == "null" || $LAT == "" ]] && LAT="0.00"
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
[[ $LON == "null" || $LON == "" ]] && LON="0.00"
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
rm ~/.zen/tmp/${MOATS}/GPS.json
########## SEND COINS TO SECTORG1PUB - ẐEN VIRTUAL BANK - EVERY 800 METERS - ;)
LAT=$(makecoord $LAT)
LON=$(makecoord $LON)
##############################################################
## POPULATE UMAP IPNS & G1PUB
$($MY_PATH/../tools/getUMAP_ENV.sh ${LAT} ${LON} | tail -n 1)
## GET COINS
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
echo "SECTOR WALLET = ${COINS} G1 : ${SECTORG1PUB}"
## UNPLUG => SEND 10 ZEN to SECTORG1PUB
## ALL => SEND ALL to $WORLDG1PUB
ALL="ALL"
[[ $ONE == "ONE" ]] && ALL=1
[[ $ALL == "ALL" ]] && SECTORG1PUB=${WORLDG1PUB} && echo "DEST = WORLDG1PUB: ${WORLDG1PUB}"
YOUSER=$(${MY_PATH}/../tools/clyuseryomail.sh ${PLAYER})
[[ ! -z ${SECTORG1PUB} ]] \
&& echo "> PAY4SURE ZEN:${ALL} WALLET MOVE" \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UPLANET:UNPLUG:${YOUSER}:${ALL}"
## REMOVING PLAYER from ASTROPORT
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)
ipfs key rm "${PLAYER}" "${PLAYER}_feed" "${G1PUB}"
for vk in $(ls -d ~/.zen/game/players/${PLAYER}/voeux/*/* 2>/dev/null | rev | cut -d / -f 1 | rev); do
echo "removing wish ${vk}"
[[ ${vk} != "" ]] && ipfs key rm ${vk}
done
## SEND PLAYER LAST KNOW TW
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Ciao ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='/ipfs/${TW}'>TW (${TW})</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE $SHOUT"
echo "PLAYER IPNS KEYS UNPLUGED"
echo "#######################"
echo "CLEANING ~/.zen/game/players/${PLAYER}"
rm -Rf ~/.zen/game/players/${PLAYER-empty}
echo "CLEANING NODE CACHE ~/.zen/tmp/${IPFSNODEID-empty}/*/${PLAYER-empty}*"
rm -Rf ~/.zen/tmp/${IPFSNODEID-empty}/*/${PLAYER-empty}*
echo "CLEANING SESSION CACHE"
rm -Rf ~/.zen/tmp/${MOATS}
exit 0

179
RUNTIME/REGION.refresh.sh Executable file
View File

@ -0,0 +1,179 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## REGION REFRESH
# UMAP > SECTOR > REGION
## Get from 100 sectors tiddlers with more than 2 signatures
############################################
echo
echo
echo "############################################"
echo "############################################"
echo "############################################"
echo "# # # # RUNNING REGION.refresh"
echo "############################################"
echo "############################################"
echo "############################################"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir ~/.zen/tmp/${MOATS}
## UMAPS list made BY UPLANET.refresh.sh
for i in $*; do
UMAPS=("$i" ${UMAPS[@]})
done
## NO $i PARAMETERS - GET ALL UMAPS
if [[ ${#UMAPS[@]} == 0 ]]; then
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
UMAPS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
fi
######## DETERMINE REGIONS FOR ALL UMAPS ################
for UMAP in ${UMAPS[@]}; do
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
[[ ${LAT} == "" || ${LON} == "" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "null" || ${LON} == "null" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
MYREGIONS=("_${RLAT}_${RLON}" ${MYREGIONS[@]})
done
## GET UNIQ REGIONS LIST
REGIONS=($(echo "${MYREGIONS[@]}" | tr ' ' '\n' | sort -u))
[[ ${REGIONS[@]} == "" ]] && echo "> NO REGION FOUND" && exit 0
echo "ACTIVATED REGIONS : ${REGIONS[@]}"
for REGION in ${REGIONS[@]}; do
echo "-------------------------------------------------------------------"
echo "_____REGION ${REGION} $(date)"
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}
RLAT=$(echo ${REGION} | cut -d '_' -f 2)
RLON=$(echo ${REGION} | cut -d '_' -f 3)
################################## TODO : make sharing key protocol evolve
## FOR NOW ONLY 1ST BOOSTRAP PUBLISH REGION KEYS
# with bigger planetary swam will be closest "IA Station", or it could be choosen according to ZEN value...
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
ACTINGNODE=${STRAPS[0]} ## FIST NODE IN STRAPS
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE=${ACTINGNODE} is not ME - CONTINUE -"
continue
fi
##############################################################
REGIONG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}")
[[ ! ${REGIONG1PUB} ]] && echo "ERROR generating REGION WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}"
ipfs key rm ${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
REGIONNS=$(ipfs key import ${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${YESTERDATE}${UPLANETNAME}${REGION}" "${YESTERDATE}${UPLANETNAME}${REGION}"
ipfs key rm ${YESTERDATE}${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
YESTERDATEREGIONNS=$(ipfs key import ${YESTERDATE}${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}"
ipfs key rm ${TODATE}${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
TODATEREGIONNS=$(ipfs key import ${TODATE}${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
##############################################################
## GET from IPNS
ipfs --timeout 240s get --progress=false -o ~/.zen/tmp/${MOATS}/${REGION}/ /ipns/${YESTERDATEREGIONNS}/
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## SHOULD NEED 12 SIGNATURES
## FULL REFRESH DEMO... ZEN CHAINING COMING LATER
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
mkdir -p ~/.zen/tmp/${MOATS}/${REGION}/RSS
rm -f ~/.zen/tmp/${MOATS}/${REGION}/RSS/_${RLAT}_${RLON}.week.rss.json
rm -f ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
## START WITH LOCAL SECTORS RSS WEEK
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${RLAT}*_${RLON}*/_${RLAT}*_${RLON}*/_${RLAT}*_${RLON}*.week.rss.json 2>/dev/null))
for RSS in ${RSSNODE[@]}; do
[[ $(cat ${RSS}) != "[]" ]] \
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
&& ${MY_PATH}/../tools/RSS2WEEKnewsfile.sh ${RSS} >> ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
done
NL=${#RSSNODE[@]}
echo "
---
" >> ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
## ADD SWARM SECTORS RSS WEEK
RSSWARM=($(ls ~/.zen/tmp/swarm/*/UPLANET/SECTORS/_${RLAT}*_${RLON}*/_${RLAT}*_${RLON}*/_${RLAT}*_${RLON}*.week.rss.json 2>/dev/null))
for RSS in ${RSSWARM[@]}; do
[[ $(cat ${RSS}) != "[]" ]] \
&& cp ${RSS} ~/.zen/tmp/${MOATS}/${REGION}/RSS/ \
&& ${MY_PATH}/../tools/RSS2WEEKnewsfile.sh ${RSS} >> ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL
done
NS=${#RSSWARM[@]}
## CREATE /.all.json FROM *.rss.json
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${MOATS}/${REGION}/RSS
## REMOVE SECTORS PARTS
rm -f ~/.zen/tmp/${MOATS}/${REGION}/RSS/*.week.rss.json
## MAKE FINAL _${RLAT}_${RLON}.week.rss.json
mv ~/.zen/tmp/${MOATS}/${REGION}/RSS/.all.json \
~/.zen/tmp/${MOATS}/${REGION}/RSS/_${RLAT}_${RLON}.week.rss.json
## PREPARING JOURNAL
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${RLAT}_${RLON}
###################################
## NODE PUBLISH REGION TODATENS LINK
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${TODATEREGIONNS}'\" />/_${RLAT}_${RLON}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${RLAT}_${RLON}/_index.html
#~ ## DEMO : PREPARE Ask.IA link - PROD will be launched during RUNTIME.
#~ echo "<meta http-equiv=\"refresh\" content=\"0; url='https://api.copylaradio.com/tellme/?cid=/ipfs/${RWEEKCID}'\" />" \
#~ > ~/.zen/tmp/${MOATS}/${REGION}/Ask.IA._${RLAT}_${RLON}.redir.html
TOTL=$((${NL}+${NS}))
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo "Numbers of REGION WEEK RSS : ${NL} + ${NS} : "${TOTL}
rm ~/.zen/tmp/${MOATS}/${REGION}/N_* 2>/dev/null
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${REGION}/N_${TOTL}
RWEEKCID=$(ipfs add -q ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL 2>/dev/null)
if [[ ${RWEEKCID} ]]; then
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/QmYNH85cJCwSVw4c7SyHtc2jtgh7dL5RegozX7e8Re28a9/md.htm?src=/ipfs/${RWEEKCID}'\" />" \
> ~/.zen/tmp/${MOATS}/${REGION}/Journal._${RLAT}_${RLON}.view.html
cp ~/.zen/tmp/${MOATS}/${REGION}/JOURNAL \
~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${RLAT}_${RLON}/JOURNAL.md
fi
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${REGION}/* | tail -n 1)
ipfs --timeout 180s name publish -k ${TODATE}${REGIONG1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${REGIONG1PUB} ${YESTERDATE}${REGIONG1PUB} > /dev/null 2>&1
done
exit 0

282
RUNTIME/RSS2UPlanetSECTORTW.sh Executable file
View File

@ -0,0 +1,282 @@
#!/bin/bash
########################################################################
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# INSERT NEW TIDDLERS FROM RSS JSON INTO UPLANET TW
# DETECTING CONFLICT WITH SAME TITLE
# ASKING TO EXISTING SIGNATURES TO UPDATE THEIR TW OR FORK TITLE
# CALLED BY "SECTOR.refresh.sh"
# SEND 10 ZEN TO EACH SIGNATURE
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "$MY_PATH/../tools/my.sh"
RSS=$1 ## filepath to RSS
SECTOR=$2 ## Sector identifier _0.0_0.0
MOATS=$3 ## temp cache access
INDEX=$4 ## SECTOR TW index file
echo
[[ ! -s ${RSS} ]] && echo "BAD RSS INPUT" && exit 1
[[ "$(cat ${RSS})" == "[]" ]] && echo "EMPTY RSS " && exit 0
[[ ! -d ~/.zen/tmp/${MOATS}/${SECTOR}/ ]] && echo "- ERROR - BAD UPLANET CONTEXT - look inside code - " && exit 1
[[ ! -s ${INDEX} ]] \
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
&& echo "- WARNING - REFRESHING SECTOR FROM empty TEMPLATE *****"
## EXTRACT PLAYER FROM RSS FILE NAME
PLAYER=$(echo ${RSS} | rev | cut -d '/' -f 1 | rev | sed "s~.rss.json~~g")
## GET PLAYER INFORMATION
$($MY_PATH/../tools/search_for_this_email_in_players.sh ${PLAYER})
echo "export ASTROPORT=${ASTROPORT} ASTROTW=${ASTROTW} ASTROG1=${ASTROG1} ASTROMAIL=${EMAIL} ASTROFEED=${FEEDNS}"
echo "======= ${INDEX} =======
SECTOR ${SECTOR} TW INSERTING ${PLAYER}
${RSS}
=================================================================="
cat "${RSS}" | jq 'sort_by(.created) | reverse | .[]' | jq -r '.title' > ~/.zen/tmp/${MOATS}/${SECTOR}/tiddlers.list
##
gloops=0
signatures=0
while read title; do
[[ ${floop} -gt 1 ]] && echo "Other Tiddlers are similaR... BREAK LOOP" && break
# FILTER "UPPERCASE" + Astroport Tid, less than 4 characters title Tiddlers (ex: GPS, ...).
[[ ${title} == "GettingStarted" || "${title^^}" == "${title}" || "${title::3}" == '$:/' || ${title::4} == ${title} || ${title} == "AstroID" || ${title} == "Voeu1.png" || ${title} == "Astroport" || ${title} == "MadeInZion" || ${title} == "G1Visa" || ${title} == "ZenCard" || ${title::5} == "Draft" ]] \
&& echo "FILTERED TITLE ${title}" && continue
## CHECK FOR TIDDLER WITH SAME TITTLE IN SECTOR TW
rm -f ~/.zen/tmp/${MOATS}/TMP.json
tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${MOATS} --render '.' 'TMP.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${title}"
ISHERE=$(cat ~/.zen/tmp/${MOATS}/TMP.json | jq -r ".[].title")
[[ ! "${ISHERE}" ]] && echo "No Tiddler found in ${INDEX}"
TMPTAGS=$(cat ~/.zen/tmp/${MOATS}/TMP.json | jq -r .[].tags)
TMPEMAILS=($(echo "$TMPTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
TMPSIGN=${#TMPEMAILS[@]}
#~ echo "INSIDE TIDDLER HAVE ${TMPSIGN} SIGNATURE(S)"
if [[ "${ISHERE}" != "${title}" || ${TMPSIGN} == 0 ]]; then
## NEW TIDDLER
echo "Importing Title: $title"
cat "${RSS}" | jq -rc ".[] | select(.title == \"$title\")" > ~/.zen/tmp/${MOATS}/NEW.json
#~ echo "DEBUG"
#~ cat ~/.zen/tmp/${MOATS}/NEW.json | jq
#~ echo "tiddlywiki --load ${INDEX} --import ~/.zen/tmp/${MOATS}/NEW.json 'application/json' --output ~/.zen/tmp/${MOATS}/${SECTOR} --render '$:/core/save/all' '"${SECTOR}.html"' 'text/plain'"
tiddlywiki --load ${INDEX} \
--import ~/.zen/tmp/${MOATS}/NEW.json 'application/json' \
--output ~/.zen/tmp/${MOATS}/${SECTOR} --render '$:/core/save/all' "${SECTOR}.html" 'text/plain'
[[ -s ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}.html ]] \
&& rm ${INDEX} \
&& mv ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}.html ${INDEX} \
&& ((gloops++)) \
&& echo "GLOOPS (${gloops}) : ${title}" \
&& signatures=$((signatures + TMPSIGN))
[[ ! -s ${INDEX} ]] && echo "ERROR. TW could not ingest ~/.zen/tmp/${MOATS}/NEW.json" && exit 1
else
## SAME TIDDLER
echo "TIDDLER : $title (${TMPSIGN} signature(s)) ... ALREADY EXISTS..."
## Remove [] and put inline to compare
cat ~/.zen/tmp/${MOATS}/TMP.json | jq -rc .[] > ~/.zen/tmp/${MOATS}/INSIDE.json
cat "${RSS}" | jq -rc ".[] | select(.title == \"$title\")" > ~/.zen/tmp/${MOATS}/NEW.json
if [[ $(diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json) == "" ]]; then
echo "... Tiddlers are similar ..."
((floop++))
continue
fi
floop=1
## LOG TIDDLERS
#~ echo
#~ echo "=========== INSIDE.json"
#~ cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -c
#~ echo
#~ echo "=========== NEW.json"
#~ cat ~/.zen/tmp/${MOATS}/NEW.json | jq -c
#~ echo
## TODO EXTEND CONTROL TO text & ipfs & _canonical_url
## NEED SIGNATURES & TIDDLER SIMILARITY TO COME UP
## CHECK FOR EMAIL SIGNATURES DIFFERENCE
NTAGS=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .tags)
NEMAILS=($(echo "$NTAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
NSIGN=${#NEMAILS[@]}
echo "New Tiddler $NSIGN signatures : ${NEMAILS[*]}"
ITAGS=$(cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -r .tags)
IEMAILS=($(echo "$ITAGS" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"))
ISIGN=${#IEMAILS[@]}
echo "Inside Tiddler $ISIGN signatures : ${IEMAILS[*]}"
## New should have more signatures than Inside
[[ ${NSIGN} -le ${ISIGN} ]] && echo "Most signed already in..." && continue
## UPLANET GRID COLLISION PARAM ###
# [[ ${NSIGN} -le 3 ]] && update TW OR continue
# https://www.copylaradio.com/blog/blog-1/post/decentralized-information-ecosystem-51
if [[ "${NEMAILS[*]}" != "${IEMAILS[*]}" ]]; then
## SEARCH FOR DIFFERENCE IN EMAIL SIGNATURES TAGS
COMMON=(); NUNIQUE=(); IUNIQUE=()
# Detect common and unique elements
for email in "${NEMAILS[@]}"; do
if [[ " ${IEMAILS[*]} " == *" $email "* ]]; then
COMMON+=("$email")
else
NUNIQUE+=("$email")
fi
done
for email in "${IEMAILS[@]}"; do
if [[ " ${NEMAILS[*]} " != *" $email "* ]]; then
IUNIQUE+=("$email")
fi
done
# Print the results
echo "Common email addresses : ${COMMON[*]}"
echo "Email addresses unique in NEW Tiddler : ${NUNIQUE[*]}"
echo "Email addresses unique in INSIDE Tiddler : ${IUNIQUE[*]}"
combined=("${IEMAILS[@]}" "${NEMAILS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
NEWTID=$(ipfs add -q ~/.zen/tmp/${MOATS}/NEW.json | tail -n 1)
INSIDETID=$(ipfs add -q ~/.zen/tmp/${MOATS}/INSIDE.json | tail -n 1)
###############################
## TODO : check STAR level and activate auto merge
for email in "${unique_combined[@]}"; do
echo "<html>
<head>
<style>
body {
font-family: 'Courier New', monospace;
}
pre {
white-space: pre-wrap;
}
</style></head>
<body>
<h1>$(date)</h1>
<h2>$title</h2>
Tiddler appears in <b>${unique_combined[*]}</b> TW(s)
<br>
<ul>
<li><a href='$(myIpfsGw)/ipfs/${INSIDETID}'>Actual Tiddler</a></li>
<li><a href='$(myIpfsGw)/ipfs/${NEWTID}'>NEW Tiddler</a> being overwrite by ${NUNIQUE[*]}</li>
</ul>
<h2><a href='$(myIpfsGw)${VDONINJA}/?room=${MOATS}'>Record VISIO for this event...</a></h2>
</body></html>" > ~/.zen/tmp/${MOATS}/g1message
${MY_PATH}/../tools/mailjet.sh "$email" ~/.zen/tmp/${MOATS}/g1message "Upgrade Tiddler : ${title}"
done
## SEND ZEN G1PalPay Signal
#~ ##############################################################
#~ G1AMOUNT=$(echo "$NSIGN / 10" | bc -l | xargs printf "%.2f" | sed "s~,~.~g" )
#~ G1AMOUNT=$NSIGN ## SEND FLUID COIN
#~ echo "***** SECTOR $SECTOR REWARD *****************"
#~ echo "SPREAD $NSIGN G1 TO ${unique_combined[@]} SIGNATURES
#~ to ${PLAYER} WALLET ${ASTROG1}"
#~ echo "************************************************************"
#~ ${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/sector.dunikey "${$G1AMOUNT}" "${ASTROG1}" "${unique_combined[@]}"
#~ ################################################ GRATITUDE SENT
## AND OVER WRITE TIDDLER...
else
echo "SIGNATURES ARE THE SAME : ${NEMAILS[*]}"
fi
echo "______________________"
#~ echo "CHECKING DIFFERENCES"
#~ diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json
## TODO CHECK MORE DIFFERENCE
DATENEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .modified)
TEXTNEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .text)
TAGSNEW=$(cat ~/.zen/tmp/${MOATS}/NEW.json | jq -r .tags)
DATEINSIDE=$(cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -r .modified)
TEXTINSIDE=$(cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -r .text)
TAGSINSIDE=$(cat ~/.zen/tmp/${MOATS}/INSIDE.json | jq -r .tags)
TIDLEREMAILSNEW=($(echo "$TAGSNEW" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b")) ## MUST BE SAME IN BOTH
TIDLEREMAILSINSIDE=($(echo "$TAGSINSIDE" | grep -E -o "\b[a-zA-Z0-9.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b")) ## MUST BE SAME IN BOTH
# [[ "${TIDLEREMAILSNEW[*]}" == "${TIDLEREMAILSINSIDE[*]}" ]]
if [ ${DATENEW} -gt ${DATEINSIDE} ]; then
echo "Newer Tiddler version... Updating SECTOR TW"
tiddlywiki --load ${INDEX} \
--import ~/.zen/tmp/${MOATS}/NEW.json "application/json" \
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "${SECTOR}.html" "text/plain"
[[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.html ]] \
&& rm ${INDEX} \
&& mv ~/.zen/tmp/${MOATS}/${SECTOR}.html ${INDEX} \
|| ((gloops--))
signatures=$((signatures + ISIGN))
fi
fi
## CLEANING
rm ~/.zen/tmp/${MOATS}/INSIDE.json 2>/dev/null
rm ~/.zen/tmp/${MOATS}/TMP.json 2>/dev/null
rm ~/.zen/tmp/${MOATS}/NEW.json 2>/dev/null
done < ~/.zen/tmp/${MOATS}/${SECTOR}/tiddlers.list
####################################################
################################################ ${signatures} -gt ${gloops}
## SECTOR SENDS GRATITUDE TO PUBLISHING PLAYER
###################################################
#~ if [[ ${gloops} -gt 0 && ${signatures} -gt ${gloops} && ${ASTROG1} ]]; then
#~ # GENERATE SECTOR PRIVATE KEY ################################
#~ ${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/sector.dunikey "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
#~ G1SECTOR=$(cat ~/.zen/tmp/${MOATS}/sector.dunikey | grep 'pub:' | cut -d ' ' -f 2)
#~ cp -f ~/.zen/tmp/coucou/${G1SECTOR}.COINS ~/.zen/tmp/${IPFSNODEID}/${SECTOR}.COINS
#~ ##############################################################
#~ GRATITUDE=$($MY_PATH/../tools/getcoins_from_gratitude_box.sh)
#~ G1AMOUNT=$(echo "$GRATITUDE / 10" | bc -l | xargs printf "%.2f" | sed "s~,~.~g" )
#~ echo "***** SECTOR $SECTOR REWARD *****************"
#~ echo "GRATITUDE ${GRATITUDE} ZEN = ${G1AMOUNT} G1
#~ to ${PLAYER} WALLET ${ASTROG1} (${gloops} Tiddlers)"
#~ echo "************************************************************"
#~ ${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/sector.dunikey "${G1AMOUNT}" "${ASTROG1}" "THANKS ${gloops} GLOOPS"
#~ ################################################ GRATITUDE SENT
#~ fi
exit 0

402
RUNTIME/SECTOR.refresh.sh Executable file
View File

@ -0,0 +1,402 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
start=`date +%s`
## SECTOR REFRESH
# SHARE & UPDATE IPNS TOGETHER
############################################
echo
echo
echo "############################################"
echo "############################################"
echo "> RUNNING SECTOR.refresh"
echo "############################################"
echo "############################################"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir ~/.zen/tmp/${MOATS}
## UMAPS list made BY UPLANET.refresh.sh
for i in $*; do
UMAPS=("$i" ${UMAPS[@]})
done
## NO $i PARAMETERS - GET ALL UMAPS
if [[ ${#UMAPS[@]} == 0 ]]; then
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
UMAPS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
fi
######## INIT SECTORS ########################
for UMAP in ${UMAPS[@]}; do
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
[[ ${LAT} == "" || ${LON} == "" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "null" || ${LON} == "null" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
SLAT="${LAT::-1}"
SLON="${LON::-1}"
MYSECTORS=("_${SLAT}_${SLON}" ${MYSECTORS[@]})
done
## GET UNIQ SECTORS LIST
SECTORS=($(echo "${MYSECTORS[@]}" | tr ' ' '\n' | sort -u))
[[ ${SECTORS[@]} == "" ]] && echo "> NO SECTOR FOUND" && exit 0
#########################################################""
echo "ACTIVATED SECTORS : ${SECTORS[@]}"
for SECTOR in ${SECTORS[@]}; do
echo "############################################"
echo "_____SECTOR ${SECTOR}"
echo "################################ $(date)"
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/
SLAT=$(echo ${SECTOR} | cut -d '_' -f 2)
SLON=$(echo ${SECTOR} | cut -d '_' -f 3)
##############################################################
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && echo "ERROR generating SECTOR WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
ipfs key rm ${G1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
SECTORNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${SECTOR}.priv)
echo "___ ORIGIN ___ ${myIPFS}/ipns/${SECTORNS}/"
echo "SECTOR : ${SECTOR} (${COINS} G1 <=> ${ZEN} ZEN) : ${G1PUB}"
###################### SPATIO TEMPORAL KEYS
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${SECTOR}" "${YESTERDATE}${UPLANETNAME}${SECTOR}"
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start=`date +%s`
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#~ ## IPFS GET ONLINE YESTERDATE SECTORNS
ipfs --timeout 180s get --progress=false -o ~/.zen/tmp/${MOATS}/${SECTOR}/ /ipns/${YESTERDATENS}/
if [[ $? != 0 ]]; then
echo "(╥☁╥ ) swarm memory empty (╥☁╥ )"
# Try retieve memory from UPlanet ZEN Memory
[[ ${ZEN} -gt 0 ]] \
&& echo "INTERCOM Refreshing from ZEN MEMORY" \
&& ${MY_PATH}/../RUNTIME/ZEN.SECTOR.memory.sh "${SECTOR}" "${MOATS}" "${G1PUB}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end=`date +%s`
echo "_____SECTOR${SECTOR} GET time was "`expr $end - $start` seconds.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
### SHOW ${SECTOR}
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/${SECTOR}
## CONTROL CHAIN TIME
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_moats 2>/dev/null)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS ${MOATS}"
MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
hours=$((DIFF_SECONDS / 3600))
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
seconds=$((DIFF_SECONDS % 60))
echo "SECTOR DATA is ${hours} hours ${minutes} minutes ${seconds} seconds OLD"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## CONTROL ACTINGNODE : BOOSTRAP DISTRIBUTED (jeu du mouchoir, token ring aléatoire)
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/SECTOR.refresher"
ALLNODES=($(cat ${UREFRESH} | grep -v '^[[:space:]]*$' 2>/dev/null)) # ${ALLNODES[@]} without empty line
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
if [[ ${ALLNODES[@]} == "" ]]; then
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL SECTOR.refresher file with all STRAPS
done
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
fi
ACTINGNODE=${ALLNODES[0]} ## FIST NODE IN SECTOR.refresher
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
## IF NOT UPDATED FOR TOO LONG : STRAPS[0] get key control
[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) ] \
&& echo ">>>>>>>>>>>>>> More than 26H update - BOOSTRAP 0 ACTION -" \
&& ACTINGNODE=${STRAPS[0]}
echo "* ACTINGNODE=${ACTINGNODE}"
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE NOT ME - CONTINUE -"
ipfs key rm "${TODATE}${G1PUB}" "${YESYERDATE}${G1PUB}" "${G1PUB}"
echo "------8<-------------8<------------------8<-----------------8<-----------------8<"
continue
fi
### NEXT REFRESHER SHUFFLE
rm ${UREFRESH}
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## RESET SECTOR.refresher file with actual STRAPS
done
# SHUFFLE UMAP.refresher
cat ${UREFRESH} | sort | uniq | shuf > ${UREFRESH}.shuf
mv ${UREFRESH}.shuf ${UREFRESH}
echo "SETTING NEXT REFRESHER : $(cat ${UREFRESH} | head -n 1)"
############ 101 ZEN (11.1 G1) REFILL ?!
CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev)
[[ ${COINS} == "" || ${COINS} == "null" ]] \
&& [[ ${ZEN} -lt 100 && ${CURRENT} != "" ]] \
&& MIUSER=$(${MY_PATH}/../tools/clyuseryomail.sh "${CURRENT}") \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/.current/secret.dunikey" "11.1" "${G1PUB}" "UPLANET:101ZEN:${SECTOR}:${MIUSER}" \
&& echo "UPLANET:101:${SECTOR}:${MIUSER}" && echo " ~~~ (♥‿‿♥) ~~ ${SECTOR} ~~ (♥‿‿♥) ~~~ "
##############################################################
## FEED SECTOR TW WITH UMAPS RSS
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/TW
INDEX="${HOME}/.zen/tmp/${MOATS}/${SECTOR}/TW/index.html"
## NEW TW TEMPLATE
[[ ! -s ${INDEX} ]] \
&& sed "s~_SECTOR_~${SECTOR}~g" ${MY_PATH}/../templates/twsector.html > ${INDEX} \
&& echo "REFRESHING SECTOR FROM empty TEMPLATE *****" \
&& [[ ${IPFSNODEID} != ${STRAPS[0]} ]] && echo "1ST BOOSTRAP JOB" && continue
## SET SECTOR
sed -i "s~_SECTOR_~${SECTOR}~g" ${INDEX}
## REFRESH ALL TWs in that SECTOR
rm -Rf ~/.zen/tmp/${MOATS}/${SECTOR}/TWz
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/TWz
cp -rf ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/* \
~/.zen/tmp/${MOATS}/${SECTOR}/TWz
cp -rf ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/* \
~/.zen/tmp/${MOATS}/${SECTOR}/TWz 2>/dev/null
## GET ALL RSS json's AND Feed SECTOR TW with it
RSSNODE=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/RSS/*.rss.json 2>/dev/null))
NL=${#RSSNODE[@]}
RSSWARM=($(ls ~/.zen/tmp/swarm/12D*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/RSS/*.rss.json 2>/dev/null))
NS=${#RSSWARM[@]}
combinedrss=("${RSSNODE[@]}" "${RSSWARM[@]}")
RSSALL=($(echo "${combinedrss[@]}" | tr ' ' '\n' | sort -u))
mkdir -p ~/.zen/tmp/${MOATS}/${SECTOR}/RSS
rm -f ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
#################### RSS2UPlanetSECTORTW #########################
############################ TRANSFER SIGNED TIDDLER IN SECTOR TW
for RSS in ${RSSALL[@]}; do
############################################################
## Extract New Tiddlers and maintain fusion in Sector TW.
############################################################
${MY_PATH}/RSS2UPlanetSECTORTW.sh "${RSS}" "${SECTOR}" "${MOATS}" "${INDEX}"
############################################################
## create sector RSS _all.json
cat ${RSS} >> ~/.zen/tmp/${MOATS}/${SECTOR}/RSS/_all.json
############################################################
done
TOTL=$((${NL}+${NS}))
##############################################################
# Update COIN & ZEN value
echo ${COINS} > ~/.zen/tmp/${MOATS}/${SECTOR}/COINS
echo ${ZEN} > ~/.zen/tmp/${MOATS}/${SECTOR}/ZEN
echo "Number of RSS : "${TOTL}
echo ${TOTL} > ~/.zen/tmp/${MOATS}/${SECTOR}/N
###########################################################################################
## MAKE SECTOR PLANET WITH ASTONAUTENS LINKS
###########################################################################################
###########################################################################################
## PREPARE Ŋ1 WORLD MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/*/index.html 2>/dev/null))
NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_${SLAT}_${SLON}/_*_*/TW/*/index.html 2>/dev/null))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
## ADD SECTOR ZENPUB.png & INFO.png
convert -font 'Liberation-Sans' \
-pointsize 80 -fill purple -draw 'text 50,120 "'"${ZEN} Zen"'"' \
-pointsize 30 -fill purple -draw 'text 40, 180 "'"${SECTOR}:${YESTERDATE}"'"' \
$MY_PATH/../images/G1WorldMap.png "${HOME}/.zen/tmp/${MOATS}/${SECTOR}.png"
# CREATE G1PUB AMZQR
amzqr ${G1PUB} -l H -p "$MY_PATH/../images/zenticket.png" -c -n ZENPUB.png -d ~/.zen/tmp/${MOATS}/${SECTOR}/
convert ~/.zen/tmp/${MOATS}/${SECTOR}/ZENPUB.png -resize 250 ~/.zen/tmp/${MOATS}/ZENPUB.png
# ADD IT
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/${MOATS}/ZENPUB.png ~/.zen/tmp/${MOATS}/${SECTOR}.png ~/.zen/tmp/${MOATS}/${SECTOR}/INFO.png
## zday marking
rm ~/.zen/tmp/${MOATS}/${SECTOR}/z* 2>/dev/null
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />${TODATE} ${SECTOR}" > ~/.zen/tmp/${MOATS}/${SECTOR}/z$(date +%A-%d_%m_%Y).html
###########################################################################################
### APPLY ON APP MODEL TODATE REGIONNS LINKING
RLAT=$(echo ${SLAT} | cut -d '.' -f 1)
RLON=$(echo ${SLON} | cut -d '.' -f 1)
REGION="_${RLAT}_${RLON}"
TODATEREGIONNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
REGIONG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}")
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetSector/index.html \
| sed -e "s~_ZONE_~SECTOR ${SECTOR}~g" \
-e "s~_UPZONE_~REGION ${REGION}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_ZCHAIN_~${ZCHAIN}~g" \
-e "s~_UPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_SECTORG1PUB_~${G1PUB}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_LAT_~${SLAT}~g" \
-e "s~_LON_~${SLON}~g" \
-e "s~_EARTHCID_~${EARTHCID}~g" \
-e "s~_ZCHAIN_~${ZCHAIN}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${RLAT}\&southWestLon=${RLON}\&deg=1~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html
##################################
cp -f ~/.zen/tmp/${MOATS}/${SECTOR}/_index.html ~/.zen/tmp/${MOATS}/${SECTOR}/index.html
rm ~/.zen/tmp/${MOATS}/${SECTOR}/index.html ## MAKE SECTOR VISIBLE ##
###################################################### CHAINING BACKUP
IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1)
################
## DOES CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${IPFSPOP} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${IPFSPOP}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_chain \
&& echo "${MOATS}" > ~/.zen/tmp/${MOATS}/${SECTOR}/CHAIN/_moats \
&& IPFSPOP=$(ipfs add -rwq ~/.zen/tmp/${MOATS}/${SECTOR}/* | tail -n 1) && echo "ROOT was ${ZCHAIN}"
######################################################
## ZEN CHAINING
# Send 1 ZEN to UPlanet REGIONG1PUB Wallet containing REGION TW HASH
INTERCOM="UPLANET:${SECTOR}:${TODATE}:/ipfs/${IPFSPOP}"
echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN)"
if [[ ${ZEN} -gt 11 ]]; then
echo "---ZZZ-- SECTOR 2 REGION ZEN CHAINING ---ZZZ------ZZZ----"
${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey "0.1" "${REGIONG1PUB}" "${INTERCOM}"
fi
##############################################################
## PUBLISHING ${SECTOR}
###############################
echo "% PUBLISHING ${SECTOR} ${myIPFS}/ipns/${TODATENS}"
start=`date +%s`
ipfs --timeout 240s name publish -k ${TODATE}${G1PUB} /ipfs/${IPFSPOP}
ipfs key rm ${YESTERDATE}${G1PUB} ${G1PUB} > /dev/null 2>&1
################# REGISTER UPlanet SECTOR to G1PODs
${MY_PATH}/../tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey -n ${myDATA} \
set -n "UPlanet SECTOR ${SECTOR}" -v " " -a " " -d "UPlanet ${myUPLANET}" \
-pos ${SLAT} ${SLON} -s ${myLIBRA}/ipfs/${IPFSPOP} \
-A ${MY_PATH}/../images/zenticket.png
${MY_PATH}/../tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey -n ${myCESIUM} \
set -n "UPlanet SECTOR ${SECTOR}" -v " " -a " " -d "UPlanet ${myUPLANET}" \
-pos ${SLAT} ${SLON} -s ${myLIBRA}/ipfs/${IPFSPOP} \
-A ${MY_PATH}/../images/zenticket.png
######################################################
rm ~/.zen/tmp/${MOATS}/${SECTOR}.dunikey
[[ ${ZCHAIN} != "" ]] && ipfs pin rm ${ZCHAIN}
###################################################
## EXTRACT SECTOR LAST WEEK TIDDLERS TO IPFSNODEID CACHE
echo "(☉_☉ ) ${REGION}.week.rss.json (☉_☉ )"
rm -Rf ~/.zen/tmp/${IPFSNODEID}/SECTORS/ ## TODO REMOVE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${RLAT}_${RLON}/_${SLAT}_${SLON}
## CREATING 7 DAYS JSON RSS STREAM
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${RLAT}_${RLON}/_${SLAT}_${SLON} \
--render '.' "${SECTOR}.week.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-7]!is[system]!tag[G1Voeu]]'
###################################
## NODE CACHE SECTOR TODATENS
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${TODATENS}'\" />_${SLAT}_${SLON}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_index.html
## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh)
## TODO EXPORT AS RSS ## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/28
end=`date +%s`
echo "_____SECTOR${SECTOR} TREATMENT time was "`expr $end - $start` seconds.
done
exit 0

View File

@ -0,0 +1,7 @@
[
{
"title": "/TEST/ForemostPoets-Moonraker.mp3",
"text": "<audio controls><source src='/ipfs/Qmc799UU3zqFojnR13qSiJYKx8mKPXJ3CXMgKyLGvVndUD' type='audio/mpeg'>Your browser does not support the audio element.</audio>",
"tags": "mp3"
}
]

33
RUNTIME/TW/delete_tiddler.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
# Generate a unique timestamp
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
# Check if TiddlyWiki file exists
TW="$1"
[[ ! -s $TW ]] && echo "No TiddlyWiki found at: $TW" && exit 1
# Check if Tiddler title is provided
TITLE="$2"
[[ -z $TITLE ]] && echo "Need a Tiddler title" && exit 1
# Delete the specified Tiddler from the TiddlyWiki
echo "Deleting Tiddler: $TITLE"
tiddlywiki --load $TW \
--deletetiddlers "$TITLE" \
--output ~/.zen/tmp --render "$:/core/save/all" "${MOATS}.html" "text/plain"
# Check if deletion was successful
if [[ -s ~/.zen/tmp/${MOATS}.html ]]; then
echo "Tiddler deleted successfully."
cp ~/.zen/tmp/${MOATS}.html ${TW}
rm ~/.zen/tmp/${MOATS}.html
echo "Updated TiddlyWiki:
${TW}"
else
echo "ERROR: Cannot delete $TITLE from
$TW"
exit 1
fi
exit 0

41
RUNTIME/TW/import_tiddler.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
# Generate a unique timestamp
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
# Check if TiddlyWiki file exists
TW="$1"
[[ ! -s $TW ]] \
&& echo "Missing TiddlyWiki index.html \$1: $TW" \
&& exit 1
# Check if Tiddler JSON file exists
TIDDLER="$2"
[[ ! -s $TIDDLER || $TIDDLER == "" ]] \
&& echo "Missing Tiddler JSON file \$2: $TIDDLER" \
&& exit 1
# Add created and modified fields to the Tiddler JSON file
echo "Putting ${TIDDLER} in ${TW}"
jq '.[] + {created: $MOATS, modified: $MOATS}' --arg MOATS "$MOATS" "$TIDDLER" > "${TIDDLER}.tmp"
# Run TiddlyWiki import command
echo "Running TiddlyWiki import..."
tiddlywiki --load "${TW}" \
--import "${TIDDLER}.tmp" 'application/json' \
--output /tmp \
--render '$:/core/save/all' "${MOATS}.html" 'text/plain'
# Check if import was successful
if [[ -s /tmp/${MOATS}.html ]]; then
echo "Import successful."
cp /tmp/${MOATS}.html ${TW}
rm /tmp/${MOATS}.html
rm "${TIDDLER}.tmp"
echo "Updated TiddlyWiki:
${TW}"
exit 0
else
echo "ERROR"
exit 1
fi

19
RUNTIME/TW/readme.md Normal file
View File

@ -0,0 +1,19 @@
TiddlyWiki acts as a distributed object database
this scripts provides elemental TW interactions
* Import a Tiddler (json) in a TiddliWiki
```./import_tiddler.sh tiddlywiki.html ForemostPoets-Moonraker.json```
https://talk.tiddlywiki.org/t/how-to-add-extract-modify-tiddlers-from-command-line-to-do-ipfs-media-transfer/4345?u=papiche
* Delete a Tiddler (title) from a TiddliWiki
```./delete_tiddler.sh tiddlywiki.html "/TEST/ForemostPoets-Moonraker.mp3"```
https://talk.tiddlywiki.org/t/how-to-filter-and-delete-multiple-tiddlers/4950
you can add more complex queries ....

3149
RUNTIME/TW/twsector.html Normal file

File diff suppressed because one or more lines are too long

574
RUNTIME/UPLANET.refresh.sh Executable file
View File

@ -0,0 +1,574 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
## SEEK FOR UPLANET KEYS
# GET & UPDATE IPNS
############################################
echo "############################################"
echo "
_________________________
< RUNNING UPLANET.refresh >
-------------------------
\ ^__^
\ (oo)\_______
(__)\ )\\/\\
||----w |
|| ||
"
echo "############################################"
echo "############################################"
[[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir ~/.zen/tmp/${MOATS}
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
## RUNING FOR ALL UMAP FOUND IN STATION MAP CACHE : "_LAT_LON"
## SEARCH UMAP (created by PLAYER.refresh.sh) /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "ACTIVATED ${#unique_combined[@]} UMAPS : ${unique_combined[@]}" # "_LAT_LON" directories
######################################################
### LEVEL 1 ###########################################
######################################################
for UMAP in ${unique_combined[@]}; do
start=`date +%s`
echo
echo "-------------------------------------------------------------------"
echo "____________REFRESHING ${UMAP}__________ $(date)"
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
[[ ${LAT} == "" || ${LON} == "" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
[[ ${LAT} == "null" || ${LON} == "null" ]] && echo ">> ERROR BAD ${LAT} ${LON}" && continue
## SECTOR BANK COORD
SLAT="${LAT::-1}"
SLON="${LON::-1}"
## REGION
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
##############################################################
## UMAP WALLET CHECK
##############################################################
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${UMAP}.dunikey "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/${UMAP}.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! ${G1PUB} ]] && echo "ERROR generating UMAP WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${G1PUB} | tail -n 1)
ZEN=$(echo "($COINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "UMAP (${COINS} G1) ${ZEN} ZEN : ${G1PUB}"
## ORIGIN ##########################################################
## CALCULATE INITIAL UMAP GEOSPACIAL IPNS KEY
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${UMAP}.priv "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
ipfs key rm ${G1PUB} > /dev/null 2>&1
UMAPNS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${UMAP}.priv)
echo "ORIGIN : ${myIPFS}/ipns/${UMAPNS}"
###################### SPATIO TEMPORAL KEYS
## TODATE #########################################
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${TODATE}.priv "${TODATE}${UPLANETNAME}${LAT}" "${TODATE}${UPLANETNAME}${LON}"
ipfs key rm ${TODATE}${G1PUB} > /dev/null 2>&1
TODATENS=$(ipfs key import ${TODATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${TODATE}.priv)
echo "TODAY : ${myIPFS}/ipns/${TODATENS}"
## YESTERDATE ###############
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv "${YESTERDATE}${UPLANETNAME}${LAT}" "${YESTERDATE}${UPLANETNAME}${LON}"
ipfs key rm ${YESTERDATE}${G1PUB} > /dev/null 2>&1
YESTERDATENS=$(ipfs key import ${YESTERDATE}${G1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${YESTERDATE}.priv)
echo "YESTERDAY : ${myIPFS}/ipns/${YESTERDATENS}"
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start=`date +%s`
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
echo "## IPFS GET YESTERDATENS /ipns/${YESTERDATENS}/"
ipfs --timeout 300s get --progress=false -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
if [[ $? != 0 ]]; then
echo "(╥☁╥ ) swarm online memory empty (╥☁╥ )"
# Try retieve memory from UPlanet ZEN Memory
[[ ${ZEN} -gt 0 ]] \
&& echo "INTERCOM Refreshing from ZEN MEMORY" \
&& ${MY_PATH}/../RUNTIME/ZEN.UMAP.memory.sh "${UMAP}" "${MOATS}" "${G1PUB}"
fi
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end=`date +%s`
echo "_____UMAP${UMAP} GET time was "`expr $end - $start` seconds.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
## FORMAT CONTROL WARNING
[[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \
&& echo ">>> INFO - INTIALIZE UMAP FORMAT - NEW UMAP KEY -" \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \
&& mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN \
&& echo ${MOATS} > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/RSS
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW
echo "~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/"
## zday of the week for IPFSNODEID
rm -f ~/.zen/tmp/${MOATS}/${UMAP}/z*.html 2>/dev/null
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain 2>/dev/null | rev | cut -d ':' -f 1 | rev 2>/dev/null)
[[ "${ZCHAIN}" != "" ]] \
&& echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/z$(date +%A-%d_%m_%Y).html
########################################################
## NODE SELECTION in UMAP.refresher
UREFRESH="${HOME}/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresher"
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
STRAPS=($(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | grep -v '^[[:space:]]*$')) ## ${STRAPS[@]}
if [[ ${ALLNODES[@]} == "" ]]; then
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
ALLNODES=($(cat ${UREFRESH} 2>/dev/null)) # ${ALLNODES[@]}
fi
ACTINGNODE=${ALLNODES[0]} ## FIST NODE IN UMAP.refresher
## IN CASE OLD BOOSTRAP IS STILL IN CHARGE - CHOOSE 1ST STRAP -
[[ ! $(echo ${STRAPS[@]} | grep ${ACTINGNODE}) ]] && ACTINGNODE=${STRAPS[0]}
# ++++++++++++++++++++ - - - - FIND LAST TREATMENT TIME
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null) || ZMOATS=${MOATS}
# ZMOATS SHOULD BE MORE THAT 5 HOURS.
MOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${MOATS})
ZMOATS_SECONDS=$(${MY_PATH}/../tools/MOATS2seconds.sh ${ZMOATS})
DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS))
hours=$((DIFF_SECONDS / 3600))
minutes=$(( (DIFF_SECONDS % 3600) / 60 ))
seconds=$((DIFF_SECONDS % 60))
echo "UMAP DATA is ${hours} hours ${minutes} minutes ${seconds} seconds "
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## IF NOT UPDATED FOR TOO LONG
[[ ${DIFF_SECONDS} -gt $(( 26 * 60 * 60 )) || ${DIFF_SECONDS} -eq 0 ]] \
&& echo ">>>>>>>>>>>>>> More than 26H update - BOOSTRAP 0 ACTION -" \
&& ACTINGNODE=${STRAPS[0]}
echo "* ACTINGNODE=${ACTINGNODE}"
if [[ "${ACTINGNODE}" != "${IPFSNODEID}" ]]; then
echo ">> ACTINGNODE NOT ME - CONTINUE -"
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}"
echo "------8<-------------8<------------------8<-----------------8<-----------------8<"
continue
fi
################################################################################
# ~~~~~~~~~~~~~ GOING FURTHER ~~~ MEANS IPFSNODEID IS UMAP REFRESHER ~~~~~~~~~~~
################################################################################
## NEXT REFRESHER
# TODO: INTRODUCE NODE BALANCE AND CHOOSE THE MOST CONFIDENT ONE
rm ${UREFRESH}
for STRAP in ${STRAPS[@]}; do
echo ${STRAP} >> ${UREFRESH} ## FILL UMAP.refresher file with all STRAPS
done
# SHUFFLE UMAP.refresher
cat ${UREFRESH} | sort | uniq | shuf > ${UREFRESH}.shuf
mv ${UREFRESH}.shuf ${UREFRESH}
## NEXT REFRESHER
echo ">> NEXT REFRESHER WILL BE $(cat ${UREFRESH} | head -n 1)"
######################################################## # NODE SELECTION in UMAP.refresher
############ 101 ZEN (11.1 G1) REFILL ?!
CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev)
[[ ${COINS} == "" || ${COINS} == "null" ]] \
&& [[ ${ZEN} -lt 100 && ${CURRENT} != "" ]] \
&& MIUSER=$(${MY_PATH}/../tools/clyuseryomail.sh "${CURRENT}") \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/.current/secret.dunikey" "11.1" "${G1PUB}" "UPLANET:101ZEN:${UMAP}:${MIUSER}" \
&& echo "UPLANET:101:${UMAP}:${MIUSER}" && echo " ~~~ (ZEN‿‿ZEN) ~~ _${LAT}_${LON} ~~ (ZEN‿‿ZEN) ~~~ "
# %%%%%%%%%% ##################################################
## SECTOR LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${SLAT}_${SLON}
# %%%%%%%%%% ##################################################
SLAT="${LAT::-1}"
SLON="${LON::-1}"
SECTOR="_${SLAT}_${SLON}"
echo "SECTOR ${SECTOR}"
############################################################## "${UPLANETNAME}${LAT}" "${UPLANETNAME}${LON}"
SECTORG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}")
[[ ! ${SECTORG1PUB} ]] && echo "ERROR generating SECTOR WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${SECTORG1PUB}"
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}"
ipfs key rm ${SECTORG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
SECTORNS=$(ipfs key import ${SECTORG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/${SECTOR}.priv)
ipfs key rm ${SECTORG1PUB}
##############################################################
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${SLAT}_${SLON}
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${SECTORNS}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/${SLAT}_${SLON}/index.html
# %%%%%%%%%% ##################################################
## REGION LINKING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ${RLAT}_${RLON}
# %%%%%%%%%% ##################################################
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
REGION="_${RLAT}_${RLON}"
echo "REGION ${REGION}"
##############################################################
REGIONG1PUB=$(${MY_PATH}/../tools/keygen -t duniter "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}")
[[ ! ${REGIONG1PUB} ]] && echo "ERROR generating REGION WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/REGION.priv "${TODATE}${UPLANETNAME}${REGION}" "${TODATE}${UPLANETNAME}${REGION}"
ipfs key rm ${REGIONG1PUB} > /dev/null 2>&1 ## AVOID ERROR ON IMPORT
TODATEREGIONNS=$(ipfs key import ${REGIONG1PUB} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/REGION.priv)
ipfs key rm ${REGIONG1PUB}
##############################################################
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${TODATEREGIONNS}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/${RLAT}_${RLON}/index.html
####################################################################################
#######################################################################################
echo "# NEXTNS : UMAP, SECTOR, REGION ## BOOSTRAP TO SWARM ##"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
####################################################################################
#################################################################################
## DEMAIN DATA
####################################################################################
## UMAP NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.umap
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${LAT}" "${DEMAINDATE}${UPLANETNAME}${LON}"
ipfs key rm "next" > /dev/null 2>&1
NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
echo "UMAP NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
ipfs key rm "next" > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}/next.priv
## BOOSTRAP SWARM PUBLICATION _next.umapns
echo "${G1PUB}:${DEMAINDATE}:${NEXTNS}" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_next.umapns
cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.umapns \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
## SECTOR NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.sector
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${SECTOR}" "${DEMAINDATE}${UPLANETNAME}${SECTOR}"
ipfs key rm "next" > /dev/null 2>&1
NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
echo "SECTOR NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
ipfs key rm "next" > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}/next.priv
## BOOSTRAP SWARM PUBLICATION _next.sectorns
echo "${SECTORG1PUB}:${DEMAINDATE}:${NEXTNS}" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_next.sectorns
cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.sectorns \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
## REGION NEXTNS ############### INFORM "PLAYER.refresh.sh" WITH _next.region
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/next.priv "${DEMAINDATE}${UPLANETNAME}${REGION}" "${DEMAINDATE}${UPLANETNAME}${REGION}"
ipfs key rm "next" > /dev/null 2>&1
NEXTNS=$(ipfs key import "next" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/next.priv)
echo "REGION NEXTNS : ${myIPFS}/ipns/${NEXTNS}"
ipfs key rm "next" > /dev/null 2>&1
rm ~/.zen/tmp/${MOATS}/next.priv
## BOOSTRAP SWARM PUBLICATION _next.regionns
echo "${REGIONG1PUB}:${DEMAINDATE}:${NEXTNS}" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_next.regionns
cp ~/.zen/tmp/${MOATS}/${UMAP}/_next.regionns \
~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
####################################################################################
## TODATE DATA
echo "WRITE $TODATE DATA ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}"
####################################################################################
echo "${TODATENS}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TODATENS
echo "${SECTORNS}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/SECTORNS
echo "${TODATEREGIONNS}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/REGIONNS
echo "${G1PUB}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/G1PUB
echo "${SECTORG1PUB}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/SECTORG1PUB
echo "${REGIONG1PUB}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/REGIONG1PUB
####################################################################################
ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
# %%%%%%%%%% ##################################################
cp ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json \
~/.zen/tmp/${MOATS}/${UMAP}/RSS/ 2>/dev/null
RSSFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/RSS/*.rss.json 2>/dev/null))
for RSSFILE in ${RSSFILES[@]}; do
cp ${RSSFILE} ~/.zen/tmp/${MOATS}/${UMAP}/RSS/
done
# %%%%%%%%%% ##################################################
## COLLECT TW LINKS FROM NODE & SWARM
# %%%%%%%%%% ##################################################
cp -r ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/* \
~/.zen/tmp/${MOATS}/${UMAP}/TW/ 2>/dev/null
TWFILES=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}
cp ${TWRED} ~/.zen/tmp/${MOATS}/${UMAP}/TW/${ZMAIL}/
done
##################################
## OSM2IPFS
### UMAP = 0.01° Planet Slice
UMAPGEN="${EARTHCID}/Umap.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
USATGEN="${EARTHCID}/Usat.html?southWestLat=${LAT}&southWestLon=${LON}&deg=0.01&ipns=${TODATENS}/_index.html"
echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Umap.html
echo "<meta http-equiv=\"refresh\" content=\"0; url='${USATGEN}'\" />" > ~/.zen/tmp/${MOATS}/${UMAP}/Usat.html
## ¤$£€ removed copy OSM map to IPFS. TODO. scrap tiles instead of screen copy
## TODO # GET SCREENSHOT UMAP SECTOR & REGION JPG
## PROBLEM ON LIBRA ... MORE TEST NEEDED ...
#~ [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Umap.jpg ]] \
#~ && python ${MY_PATH}/../tools/page_screenshot.py "${myIPFS}${UMAPGEN}" ~/.zen/tmp/${MOATS}/${UMAP}/Umap.jpg 900 900 2>/dev/null \
#~ && [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Umap.jpg ]] && killall chrome
#~ [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg ]] \
#~ && python ${MY_PATH}/../tools/page_screenshot.py "${myIPFS}${USATGEN}" ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg 900 900 2>/dev/null \
#~ && [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/Usat.jpg ]] && killall chrome
#### NOT WORKING !!!
## GEOLINKING CALCULATE SURROUNDING UMAPS ###############################
#~ if [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/geolinks.json ]]; then
#~ ${MY_PATH}/../tools/Umap_geolinks.sh "${LAT}" "${LON}" "${UMAP}" "${MOATS}" "${UMAPNS}"
#~ fi
#~ ### SET navigator.html ## MAKE EVOLVE template/umap.html
#~ cp ${MY_PATH}/../templates/umap.html ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html
#~ cat ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html | sed "s~Umap~Usat~g" > ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Usat.html
#### IS IT USEFUL ?..??
####################################
# %%%%%%%%%% ##################################################
## GET FROM WEB2.0 POI's AROUND >>>>>>>>>>>>>>>>>>>>>>>>>
# %%%%%%%%%% ##################################################
####################################
echo "################### WEB2.0 SCRAPING TIME >>>>>>>>>>>>>>>>"
## RECORD P4N SPOT DATA
echo "* park4night : https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s -L "https://www.park4night.com/api/places/around?lat=${LAT}&lng=${LON}&radius=200&filter=%7B%7D&lang=fr" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/p4n.json \
&& echo "UPDATED PARK4NIGHT" \
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
####################################
echo "* gchange : ./tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON}"
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
## GET ALL WALLETS
echo "* GET WALLETS https://g1-stats.axiom-team.fr/data/geoloc-members.json"
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
&& curl -s "https://g1-stats.axiom-team.fr/data/geoloc-members.json" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json) ]] \
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json \
&& echo "UPDATED WALLALL" \
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
## FILTER LOCAL WALLETS
target_lat=${LAT}
target_lon=${LON}
precision=0.1
jq --argjson target_lat "$target_lat" \
--argjson target_lon "$target_lon" \
--argjson precision "$precision" \
'.wallets | map(select((.geoPoint.lat | tonumber) >= ($target_lat - $precision) and (.geoPoint.lat | tonumber) <= ($target_lat + $precision) and (.geoPoint.lon | tonumber) >= ($target_lon - $precision) and (.geoPoint.lon | tonumber) <= ($target_lon + $precision)))' ~/.zen/tmp/${MOATS}/${UMAP}/wallall.json \
> ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
cat ${MY_PATH}/../templates/P4N/index.html \
| sed -e "s~43.61000~${LAT}~g" \
-e "s~1.43000~${LON}~g" \
-e "s~_SERVICE_~Commons~g" \
-e "s~_UMAP_~${UMAP}~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.p4n.html
# %%%%%%%%%% ##################################################
########################################################
echo "CREATING SPHERICAL LOCATIONS"
# %%%%%%%%%% ##################################################
## PREPARE SPHERE MAP ##################################################################
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
SWARMTW=($(ls ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
NODETW=($(ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}_${LON}/TW/*/index.html 2>/dev/null))
TWFILES=("${SWARMTW[@]}" "${NODETW[@]}")
for TWRED in ${TWFILES[@]}; do
ZMAIL=$(echo ${TWRED} | rev | cut -d '/' -f 2 | rev)
TWADD=$(cat ${TWRED} | grep -o "/ipns/[^\"]*" | sed "s/'$//")
[[ -z ${TWADD} ]] && TWADD=$(cat ${TWRED} | grep -o "/ipfs/[^\"]*" | sed "s/'$//")
## ADD ASTRONAUTNS ON SECTOR WORLD MAP
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${ZMAIL}"',
link: '"${TWADD}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON UMAP WORLD READY /ipfs/${IAMAP}/world.js"
###########################################################################################
### APPLY ON APP MODEL
SLAT="${LAT::-1}"
SLON="${LON::-1}"
SECTOR="_${SLAT}_${SLON}"
TODATESECTORNS=$(${MY_PATH}/../tools/keygen -t ipfs "${TODATE}${UPLANETNAME}${SECTOR}" "${TODATE}${UPLANETNAME}${SECTOR}")
PHONEBOOTH="${G1PUB::30}"
cat ${MY_PATH}/../templates/UPlanetUmap/index.html \
| sed -e "s~_ZONE_~${UMAP}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ZONENS_~${TODATENS}~g" \
-e "s~_ZCHAIN_~${ZCHAIN}~g" \
-e "s~_IPFSNINJA_~${VDONINJA}~g" \
-e "s~_HACKGIPFS_~${HACKGIPFS}~g" \
-e "s~_UPZONE_~SECTOR ${SECTOR}~g" \
-e "s~_UPZONENS_~${TODATESECTORNS}~g" \
-e "s~_UPUPZONE_~REGION ${REGION}~g" \
-e "s~_UPUPZONENS_~${TODATEREGIONNS}~g" \
-e "s~_PHONEBOOTH_~${PHONEBOOTH}~g" \
-e "s~_CESIUMIPFS_~${CESIUMIPFS}~g" \
-e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_DATE_~$(date +%A-%d_%m_%Y)~g" \
-e "s~_UPLANETLINK_~${EARTHCID}/map_render.html\?southWestLat=${LAT}\&southWestLon=${LON}\&deg=0.01~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${MOATS}/${UMAP}/_index.html
## Make it root App
#~ mv ~/.zen/tmp/${MOATS}/${UMAP}/_index.html \
#~ ~/.zen/tmp/${MOATS}/${UMAP}/index.html
##################################
###########################################################################################
########################################################
## CREATE .all.json for RSS in this UMAP
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${MOATS}/${UMAP}/RSS
##############################################################
############################ PUBLISHING UMAP
##############################################################
UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1)
ZCHAIN=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain | rev | cut -d ':' -f 1 | rev 2>/dev/null)
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS=${MOATS}"
######################################################
## ZEN CHAINING
# Send 1 ZEN to UPlanet SECTORG1PUB Wallet containing REGION TW HASH
INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${UMAPROOT}"
echo "> INTERCOM ${INTERCOM} (${ZEN} ZEN > 11 ?)"
if [[ ${ZEN} -gt 11 ]]; then
echo "---ZZZ-- UMAP 2 SECTOR ZEN CHAINING ---ZZZ------ZZZ----"
${MY_PATH}/../tools/PAY4SURE.sh ~/.zen/tmp/${MOATS}/${UMAP}.dunikey "0.1" "${SECTORG1PUB}" "${INTERCOM}"
fi
## MICRO LEDGER CHAIN CHANGED or INIT ?
[[ ${ZCHAIN} != ${UMAPROOT} || ${ZCHAIN} == "" ]] \
&& echo "${MOATS}:${IPFSNODEID}:${UMAPROOT}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain \
&& echo "${MOATS}" > ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats \
&& UMAPROOT=$(ipfs add -rwHq ~/.zen/tmp/${MOATS}/${UMAP}/* | tail -n 1) \
&& echo "ROOT was ${ZCHAIN}"
echo "PUBLISHING ${TODATE} UMAPROOT : ${myIPFS}/ipfs/${UMAPROOT}"
ipfs --timeout 300s name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
end=`date +%s`
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
ipfs key rm "${TODATE}${G1PUB}" "${YESTERDATE}${G1PUB}" "${G1PUB}" ## REMOVE IPNS KEY
[[ ${ZCHAIN} != "" ]] && ipfs pin rm ${ZCHAIN}
################# PUBLISH UPlanet UMAP to G1PODs
${MY_PATH}/../tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${UMAP}.dunikey -n ${myDATA} \
set -n "UPlanet ${UMAP}" -v " " -a " " -d "UPlanet ${myUPLANET}" \
-pos ${LAT} ${LON} -s ${myLIBRA}/ipfs/${UMAPROOT} \
-A ${MY_PATH}/../images/extension_territoire.jpg
${MY_PATH}/../tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/tmp/${MOATS}/${UMAP}.dunikey -n ${myCESIUM} \
set -n "UPlanet ${UMAP}" -v " " -a " " -d "UPlanet ${myUPLANET}" \
-pos ${LAT} ${LON} -s ${myLIBRA}/ipfs/${UMAPROOT} \
-A ${MY_PATH}/../images/extension_territoire.jpg
rm ~/.zen/tmp/${MOATS}/*.priv
rm ~/.zen/tmp/${MOATS}/${UMAP}.dunikey
done
######################################################
### LEVEL 2 ###########################################
######################################################
### SECTOR = 0.1° Planet Slice
${MY_PATH}/SECTOR.refresh.sh "${unique_combined[@]}"
######################################################
### LEVEL 3 ###########################################
######################################################
### REGION = 1° Planet Slice
${MY_PATH}/REGION.refresh.sh "${unique_combined[@]}"
######################################################
######################################################
exit 0
######################################################

638
RUNTIME/VISA.new.sh Executable file
View File

@ -0,0 +1,638 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# 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
. "${MY_PATH}/../tools/my.sh"
! ipfs swarm peers >/dev/null 2>&1 && echo "Lancez 'ipfs daemon' SVP" && exit 1
################################################################################
[[ ! ${MOATS} ]] && MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
SALT="$1"
PEPPER="$2"
PLAYER="$3"
PSEUDO="$4"
[[ $PSEUDO == "" ]] && PSEUDO="Anonymous"
LANG="$5"
[[ $LANG == "" ]] && LANG="_LANG_"
## UPLANET UMAP
LAT="$6"
[[ $LAT == "" ]] && LAT="0.00"
LON="$7"
[[ $LON == "" ]] && LON="0.00"
################################################################################
YOU=$(myIpfsApi);
################################################################################
## LIST TW MODELS
################################################################################
#~ TWMODEL="/ipfs/bafybeid7xwuqkgyiffehs77x3wky3dghjncxepr5ln6dewapgvbwrqi7n4"
#~ # ipfs cat $TWMODEL > templates/twdefault.html
TWUPLANET="/ipfs/bafybeigpwapdih24vnakummoyj6vodxiem4i6ezp5hxa35yt3paxpqz53y" ## WITH LIGHTBEAMS SAVER
TWUPLANET="/ipfs/bafybeidxa45qgbf34p7uvmphj5zt6jp2zgpw7ouwb3e3urnbu4jrt2dgiq" ## WITH IPFS SAVER
# ipfs cat $TWUPLANET > templates/twuplanet.html
################################################################################
mkdir -p ~/.zen/tmp/${MOATS}/TW
## TEST chargement ONLINE TW !!!
if [[ $SALT != "" && PEPPER != "" ]]; then
## Creating SALT/PEPPER IPNS KEY
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/player.key "$SALT" "$PEPPER" 2>/dev/null
ASTRONAUTENS=$(ipfs key import ${MOATS} -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/player.key 2>/dev/null)
# echo "/ipns/${ASTRONAUTENS}"
echo "SCANNING /ipns/${ASTRONAUTENS} for 180s"
## GETTING LAST TW via IPFS or HTTP GW
ipfs --timeout 180s cat --progress=false /ipns/${ASTRONAUTENS} > ~/.zen/tmp/${MOATS}/TW/index.html
if [[ -s ~/.zen/tmp/${MOATS}/TW/index.html ]]; then
echo "TW FOUND... BACKUP TIDDLERS"
# BACKUP tiddlers
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} \
--render '.' 'backup.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[!is[system]]'
[[ -s ~/.zen/tmp/${MOATS}/backup.json ]] \
&& echo ">> Tiddlers Backup : ~/.zen/tmp/${MOATS}/backup.json" \
|| echo "ERROR EXTRACTING TIDDLERS"
rm ~/.zen/tmp/${MOATS}/TW/index.html
fi
#############################################
## CREATE NEW TW FROM TEMPLATE
cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
#### REFILL WITH BACKUP
if [[ -s ~/.zen/tmp/${MOATS}/backup.json ]]; then
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html \
--import ~/.zen/tmp/${MOATS}/backup.json "application/json" \
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "tw.html" "text/plain"
[[ -s ~/.zen/tmp/${MOATS}/tw.html ]] \
&& cp -f ~/.zen/tmp/${MOATS}/tw.html ~/.zen/tmp/${MOATS}/TW/index.html
echo "BACKUP RESTORED"
fi
#############################################
# EXISTING TW : DATA TESTING & CACHE
rm -f ~/.zen/tmp/${MOATS}/Astroport.json
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
HPass=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].HPASS)
echo "ASTROPORT=${ASTROPORT}"
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'AstroID.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'AstroID'
AstroID=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[]._canonical_uri) ## Can be deleted
[[ -z $HPass ]] && HPass=$(cat ~/.zen/tmp/${MOATS}/AstroID.json | jq -r .[].HPASS) ## Double HPASS
echo "AstroID=$AstroID ($HPass)"
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'ZenCard.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'ZenCard'
ZenCard=$(cat ~/.zen/tmp/${MOATS}/ZenCard.json | jq -r .[]._canonical_uri)
echo "ZenCard=$ZenCard"
if [[ ${ASTROPORT} != "" && ${ASTROPORT} != "null" ]]; then
IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
echo "---> CONNECTING PLAYER $(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].pseudo) TW NOW with $IPFSNODEID"
else
echo ">> NO ACTIVE TW - CREATING FRESH NEW ONE"
cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
fi
ipfs key rm ${MOATS} 2>/dev/null ## CLEANING MOATS KEY
fi
##################################################### # NEW PLAYER ###############
################################################################################
#~ echo "=============================================
#~ ASTROPORT DIPLOMATIC PASSPORT - MadeInZion VISA -
#~ =============================================
#~ A Cryptographic Key to control your INTERNET
#~ Adventure & Exploration P2P Terraforming Game.
#~ =============================================
#~ WELCOME 'Astronaute'"; # sleep 1
#~ echo "Inscription..."
[[ $SALT == "" ]] && SALT=$(${MY_PATH}/../tools/diceware.sh 4 | xargs)
#~ echo "-> ID : $SALT"
[[ $PEPPER == "" ]] && PEPPER=$(${MY_PATH}/../tools/diceware.sh 4 | xargs)
#~ echo "-> PASS : $PEPPER"
[[ ! $PSEUDO ]] && PSEUDO=${PLAYER%%[0-9]*}
[[ ! $PSEUDO ]] && PSEUDO="Anonymous"
[[ $(ls ~/.zen/game/players/$PSEUDO 2>/dev/null) ]] && echo "$PSEUDO EST DEJA UN PLAYER. EXIT" && exit 1
# PSEUDO=${PSEUDO,,} #lowercase
[[ ! ${PLAYER} ]] \
&& PLAYER=${PSEUDO}${RANDOM:0:3}@$(${MY_PATH}/../tools/diceware.sh 1 | xargs).${RANDOM:0:3} \
&& echo "ADRESSE EMAIL ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER ## CLI MODE
PLAYER=${PLAYER,,}
# 4 DIGIT PASS CODE TO PROTECT QRSEC
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5)
############################################################
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/secret.dunikey "$SALT" "$PEPPER"
G1PUB=$(cat ~/.zen/tmp/${MOATS}/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
[[ ! $G1PUB ]] && echo "Désolé. clef Cesium absente. ERROR" && exit 1
## CREATE Player personnal files storage and IPFS publish directory
mkdir -p ~/.zen/game/players/${PLAYER}/.ipfs # Prepare PLAYER datastructure
echo "/ip4/127.0.0.1/tcp/5001" > ~/.zen/game/players/${PLAYER}/.ipfs/api
## secret.june = SALT PEPPER CREDENTIALS
echo "SALT=\"$SALT\"" > ~/.zen/game/players/${PLAYER}/secret.june
echo "PEPPER=\"$PEPPER\"" >> ~/.zen/game/players/${PLAYER}/secret.june
####
## MOVE ${MOATS} secret.dunikey IN PLAYER DIRECTORY
mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/${PLAYER}/
NID="${myIPFS}"
WID="${myAPI}" ## https://ipfs.libra.copylaradio.com
[[ $isLAN ]] && NID="http://ipfs.localhost:8080" \
&& WID="http://ipfs.localhost:5001"
# Create ${PLAYER} "IPNS Key"
ipfs key rm ${PLAYER} >/dev/null 2>&1
ipfs key rm ${G1PUB} >/dev/null 2>&1
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/secret.player "$SALT" "$PEPPER"
TWNS=$(ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
ASTRONAUTENS=$(ipfs key import ${G1PUB} -f pem-pkcs8-cleartext ~/.zen/game/players/${PLAYER}/secret.player)
## TODO MAKE CLEANER
mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/G1SSB # Prepare astrXbian sub-datastructure "old scarf code"
qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.png "$G1PUB" ## Check by VISA.print.sh
cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/ipfs/QR.png
echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.pubkey # G1SSB NOTATION (astrXbian compatible)
qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png "$myLIBRA/ipns/${ASTRONAUTENS}"
############################################################################
## SEC PASS PROTECTED QRCODE : base58 secret.june / openssl(pass)
#~ secFromDunikey=$(cat ~/.zen/game/players/${PLAYER}/secret.dunikey | grep "sec" | cut -d ' ' -f2)
#~ echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
USALT=$(echo "$SALT" | jq -Rr @uri)
UPEPPER=$(echo "$PEPPER" | jq -Rr @uri)
DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
## PGP ENCODING SALT/PEPPER API ACCESS
echo "${DISCO}" > ~/.zen/tmp/${MOATS}/topgp
cat ~/.zen/tmp/${MOATS}/topgp | gpg --symmetric --armor --batch --passphrase "$PASS" -o ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc
rm ~/.zen/tmp/${MOATS}/topgp
#~ openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -in ~/.zen/game/players/${PLAYER}/secret.june -out "$HOME/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec" -k "$PASS"
#~ PASsec=$(cat ~/.zen/tmp/${MOATS}/enc.${PSEUDO}.sec | base64 -w 0 | jq -sRr '@uri' )
#~ HPass=$(echo "$PASS" | sha512sum | cut -d ' ' -f 1)
#~ qrencode -s 12 -o $HOME/.zen/game/players/${PLAYER}/QRsec.png $PASsec
## Add logo to QRCode
cp ${MY_PATH}/../images/astrologo_nb.png ~/.zen/tmp/${MOATS}/fond.png
## ASTROID ~~~~~
ASTROIDQR="$(cat ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc | tr '-' '~' | tr '\n' '-' | tr '+' '_' | jq -Rr @uri )"
## MAKE amzqr ASTROID PGP QRCODE
amzqr "${ASTROIDQR}" \
-d ~/.zen/tmp/${MOATS} \
-l H \
-p ~/.zen/tmp/${MOATS}/fond.png 1>/dev/null
## ADD PLAYER EMAIL
convert -gravity northwest -pointsize 28 -fill black -draw "text 5,5 \"$PLAYER\"" ~/.zen/tmp/${MOATS}/fond_qrcode.png ~/.zen/game/players/${PLAYER}/result_qrcode.png
convert ~/.zen/game/players/${PLAYER}/result_qrcode.png -resize 480 ~/.zen/game/players/${PLAYER}/AstroID.png
ASTROQR="/ipfs/$(ipfs add -q $HOME/.zen/game/players/${PLAYER}/AstroID.png | tail -n 1)"
## DO NOT PIN ASTROID QRCODE
ipfs pin rm ${ASTROQR}
############################################################################ TW
### INITALISATION WIKI dans leurs répertoires de publication IPFS
mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/moa/
[[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
&& cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
sed "s~_BIRTHDATE_~${MOATS}~g" ~/.zen/tmp/${MOATS}/TW/index.html \
> ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
# INSERT ASTROPORT ADDRESS
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html --output ~/.zen/tmp/${MOATS} --render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
sed -i "s~${ASTROPORT}~/ipns/${IPFSNODEID}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
# TW CHAIN INIT WITH TWMODEL
sed -i "s~_MOATS_~${MOATS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_CHAIN_~${TWUPLANET}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_TWMODEL_~${TWUPLANET}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_ASTRONAUTENS_~/ipns/${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
## AND HACK QRCODE.sh FOR _PGP KEY_ TO VERIFY LAST HASH OF PROVIDED PASS
HPASS=$(echo $PASS | sha512sum | cut -d ' ' -f 1)
[[ ${HPass} != "" && ${HPass} != "null" ]] && SRCPASS=${HPass} || SRCPASS="_HPASS_"
sed -i "s~${SRCPASS}~${HPASS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
## RESET WISHES TO DEPLOY DERIVATED KEYS ON HOST AGAIN ( DONE IN PLAYER_REFRESH )
#~ sed -i "s~G1Voeu~voeu~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
# INSERT PLAYER DATA
CURRENT=$(readlink ~/.zen/game/players/.current | rev | cut -d '/' -f 1 | rev)
[[ -z ${CURRENT} ]] && CURRENT=${PLAYER}
sed -i "s~_PLAYER_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_CURRENT_~${CURRENT}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_PSEUDO_~${PSEUDO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~_G1PUB_~${G1PUB}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
#~ sed -i "s~_QRSEC_~${PASsec}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
# La Clef IPNS porte comme nom G1PUB et ${PLAYER}
sed -i "s~_MEDIAKEY_~${PLAYER}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
## AstroID Tiddler UPGRADE
cat ${MY_PATH}/../templates/data/AstroID.json \
| sed -e "s~/ipfs/bafybeifbebc3ewnzrzbm44arddedbralegnxklhua5d5ymzaqtf2kaub7i~${ASTROQR}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
-e "s~_HPASS_~${HPASS}~g" \
> ~/.zen/tmp/${MOATS}/AstroID.json
sed -i "s~tube.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
sed -i "s~ipfs.copylaradio.com~$myTUBE~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
## PREPARE UMAP LAT LON replacement
[[ ! ${LAT} ]] && LAT="0.00"
[[ ! ${LON} ]] && LON="0.00"
SECTOR="_${LAT::-1}_${LON::-1}" ### SECTOR = 0.1° Planet Slice in MadeInZion Tiddler
echo "UPlanet 0.1° SECTOR : ${SECTOR}"
PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
sed -i "s~_SECTOR_~${SECTOR}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ## MadeInZion
sed -i "s~_DAO_~${LANG}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ## MadeInZion
sed -i "s~_NUMBER_~${#PLAYERONE[@]}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ## MadeInZion
# GET ACTUAL GPS VALUES
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS'
OLAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
OLON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
# REPLACE WITH NEW LAT LON UMAP
sed -i "s~${OLAT}~${LAT}~g" ~/.zen/tmp/${MOATS}/GPS.json
sed -i "s~${OLON}~${LON}~g" ~/.zen/tmp/${MOATS}/GPS.json
## Add _SECTORTW_
cat ~/.zen/tmp/${MOATS}/GPS.json | jq '.[0] + {"sectortw": "_SECTORTW_"}' \
> ~/.zen/tmp/${MOATS}/GPStw.json \
&& mv ~/.zen/tmp/${MOATS}/GPStw.json ~/.zen/tmp/${MOATS}/GPS.json
###########
## GET OLD16 FROM MadeInZion
tiddlywiki \
--load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'MIZ.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
OLD16=$(cat ~/.zen/tmp/${MOATS}/MIZ.json | jq -r ".[].secret")
[[ ${OLD16} == "" || ${OLD16} == "null" ]] && OLD16="_SECRET_"
echo "${OLD16}"
# TODO : MAKE NODE FORGET PASS THEN DECODE ${PLAYER}/secret.june FROM TW # PROD #
MACHINEPUB=$(cat $HOME/.zen/game/myswarm_secret.dunikey | grep pub | cut -d ' ' -f 2)
if [[ "${MACHINEPUB}" != "" ]]; then
#~ echo "# CRYPTO ENCODING PLAYER KEY WITH MACHINEPUB
${MY_PATH}/../tools/natools.py encrypt \
-p ${MACHINEPUB} \
-i $HOME/.zen/game/players/${PLAYER}/secret.june \
-o $HOME/.zen/tmp/${MOATS}/secret.june.${G1PUB}.enc
ENCODING=$(cat ~/.zen/tmp/${MOATS}/secret.june.$G1PUB.enc | base16)
sed -i "s~${OLD16}~${ENCODING}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
echo "ENCODING: ${ENCODING}"
# GIVE ZEN STATION TW ACCESS #
###########
#~ echo "# CRYPTO DECODING TESTING..."
tiddlywiki \
--load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
cat ~/.zen/tmp/${MOATS}/MadeInZion.json \
| jq -r ".[].secret" | base16 -d \
> ~/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2
${MY_PATH}/../tools/natools.py decrypt \
-f pubsec \
-k $HOME/.zen/game/myswarm_secret.dunikey \
-i $HOME/.zen/tmp/${MOATS}/crypto.$G1PUB.enc.2 \
-o $HOME/.zen/tmp/${MOATS}/crypto.2
#~ echo "DEBUG : $(cat $HOME/.zen/tmp/${MOATS}/crypto.2)"
###########
## CRYPTO PROCESS VALIDATED
[[ -s ~/.zen/tmp/${MOATS}/crypto.2 ]] \
&& echo "NATOOLS LOADED STATION TW KEY " \
|| echo "NATOOLS ERRORS - CHECK STATION" # MACHINEPUB CRYPTO ERROR
else
echo " - WARNING - MISSING ~/.zen/game/myswarm_secret.dunikey - WARNING -"
fi
########### SECTOR = 0.1° UPLANET SLICE
OSECTOR=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].sector)
[[ ${OSECTOR} != "null" ]] && sed -i "s~${OSECTOR}~${SECTOR}~g" ~/.zen/tmp/${MOATS}/MadeInZion.json
### CREATE ${NID} ADDRESS FOR API & ROUND ROBIN FOR GW
cat ${MY_PATH}/../templates/data/local.api.json | sed "s~_NID_~${WID}~g" > ~/.zen/tmp/${MOATS}/local.api.json
cat ${MY_PATH}/../templates/data/local.gw.json | sed "s~_NID_~${NID}~g" > ~/.zen/tmp/${MOATS}/local.gw.json
# Create"${PLAYER}_feed" Key ! DERIVATED ! "$SALT" "$PEPPER $G1PUB"
ipfs key rm "${PLAYER}_feed" 2>/dev/null
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/tmp/${MOATS}/feed.ipfskey "$SALT" "$PEPPER $G1PUB"
FEEDNS=$(ipfs key import "${PLAYER}_feed" -f pem-pkcs8-cleartext ~/.zen/tmp/${MOATS}/feed.ipfskey)
## MAKE LightBeam Plugin Tiddler ${PLAYER}_feed
# $:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
## ADD SYSTEM TW
tiddlywiki --load ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \
--import ~/.zen/tmp/${MOATS}/lightbeam-key.json "application/json" \
--import ~/.zen/tmp/${MOATS}/local.api.json "application/json" \
--import ~/.zen/tmp/${MOATS}/local.gw.json "application/json" \
--import ~/.zen/tmp/${MOATS}/GPS.json "application/json" \
--import ~/.zen/tmp/${MOATS}/AstroID.json "application/json" \
--import ~/.zen/tmp/${MOATS}/MadeInZion.json "application/json" \
--import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_api.json" "application/json" \
--import "${MY_PATH}/../templates/tw/\$ _ipfs_saver_gateway.json" "application/json" \
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "tw.html" "text/plain"
## COPY TO LOCAL & 12345 IPFSNODEID MAP
[[ -s ~/.zen/tmp/${MOATS}/tw.html ]] \
&& cp -f ~/.zen/tmp/${MOATS}/tw.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER} \
&& cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/ \
|| ( echo "Problem with TW - EXIT" && exit 1 )
############################################################################ G1TW
#### MAKE G1TW
[[ -s ~/.zen/G1BILLET/MAKE_G1BILLET.sh ]] && \
~/.zen/G1BILLET/MAKE_G1BILLET.sh "$SALT" "$PEPPER" "___" "$G1PUB" "${PASS}" "${PSEUDO-xastro}" "$ASTRONAUTENS" "$PLAYER"
#### MADE # BILLETNAME=$(echo "$SALT" | sed 's/ /_/g') ##
# IMAGE ~/.zen/G1BILLET/tmp/g1billet/${PASS}/${BILLETNAME}.BILLET.jpg
############################################################################
## MAKE IMAGE AVATAR WITH G1PUB QRCODE
if [[ $(which amzqr) ]]; then
GIMG="${MY_PATH}/../images/moa_net.png"
CIMG="${MY_PATH}/../images/zenticket.png"
# QRG1avatar.png
[[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] && amzqr "${G1PUB}" -l H -p "$CIMG" -c -n QRG1avatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
# QRTWavatar.png
[[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] && amzqr "${myIPFSGW}/ipns/${ASTRONAUTENS}" -l H -p "$GIMG" -c -n QRTWavatar.png -d ~/.zen/game/players/${PLAYER}/ 1>/dev/null
else
[[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.png ]] \
&& cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/QRG1avatar.png
[[ ! -s ~/.zen/game/players/${PLAYER}/QRTWavatar.png ]] \
&& cp ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png ~/.zen/game/players/${PLAYER}/QRTWavatar.png
fi
## ID CARD & QRCODE
convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 300 ~/.zen/tmp/${MOATS}/QR.png 2>/dev/null
convert ~/.zen/game/players/${PLAYER}/QRTWavatar.png -resize 240 ~/.zen/tmp/${MOATS}/TW.png 2>/dev/null
convert ${MY_PATH}/../images/astroport.jpg -resize 240 ~/.zen/tmp/${MOATS}/ASTROPORT.png 2>/dev/null
composite -compose Over -gravity SouthEast -geometry +5+5 ~/.zen/tmp/${MOATS}/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/${MOATS}/astroport.png 2>/dev/null
composite -compose Over -gravity NorthEast -geometry +10+55 ~/.zen/tmp/${MOATS}/TW.png ~/.zen/tmp/${MOATS}/astroport.png ~/.zen/tmp/${MOATS}/astroport2.png 2>/dev/null
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/${MOATS}/QR.png ~/.zen/tmp/${MOATS}/astroport2.png ~/.zen/tmp/${MOATS}/one.png 2>/dev/null
convert -gravity SouthWest -pointsize 12 -fill black -draw "text 5,3 \"$G1PUB\"" ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/txt.png
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/.current/QRsec.png ~/.zen/tmp/${MOATS}/one.png ~/.zen/tmp/${MOATS}/image.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/${MOATS}/txt.png ~/.zen/tmp/${MOATS}/image.png
convert -gravity northwest -pointsize 20 -fill black -draw "text 300,40 \"${PLAYER}\"" ~/.zen/tmp/${MOATS}/image.png ~/.zen/tmp/${MOATS}/pseudo.png
## WITH CONFIDENTIAL (LOCAL PRINT)
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/${MOATS}/pseudo.png ~/.zen/tmp/${MOATS}/pass.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/${MOATS}/pass.png ~/.zen/tmp/${MOATS}/salt.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/${MOATS}/salt.png ~/.zen/game/players/${PLAYER}/ID.png
# INSERTED IMAGE IPFS
# IASTRO=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ID.png | tail -n 1) ## ZENCARD PUBLIC / PRIVATE
IASTRO="/ipfs/$(ipfs add -Hq ~/.zen/tmp/${MOATS}/pseudo.png | tail -n 1)" ## ZENCARD PUBLIC ONLY
## Update ZenCard
[[ ! $ZenCard ]] && ZenCard="/ipfs/bafybeidhghlcx3zdzdah2pzddhoicywmydintj4mosgtygr6f2dlfwmg7a"
sed -i "s~${ZenCard}~${IASTRO}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
echo
echo "♥ IPFS Ŋ1 TW INIT ♥"
echo "TW ${NID}/ipns/${ASTRONAUTENS}/"
IPUSH=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
echo $IPUSH > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain # Contains last IPFS backup PLAYER KEY
echo $MOATS > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
(
#~ echo "$MOATS :: /ipfs/$IPUSH"
ipfs name publish --key=${PLAYER} /ipfs/$IPUSH
#~ echo "TW PUBLISHING DONE"
) &
## MEMORISE PLAYER Ŋ1 ZONE
echo "${PLAYER}" > ~/.zen/game/players/${PLAYER}/.player
echo "$PSEUDO" > ~/.zen/game/players/${PLAYER}/.pseudo
echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/.g1pub
echo "${ASTRONAUTENS}" > ~/.zen/game/players/${PLAYER}/.playerns
#~ echo; echo "Création Clefs et QR codes pour accès au niveau Astroport Ŋ1"; sleep 1
echo "--- PLAYER : ${PLAYER} - DATA PROTOCOL LAYER LOADED";
# ls ~/.zen/game/players/${PLAYER}
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] && xdg-open "${myIPFS}/ipns/${ASTRONAUTENS}" && espeak "YOUR PASS IS $PASS"
####### CORRECT NO CURRENT ? PLAYER = .current
[[ ! -e ~/.zen/game/players/.current ]] \
&& rm ~/.zen/game/players/.current 2>/dev/null \
&& ln -s ~/.zen/game/players/${PLAYER} ~/.zen/game/players/.current
. "${MY_PATH}/../tools/my.sh"
#################################################################
#### make player ipfs docker ## TODO
# [[ $USER == 'zen' ]] && make player MAIL=$(myPlayer) USER_HOST=$(myPlayerHost) > /dev/null 2>&1
## 1ST RELEASE BASED ON DIRECT NODE IPFSNODEID KEY "ADD / DEL" API
#################################################################
#################################################
# !! TODO !! # DEMO MODE. REMOVE FOR PRODUCTION - RECALCULATE AND RENEW AFTER EACH NEW KEY DELEGATION
echo "$PASS" > ~/.zen/game/players/${PLAYER}/.pass
# ~/.zen/game/players/${PLAYER}/secret.june SECURITY TODO
# Astronaut QRCode + PASS = LOGIN (=> DECRYPTING CRYPTO IPFS INDEX)
# TODO : Allow Astronaut PASS change ;)
#####################################################
## MANAGE GCHANGE+ & Ŋ1 EXPLORATION
${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}"
### IF PRINTER -> PRINT VISA
LP=$(ls /dev/usb/lp* 2>/dev/null)
[[ $LP ]] && ${MY_PATH}/../tools/VISA.print.sh "${PLAYER}" &
## INIT FRIENDSHIP CAPTAIN/ASTRONAUTS (LATER THROUGH GCHANGE)
## ${MY_PATH}/FRIENDS.init.sh
## NO. GCHANGE+ IS THE MAIN INTERFACE, astrXbian manage
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "$(${MY_PATH}/../tools/face.sh cool)"
echo " 'Astronaut' $PSEUDO"
echo
echo "* ZenCard : Public Key and Wallet
${NID}/ipns/${ASTRONAUTENS}#ZenCard"
echo " "
echo "* AstroID : with PASS : $PASS"
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
echo
echo "* UMap : registration at ${LAT}, ${LON}"
echo
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
####tools##########################################getUMAP_ENV.sh
$(${MY_PATH}/../tools/getUMAP_ENV.sh "${LAT}" "${LON}" | tail -n 1)
ipns2did=""
# Loop through the ASTRONAUTENS two characters at a time
for ((i = 0; i < ${#ASTRONAUTENS}; i += 2)); do
ipns2did+=" ${ASTRONAUTENS:i:2}"
# Check if 12 doublets have been added
if (( (i / 2 + 1) % 12 == 0 )); then
ipns2did+="<br>" # Add a newline character
fi
done
# Print the result with leading space removed
echo -e "${ipns2did:1}"
####################################################### EMAIL
[[ -s ${MY_PATH}/../templates/UPlanetZINE/day0/index.${LANG}.html ]] \
&& ZINE="${MY_PATH}/../templates/UPlanetZINE/day0/index.${LANG}.html" \
|| ZINE="${MY_PATH}/../templates/UPlanetZINE/day0/index.html"
##UPlanetZine::/ipfs/QmUjgQYK74UgRoyLFfmR2LMX7rd6vNxmtWeUtRxjemELuZ - chained release -
cat ${ZINE} \
| sed -e "s~/ipfs/QmdmeZhD8ncBFptmD5VSJoszmu41edtT265Xq3HVh8PhZP~${ASTROQR}~g" \
-e "s~/ipfs/QmTL7VDgkYjpYC2qiiFCfah2pSqDMkTANMeMtjMndwXq9y~${IASTRO}~g" \
-e "s~_MOATS_~${MOATS}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
-e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
-e "s~_ASTRODID_~${ipns2did:1}~g" \
-e "s~0448~${PASS}~g" \
-e "s~_SALT_~${SALT}~g" \
-e "s~_PEPPER_~${PEPPER}~g" \
-e "s~_IPFSNODEID_~${IPFSNODEID}~g" \
-e "s~_EARTHCID_~${EARTHCID}~g" \
-e "s~_SECTOR_~${SECTOR}~g" \
-e "s~_SLAT_~${SLAT}~g" \
-e "s~_SLON_~${SLON}~g" \
> ~/.zen/tmp/${MOATS}/UPlanetZine.html
$MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/UPlanetZine.html "${PLAYER} MULTIPASS"
#####################################################################"_EARTHCID_
#~ echo "<html><head>
#~ <style>
#~ body {
#~ font-family: 'Courier New', monospace;
#~ }
#~ pre {
#~ white-space: pre-wrap;
#~ }
#~ </style></head>
#~ <body>
#~ <center>
#~ <h3><a href='${myUPLANET}'>UPlanet</a></h3>
#~ <h1>\"<a target='TW' href='$(myIpfsGw)/ipns/${ASTRONAUTENS}'>TW5</a>\"</h1>
#~ did:/ipns/${ASTRONAUTENS}
#~ <hr>
#~ <hr><a target='TW' href='$(myIpfsGw)/ipns/${ASTRONAUTENS}#AstroID'>AstroID<br>
#~ <img width=300px src='$(myIpfsGw)${ASTROQR}'\></a><br>
#~ <h2>SECRET1=\"$SALT\"<br>SECRET2=\"$PEPPER\"</h2>
#~ <h2> CODE : $PASS </h2>
#~ <hr>
#~ <a target='TW' href='$(myIpfsGw)/ipns/${ASTRONAUTENS}#ZenCard' title='${G1PUB}'>ZenCard</a><br>
#~ <img src='$(myIpfsGw)${IASTRO}'\><br><hr>
#~ ${G1PUB}" > ~/.zen/tmp/${MOATS}/AstroID.html
#~ echo "
#~ <h3> /-> ASTROPORT : <a href='$(myIpfsGw)/ipns/${IPFSNODEID}'>/ipns/${IPFSNODEID}</a></h3>
#~ <h3> /--> SECTOR : <a href='${EARTHCID}/map_render.html?southWestLat=${LAT::-1}&southWestLon=${LON::-1}&deg=0.1'>${SECTOR}</a></h3>
#~ " >> ~/.zen/tmp/${MOATS}/AstroID.html
#~ asciiart="${MY_PATH}/../images/logoastro.art"
#~ while IFS= read -r line
#~ do
#~ echo "$line" | sed "s~ ~\&nbsp;~g" >> ~/.zen/tmp/${MOATS}/AstroID.html
#~ echo "<br>" >> ~/.zen/tmp/${MOATS}/AstroID.html
#~ done <"$asciiart"
#~ echo "<br>${MOATS}<br>- print a copy -</center></body></html>" >> ~/.zen/tmp/${MOATS}/AstroID.html
#~ $MY_PATH/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/${MOATS}/AstroID.html "TW5 & AstroID"
#~ mpack -a -s "✅ UPlanet : AstroID ($PASS)" -d ~/.zen/tmp/${MOATS}/intro.txt \
#~ $HOME/.zen/game/players/${PLAYER}/AstroID.png ${PLAYER}
## CLEANING CACHE
rm -Rf ~/.zen/tmp/${MOATS}
#####################################################################"
## CHECK .current
[[ ! -d $(readlink ~/.zen/game/players/.current) ]] \
&& rm ~/.zen/game/players/.current 2>/dev/null \
&& ln -s ~/.zen/game/players/${PLAYER} ~/.zen/game/players/.current
echo $PSEUDO > ~/.zen/tmp/PSEUDO ## Return data to command.sh # KEEP IT
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
################################################ LAST LINE REPORT VALUES TO CALLING SCRIPT | tail -n 1
echo "export ASTROTW=/ipns/$ASTRONAUTENS ASTROG1=$G1PUB ASTROMAIL=$PLAYER ASTROFEED=$FEEDNS PASS=$PASS"
exit 0

View File

@ -22,13 +22,19 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "$PLAYER IPNS INTROUVABLE" && exit 1
G1PUB="$3"
[[ -s $HOME/.zen/tmp/coucou/${G1PUB}.COINS ]] \
&& COINS=$(cat $HOME/.zen/tmp/coucou/${G1PUB}.COINS) \
&& [[ ${COINS} == "null" || ${COINS} == "" ]] \
&& echo ">>> ${COINS} : G1 NEEDED TO EXECUTE A WISH"
## EXPORT [tag[voeu]]
echo "## EXTRACTION DE NOUVEAUX VOEUX pour $PLAYER TW"
echo "$INDEX [tag[voeu]] ?"
rm -f ~/.zen/tmp/voeu.json
rm -f ~/.zen/tmp/voeu.json 2>/dev/null
tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' 'voeu.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[voeu]]'
[[ ! -s ~/.zen/tmp/voeu.json ]] && echo "AUCUN VOEU - EXIT -" && exit 0
[[ ! -s ~/.zen/tmp/voeu.json ]] && echo "AUCUN VOEU A ACTIVER" && exit 0
## Tous les tiddlers comportant le tag "voeu" lancent la création d'un G1VOEU ayant le titre du Voeu comme génrateur de clef TW (pepper).
cat ~/.zen/tmp/voeu.json | jq -r '.[].title' > ~/.zen/tmp/$PLAYER.voeux.create.list
@ -39,7 +45,7 @@ do
VOEU=$(echo "$VOEU" | sed -r 's/\<./\U&/g' | sed 's/ //g') # CapitalGluedWords
echo "CREATION G1Voeu G1$VOEU"
~/.zen/Astroport.ONE/ASTROBOT/G1Voeu.sh "$VOEU" "$PLAYER" "$INDEX"
~/.zen/Astroport.ONE/RUNTIME/G1Voeu.sh "$VOEU" "$PLAYER" "$INDEX"
done < ~/.zen/tmp/$PLAYER.voeux.create.list

334
RUNTIME/VOEUX.refresh.sh Executable file
View File

@ -0,0 +1,334 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# 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
. "$MY_PATH/../tools/my.sh"
################################################################################
# Inspect game wishes, refresh latest IPNS version
# SubProcess Backup and chain
# ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/*
# ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/*
# _PLAYER.json
# change SWARM memory
### # ~/.zen/tmp/${IPFSNODEID}/WISH/${WISHNAME}/${PLAYER}/*
PLAYER="$1" ## IPNS KEY NAME - G1PUB - PLAYER ...
[[ ! ${PLAYER} ]] && echo "Please provide PLAYER publish key" && exit 1
MOATS="$2"
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
COINS=$(cat $HOME/.zen/tmp/coucou/${G1PUB}.COINS)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
## REFRESH ASTRONAUTE TW
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "WARNING No ${PLAYER} in keystore --" && ASTRONAUTENS=$ASTRONS
[[ ! $ASTRONAUTENS ]] && echo "Missing ${PLAYER} IPNS KEY - CONTINUE --" && exit 1
INDEX="$3"
[[ ! $INDEX ]] && INDEX="$HOME/.zen/game/players/${PLAYER}/ipfs/moa/index.html"
[[ ! -s $INDEX ]] && echo "TW ${PLAYER} manquant" && exit 1
mkdir -p ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu
###############################
####### NEED G1 / ZEN TO RUN
[[ ${COINS} == "null" || ${COINS} == "" ]] \
&& echo ">>> ${COINS} : DESACTIVATED - NEED G1 TO REFRESH WISH - EXIT - " \
&& exit 0
echo "%% ${COINS} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
[[ $(echo "$COINS < 2" | bc -l) -eq 1 ]] && echo ">>> ${COINS} ONLY : 1 G1 + 10 ZEN NEEDED TO CONTINUE" && exit 0
###############################
## EXTRACT G1Voeu from PLAYER TW
echo "Exporting ${PLAYER} TW [days:created[-360]tag[G1Voeu]]"
rm -f ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json
tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu --render '.' "${PLAYER}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-360]tag[G1Voeu]]'
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] \
&& echo "AUCUN G1VOEU - EXIT -" && exit 0
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r 'map(select(.wish != null)) | .[].wish' > ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
wishnumbers=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt | wc -l)
echo "${wishnumbers} VOEUX : ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt "
## ${PLAYER}.g1wishes.txt contains all TW G1PUB : IPNS key name
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
## GET VoeuTitle LIST
while read WISH
do
[[ ${WISH} == "" || ${WISH} == "null" ]] && echo "BLURP. EMPTY WISH" && continue
echo "==============================="
## Get ${WISHNAME}
WISHNAME=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .title')
[[ ! ${WISHNAME} ]] && echo "WISH sans NOM - CONTINUE -" && continue
echo "G1Voeu ${WISH} (${WISHNAME})"
IPNS_VOEUNS=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .wishns')
VOEUKEY=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .wish')
ICHECK=$(ipfs key list -l | grep -w "$VOEUKEY" | cut -d ' ' -f 1 )
if [[ ! $ICHECK ]]; then
echo ">>> STATION MISSING $VOEUKEY - RESET ASTRONAUT WISHES - DERIVATED KEYS RECREATE -"
sed -i "s~G1Voeu~voeu~g" $INDEX
break
else
VCOINS=$($MY_PATH/../tools/COINScheck.sh $VOEUKEY | tail -n 1)
[[ $VCOINS == "" || $VCOINS == "null" ]] \
&& echo "G1WALLET NOT EXISTING YET : $VCOINS" \
|| echo "WISH G1WALLET = $VCOINS G1"
fi
## RUNNING WISH REFRESH : PLAYER CACHE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/${WISH}
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json \
| jq .[] | jq -r 'select(.wish=="'${WISH}'")' \
> ~/.zen/tmp/${MOATS}/${WISH}.json
##########################################################################
##########################################################################
## RUN SPECIFIC G1Voeu ASTROBOT PROGRAM (like G1CopierYoutube.sh)
if [[ -s $MY_PATH/../ASTROBOT/G1${WISHNAME}.sh ]]; then
echo "........................ Astrobot G1${WISHNAME}.sh PROGRAM FOUND !"
echo "________________________________ Running it *****"
${MY_PATH}/../ASTROBOT/G1${WISHNAME}.sh "$INDEX" "${PLAYER}" "$MOATS" "~/.zen/tmp/${MOATS}/${WISH}.json"
echo "________________________________ Finished ******"
else
echo "......................... NO G1${WISHNAME} PROGRAM... "
fi
##########################################################################
##########################################################################
###########################################################################################
##################################
## MAKE MY OWN EXTRACTION : [tag[G1'${WISHNAME}']!tag[G1Voeu]!sort[modified]limit[30]]
################################## MOA MAINTENANT
echo "> EXPORT [tag[G1${WISHNAME}]!tag[G1Voeu]] § $myIPFSGW${IPNS_VOEUNS}/_${PLAYER}.tiddlers.rss.json"
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME} \
--render '.' _${PLAYER}'.tiddlers.rss.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]!sort[modified]limit[30]]'
## RUN TW Ŋ1 search & copy treatment
echo "*********************************"
##################################
## Search for [tag[G1${WISHNAME}]] in all Friends TW.
## Copy tiddlers ...
##################################
echo "NOW SEARCH Ŋ1 FRIENDS TW's FOR tag=G1${WISHNAME}"
echo "ls ~/.zen/game/players/${PLAYER}/FRIENDS/*/index.html"
echo "*********************************"
## Search in Local World (NB! G1Voeu TW copied by Connect_PLAYER_To_Gchange.sh)
FINDEX=($( ls $HOME/.zen/game/players/${PLAYER}/FRIENDS/*/index.html))
## PREPARE Ŋ1 WORLD MAP
echo "var examples = {};
examples['locations'] = function() {
var locations = {
" > ~/.zen/tmp/world.js
floop=1
for FRIENDTW in ${FINDEX[@]};
do
[[ ! -s ${FRIENDTW} ]] && echo "$floop / ${#FINDEX[@]} ${FRIENDTW} VIDE (AMI SANS TW)" && echo && ((floop++)) && continue
## GET FRIEND EMAIL = APLAYER (VERIFY TW IS OK)
tiddlywiki --load ${FRIENDTW} \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${MOATS}/MadeInZion.json ]] && echo "${PLAYER} MadeInZion : BAD TW (☓‿‿☓) " && continue
APLAYER=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
## EXPORT LAST 30 DAYS G1WishName in _${APLAYER}.tiddlers.rss.json
rm -f ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json
echo "$floop / ${#FINDEX[@]} TRY EXPORT [tag[G1${WISHNAME}]] FROM $APLAYER TW"
tiddlywiki --load ${FRIENDTW} \
--output ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME} \
--render '.' _${APLAYER}'.tiddlers.rss.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]!sort[modified]limit[30]]'
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json ]] \
&& echo "NO ${WISHNAME} - CONTINUE -" \
&& echo && ((floop++)) && continue
[[ $(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json) == "[]" ]] \
&& echo "EMPTY ${WISHNAME} - CONTINUE -" && echo && ((floop++)) \
&& rm ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json \
&& continue
#####################################################
echo "## TIDDLERS FOUND ;) MIAM >>> (◕‿‿◕) <<<"
##############################
## WRITE FRIEND SAME WISH TIDDLERS IN PLAYER TW ########
##############################
## SIGN Tiddlers
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.rss.json \
| sed "s~${PLAYER}~~g" \
| sed "s~${APLAYER}~${APLAYER} ${PLAYER}~g" \
> ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.signed.json
## ADD TO TW
tiddlywiki --load ${INDEX} \
--import ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.signed.json "application/json" \
--output ~/.zen/tmp/${MOATS} --render "$:/core/save/all" "newindex.html" "text/plain"
## CHECK IT IS OK
[[ -s ~/.zen/tmp/${MOATS}/newindex.html ]] \
&& cp ~/.zen/tmp/${MOATS}/newindex.html ${INDEX} \
&& rm ~/.zen/tmp/${MOATS}/newindex.html
##############################
echo ">>> G1FRIEND § $myIPFS${IPNS_VOEUNS}/_${APLAYER}.tiddlers.rss.json ${WISHNAME}"
# Extract Origin G1Voeu Tiddler
tiddlywiki --load ${FRIENDTW} --output ~/.zen/tmp --render '.' "${APLAYER}.${WISHNAME}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${WISHNAME}"
FWISHNS=$(cat ~/.zen/tmp/${APLAYER}.${WISHNAME}.json | jq -r '.[].wishns')
# FWISHPROG=$(cat ~/.zen/tmp/${APLAYER}.${WISHNAME}.json | jq -r '.[].text')
# TIDDLER COULD CONTAIN #!/bin/bash PROGRAM !!!
[[ $FWISHNS == "null" ]] && echo "NO FWISHNS in ~/.zen/tmp/${APLAYER}.${WISHNAME}.json" && echo && ((floop++)) && continue
echo ">>> ${myIPFS}${FWISHNS}"
###########################################################################################
## ADD WISH ON THE WORLD MAP (TODO: EXTRACT REAL GPS)
echo "${floop}: {
alpha: Math.random() * 2 * Math.PI,
delta: Math.random() * 2 * Math.PI,
name: '"${WISNAME} ${APLAYER}"',
link: '"${myIPFS}${FWISHNS}"'
}
," >> ~/.zen/tmp/world.js
((floop++))
done
# REMOVE la dernière virgule
sed -i '$ d' ~/.zen/tmp/world.js
##################################
## FINISH LOCATIONS
echo "
};
\$('#sphere').earth3d({
locationsElement: \$('#locations'),
dragElement: \$('#locations'),
locations: locations
});
};
" >> ~/.zen/tmp/world.js
IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1)
echo "JSON WISH WORLD READY /ipfs/${IAMAP}/world.js"
##################################
## PREPARE PLAYER G1 QRCODE : QRG1avatar.png
[[ -s ~/.zen/game/players/${PLAYER}/voeux/${WISHNAME}/${VOEUKEY}/voeu.png ]] \
&& QRLINK=$(ipfs add -q ~/.zen/game/players/${PLAYER}/voeux/${WISHNAME}/${VOEUKEY}/voeu.png | tail -n 1)
[[ $QRLINK == "" ]] && QRLINK=$(ipfs add -q ~/.zen/game/players/${PLAYER}/QRG1avatar.png | tail -n 1)
### APPLY FOR ${WISHNAME} APP MODEL : make index.html
################################## ${WISHNAME}/index.html
if [[ -s ${MY_PATH}/../WWW/${WISHNAME}/index.html ]]; then
cat ${MY_PATH}/../WWW/${WISHNAME}/index.html \
| sed -e "s~_LIBRA_~$(myIpfsGw)~g" \
-e "s~_G1VOEU_~${WISHNAME}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
-e "s~_____~${COINS}~g" \
-e "s~_G1PUB_~${G1PUB}~g" \
-e "s~_VOEUNS_~${IPNS_VOEUNS}~g" \
-e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
-e "s~http://astroport.localhost:1234~${myASTROPORT}~g" \
-e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \
-e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \
-e "s~QmWUpjGFuF7NhpXgkrCmx8Tbu4xjcFpKhE7Bsvt6HeKYxu/g1ticket_qrcode.png~${QRLINK}~g" \
-e "s~http://127.0.0.1:8080~~g" \
> ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/index.html
fi
### PREPARE WISHNAME index.html - CREATE YOUR OWN DAPP -
##################################
###########################################################################################
## N1Program are run through PLAYER G1PalPay RUNTIME
## CAN BE EXTENDED WITH DATA POST TREATMENT PROGRAMS
## RUN Z1Program ASTROBOT PROGRAM
#~ if [[ -s $MY_PATH/../ASTROBOT/Z1${WISHNAME}.sh ]]; then
#~ echo "........................ Astrobot Z1${WISHNAME}.sh post-treatment found !"
#~ echo "________________________________ Running it *****"
#~ ${MY_PATH}/../ASTROBOT/Z1${WISHNAME}.sh "~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}" "${PLAYER}" "$MOATS"
#~ echo "________________________________ Finished ******"
#~ fi
###########################################################################################
### ADD ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/*
### AND PUBLISH WISH TO IPFS
echo "++WISH PUBLISHING++ ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/*"
ls ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/
## CREATE .all.json for WISHNAME
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}
WISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/* | tail -n 1) # ADDING JSONS TO IPFS
ipfs --timeout 180s name publish -k $VOEUKEY /ipfs/$WISHFLUX # PUBLISH $VOEUKEY
echo "## ASK ${myIPFSGW}${IPNS_VOEUNS} TO REFRESH" ## TODO LOOP BOOSTRAP & ONLINE FRIENDS
curl -m 120 -so ~/.zen/tmp/${WISHNAME}.astroindex.html "${myIPFSGW}${IPNS_VOEUNS}" &
## MOVE INTO PLAYER AREA
echo ">>> ${PLAYER} G1${WISHNAME} Ŋ1 FLUX $(myIpfsGw)${IPNS_VOEUNS}"
echo "WALLET ${VOEUKEY} FOUNDED by ${G1PUB}"
cp -f ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${WISHNAME}/* ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/ 2>/dev/null
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "SEARCH WORLD SAME WISH CACHE"
[[ "$WISHNAME" != "" ]] && cat ~/.zen/game/world/$WISHNAME/*/.link 2>/dev/null
## ANYTIME A PLAYER CHOOSE AN ASTROPORT - LOCAL WISH CACHE IS EXTENDED -
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
done < ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
################################################
### SEND GRATITUDE TO SECTOR
## GET "GPS" TIDDLER
if [[ ${wishnumbers} -gt 0 ]]; then
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
TWMAPNS=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].umap)
[[ $TWMAPNS == "null" || $TWMAPNS == "" ]] && TWMAPNS="/ipns/k51qzi5uqu5djg1gqzujq5p60w25mi235gdg0lgkk5qztkfrpi5c22oolrriyu"
LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat)
[[ ${LAT} == "null" || ${LAT} == "" ]] && LAT="0.00"
LAT=$(makecoord $LAT)
LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon)
[[ ${LON} == "null" || ${LON} == "" ]] && LON="0.00"
LON=$(makecoord $LON)
echo "LAT=${LAT}; LON=${LON}; UMAPNS=${TWMAPNS}"
rm ~/.zen/tmp/${MOATS}/GPS.json
## GET UMAP ENV
$(${MY_PATH}/../tools/getUMAP_ENV.sh ${LAT} ${LON} | tail -n 1)
echo "export UMAPG1PUB=$UMAPG1PUB UMAPIPNS=$UMAPIPNS SECTOR=$SECTOR SECTORG1PUB=$SECTORG1PUB SECTORIPNS=$SECTORIPNS REGION=$REGION REGIONG1PUB=$REGIONG1PUB REGIONIPNS=$REGIONIPNS LAT=$LAT LON=$LON SLAT=$SLAT SLON=$SLON RLAT=$RLAT RLON=$RLON"
##############################################################
GRATITUDE=$($MY_PATH/../tools/getcoins_from_gratitude_box.sh)
G1AMOUNT=$(echo "$GRATITUDE / 10" | bc -l | xargs printf "%.2f" | sed "s~,~.~g" )
echo "***** PLAYER $PLAYER *************************************"
echo "GRATITUDE ${GRATITUDE} ZEN (${G1AMOUNT} G1)
to UMAP_${LAT}_${LON} WALLET ${UMAPG1PUB}"
echo "************************************************************"
YOUSER=$($MY_PATH/../tools/clyuseryomail.sh "${PLAYER}")
MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${UMAPG1PUB}" "UPLANET:UWISH:$YOUSER:/ipfs/${MYWISHFLUX}"
fi
################################################
################################################ GRATITUDE SENT TO SECTOR
exit 0

76
RUNTIME/ZEN.SECTOR.memory.sh Executable file
View File

@ -0,0 +1,76 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
#~ ZEN.SECTOR.memory.sh
#~ Search for last "UPLANET:$1:..." in UPLANETG1PUB wallet history
#~ INTERCOM="UPLANET:${SECTOR}:${TODATE}:/ipfs/${IPFSPOP}" TX COMMENT are made during SECTOR.refresh.sh
#~ ~/.zen/tmp/${MOATS}/${SECTOR} <=> "/ipfs/$ipfs_pop"
################################################################################
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
################################################################################
SECTOR="$1"
[[ $SECTOR == "" ]] && echo "MISSING SECTOR ADRESS" && exit 1
MOATS="$2"
G1PUB="$3"
## CHECK FOR BAD PARAM
[[ ! -d ~/.zen/tmp/${MOATS-empty}/${SECTOR-empty}/ ]] \
&& echo "BAD ~/.zen/tmp/${MOATS}/${SECTOR}" \
&& exit 1
## STARTING
start=`date +%s`
## CORRESPONDING REGION UKEY
LAT=$(echo ${SECTOR} | cut -d '_' -f 2)
LON=$(echo ${SECTOR} | cut -d '_' -f 3)
RLAT=$(echo ${LAT} | cut -d '.' -f 1)
RLON=$(echo ${LON} | cut -d '.' -f 1)
REGION="_${RLAT}_${RLON}"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${REGION}.priv "${UPLANETNAME}${REGION}" "${UPLANETNAME}${REGION}"
REGIONG1PUB=$(cat ~/.zen/tmp/${MOATS}/${REGION}.priv | grep "pub:" | cut -d ' ' -f 2)
[[ ! ${REGIONG1PUB} ]] && echo "ERROR generating REGION WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${REGIONG1PUB} | tail -n 1)
echo "REGION : ${REGION} (${COINS} G1) WALLET : ${REGIONG1PUB}"
## RETRIEVE FROM REGION UKEY
${MY_PATH}/../tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py history -n 40 -p ${REGIONG1PUB} -j \
> ~/.zen/tmp/${MOATS}/${REGION}.g1history.json
## SCAN FOR UPLANET:${SECTOR} in TX
if [[ -s ~/.zen/tmp/${MOATS}/${REGION}.g1history.json ]]; then
intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .comment' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1)
ipfs_pop=$(echo "$intercom" | rev | cut -d ':' -f 1 | rev)
todate=$(echo "$intercom" | rev | cut -d ':' -f 2 | rev)
echo "SYNC ${SECTOR} <= $todate (=${YESTERDATE})=> $ipfs_pop"
[[ ${todate} != ${YESTERDATE} ]] && echo "NO GOOD MEMORY - EXIT" && exit 1
## TODO: SECURITY PATCH : check payment emitter is from BOOSTRAP
if [[ $ipfs_pop ]]; then
g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${SECTOR}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${REGION}.g1history.json | tail -n 1)
echo "INFO :: $g1pub Memory updater"
ipfs --timeout 180s get --progress="false" -o ~/.zen/tmp/${MOATS}/${SECTOR} $ipfs_pop \
&& ipfs pin rm $ipfs_pop \
|| echo "$ipfs_pop ERROR ... "
else
echo "WARNING cannot revover any memory !!"
fi
else
echo "FATAL ERROR cannot access to REGIONG1PUB history"
exit 1
fi
end=`date +%s`
echo "(${SECTOR}.memory) ${todate} get time : "`expr $end - $start` seconds.
exit 0

89
RUNTIME/ZEN.UMAP.memory.sh Executable file
View File

@ -0,0 +1,89 @@
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
#~ ZEN.UMAP.memory.sh
#~ Search for last "UPLANET:$1:..." in UPLANETG1PUB wallet history
#~ INTERCOM="UPLANET:${UMAP}:${TODATE}:/ipfs/${IPFSPOP}" TX COMMENT are made during UPLANET.refresh.sh
#~ ~/.zen/tmp/${MOATS}/${UMAP} <=> "/ipfs/$ipfs_pop"
################################################################################
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/../tools/my.sh"
################################################################################
UMAP="$1"
[[ $UMAP == "" ]] && echo "MISSING UMAP ADRESS" && exit 1
MOATS="$2"
G1PUB="$3"
## CHECK FOR BAD PARAM
[[ ! -d ~/.zen/tmp/${MOATS-empty}/${UMAP-empty}/ ]] \
&& echo "BAD ~/.zen/tmp/${MOATS}/${UMAP}" \
&& exit 1
## STARTING
start=`date +%s`
## CORRESPONDING SECTOR UKEY
LAT=$(echo ${UMAP} | cut -d '_' -f 2)
LON=$(echo ${UMAP} | cut -d '_' -f 3)
## SECTOR COORD
SLAT="${LAT::-1}"
SLON="${LON::-1}"
SECTOR="_${SLAT}_${SLON}"
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/${SECTOR}.priv "${UPLANETNAME}${SECTOR}" "${UPLANETNAME}${SECTOR}"
SECTORG1PUB=$(cat ~/.zen/tmp/${MOATS}/${SECTOR}.priv | grep "pub:" | cut -d ' ' -f 2)
[[ ! ${SECTORG1PUB} ]] && echo "ERROR generating SECTOR WALLET" && exit 1
COINS=$($MY_PATH/../tools/COINScheck.sh ${SECTORG1PUB} | tail -n 1)
echo "SECTOR : ${SECTOR} (${COINS} G1) WALLET : ${SECTORG1PUB}"
## RETRIEVE FROM SECTOR UKEY
${MY_PATH}/../tools/timeout.sh -t 20 ${MY_PATH}/../tools/jaklis/jaklis.py history -n 40 -p ${SECTORG1PUB} -j \
> ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json
## SCAN FOR UPLANET:${UMAP} in TX
if [[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json ]]; then
intercom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .comment' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 1)
ipfs_pop=$(echo "$intercom" | rev | cut -d ':' -f 1 | rev)
todate=$(echo "$intercom" | rev | cut -d ':' -f 2 | rev)
echo "SYNC ${UMAP} <= $todate (=${YESTERDATE})=> $ipfs_pop"
[[ ${todate} != ${YESTERDATE} ]] && echo "NO GOOD MEMORY - EXIT" && exit 1
if [[ $ipfs_pop ]]; then
echo "FOUND $todate MEMORY SLOT"
g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 1)
echo "INFO :: $g1pub Memory updater"
## ADD SECURITY : check payment emitter is a "BOOSTRAP" (TODO)
nodeid=$(${MY_PATH}/../tools/g1_to_ipfs.py $g1pub)
ipfs --timeout 360s get --progress="false" -o ~/.zen/tmp/${MOATS}/${UMAP} $ipfs_pop \
&& ipfs pin rm $ipfs_pop \
|| echo "$ipfs_pop ERROR ... "
else
echo "WARNING cannot revover any memory !!"
fi
## REMOVE PREVIOUS PIN (in case last one was not mine)
antecom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .comment' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 2 | head -n 1)
ipfs_b=$(echo "$antecom" | rev | cut -d ':' -f 1 | rev)
[[ ! -z ${ipfs_b} ]] && ipfs pin rm ${ipfs_b}
else
echo "FATAL ERROR cannot access to SECTORG1PUB history"
exit 1
fi
end=`date +%s`
echo "(${UMAP}.memory) ${todate} get time : "`expr $end - $start` seconds.
exit 0

60
TODO.list Normal file
View File

@ -0,0 +1,60 @@
CESIUM PLUS POD API
https://github.com/duniter/cesium-plus-pod/blob/master/src/site/markdown/REST_API.md
FIND IN SYNC DUNITER NODES
https://g1.data.e-is.pro/g1/block/current
https://g1.duniter.fr/network/peers
https://g1.duniter.fr/network/ws2p/heads
EXTRACT MEMBER
https://g1.data.e-is.pro/wot/members
FOLLOW THE G1 (FIND LOOPS)
https://g1.data.e-is.pro/g1/movement/_search?pretty&q=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech
# TODO LIST
MADE BY
```
./search TODO
```
./ajouter_media.sh:## KEEPS KODI COMPATIBILITY (BROKEN astroport.py !! ) : TODO DEBUG
./ajouter_media.sh: # Funny Crypto Level # TODO MAKE IT MORE SECURE # THIS KEY OWNS THE DOMAIN NOW
./ajouter_media.sh: ## NB TEXT IS MADE WITH TIDDLERS FIELDS VALUES (LEARN TODO)
./ajouter_media.sh: #~ ## TODO
./ajouter_media.sh: FILE_NAME="$(echo "${TITLE}" | detox --inline).pdf" ## TODO make it better
./ajouter_media.sh: ## TODO : CHECK CACHE LAST MODIFIED
./setup_nginx.sh: echo "TODO: make it easier ;)"
./tools/Connect_PLAYER_To_Gchange.sh:# TODO: could make better ES stars requests
./tools/Connect_PLAYER_To_Gchange.sh:#### TODO RECUP ANNONCES Gchange ADD TO TW
./tools/RSS2UPlanetTW.sh: ## TODO EXTEND CONTROL TO text AND ipfs _canonical_url
./tools/RSS2UPlanetTW.sh: ## NB: COULD NEED SORTING (TODO)
./tools/streaming/install.sh:# TODO: why is this needed?
./tools/streaming/process-stream.sh:#TODO# Fix this one
./tools/make_video_gifanim_ipfs.sh:## Create gifanime ## TODO Search for similarities BEFORE ADD
./tools/create_ipfsnodeid_from_tmp_secret.dunikey.py:# TODO controls
./tools/cron_VRFY.sh:## TODO check for Station geoposition in ~/.zen/GPS and calibrate 20H12
./tools/cron_VRFY.sh:cat ~/.zen/GPS 2>/dev/null && echo " TODO calibrate 20H12 with GPS"
./tools/PAY4SURE.sh: echo "SENT" > ${PENDINGFILE} ## TODO : MONITOR POTENTIAL CHAIN REJECTION (FORK/MERGE WINDOW)
./tools/duniter_getnode.sh:# TODO: REMOVE 777 PATCH, ACTIVATE ramdisk
./tools/search_for_this_email_in_players.sh: ## TODO ? SEARCH WITH DNSLINK
./tools/new_file_in_astroport.sh: ## Create gifanime ## TODO Search for similarities BEFORE ADD
./tools/new_file_in_astroport.sh:# EXTRACT INDEX REFERENCE : TMDB or YOUTUBE (TODO : EXTEND)
./tools/new_file_in_astroport.sh: ## TODO USE IT TO MAKE A MEDIAKEY IMAGE KEY "SONDE" FOR FILTERING ?
./tools/new_file_in_astroport.sh: TidType="text/vnd.tiddlywiki" ## MAYBE REAL ONCE TW CAN SHOW ATTACHED IPFS VIDEO (TODO: TESTINGS)
./tools/new_file_in_astroport.sh:## TODO : Do we keep that ?
./ASTROBOT/N1Kodi.sh: ## TODO CREATE A TEMP IPNS KEY ?!
./ASTROBOT/N1Kodi.sh:## TODO CREATE FROM FRIEND LOCAL KODI RSS
./ASTROBOT/_sandbox/_GCHANGE.process.sh:# Create tiddler informing ... TODO Add keyword ... Use tag="annonce" for tiddlers propagation
./ASTROBOT/_sandbox/_GCHANGE.process.sh:echo "TODO DEBUG. CONTINUE?"
./ASTROBOT/_sandbox/_GCHANGE.process.sh: # Message tiddlywiki TODO
./ASTROBOT/G1CopierYoutube.sh: ## TODO CORRECT - CACHE CHANGED -
./ASTROBOT/G1CopierYoutube.sh: ## TODO ACCEPT MORE WITH COINS
./ASTROBOT/G1CopierYoutube.sh: # TODO : DELAY COPY OPERATION... Astro can download quicker at 03:00 AM
./ASTROBOT/G1CopierYoutube.sh: ## COPY FROM YOUTUBE (TODO DOUBLE COPY & MKV to MP4 OPTIMISATION)
./ASTROBOT/G1CopierYoutube.sh: ## Create gifanime ## TODO Search for similarities BEFORE ADD
./ASTROBOT/G1CopierYoutube.sh: ## TODO : ADD EMAIL TAG ( TIMESTAMP & ADD SIGNATURE over existing ones)

42
Ustats.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
####################################
# stats.sh
# analyse LOCAL & SWARM data structure
####################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/tools/my.sh"
echo "==========================================================="
####################################
# search for active TWS
####################################
echo " ## SEARCH TW in UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/TW/*"
METW=($(ls -d ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/TW/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMTW=($(ls -d ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/TW/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${METW[@]}" "${SWARMTW[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "${#unique_combined[@]} TW(S) : ${unique_combined[@]}"
echo "==========================================================="
####################################
# search for active UMAPS
####################################
echo " ## SEARCH UMAPS in UPLANET/__/_*_*/_*.?_*.?/*"
MEMAPS=($(ls -td ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
SWARMMAPS=($(ls -Gd ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/* 2>/dev/null | rev | cut -d '/' -f 1 | rev | sort | uniq))
combined=("${MEMAPS[@]}" "${SWARMMAPS[@]}")
unique_combined=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))
echo "${#unique_combined[@]} UMAP(S) : ${unique_combined[@]}"
echo "==========================================================="
for umap in ${unique_combined[@]}; do
lat=$(echo $umap | cut -d '_' -f 2)
lon=$(echo $umap | cut -d '_' -f 3)
echo $lat $lon
${MY_PATH}/tools/getUMAP_ENV.sh $lat $lon | tail -n 1
echo
done

View File

@ -0,0 +1 @@
HELLO THERE

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,280 @@
<!DOCTYPE html>
<html>
<head>
<title>_G1VOEU_ : _PLAYER_ : http://astroport.localhost:1234</title>
<meta charset="UTF-8">
<link rel="icon" type="image/x-icon" href="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/favicon.ico">
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/demo.css">
<link rel="stylesheet" href="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/jquery-ui.min.css">
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/requestanimationframe.polyfill.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/instascan.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/html5-qrcode.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/jquery-ui.0.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/sphere-hacked.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/jquery.earth-3d.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/demo.js"></script>
<script src="http://127.0.0.1:8080/ipfs/Qmae5v9zydax9u6C9ceDijURu5PYdd5avmv4NkenCw7RFv/astro.js"></script>
<script type="text/javascript">
examples['simple_mars'] = function() {
$('#sphere').earth3d({
texture: 'http://127.0.0.1:8080/ipfs/QmNNSAJyzVSF2m16dReYgmqmiRkKa5HMKvFUgwhbRzTYto/mars1024x1024.jpg', // texture used by G1Wish planet
dragElement: $('#locations') // where do we catch the mouse drag
});
};
</script>
<style>
body {
padding: 0;
margin: 0;
font-family: sans-serif;
}
.slidecontainer {
width: 80%;
margin: 0 auto;
text-align: center;
}
.gif-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.gif-container img {
margin: 10px;
max-width: 200px;
}
.slider {
width: 100%;
text-align: center;
}
.slider #prev {
float: left;
font-size: 40px;
}
.slider #next {
float: right;
font-size: 40px;
}
#glow-shadows.earth {
background: url(http://127.0.0.1:8080/ipfs/QmTVspfoaNL1BK2CR1vVNrEnwo4PfUjwdQxEt57mGJjsLX/earth-glow-shadows.png);
}
#glow-shadows.mars {
background: url(http://127.0.0.1:8080/ipfs/QmTVspfoaNL1BK2CR1vVNrEnwo4PfUjwdQxEt57mGJjsLX/mars-glow-shadows.png);
}
.flight {
position: absolute;
width: 24px;
height: 25px;
left: 10px;
top: 10px;
background: url(http://127.0.0.1:8080/ipfs/QmTVspfoaNL1BK2CR1vVNrEnwo4PfUjwdQxEt57mGJjsLX/plain.png);
background-size: 100% 100%;
margin-left: -12px;
margin-top: -12.5px;
cursor: pointer;
}
#yellow {
background: black;
position: absolute;
top: 2%;
right: 4%;
width: 55%;
}
#green {
background: black;
position: absolute;
top: 12%;
right: 5%;
width: 45%;
}
#ainfo {
background: grey;
position: absolute;
top: 1%;
right: 1%;
}
</style>
</head>
<body>
<button id="ainfo" onclick="javascript:var x = document.getElementById('yellow'); if (x.style.visibility === 'hidden') {x.style.visibility = 'visible';} else {x.style.visibility = 'hidden';}">0/1</button>
<iframe name="aframe" id="aframe" src="http://127.0.0.1:8080/ipns/_ASTRONAUTENS_" width="100%" height="640px"></iframe>
<div id="demo">
<div id="description">
<a href="javascript:FriendWithMe()"><img title="Connect with Me" width=20% src="http://127.0.0.1:8080/ipfs/QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/l0g0.png" alt="Link in Le Claude"></a>
<div id="countdown"></div>
<h2>G1_G1VOEU_ _PLAYER_</h2>
<div class="subtitle">A Friendly Planet of Friends</div>
<div class="slidecontainer">
<div class="gif-container">
<!-- gifs -->
</div>
<div class="slider">
<a href="#" id="prev">&lt;</a>
<a href="#" id="next">&gt;</a>
</div>
</div>
<script>
function FriendWithMe() {
let cookies = document.cookie;
console.log(cookies);
let salt = prompt("Secret 1");
let pepper = prompt("Secret 2");
let resultUt = 'http://astroport.localhost:1234/?salt=' + salt + '&pepper=' + pepper + '&friend=_G1PUB_&stars=3';
console.log(resultUt)
homeAstroportStation( resultUt,'aframe', 4000)
}
const gifContainer = document.querySelector('.gif-container');
const prevBtn = document.querySelector('#prev');
const nextBtn = document.querySelector('#next');
const pageSize = 2;
let pageNumber = 0;
let gifs = [];
let urls = [];
let titles = [];
let durees = [];
// Récupérer les données
fetch('http://127.0.0.1:8080_VOEUNS_/__PLAYER_.tiddlers.rss.json')
.then(res => res.json())
.then(data => {
// Extraire les gifanime
gifs = data.map(tiddler => tiddler.gifanime);
urls = data.map(tiddler => tiddler.ipfs);
titles = data.map(tiddler => tiddler.title);
durees = data.map(tiddler => tiddler.duree);
// Afficher les gifs
showGifs();
});
// Afficher les images
function showGifs() {
let start = pageNumber * pageSize;
let end = start + pageSize;
let pageGifs = gifs.slice(start, end);
let pageUrls = urls.slice(start, end);
let pageTitles = titles.slice(start, end);
let pageDurees = durees.slice(start, end);
let output = '';
// Générer le HTML
// <a target="aframe" href="http://127.0.0.1:8080${pageUrls[i]}">
// <a target="aframe" href="http://127.0.0.1:8080/ipns/_ASTRONAUTENS_#${pageTitles[i]}">
pageGifs.forEach((gif, i) => {
output += `
<a target="aframe" href="http://127.0.0.1:8080/ipns/_ASTRONAUTENS_#${pageTitles[i]}">
<img src="http://127.0.0.1:8080${gif}" title="${pageDurees[i]} - ${pageTitles[i]}" />
</a>
`;
});
// Ajouter le HTML
gifContainer.innerHTML = output;
}
// Écouter les évènements
prevBtn.addEventListener('click', () => {
pageNumber--;
showGifs();
});
nextBtn.addEventListener('click', () => {
pageNumber++;
showGifs();
});
</script>
<br><br>
<h3>_PLAYER_ </h3>
<p>
<a target="_PLAYER_" href="http://127.0.0.1:8080/ipns/_ASTRONAUTENS_">
<img src="http://127.0.0.1:8080/ipfs/QmWUpjGFuF7NhpXgkrCmx8Tbu4xjcFpKhE7Bsvt6HeKYxu/g1ticket_qrcode.png" width=300>
</a>
</p>
<h2>:⚡:~ <a href="https://cesium.app">Cesium </a> ~:📱: _____ </h2>
<p>
<div id="astropub"> 🏡 : <a target="gchange" href="https://www.gchange.fr/#/app/user/_G1PUB_/">_G1PUB_</a></div>
</p>
</div>
<div id="showoff">
<div id="yellow" >
<div id="container">
<br><br>
<br><br>
<canvas id="sphere" width="400" height="400"></canvas>
<div id="glow-shadows" class="earth"></div>
<canvas id="flights" width="400" height="400"></canvas>
<div id="locations"></div>
</div>
</div>
<p><a target="_PLAYER_" href="http://127.0.0.1:8080/ipns/_ASTRONAUTENS_">TW♥BOX of "_PLAYER_"</a></p>
<p>
<br>
<br> 👍 IPFS DATA STORAGE 👍 </p>
<p>Powered by <a href="https://github.com/papiche/Astroport.ONE">Astroport.ONE</a></p>
<p>/ <a href="https://opencollective.com/monnaie-libre/projects/stiits">STI</a> / <a href="https://opencollective.com/monnaie-libre/projects/coeurbox">La♥BOX</a> /
</div>
</div>
<div class="choose_example">
Choose Planet: <select id="example">
<!--
<option value="simple">Simple earth</option>
<option value="simple_tilted">Simple tilted earth</option>
-->
<option value="simple_mars">Simple mars</option>
<!--
<option value="flights">Earth with locations and flights</option>
-->
<option value="locations" selected >Ŋ1 Friends</option>
</select>
</div>
<div class="code">
<a href="#" onclick="$('#example_code').show(); $(this).hide().siblings('a').show(); return false;">Show code</a>
<a href="#" style="display: none;" onclick="$('#example_code').hide(); $(this).hide().siblings('a').show(); return false;">Hide code</a>
<textarea id="example_code" onclick="this.focus();this.select();"></textarea>
</div>
</body></html>

View File

@ -0,0 +1,129 @@
body {
background: black;
margin: 0;
padding: 0;
color: #DDD;
text-align: center;
padding-bottom: 20px;
}
h1 {
margin-top: 10px;
font-size: 40px;
margin-bottom: 10px;
}
.subtitle {
font-size: 20px;
margin-bottom: 20px;
color: #777;
}
a {
color: white;
}
#demo {
overflow: hidden;
}
#description {
text-align: left;
float: left;
width: 49%;
max-width: 500px;
padding-top: 50px;
padding-left: 20px;
}
#showoff {
float: left;
width: 49%;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#container {
position: relative;
display: inline-block;
width: 400px;
height: 400px;
}
#sphere, #flights, #glow-shadows, #locations, #drag {
position: absolute;
top: 0px;
left: 0px;
width: 400px;
height: 400px;
}
#glow-shadows {
top: 1px;
left: 1px;
}
.location {
position: absolute;
width: 10px;
height: 10px;
left: 10px;
top: 10px;
border: 2px solid white;
margin-left: -5px;
margin-top: -5px;
border-radius: 50%;
cursor: pointer;
}
.location:hover {
width: 15px;
height: 15px;
margin-left: -7.5px;
margin-top: -7.5px;
}
.flight:hover {
width: 36px;
height: 37.5px;
margin-left: -18px;
margin-top: -18.75px;
}
.choose_example {
width: 35%;
margin-left: 32.5%;
}
#example_code {
width: 100%;
height: 200px;
background-color: black;
color: white;
border: 0px;
resize: none;
display: none;
}
.code {
margin-top: 10px;
}
.social {
display: inline-block;
}
.social.twitter {
vertical-align: -3px;
}
.social.google {
vertical-align: -7px;
}

View File

@ -0,0 +1,39 @@
function selectExample(example) {
$('#sphere').earth3d('destroy');
$('#sphere').replaceWith($('<canvas id="sphere" width="400" height="400"></canvas>'));
$('.location').remove();
//~ $('.flight').remove();
//~ $('#flights')[0].getContext('2d').clearRect(0, 0, 400, 400);
if (example == 'simple_mars') {
$('#glow-shadows').removeClass('earth').addClass('mars');
} else {
$('#glow-shadows').removeClass('mars').addClass('earth');
}
var code = examples[example].toString();
code = code.substring(14);
code = code.substring(0, code.length - 2);
var lines = code.split("\n");
for (var i = 0; i < lines.length; i++) {
lines[i] = lines[i].substring(2);
}
code = lines.join("\n");
$('#example_code').val(code);
examples[example]();
}
$(document).ready(function() {
selectExample('locations');
$('#example').change(function() {
selectExample($(this).val());
});
});
function addPath() {
$('#sphere').earth3d('changePaths', {path2: {
origin: 'obj1',
destination: 'obj3'
}});
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,851 @@
/*
jquery.earth3d.js
jQuery ui plugin that allow you to draw a beautiful 3d spinning earth on canvas
Author: Sebastien Drouyer
Based on the amazing sphere.js plug of Sam Hasler
Licensed under the MIT license (MIT-LICENSE.txt)
http://sdrdis.github.com/jquery.earth-3d/
Depends:
ui.core.js
Options:
* texture: texture map used by the planet
* sphere: rotation and size of the planet
* defaultSpeed: default spinning speed of the planet
* backToDefaultTime: time (in ms) to return by to default speed when planet is dragged
* locations: locations to display on the planet:
* Each position must have a key, an alpha and delta position (or x and y if you want to display a static location).
Any additional key can be reached via callbacks functions
Example:
{
obj1: {
alpha: Math.PI / 4,
delta: 0,
name: 'location 1'
}
}
* paths: paths and flights to display over the planet:
Each path must have a key, an origin and a destination. The values are the location's key.
You can, if you want to, define flights on these paths.
Each flight has a key, a destination (the location's key) and a position.
The position is the progress a fleet has made on its path.
Any additional key can be reach via callbacks functions.
Example:
{
path: {
origin: 'obj1',
destination: 'obj2',
flights: {
flight: {
position: 0.25,
destination: 'obj2',
name: 'Flight 1'
},
flight2: {
position: 0.25,
destination: 'obj1',
name: 'Flight 2'
}
}
}
}
* flightsCanvas: Dom element which is a canvas and where the flights and paths are drawn
* dragElement: Dom element where we catch the mouse drag
* locationsElement: Dom elements where the locations are drawn
* flightsCanvasPosition: position of the flight canvas (can be use if you have some gap between your planet and your flights
* pixelRadiusMultiplier: (TEMPORARY) used by the getSphereRadiusInPixel (see the functions)
* onInitLocation: callback function which allows you to define what to do when the locations are initialized
* Parameters:
* location: location (coming from locations option)
* widget: earth3d widget object
* onShowLocation: callback function which allows you to define what to do when a location becomes visible (was behind the planet and is now in front of it)
* Parameters:
* location: location (coming from locations option)
* x: 2d left position
* y: 2d top position
* widget: earth3d widget object
* onRefreshLocation: callback function which allows you to define what to do when a location is refreshed (it moves)
* Parameters:
* location: location (coming from locations option)
* x: 2d left position
* y: 2d top position
* widget: earth3d widget object
* onHideLocation: callback function which allows you to define what to do when a location becomes invisible (was in front of the planet and is now behind it)
* Parameters:
* location: location (coming from locations option)
* x: 2d left position
* y: 2d top position
* widget: earth3d widget object
* onInitFlight: callback function which allows you to define what to do when the flights are initialized
* Parameters:
* flight: flight (coming from flights option)
* widget: earth3d widget object
* onShowFlight: callback function which allows you to define what to do when a flight becomes visible (was behind the planet and is now in front of it)
* Parameters:
* flight: flight (coming from flights option)
* widget: earth3d widget object
* onRefreshFlight: callback function which allows you to define what to do when a flight is refreshed (it moves)
* Parameters:
* flight: flight (coming from flights option)
* x: 2d left position
* y: 2d top position
* widget: earth3d widget object
* onHideFlight: callback function which allows you to define what to do when a flight becomes invisible (was in front of the planet and is now behind it)
* Parameters:
* flight: flight (coming from flights option)
* widget: earth3d widget object
Functions
* getSphereRadiusInPixel: function which allows you to get the sphere radius in pixel
/!| WARNING: this function needs to be refactored, since I didn't find out (my maths courses are far away) how to
get the exact value. I did a basic linear regression, but it is not exact, and you will have to change the pixelRadiusMultiplier
option to get the correct value
* destroy: use this function when you want to destroy the object. It will throw a cancel animation frame, so the
CPU won't be used anymore.
* changePaths: use this function when you want to update paths and flights (options on widget)
it will add the callback functions support
*/
var earth3d;
(function($) {
$.widget('ui.earth3d', {
options: {
texture: '/ipfs/QmRpS3HcsawVGL6D3ZjJwP5HBFivydb4mcMNVykKem3jai/earth1024x1024.jpg',
sphere: {
tilt: 0,
turn: 0,
r: 10
},
defaultSpeed: 20,
backToDefaultTime: 4000,
locations: {
},
paths: {
},
flightsCanvas: null,
dragElement: null,
locationsElement: null,
flightsCanvasPosition: {
x: 0,
y: 0
},
tiling: {horizontal: 1, vertical: 1},
pixelRadiusMultiplier: 0.97,
onInitLocation: function(location, widget) {
var $elem = $('<div class="location"></div>');
$elem.appendTo(widget.options.locationsElement);
$elem.click(function() {
alert('Clicked on ' + location.name + ' : ' + location.link );
window.open( location.link, "AstroTab");
});
location.$element = $elem;
},
onShowLocation: function(location, x, y) {
location.$element.show();
},
onRefreshLocation: function(location, x, y) {
//console.log(x, y);
location.$element.css({
left: x,
top: y
});
},
onHideLocation: function(location, x, y) {
location.$element.hide();
},
onDeleteLocation: function(location) {
location.$element.remove();
},
onInitFlight: function(flight, widget) {
var $elem = $('<div class="flight"></div>');
$elem.appendTo(widget.options.locationsElement);
$elem.click(function() {
alert('Clicked on ' + flight.name);
});
flight.$element = $elem;
},
onShowFlight: function(flight) {
flight.$element.show();
},
onRefreshFlight: function(flight, x, y, angle, widget) {
flight.$element.css({
left: x,
top: y,
'-webkit-transform':'rotate(' + ((angle + Math.PI / 2) * 360 / (2 * Math.PI)) + 'deg)',
'-moz-transform':'rotate(' + ((angle + Math.PI / 2) * 360 / (2 * Math.PI)) + 'deg)',
'-o-transform':'rotate(' + ((angle + Math.PI / 2) * 360 / (2 * Math.PI)) + 'deg)'
});
},
onHideFlight: function(flight) {
flight.$element.hide();
},
onDeleteFlight: function(flight) {
flight.$element.remove();
}
},
earth: null,
posVar: 24 * 3600 * 1000,
lastMousePos: null,
lastSpeed: null,
lastTime: null,
lastTurnByTime: null,
textureWidth: null,
textureHeight: null,
obj: null,
flightsCtx: null,
renderAnimationFrameId: null,
mousePressed: null,
_create: function() {
earth3d = this;
var self = this;
this.obj = $('div');
if (this.options.flightsCanvas !== null) {
this.flightsCtx = this.options.flightsCanvas[0].getContext('2d');
}
createSphere(this.element[0], this.options.texture, function(earth, textureWidth, textureHeight) { self._onSphereCreated(earth, textureWidth, textureHeight); }, this.options.tiling);
if (this.options.dragElement !== null) {
this.options.dragElement
.bind('mousedown vmousedown', function(e) {
self._mouseDragStart(e);
self.mousePressed = true;
})
.bind('mouseup vmouseup', function(e) {
self._mouseDragStop(e);
self.mousePressed = false;
})
.bind('mousemove vmousemove', function(e){
if (self.mousePressed) {
self._mouseDrag(e);
}
});
}
this._initLocations();
this._initFlights();
},
_initLocations: function() {
for (var key in this.options.locations) {
var location = this.options.locations[key];
location.visible = true;
this.options.onInitLocation(location, this);
}
},
_initFlights: function() {
for (var key in this.options.paths) {
var path = this.options.paths[key];
for (var key in path.flights) {
path.flights[key].visible = true;
this.options.onInitFlight(path.flights[key], this);
}
}
},
getSphereRadiusInPixel: function() {
return this.earth.getRadius() / 2;
},
_onSphereCreated: function(earth, textureWidth, textureHeight) {
var self = this;
this.textureWidth = textureWidth;
this.textureHeight = textureHeight;
this.earth = earth;
this.earth.init(this.options.sphere);
this.earth.turnBy = function(time) { return self._turnBy(time); };
var renderAnimationFrame = function(/* time */ time) {
/* time ~= +new Date // the unix time */
earth.renderFrame(time);
self._renderAnimationFrame(time);
self.renderAnimationFrameId = window.requestAnimationFrame(renderAnimationFrame);
};
this.renderAnimationFrameId = window.requestAnimationFrame(renderAnimationFrame);
},
destroy: function() {
window.cancelAnimationFrame(this.renderAnimationFrameId);
},
_renderAnimationFrame: function(time) {
var ry=90+this.options.sphere.tilt;
var rz=180+this.options.sphere.turn;
var RY = (90-ry);
var RZ = (180-rz);
var RX = 0,RY,RZ;
var rx=RX*Math.PI/180;
var ry=RY*Math.PI/180;
var rz=RZ*Math.PI/180;
//console.log(rx, ry, rz);
var r = this.getSphereRadiusInPixel();
var center = {
x: this.element.width() / 2,
y: this.element.height() / 2
}
for (var key in this.options.locations) {
var location = this.options.locations[key];
if (typeof location.delta === 'undefined') {
location.flatPosition = {x: location.x, y: location.y};
this.options.onRefreshLocation(location, location.x, location.y, this);
continue;
}
/*
WARNING: calculation of alphaAngle and deltaAngle is not exact
I had to create the _calibrated functions to modify the deltaAngle to make the result look good on
a spinning planet without rotation. It will totally bug with rotation!
* */
var progression = (((this.posVar + this.textureWidth * location.delta / (2 * Math.PI)) % this.textureWidth) / this.textureWidth);
var alphaAngle = progression * 2 * Math.PI;
var deltaAngle = this._calibrated(progression, location.alpha) * 2 * Math.PI;
var objAlpha = ry + location.alpha - Math.sin(alphaAngle / 2) * 0.15 * (location.alpha - Math.PI / 2) / (Math.PI / 4);
var objDelta = rz + deltaAngle;
var a = this._orbitalTo3d(objAlpha, objDelta, r);
var flatPosition = this._orthographicProjection(a);
if (a.x < 0 && !location.visible) {
this.options.onShowLocation(location, flatPosition.x, flatPosition.y, this);
}
if (a.x > 0 && location.visible) {
this.options.onHideLocation(location, flatPosition.x, flatPosition.y, this);
}
this.options.onRefreshLocation(location, flatPosition.x, flatPosition.y, this);
location.visible = a.x < 0;
location.position = a;
location.flatPosition = flatPosition;
location.rAlpha = objAlpha;
location.rDelta = objDelta;
}
if (this.flightsCtx !== null) {
this.flightsCtx.clearRect(0, 0, this.options.flightsCanvas.width(), this.options.flightsCanvas.height());
for (var key in this.options.paths) {
this._drawPath(this.options.paths[key], center, r);
}
}
},
_line_circle_intersection: function(A, B, C, r) {
var d = {
x: B.x - A.x,
y: B.y - A.y
};
var f = {
x: A.x - C.x,
y: A.y - C.y
};
var a = this._dot(d, d);
var b = 2 * this._dot(f, d);
var c = this._dot(f, f) - r * r;
var discriminant = b * b - 4 * a * c;
if (discriminant < 0) {
return false;
} else {
discriminant = Math.sqrt(discriminant);
var t1 = (-b + discriminant) / (2 * a);
var t2 = (-b - discriminant) / (2 * a);
var sols = [];
if (t1 >= 0 && t1 <= 1) {
sols.push({
x:A.x + t1 * d.x,
y:A.y + t1 * d.y
});
}
if (t2 >= 0 && t2 <= 1) {
sols.push({
x:A.x + t2 * d.x,
y:A.y + t2 * d.y
});
}
return sols;
}
},
_dot: function(A, B) {
return A.x * B.x + A.y * B.y;
},
_drawPath: function(path, center, r) {
var originLocation = this.options.locations[path.origin];
var destinationLocation = this.options.locations[path.destination];
var dotSize = 50;
var spacing = 0.15;
if (typeof originLocation.delta === 'undefined' || typeof destinationLocation.delta === 'undefined') {
var pathVisible = originLocation.visible && destinationLocation.visible;
if (pathVisible) {
var flatDistance = this._distance(originLocation.flatPosition, destinationLocation.flatPosition);
var nb = flatDistance * 0.9 / 20;
// WARNING: we are drawing the paths on canvas, intensively using CPU. Could we gain by instead using SVG or the DOM ?
for (var i = 0; i < nb; i++) {
var fromFlatPosition = {
x: ((nb - i) / nb) * originLocation.flatPosition.x + (i / nb) * destinationLocation.flatPosition.x,
y: ((nb - i) / nb) * originLocation.flatPosition.y + (i / nb) * destinationLocation.flatPosition.y
};
var toFlatPosition = {
x: Math.max(((nb - (i + 1)) / nb), 0) * originLocation.flatPosition.x + Math.min(((i + 1) / nb), 1) * destinationLocation.flatPosition.x,
y: Math.max(((nb - (i + 1)) / nb), 0) * originLocation.flatPosition.y + Math.min(((i + 1) / nb), 1) * destinationLocation.flatPosition.y
};
var diff = {
x: fromFlatPosition.x - toFlatPosition.x,
y: fromFlatPosition.y - toFlatPosition.y,
z: fromFlatPosition.z - toFlatPosition.z
};
fromFlatPosition.x -= diff.x * spacing;
fromFlatPosition.y -= diff.y * spacing;
fromFlatPosition.z -= diff.z * spacing;
toFlatPosition.x += diff.x * spacing;
toFlatPosition.y += diff.y * spacing;
toFlatPosition.z += diff.z * spacing;
this.flightsCtx.lineWidth = 3;
this.flightsCtx.beginPath();
this.flightsCtx.strokeStyle = 'rgba(255, 255, 255, 0.5)';
this.flightsCtx.moveTo(fromFlatPosition.x + this.options.flightsCanvasPosition.x, fromFlatPosition.y + this.options.flightsCanvasPosition.y);
this.flightsCtx.lineTo(toFlatPosition.x + this.options.flightsCanvasPosition.x, toFlatPosition.y + this.options.flightsCanvasPosition.y);
this.flightsCtx.stroke();
}
}
for (var key in path.flights) {
var flight = path.flights[key];
var position = flight.destination == path.destination ? flight.position : (1 - flight.position);
var flightFlatPosition = {
x: (1 - position) * originLocation.flatPosition.x + position * destinationLocation.flatPosition.x,
y: (1 - position) * originLocation.flatPosition.y + position * destinationLocation.flatPosition.y
};
if (!flight.visible && pathVisible) {
this.options.onShowFlight(flight, this);
flight.visible = true;
}
if (flight.visible && !pathVisible) {
this.options.onHideFlight(flight, this);
flight.visible = false;
}
var angle = Math.atan2(destinationLocation.flatPosition.y - originLocation.flatPosition.y, destinationLocation.flatPosition.x - originLocation.flatPosition.x) + (flight.destination == path.destination ? 0 : Math.PI);
//console.log(flightAheadFlatPosition.y - flightFlatPosition.y);
this.options.onRefreshFlight(flight, flightFlatPosition.x, flightFlatPosition.y, angle, this);
}
return;
}
var locationsDistance = this._distance(originLocation.position, destinationLocation.position);
var middlePosition = {
x: 0,
y: 0,
z: 0
};
var radius = this._distance(originLocation.position, middlePosition);
var originP = {
delta: Math.atan2((originLocation.position.y - middlePosition.y), (originLocation.position.x - middlePosition.x)),
alpha: Math.acos((originLocation.position.z - middlePosition.z) / radius)
};
var destinationP = {
delta: Math.atan2((destinationLocation.position.y - middlePosition.y), (destinationLocation.position.x - middlePosition.x)),
alpha: Math.acos((destinationLocation.position.z - middlePosition.z) / radius)
};
if (Math.abs(originP.delta - destinationP.delta) > Math.PI) {
if ((originP.delta - destinationP.delta) > Math.PI) {
originP.delta -= 2 * Math.PI;
} else {
originP.delta += 2 * Math.PI;
}
}
if (path.sens) {
if (((originP.delta - destinationP.delta) > 0 ? 1 : -1) != path.sens) {
if (Math.abs(originP.delta - destinationP.delta) > Math.PI / 2) {
originP.delta += path.sens * 2 * Math.PI;
}
}
} else {
path.sens = (originP.delta - destinationP.delta) > 0 ? 1 : -1;
}
if (!path.nb) {
path.nb = Math.round(((locationsDistance / (2 * r)) * Math.PI * 2 * r + (1 - (locationsDistance / (2 * r))) * locationsDistance) / dotSize);
}
var nb = path.nb;
var maxDistance = 1.2;
for (var i = 0; i < nb; i++) {
var fromP = {
alpha: ((nb - i) / nb) * originP.alpha + (i / nb) * destinationP.alpha,
delta: ((nb - i) / nb) * originP.delta + (i / nb) * destinationP.delta
};
var toP = {
alpha: ((nb - 1 - i) / nb) * originP.alpha + ((i + 1) / nb) * destinationP.alpha,
delta: ((nb - 1 - i) / nb) * originP.delta + ((i + 1) / nb) * destinationP.delta
};
//console.log(i, fromP.alpha, fromP.delta, toP.alpha, toP.delta);
var fromPosition = this._orbitalTo3d(fromP.alpha, fromP.delta, -(Math.sin(Math.PI * i / nb) * (maxDistance - 1) + 1) * radius);
var toPosition = this._orbitalTo3d(toP.alpha, toP.delta, -(Math.sin(Math.PI * (i + 1) / nb) * (maxDistance - 1) + 1) * radius);
var diff = {
x: fromPosition.x - toPosition.x,
y: fromPosition.y - toPosition.y,
z: fromPosition.z - toPosition.z
};
fromPosition.x -= diff.x * spacing;
fromPosition.y -= diff.y * spacing;
fromPosition.z -= diff.z * spacing;
toPosition.x += diff.x * spacing;
toPosition.y += diff.y * spacing;
toPosition.z += diff.z * spacing;
fromPosition.x += middlePosition.x;
fromPosition.y += middlePosition.y;
fromPosition.z += middlePosition.z;
toPosition.x += middlePosition.x;
toPosition.y += middlePosition.y;
toPosition.z += middlePosition.z;
var fromFlatPosition = this._orthographicProjection(fromPosition);
var toFlatPosition = this._orthographicProjection(toPosition);
var fromDistanceCenter = this._distance(fromFlatPosition, center);
var toDistanceCenter = this._distance(toFlatPosition, center);
var fromVisible = true;
var toVisible = true;
if (fromPosition.x > 0) {
if (fromDistanceCenter <= r) {
fromVisible = false;
}
}
if (toPosition.x > 0) {
if (toDistanceCenter <= r) {
toVisible = false;
}
}
//console.log(i, fromVisible, toVisible);
if (!fromVisible && !toVisible) {
continue;
}
if (!fromVisible) {
var intersection = this._line_circle_intersection(fromFlatPosition, toFlatPosition, center, r);
if (intersection.length == 0) {
continue;
}
fromFlatPosition = intersection[0];
}
if (!toVisible) {
var intersection = this._line_circle_intersection(fromFlatPosition, toFlatPosition, center, r);
if (intersection.length == 0) {
continue;
}
toFlatPosition = intersection[0];
}
this.flightsCtx.lineWidth = 3;
this.flightsCtx.beginPath();
this.flightsCtx.strokeStyle = 'rgba(255, 255, 255, 0.5)';
this.flightsCtx.moveTo(fromFlatPosition.x + this.options.flightsCanvasPosition.x, fromFlatPosition.y + this.options.flightsCanvasPosition.y);
this.flightsCtx.lineTo(toFlatPosition.x + this.options.flightsCanvasPosition.x, toFlatPosition.y + this.options.flightsCanvasPosition.y);
this.flightsCtx.stroke();
}
for (var key in path.flights) {
var flight = path.flights[key];
var position = flight.destination == path.destination ? flight.position : (1 - flight.position);
var positionAhead = flight.destination == path.destination ? (flight.position + 0.01) : (1 - (flight.position + 0.01));
var flightP = {
alpha: (1 - position) * originP.alpha + position * destinationP.alpha,
delta: (1 - position) * originP.delta + position * destinationP.delta
};
var flightAheadP = {
alpha: (1 - positionAhead) * originP.alpha + positionAhead * destinationP.alpha,
delta: (1 - positionAhead) * originP.delta + positionAhead * destinationP.delta
};
var flightPosition = this._orbitalTo3d(flightP.alpha, flightP.delta, -(Math.sin(Math.PI * position) * (maxDistance - 1) + 1) * radius);
var flightAheadPosition = this._orbitalTo3d(flightAheadP.alpha, flightAheadP.delta, -(Math.sin(Math.PI * positionAhead) * (maxDistance - 1) + 1) * radius);
flightPosition.x += middlePosition.x;
flightPosition.y += middlePosition.y;
flightPosition.z += middlePosition.z;
flightAheadPosition.x += middlePosition.x;
flightAheadPosition.y += middlePosition.y;
flightAheadPosition.z += middlePosition.z;
var flightFlatPosition = this._orthographicProjection(flightPosition);
var flightAheadFlatPosition = this._orthographicProjection(flightAheadPosition);
var flightDistanceCenter = this._distance(flightFlatPosition, center);
if (!flight.visible && (flightPosition.x < 0 || flightDistanceCenter > r)) {
this.options.onShowFlight(flight, this);
flight.visible = true;
}
if (flight.visible && (flightPosition.x > 0 && flightDistanceCenter < r)) {
this.options.onHideFlight(flight, this);
flight.visible = false;
}
var angle = Math.atan2(flightAheadFlatPosition.y - flightFlatPosition.y, flightAheadFlatPosition.x - flightFlatPosition.x);
//console.log(flightAheadFlatPosition.y - flightFlatPosition.y);
this.options.onRefreshFlight(flight, flightFlatPosition.x, flightFlatPosition.y, angle, this);
}
},
_distance: function(A, B) {
if (A.z) {
return Math.sqrt(
(A.x - B.x) * (A.x - B.x) +
(A.y - B.y) * (A.y - B.y) +
(A.z - B.z) * (A.z - B.z)
);
} else {
return Math.sqrt(
(A.x - B.x) * (A.x - B.x) +
(A.y - B.y) * (A.y - B.y)
);
}
},
// WARNING: temporary function to make the locations look good on a spinning planet without rotation
_calibrated: function(x, alpha) {
var calib = 0.3 + 0.15 * Math.abs(alpha - Math.PI / 2) / (Math.PI / 4);
//console.log(calib);
var y = calib * (4 * (x - 0.5) * (x - 0.5) * (x - 0.5) + 0.5) + (1 - calib) * x;
return y;
},
/* WARNING:
Obviously there is something wrong with _orbitalTo3d and _orthographicProjection, since
I can't get a descent display of locations when the planet is rotated. That's why I had to create the _calibrated
function in the first place. I didn't have time to look precisely into it, and I probably don't know enough math.
I leaved the _3dProjection function I found on wikipedia but is not working. (I might not have correctly understood / write it)
*/
_orbitalTo3d: function(alpha, delta, r) {
return {
x: -r * Math.sin(alpha) * Math.cos(delta),
y: -r * Math.sin(alpha) * Math.sin(delta),
z: -r * Math.cos(alpha)
};
},
_orthographicProjection: function(position) {
return {x: position.y + this.element.width() / 2, y: position.z + this.element.height() / 2};
},
_3dProjection: function(a, c, delta, e) {
// Wikipedia is your friend :) : http://en.wikipedia.org/wiki/3D_projection
var d = {x: 0, y: 0, z: 0};
d.x = Math.cos(delta.y) * (Math.sin(delta.z) * (a.y - c.y) + Math.cos(delta.z) * (a.x - c.x)) - Math.sin(delta.y) * (a.z - c.z);
d.y = Math.sin(delta.x) * (Math.cos(delta.y) * (a.z - c.z) + Math.sin(delta.y) * (Math.sin(delta.z) * (a.y - c.y) + Math.cos(delta.z) * (a.x - c.x)))
+ Math.cos(delta.x) * (Math.cos(delta.z) * (a.y - c.y) - Math.sin(delta.z) * (a.x - c.x))
d.z = Math.cos(delta.x) * (Math.cos(delta.y) * (a.z - c.z) + Math.sin(delta.y) * (Math.sin(delta.z) * (a.y - c.y) + Math.cos(delta.z) * (a.x - c.x)))
- Math.sin(delta.x) * (Math.cos(delta.z) * (a.y - c.y) - Math.sin(delta.z) * (a.x - c.x));
return {
x: d.z, //(d.x - e.x) * (e.y / d.y),
y: d.y //(d.z - e.z) * (e.y / d.y)
};
},
_mouseDragStart: function(e) {
this.lastMousePos = e.clientX;
this.lastSpeed = null;
},
_mouseDrag: function(e) {
this.lastSpeed = (e.clientX - this.lastMousePos);
this.posVar = this.posVar - this.lastSpeed;
this.lastMousePos = e.clientX;
},
_mouseDragStop: function(e) {
this.lastMousePos = null;
this.lastTime = null;
},
_turnBy: function(time) {
if (this.lastTurnByTime === null) {
this.lastTurnByTime = time;
}
var timeDiff = (time - this.lastTurnByTime) / 1000;
if (this.lastMousePos === null) {
if (this.lastSpeed !== null) {
if (this.lastTime === null) {
this.lastTime = time;
}
if (this.options.backToDefaultTime + this.lastTime - time < 0) {
this.lastSpeed = null;
} else {
var backToDef = (this.options.backToDefaultTime + this.lastTime - time) / this.options.backToDefaultTime;
this.posVar -= this.lastSpeed * backToDef + (this.options.defaultSpeed * timeDiff) * (1 - backToDef);
}
} else {
this.posVar -= this.options.defaultSpeed * timeDiff;
}
}
this.lastTurnByTime = time;
return this.posVar;
},
_getQBezierValue: function (t, p1, p2, p3) {
var iT = 1 - t;
return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
},
_getQBezierDerivation: function(t, p1, p2, p3) {
return (2 * p1 - 4 * p2 + 2 * p3) * t + 2 * p2 - 2 * p1;
},
_getQBezierAngle: function(startX, startY, cpX, cpY, endX, endY, position) {
var x = this._getQBezierDerivation(position, startX, cpX, endX);
var y = this._getQBezierDerivation(position, startY, cpY, endY);
return Math.atan2(y, x);
},
_getQuadraticCurvePoint: function(startX, startY, cpX, cpY, endX, endY, position) {
return {
x: this._getQBezierValue(position, startX, cpX, endX),
y: this._getQBezierValue(position, startY, cpY, endY),
angle: this._getQBezierAngle(startX, startY, cpX, cpY, endX, endY, position)
};
},
changeLocations: function(locations) {
for (var key in this.options.locations) {
this.options.onDeleteLocation(this.options.locations[key], this);
}
this.options.locations = locations;
this._initLocations();
},
changePaths: function(paths) {
for (var key in this.options.paths) {
var path = this.options.paths[key];
for (var keyFlight in path.flights) {
var flight = path.flights[keyFlight];
this.options.onDeleteFlight(flight, this);
}
}
this.options.paths = paths;
this._initFlights();
}
});
})($);

View File

@ -0,0 +1,99 @@
(function(){var m,aa=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}},ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a},ca=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");
},da=ca(this),r=function(a,b){if(b)a:{var c=da;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}};
r("Symbol",function(a){if(a)return a;var b=function(f,g){this.ia=f;ba(this,"description",{configurable:!0,writable:!0,value:g})};b.prototype.toString=function(){return this.ia};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(f){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(f||"")+"_"+d++,f)};return e});
r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=da[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ea(aa(this))}})}return a});
var ea=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a},fa=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};
r("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=fa(this,b,"endsWith");b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}});var ha=function(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e};
r("Array.prototype.entries",function(a){return a?a:function(){return ha(this,function(b,c){return[b,c]})}});r("Array.prototype.keys",function(a){return a?a:function(){return ha(this,function(b){return b})}});r("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});
r("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});r("String.prototype.includes",function(a){return a?a:function(b,c){return-1!==fa(this,b,"includes").indexOf(b,c||0)}});window.gapi=window.gapi||{};window.gapi.ua=(new Date).getTime();/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var t=this||self,ia=function(a){var b=typeof a;return"object"!=b?b:a?Array.isArray(a)?"array":b:"null"},la=function(a){var b=ia(a);return"array"==b||"object"==b&&"number"==typeof a.length},u=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ma="closure_uid_"+(1E9*Math.random()>>>0),na=0,oa=function(a,b,c){return a.call.apply(a.bind,arguments)},pa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}},qa=function(a,b,c){qa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?oa:pa;return qa.apply(null,arguments)},ra=function(a,b){function c(){}c.prototype=b.prototype;a.ya=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.B=function(d,e,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[e].apply(d,
g)}},sa=function(a){return a},ta=function(a){var b=null,c=t.trustedTypes;if(!c||!c.createPolicy)return b;try{b=c.createPolicy(a,{createHTML:sa,createScript:sa,createScriptURL:sa})}catch(d){t.console&&t.console.error(d.message)}return b};function ua(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,ua);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a));void 0!==b&&(this.cause=b)}ra(ua,Error);ua.prototype.name="CustomError";var va;function wa(a,b){a=a.split("%s");for(var c="",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");ua.call(this,c+a[d])}ra(wa,ua);wa.prototype.name="AssertionError";function xa(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var f=d}else a&&(e+=": "+a,f=b);throw new wa(""+e,f||[]);}
var ya=function(a,b,c){a||xa("",null,b,Array.prototype.slice.call(arguments,2));return a},za=function(a,b){throw new wa("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},Aa=function(a,b,c){"string"!==typeof a&&xa("Expected string but got %s: %s.",[ia(a),a],b,Array.prototype.slice.call(arguments,2))};var Ba=Array.prototype.forEach?function(a,b){ya(null!=a.length);Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)};function Ca(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};function Da(a,b){for(var c in a)b.call(void 0,a[c],c,a)};var Ea;var v=function(a,b){this.U=a===Fa&&b||"";this.ja=Ga};v.prototype.G=!0;v.prototype.F=function(){return this.U};v.prototype.toString=function(){return"Const{"+this.U+"}"};var Ia=function(a){if(a instanceof v&&a.constructor===v&&a.ja===Ga)return a.U;za("expected object of type Const, got '"+a+"'");return"type_error:Const"},Ga={},Fa={};var x=function(a,b){this.S=b===Ja?a:""};x.prototype.toString=function(){return this.S.toString()};x.prototype.G=!0;x.prototype.F=function(){return this.S.toString()};
var Ka=function(a){if(a instanceof x&&a.constructor===x)return a.S;za("expected object of type SafeUrl, got '"+a+"' of type "+ia(a));return"type_error:SafeUrl"},La=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,Ma=function(a){if(a instanceof x)return a;a="object"==typeof a&&a.G?a.F():String(a);ya(La.test(a),"%s does not match the safe URL pattern",a)||(a="about:invalid#zClosurez");return new x(a,Ja)},Ja={};var Na={},Oa=function(a,b){this.R=b===Na?a:"";this.G=!0};Oa.prototype.F=function(){return this.R.toString()};Oa.prototype.toString=function(){return this.R.toString()};var Pa=function(a,b){this.name=a;this.value=b};Pa.prototype.toString=function(){return this.name};var Qa=new Pa("OFF",Infinity),Ra=new Pa("WARNING",900),Sa=new Pa("CONFIG",700),Ta=function(){this.C=0;this.clear()},Ua;Ta.prototype.clear=function(){this.X=Array(this.C);this.Z=-1;this.ba=!1};var Va=function(a,b,c){this.reset(a||Qa,b,c,void 0,void 0)};Va.prototype.reset=function(){};
var Wa=function(a,b){this.level=null;this.na=[];this.parent=(void 0===b?null:b)||null;this.children=[];this.pa={N:function(){return a}}},Xa=function(a){if(a.level)return a.level;if(a.parent)return Xa(a.parent);za("Root logger has no level set.");return Qa},Ya=function(a,b){for(;a;)a.na.forEach(function(c){c(b)}),a=a.parent},Za=function(){this.entries={};var a=new Wa("");a.level=Sa;this.entries[""]=a},$a,ab=function(a,b){var c=a.entries[b];if(c)return c;c=ab(a,b.slice(0,Math.max(b.lastIndexOf("."),
0)));var d=new Wa(b,c);a.entries[b]=d;c.children.push(d);return d},bb=function(){$a||($a=new Za);return $a};/*
SPDX-License-Identifier: Apache-2.0
*/
var cb=[],db=function(a){var b;if(b=ab(bb(),"safevalues").pa){var c="A URL with content '"+a+"' was sanitized away.",d=Ra;if(a=b)if(a=b&&d){a=d.value;var e=b?Xa(ab(bb(),b.N())):Qa;a=a>=e.value}if(a){d=d||Qa;a=ab(bb(),b.N());"function"===typeof c&&(c=c());Ua||(Ua=new Ta);e=Ua;b=b.N();if(0<e.C){var f=(e.Z+1)%e.C;e.Z=f;e.ba?(e=e.X[f],e.reset(d,c,b),b=e):(e.ba=f==e.C-1,b=e.X[f]=new Va(d,c,b))}else b=new Va(d,c,b);Ya(a,b)}}};-1===cb.indexOf(db)&&cb.push(db);var eb=function(a,b){if(!u(a)||!u(a)||!u(a)||1!==a.nodeType||a.namespaceURI&&"http://www.w3.org/1999/xhtml"!==a.namespaceURI||a.tagName.toUpperCase()!==b.toString()){b=b.toString()+"; got: ";if(u(a))try{var c=a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a)}catch(d){c="<object could not be stringified>"}else c=void 0===a?"undefined":null===a?"null":typeof a;za("Argument is not an HTML Element with tag name "+(b+c))}return a};var hb=function(a,b){Da(b,function(c,d){c&&"object"==typeof c&&c.G&&(c=c.F());"style"==d?a.style.cssText=c:"class"==d?a.className=c:"for"==d?a.htmlFor=c:fb.hasOwnProperty(d)?a.setAttribute(fb[d],c):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,c):a[d]=c})},fb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",
width:"width"},ib=function(a,b,c,d){function e(k){k&&b.appendChild("string"===typeof k?a.createTextNode(k):k)}for(;d<c.length;d++){var f=c[d];if(!la(f)||u(f)&&0<f.nodeType)e(f);else{a:{if(f&&"number"==typeof f.length){if(u(f)){var g="function"==typeof f.item||"string"==typeof f.item;break a}if("function"===typeof f){g="function"==typeof f.item;break a}}g=!1}Ba(g?Ca(f):f,e)}}},jb=function(a,b){b=String(b);"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)},kb=function(a){ya(a,
"Node cannot be null or undefined.");return 9==a.nodeType?a:a.ownerDocument||a.document},lb=function(a){this.D=a||t.document||document};m=lb.prototype;m.getElementsByTagName=function(a,b){return(b||this.D).getElementsByTagName(String(a))};m.ma=function(a,b,c){var d=this.D,e=arguments,f=e[1],g=jb(d,String(e[0]));f&&("string"===typeof f?g.className=f:Array.isArray(f)?g.className=f.join(" "):hb(g,f));2<e.length&&ib(d,g,e,2);return g};m.createElement=function(a){return jb(this.D,a)};
m.createTextNode=function(a){return this.D.createTextNode(String(a))};m.appendChild=function(a,b){ya(null!=a&&null!=b,"goog.dom.appendChild expects non-null arguments");a.appendChild(b)};m.append=function(a,b){ib(kb(a),a,arguments,1)};m.canHaveChildren=function(a){if(1!=a.nodeType)return!1;switch(a.tagName){case "APPLET":case "AREA":case "BASE":case "BR":case "COL":case "COMMAND":case "EMBED":case "FRAME":case "HR":case "IMG":case "INPUT":case "IFRAME":case "ISINDEX":case "KEYGEN":case "LINK":case "NOFRAMES":case "NOSCRIPT":case "META":case "OBJECT":case "PARAM":case "SCRIPT":case "SOURCE":case "STYLE":case "TRACK":case "WBR":return!1}return!0};
m.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};m.contains=function(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};/*
gapi.loader.OBJECT_CREATE_TEST_OVERRIDE &&*/
var y=window,A=document,mb=y.location,nb=function(){},ob=/\[native code\]/,B=function(a,b,c){return a[b]=a[b]||c},pb=function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1},qb=function(a){a=a.sort();for(var b=[],c=void 0,d=0;d<a.length;d++){var e=a[d];e!=c&&b.push(e);c=e}return b},rb=/&/g,sb=/</g,tb=/>/g,ub=/"/g,vb=/'/g,wb=function(a){return String(a).replace(rb,"&amp;").replace(sb,"&lt;").replace(tb,"&gt;").replace(ub,"&quot;").replace(vb,"&#39;")},C=function(){var a;if((a=Object.create)&&
ob.test(a))a=a(null);else{a={};for(var b in a)a[b]=void 0}return a},D=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},xb=function(a){if(ob.test(Object.keys))return Object.keys(a);var b=[],c;for(c in a)D(a,c)&&b.push(c);return b},E=function(a,b){a=a||{};for(var c in a)D(a,c)&&(b[c]=a[c])},yb=function(a){return function(){y.setTimeout(a,0)}},F=function(a,b){if(!a)throw Error(b||"");},H=B(y,"gapi",{});var I=function(a,b,c){var d=new RegExp("([#].*&|[#])"+b+"=([^&#]*)","g");b=new RegExp("([?#].*&|[?#])"+b+"=([^&#]*)","g");if(a=a&&(d.exec(a)||b.exec(a)))try{c=decodeURIComponent(a[2])}catch(e){}return c},zb=new RegExp(/^/.source+/([a-zA-Z][-+.a-zA-Z0-9]*:)?/.source+/(\/\/[^\/?#]*)?/.source+/([^?#]*)?/.source+/(\?([^#]*))?/.source+/(#((#|[^#])*))?/.source+/$/.source),Ab=/[\ud800-\udbff][\udc00-\udfff]|[^!-~]/g,Bb=new RegExp(/(%([^0-9a-fA-F%]|[0-9a-fA-F]([^0-9a-fA-F%])?)?)*/.source+/%($|[^0-9a-fA-F]|[0-9a-fA-F]($|[^0-9a-fA-F]))/.source,
"g"),Cb=/%([a-f]|[0-9a-fA-F][a-f])/g,Db=/^(https?|ftp|file|chrome-extension):$/i,Eb=function(a){a=String(a);a=a.replace(Ab,function(e){try{return encodeURIComponent(e)}catch(f){return encodeURIComponent(e.replace(/^[^%]+$/g,"\ufffd"))}}).replace(Bb,function(e){return e.replace(/%/g,"%25")}).replace(Cb,function(e){return e.toUpperCase()});a=a.match(zb)||[];var b=C(),c=function(e){return e.replace(/\\/g,"%5C").replace(/\^/g,"%5E").replace(/`/g,"%60").replace(/\{/g,"%7B").replace(/\|/g,"%7C").replace(/\}/g,
"%7D")},d=!!(a[1]||"").match(Db);b.B=c((a[1]||"")+(a[2]||"")+(a[3]||(a[2]&&d?"/":"")));d=function(e){return c(e.replace(/\?/g,"%3F").replace(/#/g,"%23"))};b.query=a[5]?[d(a[5])]:[];b.j=a[7]?[d(a[7])]:[];return b},Fb=function(a){return a.B+(0<a.query.length?"?"+a.query.join("&"):"")+(0<a.j.length?"#"+a.j.join("&"):"")},Gb=function(a,b){var c=[];if(a)for(var d in a)if(D(a,d)&&null!=a[d]){var e=b?b(a[d]):a[d];c.push(encodeURIComponent(d)+"="+encodeURIComponent(e))}return c},Hb=function(a,b,c,d){a=Eb(a);
a.query.push.apply(a.query,Gb(b,d));a.j.push.apply(a.j,Gb(c,d));return Fb(a)},Ib=new RegExp(/\/?\??#?/.source+"("+/[\/?#]/i.source+"|"+/[\uD800-\uDBFF]/i.source+"|"+/%[c-f][0-9a-f](%[89ab][0-9a-f]){0,2}(%[89ab]?)?/i.source+"|"+/%[0-9a-f]?/i.source+")$","i"),Jb=function(a,b){var c=Eb(b);b=c.B;c.query.length&&(b+="?"+c.query.join(""));c.j.length&&(b+="#"+c.j.join(""));var d="";2E3<b.length&&(d=b,b=b.substr(0,2E3),b=b.replace(Ib,""),d=d.substr(b.length));var e=a.createElement("div");a=a.createElement("a");
c=Eb(b);b=c.B;c.query.length&&(b+="?"+c.query.join(""));c.j.length&&(b+="#"+c.j.join(""));b=null===b?"null":void 0===b?"undefined":b;if("string"!==typeof b)throw Error("Expected a string");b=new x(b,Ja);eb(a,"A");b=b instanceof x?b:Ma(b);a.href=Ka(b);e.appendChild(a);a=e.innerHTML;b=new v(Fa,"Assignment to self.");Aa(Ia(b),"must provide justification");ya(!/^[\s\xa0]*$/.test(Ia(b)),"must provide non-empty justification");void 0===Ea&&(Ea=ta("gapi#html"));a=(b=Ea)?b.createHTML(a):a;a=new Oa(a,Na);
if(void 0!==e.tagName){if("script"===e.tagName.toLowerCase())throw Error("Use setTextContent with a SafeScript.");if("style"===e.tagName.toLowerCase())throw Error("Use setTextContent with a SafeStyleSheet.");}a instanceof Oa&&a.constructor===Oa?a=a.R:(za("expected object of type SafeHtml, got '"+a+"' of type "+ia(a)),a="type_error:SafeHtml");e.innerHTML=a;b=String(e.firstChild.href);e.parentNode&&e.parentNode.removeChild(e);c=Eb(b+d);d=c.B;c.query.length&&(d+="?"+c.query.join(""));c.j.length&&(d+=
"#"+c.j.join(""));return d},Kb=/^https?:\/\/[^\/%\\?#\s]+\/[^\s]*$/i;var Lb;var Mb=function(a,b,c,d){if(y[c+"EventListener"])y[c+"EventListener"](a,b,!1);else if(y[d+"tachEvent"])y[d+"tachEvent"]("on"+a,b)},Nb=function(){var a=A.readyState;return"complete"===a||"interactive"===a&&-1==navigator.userAgent.indexOf("MSIE")},Qb=function(a){var b=Ob;if(!Nb())try{b()}catch(c){}Pb(a)},Pb=function(a){if(Nb())a();else{var b=!1,c=function(){if(!b)return b=!0,a.apply(this,arguments)};y.addEventListener?(y.addEventListener("load",c,!1),y.addEventListener("DOMContentLoaded",c,!1)):y.attachEvent&&
(y.attachEvent("onreadystatechange",function(){Nb()&&c.apply(this,arguments)}),y.attachEvent("onload",c))}},Rb=function(a){for(;a.firstChild;)a.removeChild(a.firstChild)},Sb={button:!0,div:!0,span:!0};var M={};M=B(y,"___jsl",C());B(M,"I",0);B(M,"hel",10);var Tb=function(a){return M.dpo?M.h:I(a,"jsh",M.h)},Ub=function(a){var b=B(M,"sws",[]);b.push.apply(b,a)},Vb=function(a){return B(M,"watt",C())[a]},Wb=function(a){var b=B(M,"PQ",[]);M.PQ=[];var c=b.length;if(0===c)a();else for(var d=0,e=function(){++d===c&&a()},f=0;f<c;f++)b[f](e)},Xb=function(a){return B(B(M,"H",C()),a,C())};var Yb=B(M,"perf",C()),Zb=B(Yb,"g",C()),$b=B(Yb,"i",C());B(Yb,"r",[]);C();C();
var ac=function(a,b,c){var d=Yb.r;"function"===typeof d?d(a,b,c):d.push([a,b,c])},N=function(a,b,c){Zb[a]=!b&&Zb[a]||c||(new Date).getTime();ac(a)},cc=function(a,b,c){b&&0<b.length&&(b=bc(b),c&&0<c.length&&(b+="___"+bc(c)),28<b.length&&(b=b.substr(0,28)+(b.length-28)),c=b,b=B($b,"_p",C()),B(b,c,C())[a]=(new Date).getTime(),ac(a,"_p",c))},bc=function(a){return a.join("__").replace(/\./g,"_").replace(/\-/g,"_").replace(/,/g,"_")};var dc=C(),O=[],P=function(a){throw Error("Bad hint: "+a);};O.push(["jsl",function(a){for(var b in a)if(D(a,b)){var c=a[b];"object"==typeof c?M[b]=B(M,b,[]).concat(c):B(M,b,c)}if(b=a.u)a=B(M,"us",[]),a.push(b),(b=/^https:(.*)$/.exec(b))&&a.push("http:"+b[1])}]);var ec=/^(\/[a-zA-Z0-9_\-]+)+$/,fc=[/\/amp\//,/\/amp$/,/^\/amp$/],gc=/^[a-zA-Z0-9\-_\.,!]+$/,hc=/^gapi\.loaded_[0-9]+$/,ic=/^[a-zA-Z0-9,._-]+$/,mc=function(a,b,c,d,e){var f=a.split(";"),g=f.shift(),k=dc[g],h=null;k?h=k(f,b,c,d):P("no hint processor for: "+g);h||P("failed to generate load url");b=h;c=b.match(jc);(d=b.match(kc))&&1===d.length&&lc.test(b)&&c&&1===c.length||P("failed sanity: "+a);try{a="?";if(e&&0<e.length){c=b=0;for(d={};c<e.length;){var l=e[c++];f=void 0;f=u(l)?"o"+(Object.prototype.hasOwnProperty.call(l,
ma)&&l[ma]||(l[ma]=++na)):(typeof l).charAt(0)+l;Object.prototype.hasOwnProperty.call(d,f)||(d[f]=!0,e[b++]=l)}e.length=b;h=h+"?le="+e.join(",");a="&"}if(M.rol){var n=M.ol;n&&n.length&&(h=""+h+a+"ol="+n.length)}}catch(q){}return h},pc=function(a,b,c,d){a=nc(a);hc.test(c)||P("invalid_callback");b=oc(b);d=d&&d.length?oc(d):null;var e=function(f){return encodeURIComponent(f).replace(/%2C/g,",")};return[encodeURIComponent(a.pathPrefix).replace(/%2C/g,",").replace(/%2F/g,"/"),"/k=",e(a.version),"/m=",
e(b),d?"/exm="+e(d):"","/rt=j/sv=1/d=1/ed=1",a.W?"/am="+e(a.W):"",a.fa?"/rs="+e(a.fa):"",a.ha?"/t="+e(a.ha):"","/cb=",e(c)].join("")},nc=function(a){"/"!==a.charAt(0)&&P("relative path");for(var b=a.substring(1).split("/"),c=[];b.length;){a=b.shift();if(!a.length||0==a.indexOf("."))P("empty/relative directory");else if(0<a.indexOf("=")){b.unshift(a);break}c.push(a)}a={};for(var d=0,e=b.length;d<e;++d){var f=b[d].split("="),g=decodeURIComponent(f[0]),k=decodeURIComponent(f[1]);2==f.length&&g&&k&&(a[g]=
a[g]||k)}b="/"+c.join("/");ec.test(b)||P("invalid_prefix");c=0;for(d=fc.length;c<d;++c)fc[c].test(b)&&P("invalid_prefix");c=qc(a,"k",!0);d=qc(a,"am");e=qc(a,"rs");a=qc(a,"t");return{pathPrefix:b,version:c,W:d,fa:e,ha:a}},oc=function(a){for(var b=[],c=0,d=a.length;c<d;++c){var e=a[c].replace(/\./g,"_").replace(/-/g,"_");ic.test(e)&&b.push(e)}return b.join(",")},qc=function(a,b,c){a=a[b];!a&&c&&P("missing: "+b);if(a){if(gc.test(a))return a;P("invalid: "+b)}return null},lc=/^https?:\/\/[a-z0-9_.-]+\.google(rs)?\.com(:\d+)?\/[a-zA-Z0-9_.,!=\-\/]+$/,
kc=/\/cb=/g,jc=/\/\//g;dc.m=function(a,b,c,d){(a=a[0])||P("missing_hint");return"https://apis.google.com"+pc(a,b,c,d)};var rc=decodeURI("%73cript"),sc=/^[-+_0-9\/A-Za-z]+={0,2}$/,tc=function(a,b){for(var c=[],d=0;d<a.length;++d){var e=a[d];e&&0>pb.call(b,e)&&c.push(e)}return c},uc=function(){var a=M.nonce;return void 0!==a?a&&a===String(a)&&a.match(sc)?a:M.nonce=null:A.querySelector?(a=A.querySelector("script[nonce]"))?(a=a.nonce||a.getAttribute("nonce")||"",a&&a===String(a)&&a.match(sc)?M.nonce=a:M.nonce=null):null:null},xc=function(a){if("loading"!=A.readyState)vc(a);else{var b=uc(),c="";null!==b&&(c=' nonce="'+
b+'"');a="<"+rc+' src="'+encodeURI(a)+'"'+c+"></"+rc+">";A.write(wc?wc.createHTML(a):a)}},vc=function(a){var b=A.createElement(rc);b.setAttribute("src",wc?wc.createScriptURL(a):a);a=uc();null!==a&&b.setAttribute("nonce",a);b.async="true";(a=A.getElementsByTagName(rc)[0])?a.parentNode.insertBefore(b,a):(A.head||A.body||A.documentElement).appendChild(b)},zc=function(a,b,c){yc(function(){var d=b===Tb(mb.href)?B(H,"_",C()):C();d=B(Xb(b),"_",d);a(d)},c)},Bc=function(a,b){var c=b||{};"function"==typeof b&&
(c={},c.callback=b);var d=(b=c)&&b._c;if(d)for(var e=0;e<O.length;e++){var f=O[e][0],g=O[e][1];g&&D(d,f)&&g(d[f],a,b)}b=[];a?b=a.split(":"):c.features&&(b=c.features);if(!(a=c.h)&&(a=Tb(mb.href),!a))throw Error("Bad hint: !hint");Ac(b||[],c,a)},Ac=function(a,b,c){var d=!!M.glrp;a=qb(a)||[];var e=b.callback,f=b.config,g=b.timeout,k=b.ontimeout,h=b.onerror,l=void 0;"function"==typeof h&&(l=h);var n=null,q=!1;if(g&&!k||!g&&k)throw"Timeout requires both the timeout parameter and ontimeout parameter to be set";
h=B(Xb(c),"r",[]).sort();var p=B(Xb(c),"L",[]).sort(),J=M.le||[],z=[].concat(h),w=function(R,ja){if(q)return 0;y.clearTimeout(n);p.push.apply(p,G);var ka=((H||{}).config||{}).update;ka?ka(f):f&&B(M,"cu",[]).push(f);if(ja){cc("me0",R,z);try{zc(ja,c,l)}finally{cc("me1",R,z)}}return 1};0<g&&(n=y.setTimeout(function(){q=!0;k()},g));var G=tc(a,p);if(G.length){G=tc(a,h);var K=B(M,"CP",[]),L=K.length;K[L]=function(R){if(!R)return 0;cc("ml1",G,z);var ja=function(Ha){d||(K[L]=null);w(G,R)&&(d&&(K[L]=null),
Wb(function(){e&&e();Ha()}))},ka=function(){var Ha=K[L+1];Ha&&Ha()};0<L&&K[L-1]?K[L]=function(){ja(ka)}:ja(ka)};if(G.length){var gb="loaded_"+M.I++;H[gb]=function(R){K[L](R);H[gb]=null};a=mc(c,G,"gapi."+gb,h,J);h.push.apply(h,G);cc("ml0",G,z);b.sync||y.___gapisync?xc(a):vc(a)}else K[L](nb)}else w(G)&&e&&e()},wc=ta("gapi#gapi");var yc=function(a,b){if(M.hee&&0<M.hel)try{return a()}catch(c){b&&b(c),M.hel--,Bc("debug_error",function(){try{window.___jsl.hefn(c)}catch(d){throw c;}})}else try{return a()}catch(c){throw b&&b(c),c;}};var Cc=H.load;Cc&&B(M,"ol",[]).push(Cc);H.load=function(a,b){return yc(function(){return Bc(a,b)})};var Dc=function(a){var b=window.___jsl=window.___jsl||{};b[a]=b[a]||[];return b[a]},Ec=function(a){var b=window.___jsl=window.___jsl||{};b.cfg=!a&&b.cfg||{};return b.cfg},Fc=function(a){return"object"===typeof a&&/\[native code\]/.test(a.push)},Q=function(a,b,c){if(b&&"object"===typeof b)for(var d in b)!Object.prototype.hasOwnProperty.call(b,d)||c&&"___goc"===d&&"undefined"===typeof b[d]||(a[d]&&b[d]&&"object"===typeof a[d]&&"object"===typeof b[d]&&!Fc(a[d])&&!Fc(b[d])?Q(a[d],b[d]):b[d]&&"object"===
typeof b[d]?(a[d]=Fc(b[d])?[]:{},Q(a[d],b[d])):a[d]=b[d])},Gc=function(a){if(a&&!/^\s+$/.test(a)){for(;0==a.charCodeAt(a.length-1);)a=a.substring(0,a.length-1);try{var b=window.JSON.parse(a)}catch(c){}if("object"===typeof b)return b;try{b=(new Function("return ("+a+"\n)"))()}catch(c){}if("object"===typeof b)return b;try{b=(new Function("return ({"+a+"\n})"))()}catch(c){}return"object"===typeof b?b:{}}},Hc=function(a,b){var c={___goc:void 0};a.length&&a[a.length-1]&&Object.hasOwnProperty.call(a[a.length-
1],"___goc")&&"undefined"===typeof a[a.length-1].___goc&&(c=a.pop());Q(c,b);a.push(c)},Ic=function(a){Ec(!0);var b=window.___gcfg,c=Dc("cu"),d=window.___gu;b&&b!==d&&(Hc(c,b),window.___gu=b);b=Dc("cu");var e=document.scripts||document.getElementsByTagName("script")||[];d=[];var f=[];f.push.apply(f,Dc("us"));for(var g=0;g<e.length;++g)for(var k=e[g],h=0;h<f.length;++h)k.src&&0==k.src.indexOf(f[h])&&d.push(k);0==d.length&&0<e.length&&e[e.length-1].src&&d.push(e[e.length-1]);for(e=0;e<d.length;++e)d[e].getAttribute("gapi_processed")||
(d[e].setAttribute("gapi_processed",!0),(f=d[e])?(g=f.nodeType,f=3==g||4==g?f.nodeValue:f.textContent||""):f=void 0,(f=Gc(f))&&b.push(f));a&&Hc(c,a);d=Dc("cd");a=0;for(b=d.length;a<b;++a)Q(Ec(),d[a],!0);d=Dc("ci");a=0;for(b=d.length;a<b;++a)Q(Ec(),d[a],!0);a=0;for(b=c.length;a<b;++a)Q(Ec(),c[a],!0)},S=function(a){var b=Ec();if(!a)return b;a=a.split("/");for(var c=0,d=a.length;b&&"object"===typeof b&&c<d;++c)b=b[a[c]];return c===a.length&&void 0!==b?b:void 0},Jc=function(a,b){var c;if("string"===typeof a){var d=
c={};a=a.split("/");for(var e=0,f=a.length;e<f-1;++e){var g={};d=d[a[e]]=g}d[a[e]]=b}else c=a;Ic(c)};var Kc=function(){var a=window.__GOOGLEAPIS;a&&(a.googleapis&&!a["googleapis.config"]&&(a["googleapis.config"]=a.googleapis),B(M,"ci",[]).push(a),window.__GOOGLEAPIS=void 0)};var Lc={callback:1,clientid:1,cookiepolicy:1,openidrealm:-1,includegrantedscopes:-1,requestvisibleactions:1,scope:1},Mc=!1,Nc=C(),Oc=function(){if(!Mc){for(var a=document.getElementsByTagName("meta"),b=0;b<a.length;++b){var c=a[b].name.toLowerCase();if(0==c.lastIndexOf("google-signin-",0)){c=c.substring(14);var d=a[b].content;Lc[c]&&d&&(Nc[c]=d)}}if(window.self!==window.top){a=document.location.toString();for(var e in Lc)0<Lc[e]&&(b=I(a,e,""))&&(Nc[e]=b)}Mc=!0}e=C();E(Nc,e);return e},Pc=function(a){return!!(a.clientid&&
a.scope&&a.callback)};var Qc=function(){this.i=window.console};Qc.prototype.log=function(a){this.i&&this.i.log&&this.i.log(a)};Qc.prototype.error=function(a){this.i&&(this.i.error?this.i.error(a):this.i.log&&this.i.log(a))};Qc.prototype.warn=function(a){this.i&&(this.i.warn?this.i.warn(a):this.i.log&&this.i.log(a))};Qc.prototype.debug=function(){};var Rc=new Qc;var Sc=function(){return!!M.oa},Tc=function(){};var T=B(M,"rw",C()),Uc=function(a){for(var b in T)a(T[b])},Vc=function(a,b){(a=T[a])&&a.state<b&&(a.state=b)};var U=function(a){var b=window.___jsl=window.___jsl||{};b.cfg=b.cfg||{};b=b.cfg;if(!a)return b;a=a.split("/");for(var c=0,d=a.length;b&&"object"===typeof b&&c<d;++c)b=b[a[c]];return c===a.length&&void 0!==b?b:void 0};var Wc=/^https?:\/\/(?:\w|[\-\.])+\.google\.(?:\w|[\-:\.])+(?:\/[^\?#]*)?\/u\/(\d)\//,Xc=/^https?:\/\/(?:\w|[\-\.])+\.google\.(?:\w|[\-:\.])+(?:\/[^\?#]*)?\/b\/(\d{10,21})\//,Yc=function(){var a=U("googleapis.config/sessionIndex");"string"===typeof a&&254<a.length&&(a=null);null==a&&(a=window.__X_GOOG_AUTHUSER);"string"===typeof a&&254<a.length&&(a=null);if(null==a){var b=window.google;b&&(a=b.authuser)}"string"===typeof a&&254<a.length&&(a=null);null==a&&(b=window.location.href,a=I(b,"authuser")||
null,null==a&&(a=(a=b.match(Wc))?a[1]:null));if(null==a)return null;a=String(a);254<a.length&&(a=null);return a},Zc=function(){var a=U("googleapis.config/sessionDelegate");"string"===typeof a&&21<a.length&&(a=null);null==a&&(a=(a=window.location.href.match(Xc))?a[1]:null);if(null==a)return null;a=String(a);21<a.length&&(a=null);return a};var $c,V,W=void 0,X=function(a){try{return t.JSON.parse.call(t.JSON,a)}catch(b){return!1}},Y=function(a){return Object.prototype.toString.call(a)},ad=Y(0),bd=Y(new Date(0)),cd=Y(!0),dd=Y(""),ed=Y({}),fd=Y([]),gd=function(a,b){if(b)for(var c=0,d=b.length;c<d;++c)if(a===b[c])throw new TypeError("Converting circular structure to JSON");d=typeof a;if("undefined"!==d){c=Array.prototype.slice.call(b||[],0);c[c.length]=a;b=[];var e=Y(a);if(null!=a&&"function"===typeof a.toJSON&&(Object.prototype.hasOwnProperty.call(a,
"toJSON")||(e!==fd||a.constructor!==Array&&a.constructor!==Object)&&(e!==ed||a.constructor!==Array&&a.constructor!==Object)&&e!==dd&&e!==ad&&e!==cd&&e!==bd))return gd(a.toJSON.call(a),c);if(null==a)b[b.length]="null";else if(e===ad)a=Number(a),isNaN(a)||isNaN(a-a)?a="null":-0===a&&0>1/a&&(a="-0"),b[b.length]=String(a);else if(e===cd)b[b.length]=String(!!Number(a));else{if(e===bd)return gd(a.toISOString.call(a),c);if(e===fd&&Y(a.length)===ad){b[b.length]="[";var f=0;for(d=Number(a.length)>>0;f<d;++f)f&&
(b[b.length]=","),b[b.length]=gd(a[f],c)||"null";b[b.length]="]"}else if(e==dd&&Y(a.length)===ad){b[b.length]='"';f=0;for(c=Number(a.length)>>0;f<c;++f)d=String.prototype.charAt.call(a,f),e=String.prototype.charCodeAt.call(a,f),b[b.length]="\b"===d?"\\b":"\f"===d?"\\f":"\n"===d?"\\n":"\r"===d?"\\r":"\t"===d?"\\t":"\\"===d||'"'===d?"\\"+d:31>=e?"\\u"+(e+65536).toString(16).substr(1):32<=e&&65535>=e?d:"\ufffd";b[b.length]='"'}else if("object"===d){b[b.length]="{";d=0;for(f in a)Object.prototype.hasOwnProperty.call(a,
f)&&(e=gd(a[f],c),void 0!==e&&(d++&&(b[b.length]=","),b[b.length]=gd(f),b[b.length]=":",b[b.length]=e));b[b.length]="}"}else return}return b.join("")}},hd=/[\0-\x07\x0b\x0e-\x1f]/,id=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*[\0-\x1f]/,jd=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*\\[^\\\/"bfnrtu]/,kd=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*\\u([0-9a-fA-F]{0,3}[^0-9a-fA-F])/,ld=/"([^\0-\x1f\\"]|\\[\\\/"bfnrt]|\\u[0-9a-fA-F]{4})*"/g,md=/-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?/g,nd=/[ \t\n\r]+/g,
od=/[^"]:/,pd=/""/g,qd=/true|false|null/g,rd=/00/,sd=/[\{]([^0\}]|0[^:])/,td=/(^|\[)[,:]|[,:](\]|\}|[,:]|$)/,ud=/[^\[,:][\[\{]/,vd=/^(\{|\}|\[|\]|,|:|0)+/,wd=/\u2028/g,xd=/\u2029/g,yd=function(a){a=String(a);if(hd.test(a)||id.test(a)||jd.test(a)||kd.test(a))return!1;var b=a.replace(ld,'""');b=b.replace(md,"0");b=b.replace(nd,"");if(od.test(b))return!1;b=b.replace(pd,"0");b=b.replace(qd,"0");if(rd.test(b)||sd.test(b)||td.test(b)||ud.test(b)||!b||(b=b.replace(vd,"")))return!1;a=a.replace(wd,"\\u2028").replace(xd,
"\\u2029");b=void 0;try{b=W?[X(a)]:eval("(function (var_args) {\n return Array.prototype.slice.call(arguments, 0);\n})(\n"+a+"\n)")}catch(c){return!1}return b&&1===b.length?b[0]:!1},zd=function(){var a=((t.document||{}).scripts||[]).length;if((void 0===$c||void 0===W||V!==a)&&-1!==V){$c=W=!1;V=-1;try{try{W=!!t.JSON&&'{"a":[3,true,"1970-01-01T00:00:00.000Z"]}'===t.JSON.stringify.call(t.JSON,{a:[3,!0,new Date(0)],c:function(){}})&&!0===X("true")&&3===X('[{"a":3}]')[0].a}catch(b){}$c=W&&!X("[00]")&&
!X('"\u0007"')&&!X('"\\0"')&&!X('"\\v"')}finally{V=a}}},Ad=function(a){if(-1===V)return!1;zd();return($c?X:yd)(a)},Bd=function(a){if(-1!==V)return zd(),W?t.JSON.stringify.call(t.JSON,a):gd(a)},Cd=!Date.prototype.toISOString||"function"!==typeof Date.prototype.toISOString||"1970-01-01T00:00:00.000Z"!==(new Date(0)).toISOString(),Dd=function(){var a=Date.prototype.getUTCFullYear.call(this);return[0>a?"-"+String(1E6-a).substr(1):9999>=a?String(1E4+a).substr(1):"+"+String(1E6+a).substr(1),"-",String(101+
Date.prototype.getUTCMonth.call(this)).substr(1),"-",String(100+Date.prototype.getUTCDate.call(this)).substr(1),"T",String(100+Date.prototype.getUTCHours.call(this)).substr(1),":",String(100+Date.prototype.getUTCMinutes.call(this)).substr(1),":",String(100+Date.prototype.getUTCSeconds.call(this)).substr(1),".",String(1E3+Date.prototype.getUTCMilliseconds.call(this)).substr(1),"Z"].join("")};Date.prototype.toISOString=Cd?Dd:Date.prototype.toISOString;var Ed=function(){this.blockSize=-1};var Fd=function(){this.blockSize=-1;this.blockSize=64;this.g=[];this.M=[];this.ka=[];this.J=[];this.J[0]=128;for(var a=1;a<this.blockSize;++a)this.J[a]=0;this.K=this.v=0;this.reset()};ra(Fd,Ed);Fd.prototype.reset=function(){this.g[0]=1732584193;this.g[1]=4023233417;this.g[2]=2562383102;this.g[3]=271733878;this.g[4]=3285377520;this.K=this.v=0};
var Gd=function(a,b,c){c||(c=0);var d=a.ka;if("string"===typeof b)for(var e=0;16>e;e++)d[e]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(e=0;16>e;e++)d[e]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(e=16;80>e;e++){var f=d[e-3]^d[e-8]^d[e-14]^d[e-16];d[e]=(f<<1|f>>>31)&4294967295}b=a.g[0];c=a.g[1];var g=a.g[2],k=a.g[3],h=a.g[4];for(e=0;80>e;e++){if(40>e)if(20>e){f=k^c&(g^k);var l=1518500249}else f=c^g^k,l=1859775393;else 60>e?(f=c&g|k&(c|g),l=2400959708):
(f=c^g^k,l=3395469782);f=(b<<5|b>>>27)+f+h+l+d[e]&4294967295;h=k;k=g;g=(c<<30|c>>>2)&4294967295;c=b;b=f}a.g[0]=a.g[0]+b&4294967295;a.g[1]=a.g[1]+c&4294967295;a.g[2]=a.g[2]+g&4294967295;a.g[3]=a.g[3]+k&4294967295;a.g[4]=a.g[4]+h&4294967295};
Fd.prototype.update=function(a,b){if(null!=a){void 0===b&&(b=a.length);for(var c=b-this.blockSize,d=0,e=this.M,f=this.v;d<b;){if(0==f)for(;d<=c;)Gd(this,a,d),d+=this.blockSize;if("string"===typeof a)for(;d<b;){if(e[f]=a.charCodeAt(d),++f,++d,f==this.blockSize){Gd(this,e);f=0;break}}else for(;d<b;)if(e[f]=a[d],++f,++d,f==this.blockSize){Gd(this,e);f=0;break}}this.v=f;this.K+=b}};
Fd.prototype.digest=function(){var a=[],b=8*this.K;56>this.v?this.update(this.J,56-this.v):this.update(this.J,this.blockSize-(this.v-56));for(var c=this.blockSize-1;56<=c;c--)this.M[c]=b&255,b/=256;Gd(this,this.M);for(c=b=0;5>c;c++)for(var d=24;0<=d;d-=8)a[b]=this.g[c]>>d&255,++b;return a};var Hd=function(){this.T=new Fd};Hd.prototype.reset=function(){this.T.reset()};var Id=y.crypto,Jd=!1,Kd=0,Ld=0,Md=1,Nd=0,Od="",Pd=function(a){a=a||y.event;var b=a.screenX+a.clientX<<16;b+=a.screenY+a.clientY;b*=(new Date).getTime()%1E6;Md=Md*b%Nd;0<Kd&&++Ld==Kd&&Mb("mousemove",Pd,"remove","de")},Qd=function(a){var b=new Hd;a=unescape(encodeURIComponent(a));for(var c=[],d=0,e=a.length;d<e;++d)c.push(a.charCodeAt(d));b.T.update(c);b=b.T.digest();a="";for(c=0;c<b.length;c++)a+="0123456789ABCDEF".charAt(Math.floor(b[c]/16))+"0123456789ABCDEF".charAt(b[c]%16);return a};
Jd=!!Id&&"function"==typeof Id.getRandomValues;Jd||(Nd=1E6*(screen.width*screen.width+screen.height),Od=Qd(A.cookie+"|"+A.location+"|"+(new Date).getTime()+"|"+Math.random()),Kd=U("random/maxObserveMousemove")||0,0!=Kd&&Mb("mousemove",Pd,"add","at"));var Rd=function(){var a=M.onl;if(!a){a=C();M.onl=a;var b=C();a.e=function(c){var d=b[c];d&&(delete b[c],d())};a.a=function(c,d){b[c]=d};a.r=function(c){delete b[c]}}return a},Sd=function(a,b){b=b.onload;return"function"===typeof b?(Rd().a(a,b),b):null},Td=function(a){F(/^\w+$/.test(a),"Unsupported id - "+a);return'onload="window.___jsl.onl.e(&#34;'+a+'&#34;)"'},Ud=function(a){Rd().r(a)};var Vd={allowtransparency:"true",frameborder:"0",hspace:"0",marginheight:"0",marginwidth:"0",scrolling:"no",style:"",tabindex:"0",vspace:"0",width:"100%"},Wd={allowtransparency:!0,onload:!0},Xd=0,Yd=function(a){F(!a||Kb.test(a),"Illegal url for new iframe - "+a)},Zd=function(a,b,c,d,e){Yd(c.src);var f,g=Sd(d,c),k=g?Td(d):"";try{document.all&&(f=a.createElement('<iframe frameborder="'+wb(String(c.frameborder))+'" scrolling="'+wb(String(c.scrolling))+'" '+k+' name="'+wb(String(c.name))+'"/>'))}catch(l){}finally{f||
(f=(a?new lb(kb(a)):va||(va=new lb)).ma("IFRAME"),g&&(f.onload=function(){f.onload=null;g.call(this)},Ud(d)))}f.setAttribute("ng-non-bindable","");for(var h in c)a=c[h],"style"===h&&"object"===typeof a?E(a,f.style):Wd[h]||f.setAttribute(h,String(a));(h=e&&e.beforeNode||null)||e&&e.dontclear||Rb(b);b.insertBefore(f,h);f=h?h.previousSibling:b.lastChild;c.allowtransparency&&(f.allowTransparency=!0);return f};var $d=/^:[\w]+$/,ae=/:([a-zA-Z_]+):/g,be=function(){var a=Yc()||"0",b=Zc();var c=Yc()||a;var d=Zc(),e="";c&&(e+="u/"+encodeURIComponent(String(c))+"/");d&&(e+="b/"+encodeURIComponent(String(d))+"/");c=e||null;(e=(d=!1===U("isLoggedIn"))?"_/im/":"")&&(c="");var f=U("iframes/:socialhost:"),g=U("iframes/:im_socialhost:");return Lb={socialhost:f,ctx_socialhost:d?g:f,session_index:a,session_delegate:b,session_prefix:c,im_prefix:e}},ce=function(a,b){return be()[b]||""},de=function(a){return function(b,
c){return a?be()[c]||a[c]||"":be()[c]||""}};var ee=function(a){var b;a.match(/^https?%3A/i)&&(b=decodeURIComponent(a));a=b?b:a;return Jb(document,a)},fe=function(a){a=a||"canonical";for(var b=document.getElementsByTagName("link"),c=0,d=b.length;c<d;c++){var e=b[c],f=e.getAttribute("rel");if(f&&f.toLowerCase()==a&&(e=e.getAttribute("href"))&&(e=ee(e))&&null!=e.match(/^https?:\/\/[\w\-_\.]+/i))return e}return window.location.href};var ge={se:"0"},he={post:!0},ie={style:"position:absolute;top:-10000px;width:450px;margin:0px;border-style:none"},je="onPlusOne _ready _close _open _resizeMe _renderstart oncircled drefresh erefresh".split(" "),ke=B(M,"WI",C()),le=function(a,b,c){var d;var e={};var f=d=a;"plus"==a&&b.action&&(d=a+"_"+b.action,f=a+"/"+b.action);(d=S("iframes/"+d+"/url"))||(d=":im_socialhost:/:session_prefix::im_prefix:_/widget/render/"+f+"?usegapi=1");for(var g in ge)e[g]=g+"/"+(b[g]||ge[g])+"/";e=Jb(A,d.replace(ae,
de(e)));g="iframes/"+a+"/params/";f={};E(b,f);(d=S("lang")||S("gwidget/lang"))&&(f.hl=d);he[a]||(f.origin=window.location.origin||window.location.protocol+"//"+window.location.host);f.exp=S(g+"exp");if(g=S(g+"location"))for(d=0;d<g.length;d++){var k=g[d];f[k]=y.location[k]}switch(a){case "plus":case "follow":g=f.href;d=b.action?void 0:"publisher";g=(g="string"==typeof g?g:void 0)?ee(g):fe(d);f.url=g;delete f.href;break;case "plusone":g=(g=b.href)?ee(g):fe();f.url=g;g=b.db;d=S();null==g&&d&&(g=d.db,
null==g&&(g=d.gwidget&&d.gwidget.db));f.db=g||void 0;g=b.ecp;d=S();null==g&&d&&(g=d.ecp,null==g&&(g=d.gwidget&&d.gwidget.ecp));f.ecp=g||void 0;delete f.href;break;case "signin":f.url=fe()}M.ILI&&(f.iloader="1");delete f["data-onload"];delete f.rd;for(var h in ge)f[h]&&delete f[h];f.gsrc=S("iframes/:source:");h=S("inline/css");"undefined"!==typeof h&&0<c&&h>=c&&(f.ic="1");h=/^#|^fr-/;c={};for(var l in f)D(f,l)&&h.test(l)&&(c[l.replace(h,"")]=f[l],delete f[l]);l="q"==S("iframes/"+a+"/params/si")?f:
c;h=Oc();for(var n in h)!D(h,n)||D(f,n)||D(c,n)||(l[n]=h[n]);n=[].concat(je);(l=S("iframes/"+a+"/methods"))&&"object"===typeof l&&ob.test(l.push)&&(n=n.concat(l));for(var q in b)D(b,q)&&/^on/.test(q)&&("plus"!=a||"onconnect"!=q)&&(n.push(q),delete f[q]);delete f.callback;c._methods=n.join(",");return Hb(e,f,c)},me=["style","data-gapiscan"],oe=function(a){for(var b=C(),c=0!=a.nodeName.toLowerCase().indexOf("g:"),d=a.attributes.length,e=0;e<d;e++){var f=a.attributes[e],g=f.name,k=f.value;0<=pb.call(me,
g)||c&&0!=g.indexOf("data-")||"null"===k||"specified"in f&&!f.specified||(c&&(g=g.substr(5)),b[g.toLowerCase()]=k)}a=a.style;(c=ne(a&&a.height))&&(b.height=String(c));(a=ne(a&&a.width))&&(b.width=String(a));return b},ne=function(a){var b=void 0;"number"===typeof a?b=a:"string"===typeof a&&(b=parseInt(a,10));return b},re=function(){var a=M.drw;Uc(function(b){if(a!==b.id&&4!=b.state&&"share"!=b.type){var c=b.id,d=b.type,e=b.url;b=b.userParams;var f=A.getElementById(c);if(f){var g=le(d,b,0);g?(f=f.parentNode,
pe(e)!==pe(g)&&(b.dontclear=!0,b.rd=!0,b.ri=!0,b.type=d,qe(f,b),(d=T[f.lastChild.id])&&(d.oid=c),Vc(c,4))):delete T[c]}else delete T[c]}})},pe=function(a){var b=RegExp("(\\?|&)ic=1");return a.replace(/#.*/,"").replace(b,"")};var se,te,ue,ve,we,xe=/(?:^|\s)g-((\S)*)(?:$|\s)/,ye={plusone:!0,autocomplete:!0,profile:!0,signin:!0,signin2:!0};se=B(M,"SW",C());te=B(M,"SA",C());ue=B(M,"SM",C());ve=B(M,"FW",[]);we=null;
var ze=function(a,b){return("string"===typeof a?document.getElementById(a):a)||b},Be=function(a,b){Ae(void 0,!1,a,b)},Ae=function(a,b,c,d){N("ps0",!0);c=ze(c,A);var e=A.documentMode;if(c.querySelectorAll&&(!e||8<e)){e=d?[d]:xb(se).concat(xb(te)).concat(xb(ue));for(var f=[],g=0;g<e.length;g++){var k=e[g];f.push(".g-"+k,"g\\:"+k)}e=c.querySelectorAll(f.join(","))}else e=c.getElementsByTagName("*");c=C();for(f=0;f<e.length;f++){g=e[f];k=d;var h=g.nodeName.toLowerCase(),l=void 0;if(g.getAttribute("data-gapiscan"))k=
null;else{var n=h.indexOf("g:");0==n?l=h.substr(2):(n=(n=String(g.className||g.getAttribute("class")))&&xe.exec(n))&&(l=n[1]);k=!l||!(se[l]||te[l]||ue[l])||k&&l!==k?null:l}k&&(ye[k]||0==g.nodeName.toLowerCase().indexOf("g:")||0!=xb(oe(g)).length)&&(g.setAttribute("data-gapiscan",!0),B(c,k,[]).push(g))}if(b)for(var q in c)for(b=c[q],d=0;d<b.length;d++)b[d].setAttribute("data-onload",!0);for(var p in c)ve.push(p);N("ps1",!0);if((q=ve.join(":"))||a)try{H.load(q,a)}catch(z){Rc.log(z);return}if(Ce(we||
{}))for(var J in c){a=c[J];p=0;for(b=a.length;p<b;p++)a[p].removeAttribute("data-gapiscan");De(J)}else{d=[];for(J in c)for(a=c[J],p=0,b=a.length;p<b;p++)e=a[p],Ee(J,e,oe(e),d,b);Fe(q,d)}},Ge=function(a){var b=B(H,a,{});b.go||(b.go=function(c){return Be(c,a)},b.render=function(c,d){d=d||{};d.type=a;return qe(c,d)})},He=function(a){se[a]=!0},Ie=function(a){te[a]=!0},Je=function(a){ue[a]=!0};var De=function(a,b){var c=Vb(a);b&&c?(c(b),(c=b.iframeNode)&&c.setAttribute("data-gapiattached",!0)):H.load(a,function(){var d=Vb(a),e=b&&b.iframeNode,f=b&&b.userParams;e&&d?(d(b),e.setAttribute("data-gapiattached",!0)):(d=H[a].go,"signin2"==a?d(e,f):d(e&&e.parentNode,f))})},Ce=function(){return!1},Fe=function(){},Ee=function(a,b,c,d,e,f){switch(Ke(b,a,f)){case 0:a=ue[a]?a+"_annotation":a;d={};d.iframeNode=b;d.userParams=c;De(a,d);break;case 1:if(b.parentNode){for(var g in c){if(f=D(c,g))f=c[g],
f=!!f&&"object"===typeof f&&(!f.toString||f.toString===Object.prototype.toString||f.toString===Array.prototype.toString);if(f)try{c[g]=Bd(c[g])}catch(G){delete c[g]}}var k=!0;c.dontclear&&(k=!1);delete c.dontclear;Tc();f=le(a,c,e);g={allowPost:1,attributes:ie};g.dontclear=!k;e={};e.userParams=c;e.url=f;e.type=a;if(c.rd)var h=b;else h=document.createElement("div"),b.setAttribute("data-gapistub",!0),h.style.cssText="position:absolute;width:450px;left:-10000px;",b.parentNode.insertBefore(h,b);e.siteElement=
h;h.id||(b=h,B(ke,a,0),k="___"+a+"_"+ke[a]++,b.id=k);b=C();b[">type"]=a;E(c,b);k=f;c=h;f=g||{};b=f.attributes||{};F(!(f.allowPost||f.forcePost)||!b.onload,"onload is not supported by post iframe (allowPost or forcePost)");g=b=k;$d.test(b)&&(g=U("iframes/"+g.substring(1)+"/url"),F(!!g,"Unknown iframe url config for - "+b));k=Jb(A,g.replace(ae,ce));b=c.ownerDocument||A;h=0;do g=f.id||["I",Xd++,"_",(new Date).getTime()].join("");while(b.getElementById(g)&&5>++h);F(5>h,"Error creating iframe id");h={};
var l={};b.documentMode&&9>b.documentMode&&(h.hostiemode=b.documentMode);E(f.queryParams||{},h);E(f.fragmentParams||{},l);var n=f.pfname;var q=C();U("iframes/dropLegacyIdParam")||(q.id=g);q._gfid=g;q.parent=b.location.protocol+"//"+b.location.host;var p=I(b.location.href,"parent");n=n||"";!n&&p&&(p=I(b.location.href,"_gfid","")||I(b.location.href,"id",""),n=I(b.location.href,"pfname",""),n=p?n+"/"+p:"");n||(p=Ad(I(b.location.href,"jcp","")))&&"object"==typeof p&&(n=(n=p.id)?p.pfname+"/"+n:"");q.pfname=
n;f.connectWithJsonParam&&(p={},p.jcp=Bd(q),q=p);p=I(k,"rpctoken")||h.rpctoken||l.rpctoken;if(!p){if(!(p=f.rpctoken)){p=String;n=Math;var J=n.round;if(Jd){var z=new y.Uint32Array(1);Id.getRandomValues(z);z=Number("0."+z[0])}else z=Md,z+=parseInt(Od.substr(0,20),16),Od=Qd(Od),z/=Nd+Math.pow(16,20);p=p(J.call(n,1E8*z))}q.rpctoken=p}f.rpctoken=p;E(q,f.connectWithQueryParams?h:l);p=b.location.href;q=C();(n=I(p,"_bsh",M.bsh))&&(q._bsh=n);(p=Tb(p))&&(q.jsh=p);f.hintInFragment?E(q,l):E(q,h);k=Hb(k,h,l,f.paramsSerializer);
l=C();E(Vd,l);E(f.attributes,l);l.name=l.id=g;l.src=k;f.eurl=k;h=f||{};q=!!h.allowPost;if(h.forcePost||q&&2E3<k.length){h=Eb(k);l.src="";f.dropDataPostorigin||(l["data-postorigin"]=k);k=Zd(b,c,l,g);if(-1!=navigator.userAgent.indexOf("WebKit")){var w=k.contentWindow.document;w.open();l=w.createElement("div");q={};p=g+"_inner";q.name=p;q.src="";q.style="display:none";Zd(b,l,q,p,f)}l=(f=h.query[0])?f.split("&"):[];f=[];for(q=0;q<l.length;q++)p=l[q].split("=",2),f.push([decodeURIComponent(p[0]),decodeURIComponent(p[1])]);
h.query=[];l=Fb(h);F(Kb.test(l),"Invalid URL: "+l);h=b.createElement("form");h.method="POST";h.target=g;h.style.display="none";g=l instanceof x?l:Ma(l);eb(h,"FORM").action=Ka(g);for(g=0;g<f.length;g++)l=b.createElement("input"),l.type="hidden",l.name=f[g][0],l.value=f[g][1],h.appendChild(l);c.appendChild(h);h.submit();h.parentNode.removeChild(h);w&&w.close();w=k}else w=Zd(b,c,l,g,f);e.iframeNode=w;e.id=w.getAttribute("id");w=e.id;c=C();c.id=w;c.userParams=e.userParams;c.url=e.url;c.type=e.type;c.state=
1;T[w]=c;w=e}else w=null;w&&((e=w.id)&&d.push(e),De(a,w))}},Ke=function(a,b,c){if(a&&1===a.nodeType&&b){if(c)return 1;if(ue[b]){if(Sb[a.nodeName.toLowerCase()])return(a=a.innerHTML)&&a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")?0:1}else{if(te[b])return 0;if(se[b])return 1}}return null},qe=function(a,b){var c=b.type;delete b.type;var d=ze(a);if(d){a={};for(var e in b)D(b,e)&&(a[e.toLowerCase()]=b[e]);a.rd=1;(b=!!a.ri)&&delete a.ri;e=[];Ee(c,d,a,e,0,b);Fe(c,e)}else Rc.log("string"==="gapi."+c+".render: missing element "+
typeof a?a:"")};B(H,"platform",{}).go=Be;Ce=function(a){for(var b=["_c","jsl","h"],c=0;c<b.length&&a;c++)a=a[b[c]];b=Tb(mb.href);return!a||0!=a.indexOf("n;")&&0!=b.indexOf("n;")&&a!==b};Fe=function(a,b){Le(a,b)};var Ob=function(a){Ae(a,!0)},Me=function(a,b){b=b||[];for(var c=0;c<b.length;++c)a(b[c]);for(a=0;a<b.length;a++)Ge(b[a])};
O.push(["platform",function(a,b,c){we=c;(b||c.features)&&ve.push(b||c.features.join(":"));Me(He,a);Me(Ie,c._c.annotation);Me(Je,c._c.bimodal);Kc();Ic();if("explicit"!=S("parsetags")){Ub(a);Pc(Oc())&&!S("disableRealtimeCallback")&&Tc();if(c&&(a=c.callback)){var d=yb(a);delete c.callback}Qb(function(){Ob(d)})}}]);H._pl=!0;var Ne=function(a){a=(a=T[a])?a.oid:void 0;if(a){var b=A.getElementById(a);b&&b.parentNode.removeChild(b);delete T[a];Ne(a)}};var Oe=/^\{h:'/,Pe=/^!_/,Qe="",Le=function(a,b){function c(){Mb("message",d,"remove","de")}function d(f){var g=f.data,k=f.origin;if(Re(g,b)){var h=e;e=!1;h&&N("rqe");Se(a,function(){h&&N("rqd");c();for(var l=B(M,"RPMQ",[]),n=0;n<l.length;n++)l[n]({data:g,origin:k})})}}if(0!==b.length){Qe=I(mb.href,"pfname","");var e=!0;Mb("message",d,"add","at");Bc(a,c)}},Re=function(a,b){a=String(a);if(Oe.test(a))return!0;var c=!1;Pe.test(a)&&(c=!0,a=a.substr(2));if(!/^\{/.test(a))return!1;var d=Ad(a);if(!d)return!1;
a=d.f;if(d.s&&a&&-1!=pb.call(b,a)){if("_renderstart"===d.s||d.s===Qe+"/"+a+"::_renderstart")if(d=d.a&&d.a[c?0:1],b=A.getElementById(a),Vc(a,2),d&&b&&d.width&&d.height){a:{c=b.parentNode;a=d||{};if(Sc()){var e=b.id;if(e){d=(d=T[e])?d.state:void 0;if(1===d||4===d)break a;Ne(e)}}(d=c.nextSibling)&&d.getAttribute&&d.getAttribute("data-gapistub")&&(c.parentNode.removeChild(d),c.style.cssText="");d=a.width;var f=a.height,g=c.style;g.textIndent="0";g.margin="0";g.padding="0";g.background="transparent";g.borderStyle=
"none";g.cssFloat="none";g.styleFloat="none";g.lineHeight="normal";g.fontSize="1px";g.verticalAlign="baseline";c=c.style;c.display="inline-block";g=b.style;g.position="static";g.left="0";g.top="0";g.visibility="visible";d&&(c.width=g.width=d+"px");f&&(c.height=g.height=f+"px");a.verticalAlign&&(c.verticalAlign=a.verticalAlign);e&&Vc(e,3)}b["data-csi-wdt"]=(new Date).getTime()}return!0}return!1},Se=function(a,b){Bc(a,b)};var Te=function(a,b){this.P=a;a=b||{};this.qa=Number(a.maxAge)||0;this.aa=a.domain;this.da=a.path;this.ra=!!a.secure};Te.prototype.read=function(){for(var a=this.P+"=",b=document.cookie.split(/;\s*/),c=0;c<b.length;++c){var d=b[c];if(0==d.indexOf(a))return d.substr(a.length)}};
Te.prototype.write=function(a,b){if(!Ue.test(this.P))throw"Invalid cookie name";if(!Ve.test(a))throw"Invalid cookie value";a=this.P+"="+a;this.aa&&(a+=";domain="+this.aa);this.da&&(a+=";path="+this.da);b="number"===typeof b?b:this.qa;if(0<=b){var c=new Date;c.setSeconds(c.getSeconds()+b);a+=";expires="+c.toUTCString()}this.ra&&(a+=";secure");document.cookie=a;return!0};Te.prototype.clear=function(){this.write("",0)};var Ve=/^[-+/_=.:|%&a-zA-Z0-9@]*$/,Ue=/^[A-Z_][A-Z0-9_]{0,63}$/;
Te.iterate=function(a){for(var b=document.cookie.split(/;\s*/),c=0;c<b.length;++c){var d=b[c].split("="),e=d.shift();a(e,d.join("="))}};var We=function(a){this.H=a};We.prototype.read=function(){if(Z.hasOwnProperty(this.H))return Z[this.H]};We.prototype.write=function(a){Z[this.H]=a;return!0};We.prototype.clear=function(){delete Z[this.H]};var Z={};We.iterate=function(a){for(var b in Z)Z.hasOwnProperty(b)&&a(b,Z[b])};var Xe="https:"===window.location.protocol,Ye=Xe||"http:"===window.location.protocol?Te:We,Ze=function(a){var b=a.substr(1),c="",d=window.location.hostname;if(""!==b){c=parseInt(b,10);if(isNaN(c))return null;b=d.split(".");if(b.length<c-1)return null;b.length==c-1&&(d="."+d)}else d="";return{l:"S"==a.charAt(0),domain:d,o:c}},$e=function(){var a,b=null;Ye.iterate(function(c,d){0===c.indexOf("G_AUTHUSER_")&&(c=Ze(c.substring(11)),!a||c.l&&!a.l||c.l==a.l&&c.o>a.o)&&(a=c,b=d)});return{la:a,L:b}};function af(a){if(0!==a.indexOf("GCSC"))return null;var b={ca:!1};a=a.substr(4);if(!a)return b;var c=a.charAt(0);a=a.substr(1);var d=a.lastIndexOf("_");if(-1==d)return b;var e=Ze(a.substr(d+1));if(null==e)return b;a=a.substring(0,d);if("_"!==a.charAt(0))return b;d="E"===c&&e.l;return!d&&("U"!==c||e.l)||d&&!Xe?b:{ca:!0,l:d,va:a.substr(1),domain:e.domain,o:e.o}}
var bf=function(a){if(!a)return[];a=a.split("=");return a[1]?a[1].split("|"):[]},cf=function(a){a=a.split(":");return{clientId:a[0].split("=")[1],ta:bf(a[1]),xa:bf(a[2]),wa:bf(a[3])}},df=function(){var a=$e(),b=a.la;a=a.L;if(null!==a){var c;Ye.iterate(function(f,g){(f=af(f))&&f.ca&&f.l==b.l&&f.o==b.o&&(c=g)});if(c){var d=cf(c),e=d&&d.ta[Number(a)];d=d&&d.clientId;if(e)return{L:a,sa:e,clientId:d}}}return null};var ff=function(){this.Y=ef};m=ff.prototype;m.ga=function(){this.O||(this.A=0,this.O=!0,this.ea())};m.ea=function(){this.O&&(this.Y()?this.A=this.V:this.A=Math.min(2*(this.A||this.V),120),window.setTimeout(qa(this.ea,this),1E3*this.A))};m.A=0;m.V=2;m.Y=null;m.O=!1;var gf=null;Sc=function(){return M.oa=!0};Tc=function(){M.oa=!0;var a=df();(a=a&&a.L)&&Jc("googleapis.config/sessionIndex",a);gf||(gf=B(M,"ss",new ff));a=gf;a.ga&&a.ga()};
var ef=function(){var a=df(),b=a&&a.sa||null,c=a&&a.clientId;Bc("auth",{callback:function(){var d=y.gapi.auth,e={client_id:c,session_state:b};d.checkSessionState(e,function(f){var g=e.session_state,k=!!S("isLoggedIn");f=S("debug/forceIm")?!1:g&&f||!g&&!f;if(k=k!==f)Jc("isLoggedIn",f),Tc(),re(),f||((f=d.signOut)?f():(f=d.setToken)&&f(null));f=Oc();var h=S("savedUserState");g=d._guss(f.cookiepolicy);h=h!=g&&"undefined"!=typeof h;Jc("savedUserState",g);(k||h)&&Pc(f)&&!S("disableRealtimeCallback")&&d._pimf(f,
!0)})}});return!0};O.unshift(["url",function(a,b,c){!a||b&&""!==b||!a.endsWith(".js")||(a=a.substring(0,a.length-3),b=a.lastIndexOf("/")+1,b>=a.length||(a=a.substr(b).split(":").filter(function(d){return!["api","platform"].includes(d)}),c.features=a))}]);N("bs0",!0,window.gapi._bs);N("bs1",!0);delete window.gapi._bs;window.gapi.load("",{callback:window["gapi_onload"],_c:{url:"https://apis.google.com/js/plusone.js",jsl:{ci:{"oauth-flow":{authUrl:"https://accounts.google.com/o/oauth2/auth",proxyUrl:"https://accounts.google.com/o/oauth2/postmessageRelay",disableOpt:!0,idpIframeUrl:"https://accounts.google.com/o/oauth2/iframe",usegapi:!1},debug:{reportExceptionRate:1,forceIm:!1,rethrowException:!0,host:"https://apis.google.com"},enableMultilogin:!0,"googleapis.config":{auth:{useFirstPartyAuthV2:!0},root:"https://content.googleapis.com","root-1p":"https://clients6.google.com"},inline:{css:1},
disableRealtimeCallback:!1,drive_share:{skipInitCommand:!0},csi:{rate:.01},client:{cors:!1},signInDeprecation:{rate:0},include_granted_scopes:!0,llang:"fr",iframes:{youtube:{params:{location:["search","hash"]},url:":socialhost:/:session_prefix:_/widget/render/youtube?usegapi=1",methods:["scroll","openwindow"]},ytsubscribe:{url:"https://www.youtube.com/subscribe_embed?usegapi=1"},plus_circle:{params:{url:""},url:":socialhost:/:session_prefix::se:_/widget/plus/circle?usegapi=1"},plus_share:{params:{url:""},
url:":socialhost:/:session_prefix::se:_/+1/sharebutton?plusShare=true&usegapi=1"},rbr_s:{params:{url:""},url:":socialhost:/:session_prefix::se:_/widget/render/recobarsimplescroller"},":source:":"3p",playemm:{url:"https://play.google.com/work/embedded/search?usegapi=1&usegapi=1"},savetoandroidpay:{url:"https://pay.google.com/gp/v/widget/save"},blogger:{params:{location:["search","hash"]},url:":socialhost:/:session_prefix:_/widget/render/blogger?usegapi=1",methods:["scroll","openwindow"]},evwidget:{params:{url:""},
url:":socialhost:/:session_prefix:_/events/widget?usegapi=1"},partnersbadge:{url:"https://www.gstatic.com/partners/badge/templates/badge.html?usegapi=1"},dataconnector:{url:"https://dataconnector.corp.google.com/:session_prefix:ui/widgetview?usegapi=1"},surveyoptin:{url:"https://www.google.com/shopping/customerreviews/optin?usegapi=1"},":socialhost:":"https://apis.google.com",shortlists:{url:""},hangout:{url:"https://talkgadget.google.com/:session_prefix:talkgadget/_/widget"},plus_followers:{params:{url:""},
url:":socialhost:/_/im/_/widget/render/plus/followers?usegapi=1"},post:{params:{url:""},url:":socialhost:/:session_prefix::im_prefix:_/widget/render/post?usegapi=1"},signin:{params:{url:""},url:":socialhost:/:session_prefix:_/widget/render/signin?usegapi=1",methods:["onauth"]},rbr_i:{params:{url:""},url:":socialhost:/:session_prefix::se:_/widget/render/recobarinvitation"},share:{url:":socialhost:/:session_prefix::im_prefix:_/widget/render/share?usegapi=1"},plusone:{params:{count:"",size:"",url:""},
url:":socialhost:/:session_prefix::se:_/+1/fastbutton?usegapi=1"},comments:{params:{location:["search","hash"]},url:":socialhost:/:session_prefix:_/widget/render/comments?usegapi=1",methods:["scroll","openwindow"]},":im_socialhost:":"https://plus.googleapis.com",backdrop:{url:"https://clients3.google.com/cast/chromecast/home/widget/backdrop?usegapi=1"},visibility:{params:{url:""},url:":socialhost:/:session_prefix:_/widget/render/visibility?usegapi=1"},autocomplete:{params:{url:""},url:":socialhost:/:session_prefix:_/widget/render/autocomplete"},
":signuphost:":"https://plus.google.com",ratingbadge:{url:"https://www.google.com/shopping/customerreviews/badge?usegapi=1"},appcirclepicker:{url:":socialhost:/:session_prefix:_/widget/render/appcirclepicker"},follow:{url:":socialhost:/:session_prefix:_/widget/render/follow?usegapi=1"},community:{url:":ctx_socialhost:/:session_prefix::im_prefix:_/widget/render/community?usegapi=1"},sharetoclassroom:{url:"https://classroom.google.com/sharewidget?usegapi=1"},ytshare:{params:{url:""},url:":socialhost:/:session_prefix:_/widget/render/ytshare?usegapi=1"},
plus:{url:":socialhost:/:session_prefix:_/widget/render/badge?usegapi=1"},family_creation:{params:{url:""},url:"https://families.google.com/webcreation?usegapi=1&usegapi=1"},commentcount:{url:":socialhost:/:session_prefix:_/widget/render/commentcount?usegapi=1"},configurator:{url:":socialhost:/:session_prefix:_/plusbuttonconfigurator?usegapi=1"},zoomableimage:{url:"https://ssl.gstatic.com/microscope/embed/"},appfinder:{url:"https://workspace.google.com/:session_prefix:marketplace/appfinder?usegapi=1"},savetowallet:{url:"https://pay.google.com/gp/v/widget/save"},
person:{url:":socialhost:/:session_prefix:_/widget/render/person?usegapi=1"},savetodrive:{url:"https://drive.google.com/savetodrivebutton?usegapi=1",methods:["save"]},page:{url:":socialhost:/:session_prefix:_/widget/render/page?usegapi=1"},card:{url:":socialhost:/:session_prefix:_/hovercard/card"}}},h:"m;/_/scs/abc-static/_/js/k=gapi.lb.fr.CAOyDGt5mKU.O/d=1/rs=AHpOoo_3N2T_xTSzzfu-Lp8hVcRjkVoYFQ/m=__features__",u:"https://apis.google.com/js/plusone.js",hee:!0,dpo:!1,le:["scs"],glrp:false},platform:"backdrop blogger comments commentcount community donation family_creation follow hangout health page partnersbadge person playemm playreview plus plusone post ratingbadge savetoandroidpay savetodrive savetowallet sharetoclassroom shortlists signin2 surveyoptin visibility youtube ytsubscribe zoomableimage".split(" "),
annotation:["interactivepost","recobar","signin2","autocomplete"]}});}).call(this);

View File

@ -0,0 +1,30 @@
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());

View File

@ -0,0 +1,608 @@
// **Sphere** renders a mathematically perfect textured sphere.
// It calculates the surface of the sphere instead of approximating it with triangles.
// Shamefully hacked by Sébastien Drouyer
/*jshint laxcomma: true, laxbreak: true, browser: true */
(function() {
"use strict";
var opts = { tilt: 40
, turn: 20
};
// Tiling informations
var tiling = {
horizontal: 1,
vertical: 1
};
// frame count, current angle of rotation. inc/dec to turn.
var gCtx;
var gImage, gCtxImg;
//Variable to hold the size of the canvas
var size;
var canvasImageData, textureImageData;
// Constants for indexing dimentions
var X=0, Y=1, Z=2;
var textureWidth, textureHeight;
var hs=30; // Horizontal scale of viewing area
var vs=30; // Vertical scale of viewing area
// NB The viewing area is an abstract rectangle in the 3d world and is not
// the same as the canvas used to display the image.
var F = [0,0,0]; // Focal point of viewer
var S = [0,30,0]; // Centre of sphere/planet
var r=12; // Radius of sphere/planet
// Distance of the viewing area from the focal point. This seems
// to give strange results if it is not equal to S[Y]. It should
// theoreticaly be changable but hs & vs can still be used along
// with r to change how large the sphere apears on the canvas.
// HOWEVER, the values of hs, vs, S[Y], f & r MUST NOT BE TOO BIG
// as this will result in overflow errors which are not traped
// and do not stop the script but will result in incorrect
// displaying of the texture upon the sphere.
var f = 30;
// There may be a solution to the above problem by finding L in
// a slightly different way.
// Since the problem is equivelent to finding the intersection
// in 2D space of a line and a circle then each view area pixel
// and associated vector can be used define a 2D plane in the 3D
// space that 'contains' the vector S-F which is the focal point
// to centre of the sphere.
//
// This is essentialy the same problem but I belive/hope it will
// not result in the same exact solution. I have hunch that the
// math will not result in such big numbers. Since this abstract
// plane will be spinning, it may be posilbe to use the symetry
// of the arangement to reuse 1/4 of the calculations.
// Variables to hold rotations about the 3 axis
var RX = 0,RY,RZ;
// Temp variables to hold them whilst rendering so they won't get updated.
var rx,ry,rz;
var a;
var b;
var b2; // b squared
var bx=F[X]-S[X]; // = 0 for current values of F and S
var by=F[Y]-S[Y];
var bz=F[Z]-S[Z]; // = 0 for current values of F and S
// c = Fx^2 + Sx^2 -2FxSx + Fy^2 + Sy^2 -2FySy + Fz^2 + Sz^2 -2FzSz - r^2
// for current F and S this means c = Sy^2 - r^2
var c = F[X]*F[X] + S[X]*S[X]
+ F[Y]*F[Y] + S[Y]*S[Y]
+ F[Z]*F[Z] + S[Z]*S[Z]
- 2*(F[X]*S[X] + F[Y]*S[Y] + F[Z]*S[Z])
- r*r
;
var c4 = c*4; // save a bit of time maybe during rendering
var s;
var m1 = 0;
//double m2 = 0;
// The following are use to calculate the vector of the current pixel to be
// drawn from the focus position F
var hs_ch; // horizontal scale divided by canvas width
var vs_cv; // vertical scale divided by canvas height
var hhs = 0.5*hs; // half horizontal scale
var hvs = 0.5*vs; // half vertical scale
var V = new Array(3); // vector for storing direction of each pixel from F
var L = new Array(3); // Location vector from S that pixel 'hits' sphere
var VY2=f*f; // V[Y] ^2 NB May change if F changes
var rotCache = {};
var calculateVector = function(h,v) {
// Calculate vector from focus point (Origin, so can ignor) to pixel
V[X]=(hs_ch*h)-hhs;
// V[Y] always the same as view frame doesn't mov
V[Z]=(vs_cv*v)-hvs;
// Vector (L) from S where m*V (m is an unknown scalar) intersects
// surface of sphere is as follows
//
// <pre>
// L = F + mV - S
//
// ,-------.
// / \ -----m------
// | S<-L->| <-V->F
// \ /
// `-------'
//
// L and m are unknown so find magnitude of vectors as the magnitude
// of L is the radius of the sphere
//
// |L| = |F + mV - S| = r
//
// Can be rearranged to form a quadratic
//
// 0 = am&sup2; +bm + c
//
// and solved to find m, using the following formula
//
// <pre>
// ___________
// m = ( -b &PlusMinus; \/(b&sup2;) - 4ac ) /2a
// </pre>
//
// r = |F + mV - S|
// __________________________________________________
// r = v(Fx + mVx -Sx)&sup2; + (Fy + mVy -Sy)&sup2; + (Fz + mVz -Sz)&sup2;
//
// r&sup2; = (Fx + mVx -Sx)&sup2; + (Fy + mVy -Sy)&sup2; + (Fz + mVz -Sz)&sup2;
//
// r&sup2; = (Fx + mVx -Sx)&sup2; + (Fy + mVy -Sy)&sup2; + (Fz + mVz -Sz)&sup2;
//
// 0 = Fx&sup2; + FxVxm -FxSx + FxVxm + Vx&sup2;m&sup2; -SxVxm -SxFx -SxVxm + Sx&sup2;
// +Fy&sup2; + FyVym -FySy + FyVym + Vy&sup2;m&sup2; -SyVym -SyFy -SyVym + Sy&sup2;
// +Fz&sup2; + FzVzm -FzSz + FzVzm + Vz&sup2;m&sup2; -SzVzm -SzFz -SzVzm + Sz&sup2; - r&sup2;
//
// 0 = Vx&sup2;m&sup2; + FxVxm + FxVxm -2SxVxm + Fx&sup2; -FxSx -SxFx + Sx&sup2;
// +Vy&sup2;m&sup2; + FyVym + FyVym -2SyVym + Fy&sup2; -FySy -SyFy + Sy&sup2;
// +Vz&sup2;m&sup2; + FzVzm + FzVzm -2SzVzm + Fz&sup2; -FzSz -SzFz + Sz&sup2; - r&sup2;
//
// 0 = (Vx&sup2; + Vy&sup2; + Vz&sup2;)m&sup2; + (FxVx + FxVx -2SxVx)m + Fx&sup2; - 2FxSx + Sx&sup2;
// + (FyVy + FyVy -2SyVy)m + Fy&sup2; - 2FySy + Sy&sup2;
// + (FzVz + FzVz -2SzVz)m + Fz&sup2; - 2FzSz + Sz&sup2; - r&sup2;
//
// 0 = |Vz|m&sup2; + (FxVx + FxVx -2SxVx)m + |F| - 2FxSx + |S|
// + (FyVy + FyVy -2SyVy)m - 2FySy
// + (FyVy + FyVy -2SyVy)m - 2FySy - r&sup2;
//
// a = |Vz|
// b =
// c = Fx&sup2; + Sx&sup2; -2FxSx + Fy&sup2; + Sy&sup2; -2FySy + Fz&sup2; + Sz&sup2; -2FzSz - r&sup2;
// for current F and S this means c = Sy&sup2; - r&sup2;
// </pre>
// Where a, b and c are as in the code.
// Only the solution for the negative square root term is needed as the
// closest intersection is wanted. The other solution to m would give
// the intersection of the 'back' of the sphere.
a=V[X]*V[X]+VY2+V[Z]*V[Z];
s=(b2-a*c4); // the square root term
// if s is negative then there are no solutions to m and the
// sphere is not visible on the current pixel on the canvas
// so only draw a pixel if the sphere is visable
// 0 is a special case as it is the 'edge' of the sphere as there
// is only one solution. (I have never seen it happen though)
// of the two solutions m1 & m2 the nearest is m1, m2 being the
// far side of the sphere.
if (s > 0) {
m1 = ((-b)-(Math.sqrt(s)))/(2*a);
L[X]=m1*V[X]; // bx+m1*V[X];
L[Y]=by+(m1*V[Y]);
L[Z]=m1*V[Z]; // bz+m1*V[Z];
// Do a couple of rotations on L
var lx=L[X];
var srz = Math.sin(rz);
var crz = Math.cos(rz);
L[X]=lx*crz-L[Y]*srz;
L[Y]=lx*srz+L[Y]*crz;
var lz;
lz=L[Z];
var sry = Math.sin(ry);
var cry = Math.cos(ry);
L[Z]=lz*cry-L[Y]*sry;
L[Y]=lz*sry+L[Y]*cry;
// Calculate the position that this location on the sphere
// coresponds to on the texture
var lh = textureWidth + textureWidth * ( Math.atan2(L[Y],L[X]) + Math.PI ) / (2*Math.PI);
// %textureHeight at end to get rid of south pole bug. probaly means that one
// pixel may be a color from the opposite pole but as long as the
// poles are the same color this won't be noticed.
var lv = textureWidth * Math.floor(textureHeight-1-(textureHeight*(Math.acos(L[Z]/r)/Math.PI)%textureHeight));
return {lv:lv,lh:lh};
}
return null;
};
/**
* Create the sphere function opject
*/
var sphere = function(){
var textureData = textureImageData.data;
var canvasData = canvasImageData.data;
var copyFnc;
if (canvasData.splice){
//2012-04-19 splice on canvas data not supported in any current browser
copyFnc = function(idxC, idxT){
canvasData.splice(idxC, 4 , textureData[idxT + 0]
, textureData[idxT + 1]
, textureData[idxT + 2]
, 255);
};
} else {
copyFnc = function(idxC, idxT){
canvasData[idxC + 0] = textureData[idxT + 0];
canvasData[idxC + 1] = textureData[idxT + 1];
canvasData[idxC + 2] = textureData[idxT + 2];
canvasData[idxC + 3] = 255;
};
}
var getVector = (function(){
var cache = new Array(size*size);
return function(pixel){
if (cache[pixel] === undefined){
var v = Math.floor(pixel / size);
var h = pixel - v * size;
cache[pixel] = calculateVector(h,v);
}
return cache[pixel];
};
})();
var posDelta = textureWidth*0.2/(20*1000);
//var firstFramePos = (new Date()) * posDelta;
var stats = {fastCount: 0, fastSumMs: 0};
return {
posDelta: posDelta,
firstFramePos: (new Date()) * posDelta,
positionsCache: [],
minX: null,
minY: null,
maxX: null,
maxY: null,
init: function(options) {
this.changeRotation(options);
hs=30; // Horizontal scale of viewing area
vs=30; // Vertical scale of viewing area
F = [0,0,0]; // Focal point of viewer
S = [0,30,0]; // Centre of sphere/planet
r=options.r; // Radius of sphere/planet
f = 30;
bx=F[X]-S[X]; // = 0 for current values of F and S
by=F[Y]-S[Y];
bz=F[Z]-S[Z]; // = 0 for current values of F and S
c = F[X]*F[X] + S[X]*S[X]
+ F[Y]*F[Y] + S[Y]*S[Y]
+ F[Z]*F[Z] + S[Z]*S[Z]
- 2*(F[X]*S[X] + F[Y]*S[Y] + F[Z]*S[Z])
- r*r
;
c4 = c*4; // save a bit of time maybe during rendering
m1 = 0;
hhs = 0.5*hs; // half horizontal scale
hvs = 0.5*vs; // half vertical scale
/*V = new Array(3);*/ // vector for storing direction of each pixel from F
L = new Array(3); // Location vector from S that pixel 'hits' sphere
VY2=f*f; // V[Y] ^2 NB May change if F changes
rotCache = {};
if (canvasData.splice){
//2012-04-19 splice on canvas data not supported in any current browser
copyFnc = function(idxC, idxT){
canvasData.splice(idxC, 4 , textureData[idxT + 0]
, textureData[idxT + 1]
, textureData[idxT + 2]
, 255);
};
} else {
copyFnc = function(idxC, idxT){
canvasData[idxC + 0] = textureData[idxT + 0];
canvasData[idxC + 1] = textureData[idxT + 1];
canvasData[idxC + 2] = textureData[idxT + 2];
canvasData[idxC + 3] = 255;
};
}
posDelta = textureWidth*0.2/(20*1000);
//var firstFramePos = (new Date()) * posDelta;
stats = {fastCount: 0, fastSumMs: 0};
getVector = (function(){
var cache = new Array(size*size);
return function(pixel){
if (cache[pixel] === undefined){
var v = Math.floor(pixel / size);
var h = pixel - v * size;
cache[pixel] = calculateVector(h,v);
}
return cache[pixel];
};
})();
},
renderFrame: function(time){
this.RF(time);
return;
stats.firstMs = new Date() - time;
this.renderFrame = this.sumRF;
console.log(rotCache);
for (var key in rotCache){
if (rotCache[key] > 1){
console.log(rotCache[key]);
}
}
},
sumRF: function(time){
this.RF(time);
stats.fastSumMs += new Date() - time;
stats.fastCount++;
if (stats.fastSumMs > stats.firstMs) {
// alert("calc:precompute ratio = 1:"+ stats.fastCount +" "+ stats.fastSumMs +" "+ stats.firstMs);
this.renderFrame = this.RF;
}
},
turnBy: function(time){
return 24*60*60 + this.firstFramePos - time * this.posDelta
},
changeRotation: function(opts) {
ry=90+opts.tilt;
rz=180+opts.turn;
RY = (90-ry);
RZ = (180-rz);
RX = 0,RY,RZ;
},
getRadius: function() {
if (this.minX === null) {
return null;
} else {
return ((this.maxX - this.minX) + (this.maxY - this.minY)) / 2;
}
},
getTexturePointPosition: function(x, y) {
var maxDistance = 30;
for (var i = 0; i < maxDistance; i++) {
var xx
var yy;
var pos;
for (xx = x - i; xx < x + i + 1; xx++) {
yy = y - i;
pos = this.getTexturePointPositionExact(xx, yy);
if (typeof pos !== 'undefined') {
return pos;
}
yy = y + i;
pos = this.getTexturePointPositionExact(xx, yy);
if (typeof pos !== 'undefined') {
return pos;
}
}
for (yy = y - i + 1; yy < y + i; yy++) {
xx = x - i;
pos = this.getTexturePointPositionExact(xx, yy);
if (typeof pos !== 'undefined') {
return pos;
}
xx = x + i;
pos = this.getTexturePointPositionExact(xx, yy);
if (typeof pos !== 'undefined') {
return pos;
}
}
}
},
getTexturePointPositionExact: function(x, y) {
var pixel = this.positionsCache[x + y * textureWidth];
if (typeof pixel === 'undefined') {
return pixel;
} else {
return {x: pixel % size, y: Math.floor(pixel / size), pixel: pixel, originalX: x, originalY: y};
}
},
RF: function(time){
// RX, RY & RZ may change part way through if the newR? (change tilt/turn) meathods are called while
// this meathod is running so put them in temp vars at render start.
// They also need converting from degrees to radians
rx=RX*Math.PI/180;
ry=RY*Math.PI/180;
rz=RZ*Math.PI/180;
// add to 24*60*60 so it will be a day before turnBy is negative and it hits the slow negative modulo bug
var turnBy = this.turnBy(time);
var pixel = size*size;
var h2 = (textureHeight * textureHeight);
this.positionsCache = new Array(h2);
this.minX = null;
this.minY = null;
this.maxX = null;
this.maxY = null;
while(pixel--){
var vector = getVector(pixel);
if (vector !== null){
var x = pixel % size;
var y = Math.floor(pixel / size);
if (this.minX == null) {
this.minX = x;
this.maxX = x;
this.minY = y;
this.maxY = y;
} else {
if (this.minX > x) {
this.minX = x;
}
if (this.maxX < x) {
this.maxX = x;
}
if (this.minY > y) {
this.minY = y;
}
if (this.maxY < y) {
this.maxY = y;
}
}
//rotate texture on sphere
var lh = Math.floor(vector.lh * tiling.horizontal + turnBy * tiling.horizontal) % textureWidth;
/* lh = (lh < 0)
? ((textureWidth-1) - ((lh-1)%textureWidth))
: (lh % textureWidth) ;
*/
var idxC = pixel * 4;
var idxT = ((lh + (vector.lv * tiling.vertical) % h2) * 4);
this.positionsCache[Math.floor(idxT / 4)] = Math.floor(idxC / 4);
/* TODO light for alpha channel or alter s or l in hsl color value?
- fn to calc distance between two points on sphere?
- attenuate light by distance from point and rotate point separate from texture rotation
*/
// Update the values of the pixel;
canvasData[idxC + 0] = textureData[idxT + 0];
canvasData[idxC + 1] = textureData[idxT + 1];
canvasData[idxC + 2] = textureData[idxT + 2];
canvasData[idxC + 3] = 255;
// Slower?
/*
canvasImageData.data[idxC + 0] = textureImageData.data[idxT + 0];
canvasImageData.data[idxC + 1] = textureImageData.data[idxT + 1];
canvasImageData.data[idxC + 2] = textureImageData.data[idxT + 2];
canvasImageData.data[idxC + 3] = 255;
*/
// Faster?
/* copyFnc(idxC,idxT); */
}
}
gCtx.putImageData(canvasImageData, 0, 0);
}};
};
function copyImageToBuffer(aImg)
{
gImage = document.createElement('canvas');
textureWidth = aImg.naturalWidth;
textureHeight = aImg.naturalHeight;
gImage.width = textureWidth;
gImage.height = textureHeight;
gCtxImg = gImage.getContext("2d");
gCtxImg.clearRect(0, 0, textureHeight, textureWidth);
gCtxImg.drawImage(aImg, 0, 0);
textureImageData = gCtxImg.getImageData(0, 0, textureHeight, textureWidth);
hs_ch = (hs / size);
vs_cv = (vs / size);
}
this.createSphere = function (gCanvas, textureUrl, callback, tilingInfos) {
size = Math.min(gCanvas.width, gCanvas.height);
gCtx = gCanvas.getContext("2d");
canvasImageData = gCtx.createImageData(size, size);
tiling = tilingInfos;
hs_ch = (hs / size);
vs_cv = (vs / size);
V[Y]=f;
b=(2*(-f*V[Y]));
b2=Math.pow(b,2);
var img = new Image();
img.onload = function() {
copyImageToBuffer(img);
var earth = sphere();
callback(earth, textureWidth, textureHeight);
// BAD! uses 100% CPU, stats.js runs at 38FPS
/*
function renderFrame(){
earth.renderFrame(new Date);
}
setInterval(renderFrame, 0);
*/
// Better - runs at steady state
/*
(function loop(){
setTimeout(function(){
earth.renderFrame(new Date);
loop();
}, 0);
})();
*/
// Best! only renders frames that will be seen. stats.js runs at 60FPS on my desktop
};
img.setAttribute("src", textureUrl);
};
}).call(this);

View File

@ -0,0 +1,198 @@
var examples = {};
//~ examples['simple'] = function() {
//~ $('#sphere').earth3d({
//~ dragElement: $('#locations') // where do we catch the mouse drag
//~ });
//~ };
//~ examples['simple_tilted'] = function() {
//~ $('#sphere').earth3d({
//~ dragElement: $('#locations'), // where do we catch the mouse drag
//~ sphere: { // rotation and size of the planet
//~ tilt: 40,
//~ turn: 20,
//~ r: 10
//~ }
//~ });
//~ };
examples['locations'] = function() {
/* defining locations to display.
Each position must have a key, an alpha and delta position (or x and y if you want to display a static location).
Any additional key can be reached via callbacks functions.
*/
var locations = {
obj1: {
alpha: Math.PI / 4,
delta: 0,
name: '_usa_',
link: 'https://oasis.astroport.com#usa'
},
obj2: {
alpha: 1 * Math.PI / 4,
delta: -2 * Math.PI / 4,
name: '_africa_',
link: 'https://oasis.astroport.com#africa'
},
obj3: {
alpha: 2 * Math.PI / 4,
delta: 0,
name: '_hawai_',
link: 'https://oasis.astroport.com#awai'
},
obj4: {
alpha: 3 * Math.PI / 4,
delta: 3 * Math.PI / 4,
name: '_australia_',
link: 'https://oasis.astroport.com#australia'
},
obj5: {
alpha: 2.2 * Math.PI / 4,
delta: -0.9 * Math.PI / 4,
name: '_southamerica_',
link: 'https://oasis.astroport.com#southamerica'
},
obj6: {
alpha: 1.2 * Math.PI / 4,
delta: -2 * Math.PI / 4,
name: '_europe_',
link: 'https://oasis.astroport.com#europe'
}
};
$('#sphere').earth3d({
locationsElement: $('#locations'),
dragElement: $('#locations'), // where do we catch the mouse drag
locations: locations
});
};
//~ examples['flights'] = function() {
//~ /* defining locations to display.
//~ Each position must have a key, an alpha and delta position (or x and y if you want to display a static location).
//~ Any additional key can be reached via callbacks functions.
//~ */
//~ var locations = {
//~ obj1: {
//~ alpha: Math.PI / 4,
//~ delta: 0,
//~ name: '_usa_',
//~ link: 'https://oasis.astroport.com#usa'
//~ },
//~ obj2: {
//~ alpha: 1 * Math.PI / 4,
//~ delta: -2 * Math.PI / 4,
//~ name: '_africa_',
//~ link: 'https://oasis.astroport.com#africa'
//~ },
//~ obj3: {
//~ alpha: 2 * Math.PI / 4,
//~ delta: 0,
//~ name: '_hawai_',
//~ link: 'https://oasis.astroport.com#awai'
//~ },
//~ obj4: {
//~ alpha: 3 * Math.PI / 4,
//~ delta: 3 * Math.PI / 4,
//~ name: '_australia_',
//~ link: 'https://oasis.astroport.com#australia'
//~ },
//~ obj5: {
//~ alpha: 2.2 * Math.PI / 4,
//~ delta: -0.9 * Math.PI / 4,
//~ name: '_southamerica_',
//~ link: 'https://oasis.astroport.com#southamerica'
//~ },
//~ obj6: {
//~ alpha: 1.2 * Math.PI / 4,
//~ delta: -2 * Math.PI / 4,
//~ name: '_europe_',
//~ link: 'https://oasis.astroport.com#europe'
//~ },
//~ zero: {
//~ alpha: 0 * Math.PI / 4,
//~ delta: 0 * Math.PI / 4,
//~ name: '_CraftYourWorld_',
//~ link: 'https://ipfs.copylaradio.com/ipfs/QmNcNcYRDUFmR1Ey1MAyhzzZRJEi1Dfq8YXRTXq6XZ9n4A'
//~ },
//~ pi: {
//~ alpha: -3 * Math.PI / 4,
//~ delta: -3 * Math.PI / 4,
//~ name: '_OpenTW_',
//~ link: 'https://astroport.copylaradio.com'
//~ }
//~ };
//~ /* defining paths to display.
//~ Each path must have a key, an origin and a destination. The values are the location's key.
//~ You can, if you want to, define flights on these paths.
//~ Each flight has a key, a destination (the location's key) and a position.
//~ The position is the progress a fleet has made on its path.
//~ Any additional key can be reach via callbacks functions.
//~ */
//~ var paths = {
//~ path: {
//~ origin: 'obj1',
//~ destination: 'obj2',
//~ flights: {
//~ flight: {
//~ position: 0.25,
//~ destination: 'obj2',
//~ name: 'Flight 1'
//~ },
//~ flight2: {
//~ position: 0.25,
//~ destination: 'obj1',
//~ name: 'Flight 2'
//~ }
//~ }
//~ },
//~ path2: {
//~ origin: 'obj1',
//~ destination: 'obj3',
//~ flights: {
//~ flight3: {
//~ position: 0.5,
//~ destination: 'obj3',
//~ name: 'Flight 3'
//~ }
//~ }
//~ },
//~ path3: {
//~ origin: 'obj1',
//~ destination: 'obj4',
//~ flights: {
//~ flight4: {
//~ position: 0.5,
//~ destination: 'obj4',
//~ name: 'Flight 4'
//~ }
//~ }
//~ },
//~ path4: {
//~ origin: 'obj1',
//~ destination: 'obj5'
//~ },
//~ path7: {
//~ origin: 'obj1',
//~ destination: 'obj5',
//~ flights: {
//~ flight5: {
//~ position: 0.25,
//~ destination: 'obj7',
//~ name: 'Flight 5'
//~ }
//~ }
//~ }
//~ }
//~ $('#sphere').earth3d({
//~ flightsCanvas: $('#flights'),
//~ locationsElement: $('#locations'),
//~ dragElement: $('#locations'), // where do we catch the mouse drag
//~ paths: paths,
//~ locations: locations
//~ });
//~ };

BIN
WWW/CopierYoutube/l0g0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

3
WWW/FAVICON/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# Images & icons
Add favicon from the web2.0 you wish to copy to WEB3

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

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