Skip to content

Instantly share code, notes, and snippets.

@runbiscuit
Last active March 4, 2019 15:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runbiscuit/cc0d58c6fc7cad16c2441793c36512a3 to your computer and use it in GitHub Desktop.
Save runbiscuit/cc0d58c6fc7cad16c2441793c36512a3 to your computer and use it in GitHub Desktop.
Syncthing is πŸš€

deploy-syncthing

Everyone knows it. Syncthing is the best way to sync your files. Comes with local discovery, too! Best thing ever.

πŸš€

Install is easy. Too easy.

wget https://gist.githubusercontent.com/theroyalstudent/cc0d58c6fc7cad16c2441793c36512a3/raw/deploySyncthing.sh -O deploySyncthing.sh && bash deploySyncthing.sh && rm -rf deploySyncthing.sh
#!/bin/bash
# Add the release PGP keys:
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
# Add the "release" channel to your APT sources:
echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list
# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing supervisor -y
adduser syncthing --gecos '' --disabled-password
(systemctl enable supervisor && systemctl start supervisor) || (update-rc.d -f supervisor defaults || service supervisor start)
wget https://gist.githubusercontent.com/theroyalstudent/cc0d58c6fc7cad16c2441793c36512a3/raw/syncthing.conf -O /etc/supervisor/conf.d/syncthing.conf
supervisorctl reread
supervisorctl update
sleep 5
supervisorctl stop syncthing
sed -i s/"127.0.0.1"/"$(ifconfig private | grep "inet addr" | awk '{ print $2 }' | sed s/"addr:"/""/)"/ /home/syncthing/.config/syncthing/config.xml
sed -i s/"<globalAnnounceEnabled>true<\/globalAnnounceEnabled>"/"<globalAnnounceEnabled>false<\/globalAnnounceEnabled>"/ /home/syncthing/.config/syncthing/config.xml
sed -i s/"<relaysEnabled>true<\/relaysEnabled>"/"<relaysEnabled>false<\/relaysEnabled>"/ /home/syncthing/.config/syncthing/config.xml
supervisorctl start syncthing
[program:syncthing]
command = /usr/bin/syncthing -no-browser -home="/home/syncthing/.config/syncthing"
directory = /home/syncthing/
autorestart = True
user = syncthing
environment = STNORESTART="1", HOME="/home/syncthing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment