setup files for my VPS
 
 
Go to file
Abhinav Sarkar 3106d7bdab Builds the smtp service instead of fetching image 2018-07-07 08:57:11 +00:00
nginx-conf Adds blacklist for nginx 2018-06-28 19:01:34 +00:00
smtp@49dbeb4b31 Builds the smtp service instead of fetching image 2018-07-07 08:57:11 +00:00
webhooks Adds webhooks service with site reploy webhook 2018-06-20 18:25:14 +00:00
.gitignore Adds gitea 2018-06-09 12:25:36 +00:00
.gitmodules Builds the smtp service instead of fetching image 2018-07-07 08:57:11 +00:00
README.md Adds README with setup instructions 2018-06-14 05:45:32 +00:00
docker-compose.yml Builds the smtp service instead of fetching image 2018-07-07 08:57:11 +00:00
space.service Adds systemd service to start docker compose 2018-06-13 16:24:03 +00:00

README.md

space

Setup files for my VPS

Steps to setup

Setup VM

  • login as root
  • disable ssh for root
  • add user: adduser <username>
  • move and chown ssh keys from root to the new user
  • add user to sudo: sudo usermod -aG sudo <username>
  • setup firewall to allow/disallow ports
  • logout and login as the new user

Install docker

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install -y docker-ce docker-compose
$ sudo gpasswd -a $USER docker

Setup space

  • copy/clone this repo to ~/space
  • setup SSL certificates (optional)
$ wget https://dl.eff.org/certbot-auto
$ chmod a+x ./certbot-auto
$ sudo ./certbot-auto certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d *.abhinavsarkar.net
$ sudo cp /etc/letsencrypt/live/abhinavsarkar.net/* ~/space/certs/
$ sudo chown -R $USER:$USER ~/space/certs/
  • stop and disable resolvd
$ sudo service systemd-resolved stop
$ sudo systemctl disable systemd-resolved.service
  • edit /etc/resolv.conf to set the nameserver to 8.8.8.8
  • edit ~/space/space.service to set environment variables
    • set passwords to random values if new setup
    • set passwords to the previous values if a copy setup
    • set PH_SERVER_IP to the static IP of the server
  • setup the service and start
$ sudo cp ~/space/space.service /etc/systemd/system/
$ sudo systemctl enable space
$ sudo systemctl start space
  • edit /etc/resolv.conf to set the nameserver to 127.0.0.1