~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.cesium_name

This commit is contained in:
qo-op 2020-05-17 22:13:55 +02:00
parent 8f5a291eab
commit 2f5c7d87ce
3 changed files with 12 additions and 7 deletions

View File

@ -72,7 +72,7 @@ do
### Is "ipfs_swarm/.$id/G1SSB/_ssb.whoami" my SSB friend??
ssbID=$(cat /home/$YOU/.zen/ipfs_swarm/.$id/G1SSB/_ssb.whoami)
isMyFriend=$(grep -Rwl "$ssbID" /tmp/ssb-friends.txt)
[[ ! $isMyFriend ]] && echo "WARNING! $peer is NOT my SSB Friend..." # TODO: PROD ACTIVATE # && ipfs swarm disconnect $peer && ipfs bootstrap rm $peer
[[ ! $isMyFriend ]] && echo "WARNING! $peer is NOT my SSB Friend... $ssbID" # TODO: PROD ACTIVATE # && ipfs swarm disconnect $peer && ipfs bootstrap rm $peer
## TODO: Use fail2ban if same node continue entering our swarm...

View File

@ -188,6 +188,7 @@ ipfs ls /ipns/$ipfsnodeid
"
# COPY NODE G1SSB ID to IPFS
curl -s ${CESIUM}/user/profile/${g1pub} | jq -r '._source.title' > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.cesium_name
echo "$ssbpub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_ssb.whoami
echo "$g1pub" > ~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.pubkey

View File

@ -19,6 +19,7 @@ PASSENGER="$3" # ~/.zen/miam/timestamp/src_id.ext in ZenTag (add to IPFS datastr
METADATA="$4"
READ="$5" # Zen amount asked to allow passenger reading
PARK="$6" # Zen amount payed for IPFS PIN by passenger everyday
# Add any "parameters" needed by CONTRACT.sh
echo "
########################################################################
@ -29,7 +30,7 @@ echo "
########################################################################"
# If PASSENGER file, then must provide METADATA!
[[ $PASSENGER != "" ]] && [[ $METADATA == "" ]] && echo "PASSENGER needs METADATA !!! Please verify and correct..." && exit 1
[[ $PASSENGER != "" ]] && [[ $METADATA == "" ]] && echo "ERROR PASSENGER needs METADATA !!! Please verify and correct..." && exit 1
[[ $READ == "" ]] && READ=1
[[ $PARK == "" ]] && PARK=10
##############################################
@ -285,6 +286,8 @@ exit 0
EOF
fi
# END PASSENGER FILE
####################
###########################################################
# Copy TAG into IPFS + ipfs name publish -k ${AA}.key
@ -375,9 +378,8 @@ echo "
# READ QRCODE
qrencode -s 5 -o ~/.zen/tag/${AAH}/_QRCODE.read.png "RJ:${AA}#${J}"
# WRITE QRCODE
# TODO: best security cypher? but it is better to defend system than file ??? I think so.
# So consider well before using this code not under DEBIAN 10 it is tested for!
qrencode -s 5 -o ~/.zen/tag/${AAH}/_QRCODE.write.png "BJ:${BB}#${J}"
## TODO PROD REMOVE WRITE FILE
echo "QRCodes CREATED !!
See it :
@ -386,6 +388,7 @@ xviewer ~/.zen/tag/${AAH}/_QRCODE.write.png &
${AA}
"
[[ $(which xviewer) ]] && xviewer ~/.zen/tag/${AAH}/_QRCODE.read.png &
[[ $(which xviewer) ]] && xviewer ~/.zen/tag/${AAH}/_QRCODE.write.png &
@ -393,11 +396,11 @@ ${AA}
########################################################################
# SBOT PUBLISH
########################################################################
if [[ "${PASSENGERNAME}" != "" ]]; then
if [[ "${PASSENGERNAME}" != "" ]]; then
echo "$ISSUER"
msg="$(sbotc get '{"id":"'"$ISSUER"'"}')"
# echo "$msg" | jq #DEBUG
[[ $msg == "" ]] && echo "ERROR No SSB message for PASSENGER in $tstamp" && exit 1
[[ $msg == "" ]] && echo "ERROR No SSB message for PASSENGER (timestamp: $tstamp)" && exit 1
msg_root=$(printf %s "$msg" | jq -r .value.content.root)
[[ $msg_root == "null" ]] && msg_root=$ISSUER
msg_branch=$(printf %s "$msg" | jq -r .value.content.branch)
@ -447,7 +450,8 @@ sbotc publish '{"type":"post", "branch": "'"$msg_branch"'", "root": "'"$msg_root
else
# REGULAR ZenTAG, Send QRCode to INPUT TX emitter
### TODO PRINT AND SEND BY SSB WITH WHEN PASSENGER TOO
# CAREFULL IN THAT CASE ISSUER IS A G1WALLET
ssbid="@$(echo $ISSUER | base58 -d | base64).ed25519"
file=~/.zen/tag/${AAH}/_QRCODE.read.png