Pour une planète Heureuse

This commit is contained in:
qo-op 2020-05-21 11:32:43 +02:00
parent 90d54acb30
commit afd7c29b7c
7 changed files with 24 additions and 47 deletions

View File

@ -1,14 +1,14 @@
#!/bin/bash
################################################################################
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
########################################################################
# AJAX REQUEST TRACKER : ASTROPORT ON BOARDING
# GETTING : PHONE + PARRAIN + NAISSANCE
#
# DataFlow : index.html + ajaxform.js + zen_loveland_entrance.php
################################################################################
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
source $MY_PATH/init.sh
@ -38,10 +38,13 @@ Love Land ENTRANCE CHECKING
'
[[ ! $G1SMS == "yes" ]] && echo "I am NOT a G1SMS Node... Can't do nothing... EXIT" && exit 1
$MY_PATH/ipfs_SWARM_refresh.sh
/home/$YOU/.zen/astroport/zen/ipfs_SWARM_refresh.sh
for hashfile in $(ls /home/$YOU/.zen/ipfs_swarm/.Qm*/TASK/loveland_entrance); do
PHONE=$(cat $hashfile)
PP=$(cat $hashfile)
PHONE=$(echo $PP | cut -d '|' -f 1)
PARRAIN=$(echo $PP | cut -d '|' -f 2)
NAISSANCE=$(echo $PP | cut -d '|' -f 3)
HPHONE=$(basename -- "$hashfile")
echo "We have received Ajax Astroport request from $PHONE"
done

View File

@ -24,7 +24,7 @@ angular.module("cesium.config", [])
"httpsMode": false,
"shareBaseUrl": "https://g1.duniter.fr",
"helptip": {
"enable": true,
"enable": false,
"installDocUrl": {
"fr-FR": "https://duniter.org/fr/wiki/duniter/installer/",
"en": "https://duniter.org/en/wiki/duniter/install/"

View File

@ -88,7 +88,7 @@
<div class="row">
<div class="col-xl-9 mx-auto">
<div id="phoneresultat">
<br><h4>Soyons LIBRE !!<br>ensemble vers un Futur plus Humain.</h4>
<br><h4>Pour une planète Heureuse !!<br>ensemble vers un Futur plus Humain.</h4>
</div>
</div>
</div>

View File

@ -23,10 +23,10 @@ if (strlen($_REQUEST['phone']) == 10 ) {
// MODE SWARM : write
$YOU = exec("ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1", $output, $return);
$POINTSMS = exec("ls /home/$YOU/.zen/ipfs_swarm/.Qm*/G1SSB/_sms | shuf -n 1 | cut -d '/' -f 6", $output, $return);
if ($return == 0) {
$IPFSNODEID = exec("ipfs id -f='<id>\n'", $output, $return);
// ACCESS RIGHT PROBLEM !!!
$fp = fopen('/home/'.$YOU.'/.zen/ipfs/.'.$IPFSNODEID.'/TASK/loveland_entrance/'.$HPHONE, 'w');
// FOUND $POINTSMS ACCESS RIGHT PROBLEM !!! SO loveland_entrance is 777
$fp = fopen('/home/'.$YOU.'/.zen/ipfs/'.$POINTSMS.'/TASK/loveland_entrance/'.$HPHONE, 'w');
fwrite($fp, $PHONE);
}
return true;

View File

@ -19,13 +19,13 @@ ME="${0##*/}"
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
[[ $YOU == "" ]] && echo "Please run ipfs daemon" && exit 1
########################################################################
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_info
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info
########################################################################
ipfsnodeid=$(ipfs id -f='<id>\n')
[[ $ipfsnodeid == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
########################################################################
[[ ! -f ~/.ssb/secret.dunikey ]] && $MY_PATH/tools/secret2dunikey.sh
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
G1PUB=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
########################################################################
mkdir -p ~/.zen/ipfs_swarm
@ -35,7 +35,7 @@ ___ _ _ __ __ _ _ _ _ _ _ __
_|_| | __) __)\/\//--\| \| | | \|_| | \|___)| |
'
echo "I am $ipfsnodeid"
echo "I am $IPFSNODEID"
## CHANNELS SWARM INDEX COPY PROCEDURE
## SIGNAL ~/.zen/g1sms_wallets TODO
@ -44,7 +44,7 @@ echo "PUBLISHING MY OWN /home/$YOU/.zen/ipfs/ to SWARM"
[[ ! -d /home/$YOU/.zen/ipfs ]] && echo "ERROR : /home/$YOU/.zen/ipfs/ NOT FOUND" && exit 1
IWALLETS=$(ipfs add -rHq /home/$YOU/.zen/ipfs | tail -n 1)
NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
echo "REFRESHING /home/$YOU/.zen/ipfs_swarm/ from my SWARM peers"
count=1

View File

@ -18,13 +18,13 @@ ME="${0##*/}"
########################################################################'
########################################################################
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_info
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info
########################################################################
ipfsnodeid=$(ipfs id -f='<id>\n')
[[ $ipfsnodeid == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
IPFSNODEID=$(ipfs id -f='<id>\n')
[[ $IPFSNODEID == "" ]] && echo "ERROR missing IPFS Node id !! IPFS is not installed !?" && exit 1
########################################################################
[[ ! -f ~/.ssb/secret.dunikey ]] && $MY_PATH/tools/secret2dunikey.sh
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
G1PUB=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
########################################################################
echo '
@ -36,7 +36,7 @@ echo '
ZENTAG REFRESH
'
echo "I am /ipns/$ipfsnodeid controling and refreshing my ZenTag"
echo "I am /ipns/$IPFSNODEID controling and refreshing my ZenTag"
count=0
[[ ! -d ~/.zen/tag/ ]] && exit 1

View File

@ -1,26 +0,0 @@
#!/bin/sh
# Author @f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519
invite="${1?invite}"
code="${invite##*~}"
addr="${invite%%~*}"
feed="${addr##*:}"
hostname="${addr%:*}"
host="${hostname%:*}"
port="${hostname##*:}"
out="$(sbotc -s "$host" -p "$port" -k "$feed" -K "$code" -t async invite.use {} 2>&1)"
if echo "$out" | grep -q 'feed to follow is missing'
then
echo success
elif echo "$out" | grep -q 'method:invite,use is not in list of allowed methods'
then
echo invalid/expired
exit 1
else
echo fail
echo "$out"
echo trying another method:
sbotc -s "$host" -p "$port" -k "$feed" -K "$code" -t source blobs.get ''
exit 1
fi