User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gentoo:syncthing [2024/03/05 10:20] willygentoo:syncthing [2025/03/13 13:27] (current) – [SyncThing] willy
Line 1: Line 1:
-====== SyncThing ======+====== K) SyncThing ======
  
-[[https://syncthing.net/|SyncThing]] is a **continuous file synchronization** program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it’s transmitted over the internet.+[[https://syncthing.net/|SyncThing]] is a **continuous file synchronization** program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it’s transmitted over the internet.  
 + 
 +It also bypass the need for exposing your server to the internet due to the usage of an anonymous network or interface servers (which you could also host if you like).
  
 It basically keep folders in synchronization between hosts. hosts can be computers and also mobile devices. It basically keep folders in synchronization between hosts. hosts can be computers and also mobile devices.
  
-__Remember:__ SyncThing is **NOT A BACKUP** solution!+__Remember:__ SyncThing is **NOT A BACKUP** solution for your server! 
 +(not even for your mobile devices, but if you [[selfhost:backup|backup]] your server, then it is) 
 + 
 +Syncthing can be configured via a nice web interface.
  
 ===== Installation ===== ===== Installation =====
Line 14: Line 19:
 </code> </code>
  
-For SyncThing to be useful you need to run it as the **users** group, and you should also ensure SyncThing data and logs are stored on your raid arrays. Edit the **/etc/conf.d/syncthing** configuration file+Syncthing is configured via **/etc/conf.d/syncthing** file, where you can specify the user it will run as and the port it will bind to. Following the Gentoo way you can run more than one instance of syncthing, something you might want to do to separate instances by users.
-<file - synchting> +
-SYNCTHING_USER="syncthing+
-SYNCTHING_GROUP="users"+
  
-# Configuration directory +There is a wiki page on Gentoo [[https://wiki.gentoo.org/wiki/Syncthing|here]] if you want more details.
-SYNCTHING_HOMEDIR="/data/syncthing/.config/syncthing"+
  
-# Log file location +You want to run Syncthing as the user you need your data synched as.
-SYNCTHING_LOGFILE="/data/syncthing/syncthing.log" +
-</file>+
  
-And create the **/data/syncthing** folder that will contain default shared folders and logs:+After you have set it up, you should login as that specific user and run it once manually:
 <code bash> <code bash>
-mkdir /data/syncthing+syncthing
 </code> </code>
 +then close it. This will create the basic internal configuration files needed. 
  
-===== Usage =====+You most probably don't want to run the standard instance of syncthing but always make a copy of it for the user or groups you want. For example, if you need to run a syncthing to sync your mobile phone stuff as user **myuser**, you will need to: 
 +  * copy **/etc/conf.d/syncthing** to **/etc/conf.d/syncthing.myuser** 
 +  * symlink **/etc/init.d/syncthing** to **/etc/init.d/syncthing.myuser**
  
-Add it to default runlevel and start it:+then edit (see below) the config file and start the service:
 <code bash> <code bash>
-rc-update add syncthing default +rc-update add syncthing.myser default 
-/etc/init.t/syncthing start+/etc/init.d/syncthing.myuser start
 </code> </code>
  
-Open your browser to **http://127.0.0.1/8384**+===== Configuration (per user) ===== 
 + 
 +For SyncThing to be useful you need to run it as a specific user or group, and assign a unique port to it.  
 + 
 +Edit the **/etc/conf.d/syncthing.myuser** configuration file: 
 +<file - synchting> 
 +SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8384" 
 +SYNCTHING_USER="myuser" 
 +SYNCTHING_GROUP="users" 
 +SYNCTHING_HOMEDIR="/home/myuser/.config/syncthing" 
 +SYNCTHING_LOGFILE="/home/myuser/syncthing.log" 
 +SYNCTHING_UMASK=003 # to allow pid file to be read by monitor utilities 
 +</file> 
 + 
 +Remember to run syncthing manually once as the user: 
 +<code bash> 
 +su - myuser 
 +syncthing 
 +</code> 
 +then stop it, before launching the service. 
 + 
 +===== Reverse Proxy ===== 
 + 
 +Running syncthing under NGINX is easy, take this as example: 
 +<file - syncthing.conf> 
 +location /syncthing-myuser/
 +        proxy_pass http://127.0.0.1:8384/; 
 +        proxy_read_timeout 120s; 
 +        proxy_set_header Host 127.0.0.1; 
 +        access_log off; 
 +
 +</file> 
 + 
 +Just make sure the port is correct. 
 + 
 +===== Usage ===== 
 + 
 +Open your browser to **http://127.0.0.1/8384**, use the correct port, and configure it.
  
  
  
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information