Installing Resilio Sync on a VPS
Most of the stuff I care about is backed up to iCloud, but it is pants for in progress documents / code when swapping between computers. Dropbox is great for that, but I keep hitting the free space limit, don't need 2TB, and recently the client on my mac was beginning to take over all resources.
I installed Resilio Sync (the free version) on the various computers I want to sync files between, but it requires the two computers (source and destination) to be on at the same time in order to sync, which is not always the case. The solution is a server which is always on. I don't need to actually access the documents on the server, so they can live encrypted there.
Reference
Super helpful post with all steps succinctly written and troubleshooting steps: https://kenfavors.com/code/how-to-install-resilio-sync-on-ubuntu-16-04-using-vagrant/ which takes a lot from: https://www.linuxbabe.com/ubuntu/install-resilio-sync-ubuntu-16-04-16-10. This post was also helpful especially for the intial set up locally: https://danielandrade.net/2017/07/22/roll-your-own-secure-dropbox-alternative/
Install from repository
See: https://help.resilio.com/hc/en-us/articles/206178924
echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" | sudo tee /etc/apt/sources.list.d/resilio-sync.list
curl -L https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add
sudo apt update
sudo apt install resilio-sync
sudo systemctl enable resilio-sync
# check running
systemctl status resilio-sync
This failed for me the first time for some reason, fixed by uninstalling with sudo apt-get purge resilio-sync
and reinstalling.
Enable UI remotely
# check gui is available locally
curl https://localhost:8888/gui/ -ki
# add / update DNS with registrar
# create config for nginx
sudo vi /etc/nginx/sites-available/resilio.dot.kitchen
server {
listen 443 ssl;
server_name resilio.dot.kitchen;
access_log /var/log/nginx/resilio_access.log;
error_log /var/log/nginx/resilio_error.log;
location / {
proxy_pass https://127.0.0.1:8888;
}
}
sudo ln -s /etc/nginx/sites-available/resilio.dot.kitchen.conf /etc/nginx/sites-enabled/resilio.dot.kitchen
sudo nginx -t
sudo systemctl reload nginx
# gui should now be accessible externally, with SSL errors
# generate SSL cert
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d resilio.dot.kitchen
Secure UI
- Access the UI and set a username and password
- Enter a name for this server, confirm terms, submit, login again
Set up sync
- Ensure rslsync user has permissions to target folder used for sync
sudo apt install acl
sudo setfacl -R -m "u:rslsync:rwx" /sync
- Copy encrypted key from existing folder on local computer
- + > Enter a key or link > paste key > choose folder