This commit is contained in:
poka 2020-03-15 00:33:07 +01:00
parent 8345c42790
commit c8b3ec959b
1 changed files with 51 additions and 0 deletions

View File

@ -24,6 +24,57 @@ if [[ ! $(which silkaj) ]]; then
echo 'PATH=$PATH:.local/bin' >> ~/.bashrc && source ~/.bashrc
fi
# Install ScuttleButt
if [[ ! $(which sbot) ]]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
source ~/.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install --lts
sudo apt install libtool autoconf -y
npm install sodium-native ssb-backlinks
sudo npm install -g ssb-server
echo "Adresse DNS de votre Pub SSB? hostname.yourdomain.tld"
read EXTERNAL
mkdir -p ~/.ssb
cat > ~/.ssb/config <<EOF
{
"connections": {
"incoming": {
"net": [
{
"scope": "public", "external": ["$EXTERNAL"], "transform": "shs", "port": 8008
},
{ "scope": "private", "transform": "shs", "port": 8008, "host": "127.0.0.1" }
]
},
"outgoing": {
"net": [
{
"transform": "shs"
}
]
}
}
}
EOF
cat > ~/run-ssb-PUB_$EXTERNAL.sh <<EOF
#!/bin/bash
while true; do
ssb-server start --host $EXTERNAL
done
EOF
chmod 755 ~/run-ssb-PUB_$EXTERNAL.sh
~/run-ssb-PUB_$EXTERNAL.sh &
fi
# INSTALL sbotc
if [[ ! $(which sbotc) ]]; then
sudo apt install libsodium-dev jq -y