2020-01-29 20:46:44 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Copy over basic configuration files.
|
|
|
|
cp ./tmux.conf ~/.tmux.conf
|
|
|
|
cp ./bashrc ~/.bashrc
|
|
|
|
source ~/.bashrc
|
|
|
|
|
|
|
|
# Nodejs install prerequisite. From official documentation.
|
|
|
|
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
|
|
|
|
|
|
|
|
# Yarn install prerequisite.
|
|
|
|
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
|
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
|
|
|
|
|
|
|
# Apt installations.
|
|
|
|
sudo apt-get update
|
2020-01-29 21:41:20 +00:00
|
|
|
sudo apt-get -y install ufw tmux ranger htop nload nginx certbot \
|
|
|
|
python-certbot-nginx nodejs gcc g++ make yarn git
|
2020-01-29 20:46:44 +00:00
|
|
|
|
|
|
|
# Install pm2
|
|
|
|
sudo npm i -g pm2
|
|
|
|
|
|
|
|
# terminfo for alacritty terminal via ssh
|
|
|
|
wget -c https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info
|
|
|
|
sudo tic -xe alacritty,alacritty-direct alacritty.info
|
|
|
|
rm alacritty.info
|
|
|
|
|
|
|
|
# Install Go 1.13.7.
|
|
|
|
wget -c https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
|
|
|
|
sudo tar -C /usr/local -xzf go1.13.7.linux-amd64.tar.gz
|
2020-01-30 16:21:47 +00:00
|
|
|
source ~/.bashrc
|
2020-01-29 20:46:44 +00:00
|
|
|
rm go1.13.7.linux-amd64.tar.gz
|
|
|
|
|
2020-01-29 22:30:40 +00:00
|
|
|
# Sanity check that will pass if go was installed correctly.
|
2020-01-29 20:46:44 +00:00
|
|
|
go version
|
|
|
|
|
|
|
|
# Install Sia
|
|
|
|
git clone https://gitlab.com/NebulousLabs/Sia
|
|
|
|
cd Sia && git checkout viewnode && make
|
2020-01-29 21:41:20 +00:00
|
|
|
|
|
|
|
# Setup nginx config
|
|
|
|
sudo cp ./skynet-nginx.conf /etc/nginx/sites-available/skynet
|
|
|
|
sudo nginx -t
|
|
|
|
sudo systemctl reload nginx
|
|
|
|
|
|
|
|
# Setup firewall
|
|
|
|
sudo ufw enable
|
|
|
|
sudo ufw allow 'Nginx Full'
|
|
|
|
sudo ufw delete allow 'Nginx HTTP'
|
|
|
|
|
2020-01-29 22:30:40 +00:00
|
|
|
# Setup skynet frontend.
|
|
|
|
cd ~/
|
|
|
|
git clone https://gitlab.com/NebulousLabs/siawebviewer && cd siawebviewer
|
2020-01-29 21:41:20 +00:00
|
|
|
git checkout logging
|
|
|
|
yarn
|
2020-01-29 22:30:40 +00:00
|
|
|
|
|
|
|
# Start the frontend.
|
|
|
|
pm2 --name skynet start npm -- start
|