Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gentoo:syncthing [2024/03/05 10:19] – willy | gentoo:syncthing [2025/03/13 13:27] (current) – [SyncThing] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SyncThing ====== | + | ====== |
- | [[https:// | + | [[https:// |
+ | |||
+ | 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: | ||
+ | (not even for your mobile devices, but if you [[selfhost: | ||
+ | |||
+ | Syncthing can be configured via a nice web interface. | ||
===== Installation ===== | ===== Installation ===== | ||
Line 12: | Line 19: | ||
</ | </ | ||
- | 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 **/ | + | Syncthing is configured via **/ |
- | <file - synchting> | + | |
- | SYNCTHING_USER=" | + | |
- | SYNCTHING_GROUP=" | + | |
- | # Configuration directory | + | There is a wiki page on Gentoo [[https://wiki.gentoo.org/wiki/ |
- | SYNCTHING_HOMEDIR=" | + | |
- | # Log file location | + | You want to run Syncthing as the user you need your data synched as. |
- | SYNCTHING_LOGFILE="/ | + | |
- | </ | + | |
- | And create the **/ | + | 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 |
</ | </ | ||
+ | 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 **/ | ||
+ | * symlink **/ | ||
- | Add it to default runlevel | + | 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 |
- | /etc/init.t/syncthing start | + | /etc/init.d/syncthing.myuser |
</ | </ | ||
- | Open your browser to **http:// | + | ===== 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 **/ | ||
+ | <file - synchting> | ||
+ | SYNCTHING_GUI_ADDRESS=" | ||
+ | SYNCTHING_USER=" | ||
+ | SYNCTHING_GROUP=" | ||
+ | SYNCTHING_HOMEDIR="/ | ||
+ | SYNCTHING_LOGFILE="/ | ||
+ | SYNCTHING_UMASK=003 # to allow pid file to be read by monitor utilities | ||
+ | </ | ||
+ | |||
+ | Remember to run syncthing manually once as the user: | ||
+ | <code bash> | ||
+ | su - myuser | ||
+ | syncthing | ||
+ | </ | ||
+ | then stop it, before launching the service. | ||
+ | |||
+ | ===== Reverse Proxy ===== | ||
+ | |||
+ | Running syncthing under NGINX is easy, take this as example: | ||
+ | <file - syncthing.conf> | ||
+ | location / | ||
+ | proxy_pass http:// | ||
+ | proxy_read_timeout 120s; | ||
+ | proxy_set_header Host 127.0.0.1; | ||
+ | access_log off; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Just make sure the port is correct. | ||
+ | |||
+ | ===== Usage ===== | ||
+ | |||
+ | Open your browser to **http:// | ||