forked from STI/Astroport.ONE
Compare commits
7 Commits
5352e972b9
...
05f1a9b4c0
Author | SHA1 | Date |
---|---|---|
Yann Autissier | 05f1a9b4c0 | |
fred | b57cc06286 | |
fred | 48368db29f | |
fred | 6fa950367c | |
fred | 60f7bd752e | |
fred | 816517cd89 | |
fred | 48c5b98e7f |
141
README.md
141
README.md
|
@ -8,7 +8,8 @@ L'avantage de ce système, une consommation énergétique divisé par 100, une r
|
|||
S'il vous plaît arrêtons cet Internet Supermarché de nous même...
|
||||
C'est une bibliothèque du savoir à la base.
|
||||
|
||||
## http://astroport.com
|
||||
## 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.
|
||||
|
||||
|
@ -21,7 +22,7 @@ Ce programme introduit des données multimédia (page web, audio, vidéo) en tan
|
|||
que les joueurs échangent au travers des Oasis.
|
||||
|
||||
|
||||
# INSTALLATION (Debian/Ubuntu/Mint ou Xbian)
|
||||
# INSTALLATION (Linux Mint / Ubuntu / DEBIAN)
|
||||
|
||||
```
|
||||
bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/install.sh)
|
||||
|
@ -31,20 +32,22 @@ bash <(wget -qO- https://git.p2p.legal/qo-op/Astroport.ONE/raw/branch/master/ins
|
|||
|
||||
## ./start.sh
|
||||
|
||||
Gestion des Astronautes, de leurs VISA et VOEUX en mode CLI
|
||||
Gestion des VISA PLAYER (et gestion des VOEUX) en mode CLI
|
||||
|
||||
```
|
||||
~/.zen/Astroport.ONE/start.sh
|
||||
~/.zen/Astroport.ONE/command.sh
|
||||
```
|
||||
Lancement API (1234) et MAP (12345)
|
||||
|
||||
MODE AVENTURE : Activez votre VISA Astronaute sur une Station !
|
||||
## MODE AVENTURE : Activez une Ambassade "Astroport" !
|
||||
|
||||
```
|
||||
~/.zen/Astroport.ONE/adventure/adventure.sh
|
||||
```
|
||||
|
||||
Trouvez le moyen d'accéder à votre "Station Astroport" en explorant les environs du premier de ce nom.
|
||||
Trouvez le moyen d'accéder à une "Station Astroport" installée en forêt...
|
||||
|
||||
NB: Une Stattion branché sur un panneau solaire et une batterie adéquate, peut fonctionner OnGrid et OffGrid
|
||||
|
||||
|
||||
# INSTALLATION (Docker)
|
||||
|
||||
|
@ -59,20 +62,51 @@ make
|
|||
make install
|
||||
```
|
||||
|
||||
Plus de connexion officielle.
|
||||
L'UTILISATEUR devient un JOUEUR, en semant son propre IPFS, en utilisant un Docker sur un nœud Astroport géré par un autre JOUEUR.
|
||||
|
||||
Ainsi, les AMIS peuvent héberger d'autres AMIS.
|
||||
|
||||
# TW
|
||||
|
||||
PLAYER support@qo-op.com
|
||||
# API : "Code qui Peut"
|
||||
## https://astroport.localhost:1234
|
||||
|
||||
https://ipfs.copylaradio.com/ipns/support.qo-op.com.localhost.copylaradio.com
|
||||
Une fois votre Station Astroport démarrée (```~/.start.sh```):
|
||||
* le port 1234 publie API
|
||||
* le port 12345 publie MAP(*)
|
||||
|
||||
# TW
|
||||
|
||||
Selon le modèle de votre TW,
|
||||
### PRIVATE ZONE
|
||||
### ```/?salt=${SALT}&pepper=${PEPPER}&${APPNAME}=${WHAT}&${OBJ}=${VAL}...```
|
||||
|
||||
* Créer TW BunkerBOX
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=$URLENCODEDURL&email=$PLAYER```
|
||||
|
||||
* Lire Messagerie Gchange
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&messaging=on```
|
||||
|
||||
* Convertir vers adresse IPNS
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&getipns=on```
|
||||
|
||||
* AppName=testcraft : Enregistrer JSON
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&testcraft=json&nodeid=&dataid=$QRHASH```
|
||||
|
||||
|
||||
* Déclencher un Payement (G1)
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&pay=$MONTANT&to=$G1PUB```
|
||||
|
||||
Redirections
|
||||
* vers Gchange
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=on```
|
||||
|
||||
* vers TW
|
||||
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=astro```
|
||||
|
||||
|
||||
### PUBLIC
|
||||
### ```/?qrcode=$G1PUB/$IPNS/$...```
|
||||
|
||||
|
||||
# TW : TiddlyWiki
|
||||
|
||||
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.
|
||||
|
||||
|
@ -106,11 +140,13 @@ Cet horaire commun invite chaque propriétaire de TW à publier leur version ava
|
|||
|
||||
A cette heure les Stations raffraichissent vos canaux TW communs...
|
||||
|
||||
# EXEMPLE DE TW
|
||||
|
||||
NB: Une Stattion branché sur un panneau solaire et une batterie adéquate, peut fonctionner OnGrid et OffGrid
|
||||
PLAYER support@qo-op.com
|
||||
|
||||
https://ipfs.copylaradio.com/ipns/support.qo-op.com.localhost.copylaradio.com
|
||||
|
||||
# - ESSAYEZ IPFS - UN SOCKAGE INALTERABLE ET INTELLIGENT
|
||||
# IPFS : UN STOCKAGE INALTERABLE ET INTELLIGENT
|
||||
|
||||
### "The Barefoot Architect" de Johan Van Lengen.
|
||||
|
||||
|
@ -128,81 +164,6 @@ Vos données son stockées [dans des Tiddlers](https://ipfs.copylaradio.com/ipns
|
|||
|
||||
https://ipfs.copylaradio.com/ipfs/QmUtGpGeMZvwp47ftqebVmoFWCmvroy5wEtWsKvWvDWJpR
|
||||
|
||||
# API
|
||||
|
||||
## Hybride et Asynchrone
|
||||
|
||||
API du système
|
||||
|
||||
|
||||
En utilisant netcat comme "serveur web minimal", la première page que renvoi le serveur est un rendez-vous vers la prochaine adresse IP et port où trouver la réponse à l'appel de l'API.
|
||||
|
||||
Comme un client qui commande, à qui on attribue un point relai qu'il devra contrôler lui même pour en connaitre la livraison.
|
||||
|
||||
chaque passerelle de l'essaim sert toujours la même page (voir "templates/index.http")
|
||||
|
||||
https://astroport.copylaradio.com, informe où trouver la suite qui permet de découvrir la suite.
|
||||
|
||||
ici pour informer de l'état de la commande (OK, ERROR)
|
||||
```
|
||||
<meta http-equiv="refresh" content="12; url='http://_ASTROIP_:_ASTROPORT_'" />
|
||||
|
||||
```
|
||||
http://_ASTROIP_:_ASTROPORT_
|
||||
|
||||
ici pour récupérer les éventuels colis
|
||||
```
|
||||
<a href="http://_ASTROIP_:8080/ipns/_APID_" target="json">
|
||||
```
|
||||
http://_ASTROIP_:8080/ipns/_APID_/
|
||||
|
||||
_APID_ est la clef IPNS qui contient l'arborescence "json" en lecture
|
||||
|
||||
Exemple pour l'application "G1Voeu" https://ipfs.copylaradio.com/ipns/12D3KooWL2FcDJ41U9SyLuvDmA5qGzyoaj2RoEHiJPpCvY8jvx9u
|
||||
|
||||
Application "messaging"
|
||||
https://astroport.copylaradio.com/?salt=toto&pepper=toto&messaging=on
|
||||
|
||||
Pour écrire une application on pourra utiliser "jsipfs"
|
||||
|
||||
https://js.ipfs.tech/
|
||||
<script src="https://cdn.jsdelivr.net/npm/ipfs-core/dist/index.min.js"></script>
|
||||
|
||||
Ajoutez l'appel API "testcraft" pour enregistrer vos json
|
||||
?salt=toto&pepper=toto&testcraft=on&nodeid=_IPFDNODEID_&DATAID=_IPDSID_
|
||||
|
||||
https://astroport.copylaradio.com/?salt=toto&pepper=toto&testcraft=on&nodeid=12D3KooWK1ACupF7RD3MNvkBFU9Z6fX11pKRAR99WDzEUiYp5t8j&dataid=QmZXo87nn34i54HhuMrbuXM5fKXymhV3Zj9exeZDK6s4WD
|
||||
|
||||
```
|
||||
# APP = g1pub, messaging, testcraft, ....
|
||||
http://127.0.0.1:1234/?salt=${SALT}&pepper=${PEPPER}&${APP}=?&...
|
||||
```
|
||||
[12345.sh](/qo-op/Astroport.ONE/src/branch/master/12345.sh)
|
||||
|
||||
```
|
||||
IPFSNODEID JSON CACHE
|
||||
DATA ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${TYPE}/${MOATS}.data.json
|
||||
INDEX ~/.zen/tmp/${IPFSNODEID}/${TYPE}.json
|
||||
```
|
||||
|
||||
# TIDDLYWIKI
|
||||
|
||||
Les données produites par chaque clef sont stockées en tant que tiddlers dans des Tiddlywiki.
|
||||
Le tag "voeu" déclenche la transformation du tiddler en "G1Voeu".
|
||||
Son Titre devient un tag qui permet d'échanger les tiddlers correspondant au même voeu que ses TW amis.
|
||||
|
||||
|
||||
## COME TO TALK TW ? https://talk.tiddlywiki.org
|
||||
|
||||
```
|
||||
# TiddlyWiki #
|
||||
sudo apt install npm
|
||||
sudo npm install -g tiddlywiki
|
||||
added 1 package, and audited 2 packages in 10s
|
||||
found 0 vulnerabilities
|
||||
```
|
||||
Proposez vos "Templates"
|
||||
|
||||
---
|
||||
|
||||
## LOOPY
|
||||
|
|
|
@ -128,7 +128,7 @@ select fav in "${choices[@]}"; do
|
|||
echo "Enter to continue. Ctrl+C to stop"
|
||||
read
|
||||
echo "REPLACE $IPFSNODEID WITH _ASTROPORT_"
|
||||
sed "s~${IPFSNODEID}~_ASTROPORT_~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html ~/.zen/tmp/$PLAYER.html
|
||||
sed "s~${IPFSNODEID}~_ASTROPORT_~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html > ~/.zen/tmp/$PLAYER.html
|
||||
TW=$(ipfs add -Hq ~/.zen/tmp/$PLAYER.html | tail -n 1)
|
||||
ipfs name publish --allow-offline --key=$PLAYER /ipfs/$TW
|
||||
espeak "TW dropped in cyberspace..."
|
||||
|
|
|
@ -55,7 +55,7 @@ header {
|
|||
<br>
|
||||
<input type='hidden' name='salt' value='0'></br></br>
|
||||
<input type='hidden' name='pepper' value='0'></br></br>
|
||||
<h2><span>ENREGISTREZ VOS VIDEOS YOUTUBE FAVORITES</span></h2><input type="hidden" name=g1pub value='https://www.youtube.com/playlist?list=LL'></br>
|
||||
<h2><span>ENREGISTREZ VOS VIDEOS FAVORITES</span></h2><input type="hidden" name=g1pub value='https://www.youtube.com/playlist?list=LL'></br>
|
||||
<span>Email : </span><input name=email value=''></br></br>
|
||||
<input type='submit' value='[(♥‿‿♥)]'>
|
||||
</form>
|
||||
|
@ -75,10 +75,10 @@ header {
|
|||
<div class="row justify-center">
|
||||
<h1 class="video-title">
|
||||
<center><a href="https://twitch.com/zicmama" target="twitch">COCODING TWITCH TW</a><br></center><br>
|
||||
<a href="https://astroport.com">Astroport.ONE</a>
|
||||
<a href="https://astroport.com">Astroport.ONE</a>
|
||||
<a href="https://git.p2p.legal/qo-op/Astroport.ONE" target="code">- ♥BOX Edition - </a>
|
||||
<a href="https://olympe.network">Olympe.Network</a><br>
|
||||
<a target="code" href="http://opencollective.com/monnaie-libre/projects/bunker-box">Recopiez les vidéos que vous aimez dans les capsules multimédia de votre TW!
|
||||
<a href="https://olympe.network">Olympe.Network</a><br>
|
||||
<a target="code" href="http://opencollective.com/monnaie-libre/projects/bunker-box">Recopiez les vidéos que vous aimez dans les capsules de votre TW!
|
||||
<br>Une fois votre G1Visa obtenu, direction <a target="gchange" href="https://gchange.fr">https://gchange.fr</a> !</a>
|
||||
</h1>
|
||||
</div>
|
||||
|
|
|
@ -6,46 +6,50 @@ myHash() {
|
|||
|| myHash=$(template_register |ipfs add -q)
|
||||
[ ! -f ~/.zen/game/players/localhost/latest ] \
|
||||
&& echo "$myHash" > ~/.zen/game/players/localhost/latest
|
||||
[ -n "$myHash" ] \
|
||||
&& echo "$myHash"
|
||||
[ -n "$myHash" ] && echo "$myHash"
|
||||
}
|
||||
|
||||
myHttp() {
|
||||
echo "$(myHttpHeader)"
|
||||
echo
|
||||
echo "$(myHttpContent)"
|
||||
[ -n "$(myHttpHeader)" ] \
|
||||
&& echo "${myHttpHeader}" \
|
||||
&& echo
|
||||
[ -n "$(myHttpContent)" ] \
|
||||
&& echo "${myHttpContent}"
|
||||
}
|
||||
|
||||
myHttpContent() {
|
||||
[ -n "$(myHash)" ] \
|
||||
&& myHttpContent="<html><head><title>302 Found</title></head><body><h1>Found</h1>
|
||||
<p>The document is <a href=\""ipfs/$(myHash)"\">here</a> in IPFS.</p></body></html>" \
|
||||
&& echo "$myHttpContent"
|
||||
}
|
||||
|
||||
myHttpHeader() {
|
||||
[ -n "$(myHash)" ] \
|
||||
&& myHttpHeader="HTTP/1.0 302 Found
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Length: $(myHttpContent |wc -c)
|
||||
Date: $(date -R)
|
||||
Location: ipfs/$(myHash)
|
||||
Server: and"
|
||||
[ -n "$(myKey)" ] && myHttpHeader+="
|
||||
set-cookie: AND=$(myKey); expires=$(date -R -d "+1 month"); path=/; domain=.$myDomainName; Secure; SameSite=lax"
|
||||
[ -n "$myHttpHeader" ] && echo "$myHttpHeader"
|
||||
}
|
||||
|
||||
myIpfs() {
|
||||
myIpfs=${myIPFS}/ipfs/$(myHash)
|
||||
echo "$myIpfs"
|
||||
[ -n "$(myHash)" ] \
|
||||
&& myIpfs="${myIPFS}/ipfs/$(myHash)" \
|
||||
&& echo "$myIpfs"
|
||||
}
|
||||
|
||||
myIpns() {
|
||||
myIpns=${myIPFS}/ipns/$(myKey)
|
||||
echo "$myIpns"
|
||||
[ -n "$(myKey)" ] \
|
||||
&& myIpns="${myIPFS}/ipns/${myKey}" \
|
||||
&& echo "$myIpns"
|
||||
}
|
||||
|
||||
myKey() {
|
||||
myKey=$(ipfs key list -l | awk '$2 == "self" {print $1}')
|
||||
[ -n "$myKey" ] && echo "$myKey"
|
||||
}
|
||||
|
||||
myHttpContent() {
|
||||
myHash=$(myHash)
|
||||
myHttpContent="<html><head><title>302 Found</title></head><body><h1>Found</h1>
|
||||
<p>The document has moved <a href="ipfs/$myHash">here</a>.</p></body></html>"
|
||||
echo "$myHttpContent"
|
||||
}
|
||||
|
||||
myHttpHeader() {
|
||||
myHttpContent=$(myHttpContent)
|
||||
myHttpHeader="HTTP/1.0 302 Found
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Length: $(myHttpContent |wc -c)
|
||||
Date: $(date -R)
|
||||
Location: ipfs/$myHash
|
||||
set-cookie: AND=$myKey; expires=$(date -R -d "+1 month"); path=/; domain=.$myDomainName; Secure; SameSite=lax
|
||||
Server: and"
|
||||
echo "$myHttpHeader"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,48 @@
|
|||
#shellcheck shell=sh
|
||||
|
||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||
IPFSNODEID=$(jq -r .Identity.PeerID ~/.ipfs/config)
|
||||
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
|
||||
isLAN=$(route -n |awk '$1 == "0.0.0.0" {print $2}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
||||
ipfsNodeId() {
|
||||
ipfsNodeId=$(jq -r .Identity.PeerID ~/.ipfs/config)
|
||||
[ -n "$ipfsNodeId" ] && echo "$ipfsNodeId"
|
||||
}
|
||||
|
||||
myDomainName=$(hostname -d 2>/dev/null) && [ -z "$myDomainName" ] && myDomainName=$(domainname 2>/dev/null) && [ "$myDomainName" = "(none)" ] && myDomainName="localhost"
|
||||
myHostName=$(hostname |sed 's/\.'${myDomainName}'$//')
|
||||
[ -n "$myDomainName" ] && myHostName="${myHostName}.${myDomainName}" || myDomainName=${myHostName#*.}
|
||||
[ -z "$myDomainName" ] && myDomainName=localhost
|
||||
myHOST="astroport.${myDomainName}"
|
||||
myIPFS="http://ipfs.${myDomainName}:8080"
|
||||
myASTROPORT="http://astroport.${myDomainName}:1234"
|
||||
isLan() {
|
||||
isLan=$(ip route |awk '$1 == "default" {print $3}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" \
|
||||
|| route -n |awk '$1 == "0.0.0.0" {print $2}' | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
||||
[ -n "$isLan" && echo "$isLan"
|
||||
} 2>/dev/null
|
||||
|
||||
[ -z "$isLAN" ] && myIPFS="https://ipfs.${myDomainName}" && myASTROPORT="https://astroport.${myDomainName}" ||: ## WAN STATION
|
||||
myDomainName() {
|
||||
myDomainName=$(hostname -d 2>/dev/null) && [ -z "$myDomainName" ] && myDomainName=$(domainname 2>/dev/null) && [ "$myDomainName" = "(none)" ] && myDomainName="localhost"
|
||||
[ -n "$myDomainName" ] && echo "$myDomainNane"
|
||||
}
|
||||
|
||||
myHostName() {
|
||||
myHostName=$(hostname |sed 's/\.'$(myDomainName)'$//')
|
||||
[ -n "$myDomainName" ] && myHostName="${myHostName}.${myDomainName}" || myDomainName=${myHostName#*.}
|
||||
[ -z "$myDomainName" ] && myDomainName=localhost
|
||||
[ -n "$myHostName" ] && echo "$myHostName"
|
||||
}
|
||||
|
||||
myIp() {
|
||||
myIp=$(hostname -I | awk '{print $1}' | head -n 1)
|
||||
[ -n "$myIp" ] && echo "$myIp"
|
||||
}
|
||||
|
||||
myTs() {
|
||||
myTs=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||
[ -n "$myTs" ] && echo "$myTs"
|
||||
}
|
||||
|
||||
[ -n "$(myTs)" ] && MOATS="${myTs}"
|
||||
[ -n "$(ipfsNodeId)" ] && IPFSNODEID="${ipfsNodeId}"
|
||||
[ -n "$(myIp)" ] && myIP="${myIp}"
|
||||
[ -n "$(isLan)" ] && isLAN="${isLan}"
|
||||
[ -n "$(myDomainName)" ] \
|
||||
&& myHOST="astroport.${myDomainName}" \
|
||||
&& myIPFS="http://ipfs.${myDomainName}:8080" \
|
||||
&& myASTROPORT="http://astroport.${myDomainName}:1234"
|
||||
## WAN STATION
|
||||
[ -n "$(myHostName)" ] && [ -z "$isLAN" ] \
|
||||
&& myHOST="astroport.${myHostName}" \
|
||||
&& myIPFS="https://ipfs.${myDomainName}" \
|
||||
&& myASTROPORT="https://astroport.${myDomainName}"
|
||||
|
|
Loading…
Reference in New Issue