Compare commits

...

8 Commits

Author SHA1 Message Date
Yann Autissier b1ee55d196 myPlayerApi 2022-12-27 18:35:43 +00:00
fred b64c8eff47 space 2022-12-27 16:46:09 +01:00
fred 948bc1c79f PLAYER pay to G1PUB API 2022-12-27 15:48:58 +01:00
fred 8b59816876 iframe one 2022-12-27 15:12:32 +01:00
fred 1a6fdb1364 Add G1PUB (publisher g1 key) in TIDDLERS 2022-12-27 12:56:35 +01:00
fred 260650ee0d ~/.zen/tmp/${MOATS}/local.api.json 2022-12-27 04:17:15 +01:00
fred 7911f88483 make 2022-12-27 00:46:12 +01:00
fred b8ce357d28 make player MAIL=$PLAYER PLAYER_API_ONLINE=true \ 2022-12-27 00:37:17 +01:00
15 changed files with 199 additions and 87 deletions

View File

@ -11,13 +11,11 @@
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/tools/my.sh"
PORT=12345
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); ## $USER running ipfs
YOU=$(myIpfsApi); ## API of $USER running ipfs
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) ## SWARM#0 ENTRANCE URL
TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
@ -223,19 +221,6 @@ while true; do
## APPNAME SELECTION ########################
########################################
##############################################
# PAY
##############################################
if [[ $APPNAME == "pay" ]]; then
echo "$APPNAME : $WHAT $OBJ $VAL"
echo "${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key -a ${WHAT} -p ${VAL} -c 'Bro'"
echo "$HTTPCORS $(${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key -a ${WHAT} -p ${VAL} -c 'Bro')" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo "(G_G ) PAYING Execution time was "`expr $end - $start` seconds.
continue
fi
##############################################
# MESSAGING
##############################################
@ -521,8 +506,40 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
fi ## END IF SALT
##############################################
# /?player=PLAYER&APPNAME=WHAT&OBJ=VAL
##############################################
if [[ ${arr[0]} == "player" ]]; then
PLAYER=$(urldecode ${arr[1]} | xargs)
APPNAME=$(urldecode ${arr[2]} | xargs)
WHAT=$(urldecode ${arr[3]} | xargs)
OBJ=$(urldecode ${arr[4]} | xargs)
VAL=$(urldecode ${arr[5]} | xargs)
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 &) && continue
##############################################
# PAY : /?player=PLAYER&pay=1&dest=G1PUB
##############################################
if [[ $APPNAME == "pay" ]]; then
echo "${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m"
echo "$HTTPCORS" > ~/.zen/tmp/pay.log
${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/pay.log
cat ~/.zen/tmp/pay.log | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo "(G_G ) PAYING Execution time was "`expr $end - $start` seconds.
continue
fi
fi
##############################################
# /?player=PLAYER&APPNAME=WHAT&OBJ=VAL
##############################################
###################################################################################################
###################################################################################################

View File

@ -30,6 +30,8 @@ PLAYER="$2"
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)
# Extract tag=tube from TW
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
@ -209,6 +211,7 @@ if [[ ! ${TIDDLER} ]]; then
"type": "'text/vnd.tiddlywiki'",
"vtratio": "'${VTRATIO}'",
"text": "'$TEXT'",
"g1pub": "'${G1PUB}'",
"mime": "'${MIME}'",
"size": "'${FILE_BSIZE}'",
"filesize": "'${FILE_SIZE}'",

View File

@ -22,7 +22,7 @@ PLAYERONE="$1"
for PLAYER in ${PLAYERONE[@]}; do
[[ ! -d ~/.zen/game/players/$PLAYER ]] && echo "BAD $PLAYERONE" && continue
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
[[ $PLAYER == "user" || $PLAYER == "zen" ]] && continue
[[ ! $(echo "$PLAYER" | grep '@') ]] && continue
mkdir -p ~/.zen/tmp/${MOATS}
echo "##################################################################"
echo ">>>>> PLAYER : $PLAYER >>>>>>>>>>>>> REFRESHING TW STATION"

View File

@ -91,9 +91,6 @@ Une fois votre Station Astroport démarrée (```~/.start.sh```):
```/?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```
@ -101,6 +98,11 @@ Redirections
* vers TW
```/?salt=${SALT}&pepper=${PEPPER}&g1pub=astro```
### PLAYER
* Déclencher un Payement (G1)
```/?player=${PLAYER}&pay=99&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech```
### PUBLIC
### ```/?qrcode=$G1PUB/$IPNS/$...```

View File

@ -8,16 +8,13 @@
# This script scan Swarm API layer from official bootstraps
# Then publish map of json DApp data
#
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
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])/")
[[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost"
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "${MY_PATH}/tools/my.sh"
PORT=12345
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); ## $USER running ipfs
YOU=$(myIpfsApi); ## API of $USER running ipfs
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2) ## SWARM#0 ENTRANCE URL
ncrunning=$(ps axf --sort=+utime | grep -w 'nc -l -p 12345' | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 2)
@ -126,11 +123,11 @@ Content-Type: application/json; charset=UTF-8
{
\"created\" : \"${MOATS}\",
\"hostname\" : \"$(hostname)\",
\"hostname\" : \"$(myHostName)\",
\"myIP\" : \"${myIP}\",
\"ipfsnodeid\" : \"${IPFSNODEID}\",
\"url\" : \"http://${myIP}:8080/ipns/${IPFSNODEID}\",
\"myswarm\" : \"http://${myIP}:8080/ipns/${CHAN}\"
\"url\" : \"${myIPFS}/ipns/${IPFSNODEID}\",
\"myswarm\" : \"${myIPFS}/ipns/${CHAN}\"
}
"
######################################################################################

View File

@ -20,7 +20,10 @@
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
. "${MY_PATH}/tools/my.sh"
[[ $IPFSNODEID == "" ]] && echo "IPFSNODEID manquant" && espeak "IPFS NODE ID Missing" && exit 1
start=`date +%s`
# REMOVE GtkDialog errors for zenity
shopt -s expand_aliases
@ -39,7 +42,7 @@ PLAYER="$2"
CHOICE="$3"
# Check who is .current PLAYER
[[ ${PLAYER} == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ${PLAYER} == "" ]] && PLAYER=$(myPlayer)
[[ ${PLAYER} == "" ]] \
&& players=($(ls ~/.zen/game/players 2>/dev/null)) \
@ -53,28 +56,18 @@ CHOICE="$3"
&& xdg-open "https://qo-op.com" \
&& exit 1
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
PSEUDO=$(myPlayerPseudo)
espeak "Hello $PSEUDO"
( cd $MY_PATH && git pull ) &
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
G1PUB=$(myPlayerG1Pub)
[[ $G1PUB == "" ]] && espeak "ERROR NO G 1 PUBLIC KEY FOUND - EXIT" && exit 1
PLAYERNS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
PLAYERNS=$(myPlayerNs) || ( echo "noplayerns" && exit 1 )
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
ASTRONAUTENS=$(myAstronauteKey)
[[ $ASTRONAUTENS == "" ]] && echo "ASTRONAUTE manquant" && espeak "Astronaut Key Missing" && exit 1
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ $IPFSNODEID == "" ]] && echo "IPFSNODEID manquant" && espeak "IPFS NODE ID Missing" && exit 1
BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser
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])/")
[[ ! $myIP || $isLAN ]] && myIP="ipfs.localhost"
BROWSER=$(myPlayerBrowser) ## GET cookies-from-browser
if [ $URL ]; then
echo "URL: $URL"
@ -145,10 +138,9 @@ ISPUBLISHING=$(ps auxf --sort=+utime | grep -w 'ipfs name publish' | grep -v -E
########################################################################
espeak "restart I P F S daemon"
sudo systemctl restart ipfs
sleep 1
[[ "$isLAN" ]] && sudo systemctl restart ipfs && sleep 1
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
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=$(myIpfsApi)
[[ ! $YOU ]] && espeak "I P F S not running - EXIT" && exit 1
########################################################################

View File

@ -6,12 +6,13 @@ HOST_ASTROPORT_SERVICE_NAME ?= astroport
HOST_ASTROPORT_SERVICE_1234_TAGS ?= $(call tagprefix,HOST_ASTROPORT,1234)
HOST_ASTROPORT_UFW_UPDATE := 1234/tcp 12245:12445/tcp 45720/tcp
MAKE_VARS += SSH_PORT User host
PLAYER_MAKE_VARS := COMPOSE_PROJECT_NAME MAIL IPFS_UFW_DOCKER IPFS_UFW_UPDATE USER_IPFS_SERVICE_PROXY_TCP USER_IPFS_SERVICE_5001_ENVS USER_RESU_HOST
PLAYER_MAKE_VARS := COMPOSE_PROJECT_NAME MAIL IPFS_UFW_DOCKER IPFS_UFW_UPDATE USER_IPFS_SERVICE_PROXY_TCP USER_IPFS_SERVICE_5001_ENVS RESU_HOME RESU_HOST
RESU_HOME := mail
RESU_HOST := true
SERVICE := astroport
SSH_PORT := 45720
SSH_PUBLIC_HOSTS := git.p2p.legal
STACK := host
USER_RESU_HOST := true
User := User/ipfs
host := host/ipfs
ifeq ($(PLAYER_API_ONLINE),true)

View File

@ -101,6 +101,14 @@ RUN set -x && buildDeps=' \
RUN npm install -g tiddlywiki sjcl-cli
ARG COMPOSE_REMOTE=https://github.com/docker/compose
ARG COMPOSE_VERSION=2.5.0
RUN OS="$(echo ${DOCKER_SYSTEM} |awk '{print tolower($0)}')"; \
ARCH="$(echo ${DOCKER_MACHINE})"; \
wget -qO /usr/bin/docker-compose ${COMPOSE_REMOTE}/releases/download/v${COMPOSE_VERSION}/docker-compose-${OS}-${ARCH} \
&& chmod +x /usr/bin/docker-compose
ARG IPFS_VERSION=0.16.0
RUN { OS="$(echo ${DOCKER_SYSTEM} |awk '{print tolower($0)}')"; \

View File

@ -17,6 +17,7 @@ zen() {
mkdir -p /home/zen/Astroport
sudo chown zen:users /home/zen /home/zen/.zen /home/zen/.zen/game /home/zen/.zen/game/players
[ -d "$ASTROPORT_DIR" ] && cd "$ASTROPORT_DIR" && git pull -q || git clone -q "$ASTROPORT_REPO" "$ASTROPORT_DIR"
cd "$ASTROPORT_DIR" && make
}
case "${1:-${cmd:-start}}" in

View File

@ -178,9 +178,16 @@ echo "NEXT STYLE GW : https://ipfs.$CLYUSER$YOMAIN.$HOSTNAME"
NID="${myIPFSGW}" && WID="$NID/api"
[[ $isLAN ]] && NID="http://ipfs.localhost:8080" && WID="http://ipfs.localhost:5001"
####
[[ $USER == "zen" || $isLAN == "" ]] \
&& make player MAIL=$PLAYER PLAYER_API_ONLINE=true \
&& NID="https://ipfs.$HOSTNAME" && WID="https://ipfs.$CLYUSER$YOMAIN.$HOSTNAME/api"
####
### CREATE $NID ADDRESS FOR API & ROUND ROBIN FOR GW
cat ~/.zen/Astroport.ONE/templates/data/local.api.json | sed -i "s~_NID_~${WID}~g" > ~/.zen/tmp/${MOATS}/local.api.json
cat ~/.zen/Astroport.ONE/templates/data/local.gw.json | sed -i "s~_NID_~${NID}~g" > ~/.zen/tmp/${MOATS}/local.gw.json
cat ~/.zen/Astroport.ONE/templates/data/local.api.json | sed "s~_NID_~${WID}~g" > ~/.zen/tmp/${MOATS}/local.api.json
cat ~/.zen/Astroport.ONE/templates/data/local.gw.json | sed "s~_NID_~${NID}~g" > ~/.zen/tmp/${MOATS}/local.gw.json
mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/$PLAYER/
@ -277,6 +284,11 @@ NID="${myIPFSGW}" && WID="$NID/api"
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
echo "TW IPFS GATEWAY"
cat ~/.zen/tmp/${MOATS}/local.gw.json | jq -r
echo "TW IPFS API"
cat ~/.zen/tmp/${MOATS}/local.api.json | jq -r
## ADD SYSTEM TW
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
--import ~/.zen/tmp/${MOATS}/lightbeam-name.json "application/json" \

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
import sys, re, base58, base64, crypto_pb2
import sys, re, base58, base64
import cryptography.hazmat.primitives.asymmetric.ed25519 as ed25519
from cryptography.hazmat.primitives import serialization

View File

@ -2,7 +2,7 @@
DUNIKEY=/.zen/game/players/.current/secret.dunikey
# Noeud Duniter
NODE=https://duniter.pini.fr/gva
NODE=https://g1.asycn.io/gva
# Adresse du pod Cesium ou Gchange à utiliser
#POD=https://g1.data.le-sou.org

View File

@ -1,29 +1,34 @@
#shellcheck shell=sh disable=SC2034
ipfsNodeId() {
ipfsNodeId=$(jq -r .Identity.PeerID ~/.ipfs/config)
[ -n "$ipfsNodeId" ] && echo "$ipfsNodeId"
}
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])/" \
|| true)
[ -n "$isLan" ] && echo "$isLan" ||:
[ -n "$isLan" ] && echo "$isLan" || true
} 2>/dev/null
isPlayerLegal() {
isPlayerLegal=$(cat "$(myPlayerPath)"/.legal 2>/dev/null || true)
[ -n "$isPlayerLegal" ] && echo "$isPlayerLegal" || true
}
myAstronauteKey() {
myAstronauteKey=$(ipfs --api "$(myIpfsApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
[ -n "$myAstronauteKey" ] && echo "$myAstronauteKey"
}
myDomainName() {
myDomainName=$(hostname -d 2>/dev/null) && [ -z "$myDomainName" ] && myDomainName=$(domainname 2>/dev/null) && [ "$myDomainName" = "(none)" ] && myDomainName="localhost"
[ -n "$myDomainName" ] && echo "$myDomainName"
}
myHash() {
[ -f ~/.zen/game/players/localhost/latest ] \
&& myHash=$(cat ~/.zen/game/players/localhost/latest) \
|| myHash=$(myTmpl |ipfs add -q)
[ ! -f ~/.zen/game/players/localhost/latest ] \
&& echo "$myHash" > ~/.zen/game/players/localhost/latest
[ -n "$myHash" ] && echo "$myHash"
myIpfsHash() {
[ -f "$(myPath)"/localhost/latest ] \
&& myIpfsHash=$(cat "$(myPath)"/localhost/latest) \
|| myIpfsHash=$(myTmpl |ipfs add -q)
[ ! -f "$(myPath)"/localhost/latest ] \
&& echo "$myIpfsHash" > "$(myPath)"/localhost/latest
[ -n "$myIpfsHash" ] && echo "$myIpfsHash"
}
myHttp() {
@ -38,25 +43,30 @@ myHttp() {
}
myHttpContent() {
[ -n "$(myHash)" ] \
[ -n "$(myIpfsHash)" ] \
&& 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>" \
<p>The document is <a href=\"ipfs/$(myIpfsHash)\">here</a> in IPFS.</p></body></html>" \
&& echo "$myHttpContent"
}
myHttpHeader() {
[ -n "$(myHash)" ] \
[ -n "$(myIpfsHash)" ] \
&& myHttpHeader="HTTP/1.0 302 Found
Content-Type: text/html; charset=UTF-8
Content-Length: $(myHttpContent |wc -c)
Date: $(date -R)
Location: ipfs/$(myHash)
Location: ipfs/$(myIpfsHash)
Server: and"
[ -n "$(myKey)" ] && myHttpHeader="${myHttpHeader}
set-cookie: AND=$(myKey); expires=$(date -R -d "+1 month"); path=/; domain=.$(myDomainName); Secure; SameSite=lax"
[ -n "$(myIpfsKey)" ] && myHttpHeader="${myHttpHeader}
set-cookie: AND=$(myIpfsKey); expires=$(date -R -d "+1 month"); path=/; domain=.$(myDomainName); Secure; SameSite=lax"
[ -n "$myHttpHeader" ] && echo "$myHttpHeader"
}
myHome() {
myHome=$(cd ~ && pwd -P)
[ -n "$myHome" ] && echo "$myHome"
}
myHostName() {
myHostName=$(hostname |sed 's/\.'"$(myDomainName)"'$//')
[ -n "$(myDomainName)" ] && myHostName="${myHostName}.$(myDomainName)" || myDomainName=${myHostName#*.}
@ -69,25 +79,93 @@ myIp() {
}
myIpfs() {
[ -n "$(myHash)" ] \
&& myIpfs="${myIPFS}/ipfs/$(myHash)" \
[ -n "$(myIpfsHash)" ] \
&& myIpfs="${myIPFS}/ipfs/$(myIpfsHash)" \
&& echo "$myIpfs"
}
myIpfsApi() {
ipfs --api "$(cat "$(myHome)"/.ipfs/api)" swarm peers >/dev/null 2>&1 \
&& myIpfsApi=$(cat "$(myHome)"/.ipfs/api) \
&& echo "$myIpfsApi"
}
myIpfsKey() {
myIpfsKey=$(ipfs --api "$(myIpfsApi)" key list -l | awk '$2 == "self" {print $1}')
[ -n "$myIpfsKey" ] && echo "$myIpfsKey"
}
myIpfsKeystore() {
myIpfsKeystore=$(cd "$(myHome)"/.ipfs/keystore && pwd -P)
[ -n "$myIpfsKeystore" ] && echo "$myIpfsKeystore"
}
myIpfsPeerId() {
myIpfsPeerId=$(jq -r .Identity.PeerID "$(myHome)"/.ipfs/config)
[ -n "$myIpfsPeerId" ] && echo "$myIpfsPeerId"
}
myIpns() {
[ -n "$(myKey)" ] \
&& myIpns="${myIPFS}/ipns/$(myKey)" \
[ -n "$(myIpfsKey)" ] \
&& myIpns="${myIPFS}/ipns/$(myIpfsKey)" \
&& echo "$myIpns"
}
myKey() {
myKey=$(ipfs key list -l | awk '$2 == "self" {print $1}')
[ -n "$myKey" ] && echo "$myKey"
myPath() {
myPath=$(cd ~/.zen/game/players/ && pwd -P)
[ -n "$myPath" ] && echo "$myPath"
}
myPath() {
myPath=$(cd "$(dirname "$0")" 2>/dev/null && pwd -P)
[ -n "$myPath" ] && echo "$myPath"
myPlayer() {
myPlayer=$(cat "$(myPath)"/.current/.player 2>/dev/null)
[ -n "$myPlayer" ] && echo "$myPlayer"
}
myPlayerApi() {
ipfs --api "$(cat "$(myPlayerPath)"/.ipfs/api )" swarm peers >/dev/null 2>&1 \
&& myPlayerApi=$(cat "$(myPlayerPath)"/.ipfs/api) \
&& echo "$myPlayerApi"
}
myPlayerBrowser() {
myPlayerBrowser=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1)
[ -n "$myPlayerBrowser" ] && echo "$myPlayerBrowser"
}
myPlayerFeedKey() {
myPlayerFeedKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayer)"'_feed" {print $1}')
[ -n "$myPlayerFeedKey" ] && echo "$myPlayerFeedKey"
}
myPlayerG1Pub() {
myPlayerG1Pub=$(cat "$(myPlayerPath)"/.g1pub 2>/dev/null)
[ -n "$myPlayerG1Pub" ] && echo "$myPlayerG1Pub"
}
myPlayerKey() {
myPlayerKey=$(ipfs --api "$(myPlayerApi)" key list -l | awk '$2 == "'"$(myPlayer)"'" {print $1}')
[ -n "$myPlayerKey" ] && echo "$myPlayerKey"
}
myPlayerKeystore() {
myPlayerKeystore=$(cd "$(myPlayerPath)"/.ipfs/keystore && pwd -P)
[ -n "$myPlayerKeystore" ] && echo "$myPlayerKeystore"
}
myPlayerNs() {
myPlayerNs=$(cat "$(myPlayerPath)"/.playerns 2>/dev/null)
[ -n "$myPlayerNs" ] && echo "$myPlayerNs"
}
myPlayerPath() {
[ -n "$myPlayer" ] \
&& myPlayerPath=$(cd "$(myPath)"/"$(myPlayer)" && pwd -P) \
&& echo "$myPlayerPath"
}
myPlayerPseudo() {
myPlayerPseudo=$(cat "$(myPlayerPath)"/.pseudo 2>/dev/null)
[ -n "$myPlayerPseudo" ] && echo "$myPseudo"
}
myTmpl() {
@ -113,7 +191,7 @@ myTs() {
}
MOATS="$(myTs)"
IPFSNODEID="$(ipfsNodeId)"
IPFSNODEID="$(myIpfsPeerId)"
myIP="$(myIp)"
isLAN="$(isLan)"
myHOST="astroport.$(myDomainName)" \

View File

@ -330,6 +330,7 @@ then
"size": "'${FILE_BSIZE}'",
"description": "'${DESCRIPTION}'",
"screenshot": "'/ipfs/${POSTER}'",
"g1pub": "'${G1PUB}'",
"ipfsroot": "'/ipfs/${IPFSREPFILEID}'",
"file": "'${file}'",
"ipfs": "'/ipfs/${IPFSREPFILEID}/${URLENCODE_FILE_NAME}'",

View File

@ -127,7 +127,7 @@ h1, p {
<header class="header">
<h1>Astroport.ONE</h1>
<a target="you" href="_ME_">ME</a> : _IFRIENDHEAD_
<a target="you" href="_ME_">MOA</a> : _IFRIENDHEAD_
</header>
<div class="row">