This commit is contained in:
qo-op 2020-03-26 05:20:49 +01:00
parent 7d0f45a4d8
commit 7ffd053c65
3 changed files with 11 additions and 58 deletions

View File

@ -31,6 +31,16 @@ scuttlebutt() {
mv ~/.ssb_astroport/node_modules/* $node_lib_path/node_modules/
# Create sblob symlink
ln -s $node_lib_path/node_modules/ssb-secret-blob/index.js $node_bin_path/sblob
# INSTALL sbotc
if [[ ! $(which sbotc) ]]; then
sudo apt install libsodium-dev jq -y
git clone https://git.scuttlebot.io/%25133ulDgs%2FoC1DXjoK04vDFy6DgVBB%2FZok15YJmuhD5Q%3D.sha256 sbotc
cd sbotc
make
sudo make install
fi
fi
# TEST ssb-server Install

View File

@ -123,7 +123,7 @@ FROM.G1_${g1self}
FROM.IPFS_${ipfsnodeid}
"
sbotc publish '{"type":"post","text":"#astroport-swarmkey = ['"$name"']('"$id"') TO.SSB_${author} TO.G1_${g1author} +++ FROM.SSB_${self_name} FROM.G1_${g1self} FROM.IPFS_${ipfsnodeid}","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
sbotc publish '{"type":"post","text":"#astroport-swarmkey = ['"$name"']('"$id"') TO.SSB_'"$author"' TO.G1_'"$g1author"' +++ FROM.SSB_'"$self_name"' FROM.G1_'"$g1self"' FROM.IPFS_'"$ipfsnodeid"'","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
else

View File

@ -34,63 +34,6 @@ messages=$(sbotc backlinks.read '{"query":[{"$filter":{"dest":"#astroport-swarmk
while read -r msg
do
autofollow=$(printf %s "$msg" | jq .value.content.autofollow)
[[ ! $autofollow ]] && echo "I am NOT the Pub..." && echo "$msg" | jq && continue
echo "
___ _______ _ _ ___ ____
| |\ |\ /| ||_ / / \|\ || /\ / |
_|_| \| \/_|_ ||_ \_\_/| \||/--\\_ | RECEIVED
"
author=$(printf %s "$msg" | jq -r .value.author)
g1author=$(printf %s "$msg" | jq -r .value.author | cut -d '@' -f 2 | cut -d '.' -f 1 | base64 -d | base58)
# Crypt, ipfs store, send
if [[ -f ~/.ipfs/swarm.key ]]; then
mkdir -p ~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}
file=~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/ipfs_swarm.key.crypt
$MY_PATH/tools/natools.py encrypt -p ${g1author} -i ~/.ipfs/swarm.key -o ${file}
cp ${file} ~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/
echo "
$author
\|/ \|/ \|/
/|\ /|\ /|\ cyphering swarmkey
IPFS
~/.zen/ipfs/.${ipfsnodeid}/INVITE/${g1author}/ipfs_swarm.key.crypt
"
name=${file##*/}
id="$(sbotc blobs.add < "$file")"
type="$(file -b --mime-type "$file")"
size="$(wc -c < "$file")"
echo "
______ _ _ _ ____ __ _ _ _ _ _____
/\ (_ ||_)/ \|_)/ \|_)|__(_\ //\ |_)|\/||/|_\_/ |_)/ \(_ |
/--\__) || \\_/| \_/| \| __)\/\//--\| \| ||\|_ | | \_/__) |
SSB
#astroport-swarmkey
[$name]($id)
TO.SSB_${author}
TO.G1_${g1author}
+++
FROM.SSB_${self_name}
FROM.G1_${g1self}
FROM.IPFS_${ipfsnodeid}
"
sbotc publish '{"type":"post","text":"#astroport-swarmkey = ['"$name"']('"$id"') TO.SSB_'"$author"' TO.G1_'"$g1author"' +++ FROM.SSB_'"$self_name"' FROM.G1_'"$g1self"' FROM.IPFS_'"$ipfsnodeid"'","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
fi
done < <(printf '%s\n' "$messages")