how to install and configure syncthing

Опубликовано: 01 Январь 1970
на канале: Heikki Koivisto
2,921
7

I ran a long time Nextcloud server which works as a backup server, but it got an issue syncing larger video files. So let's try Syncthing for a backup solution, installation is easy, and configuration simple. But Syncthing won't able to show content like nextcloud.

Commands:

sudo apt-get install curl apt-transport-https ca-certificates
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt update
sudo apt-get install syncthing
systemctl enable [email protected]
systemctl start [email protected]
systemctl status [email protected]
sudo ufw allow 22000/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 8384/tcp
sudo apt install nginx
sudo nano /etc/nginx/conf.d/syncthing.conf

sudo nginx -t
sudo systemctl reload nginx

Nginx configure:

server {
listen 80;
return 301 https://$host$request_uri:8384;
}
server {

listen 443;
server_name server-dns;
ssl_certificate /home/de/.config/syncthing/https-cert.pem;
ssl_certificate_key /home/de/.config/syncthing/https-key.pem;

ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;

access_log /var/log/nginx/syncthing.access.log;

location / {

proxy_pass https://127.0.0.1:8384;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

}
}

#syncthing #fileshare #owndropbox