diff --git a/.install/scuttlebutt.sh b/.install/scuttlebutt.sh index dfd6d55..5e3361d 100755 --- a/.install/scuttlebutt.sh +++ b/.install/scuttlebutt.sh @@ -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 diff --git a/zen/ssb_SURVEY_contact.sh b/zen/ssb_SURVEY_contact.sh index 3071be9..ff7fdfb 100755 --- a/zen/ssb_SURVEY_contact.sh +++ b/zen/ssb_SURVEY_contact.sh @@ -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 diff --git a/zen/ssb_SURVEY_swarmkey.sh b/zen/ssb_SURVEY_swarmkey.sh index 79dc0c2..e2f109e 100755 --- a/zen/ssb_SURVEY_swarmkey.sh +++ b/zen/ssb_SURVEY_swarmkey.sh @@ -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")