Some Bits: Nelson's log

9 posts about syncthing

Vault: towards my own NAS

Working on rationalizing my file storage now that I’m in a Proxmox universe. The idea here is to put all my important stuff on a NAS VM running the following services:

  • NFSv4
  • Samba
  • Syncthing
  • Restic with BackRest

I’ve got a basic cut at it working (other than Samba) and it seems good. Some notes on what and why.

Contents

What am I storing on the NAS? Very little right now, but the plan is:

  • 14GB of source code. Most of this never changes and it’s mostly small files although some 1GB data blobs sneak in occasionally.
  • 7GB of Windows Documents. Random stuff here but it’s helpful to sync and backup.
  • < 1GB of files on mobile devices. I use Syncthing to get stuff off my Android devices.
  • 4TB of Media archives. NFS and SMB mounted locally. No Syncthing, no backups. Right I am manually rsyncing them occasionally to the second house. I may migrate this to backups (local only, Backblaze is expensive) and Syncthing.

Access over the Internet

The challenge here is I want my files accessible over the Internet, because I have two houses. My house with Starlink is 50ms away from the house with the server (and Sonic fiber). NFS and Samba are only good for LAN access. Those network file systems sorta work over the Internet but it’s slow and awful.

So instead I’m using Syncthing to maintain a working copy of files on my local machine. That makes my setup a lot like what Dropbox or other cloud drives is doing. I’ve done it for years with important stuff including all my source code and it’s worked fine. A key thing here: I am almost never modifying files in two places at once. Syncthing has a conflict resolution system for that but it’s a little primitive.

I’m using Tailscale for now to access the Syncthing server on the vault. That shouldn’t strictly be necessary.

Storage medium

Where are my files stored? On virtual disks that Proxmox provides. Those virtual disks are allocated on a ZFS pool that Proxmox maintains. That way the NAS VM doesn’t need to use ZFS directly, instead it just puts an ext4 filesystem on the virtual disks and it’s simple.

It’s a little weird that ZFS doesn’t see the individual files and the NAS is unaware of the ZFS pool status. But it turns out almost all the advantages of ZFS operate at the block level. Proxmox creates the virtual disk as a ZFS dataset, a block device, and ZFS will happily snapshot and compress and checksum and self-heal those blocks for me. There are a few filesystem-level ZFS features (like ACLs) but I don’t really care about them, so not having them in the NAS is no big loss.

The other option would be to pass through raw disk devices to the VM and let it run a ZFS pool itself. That’s more like what a TrueNAS setup does.

Still on the fence about what physical media I’ll use. So far I’m doing it on a single SSD in the Proxmox server. I think a pair of spinning disks with mirroring makes sense for the media archive but might be a little slow for the NFS clients accessing the source code.

I’m using Restic (with Backrest) for two sets of backups. One of everything to local disk, an extra disk in my Proxmox server. (See this pattern). One leaving out the media archives to Backblaze.

Product design

So far I’m at the “hack config files” stage of building this out. And that’s fine. Backrest and Syncthing already offer Web GUIs. I’d like to streamline the NFS and Samba configs so I don’t have to keep re-referencing the same disk volume over and over in several config files but eh, whatever. I could imagine making this into an actual product other people could use but it’d take a lot of configuration and testing. The VM might also make a good NixOS project.

Why not Cockpit for a GUI? It might actually be a good idea, I’ve never tried it.

Why not TrueNAS or OMV? Partly because I don’t like either very much. Also because neither supports Restic or Syncthing. You can install them in the VM but it’s kind of a kludge and really, I’m OK just managing NFS and Samba myself. TrueNAS can also manage a ZFS array which would be a different storage solution than what I’m doing.

As always with hacker projects there’s a lot niceties of monitoring and alerting I should be doing but haven’t set up yet. At least Proxmox ZFS will tell me if something catastrophic happens to the data.

Wrinkles

One problem with any NAS is managing file ownership. The POSIX file model is very clear for ownership and permissions. But SMB kind of screws that up. And so does Syncthing: it really wants to run as a single non-root user. (Although it has some support for multiple owners). For now I’m going to stick with POSIX files but they’re all just owned by me. That’s a good match for my data. OTOH I am allowing NFS clients to be root on the server, so maybe I can do more when Syncthing isn’t involved.

NFS still sucks for clients when the server fails. I’m mounting with noauto,x-systemd.automount,x-systemd.idle-timeout=60,soft,timeo=15,retrans=2 which first of all, lol, why aren’t the defaults adequate? And x-systemd really? But it seems to work; if the server is down the client will throw an error in under a minute.

Setup details.

The Vault VM is set up to use two vCPUs and 2GB of RAM. There’s a 4GB disk for the system volume (including 0.5GB of swap) and then as many user data volumes as I want.

I’m running Debian 12 on the VM with just the basics installed: nfs-kernel-server, samba, syncthing, backrest. The system seems to be using an actual 400MB of RAM, very little. I think the most RAM-hungry thing is Restic, it likes to do a lot of housekeeping when de-duping backups etc. It might make sense to give more RAM to the NAS just for it to cache files its serving.

Right now I’m mounting the datasets on virtual disks into /mnt/UUID, big ugly names. Then I have a second fstab entry to bind mount from /mnt/UUID to /export/friendlyname. Trying to reference the datasets everywhere else with the /export name.

Some specifics:

  • /etc/interfaces: modified to add 192.168.240.* subnet for sharing within Proxmox
  • /etc/fstab: edited to mount disks into /mnt and bind mount into /export
  • /etc/exports: individually names each /export filesystem so NFS will send them
  • /etc/default/nfs-kernel-server was modified to be NFSv4 only. Debian has some docs on this but they seem to be badly out of date.
  • Backrest config is mostly in ~root/.config/backrest, also the systemd unit file. The GUI manages that.
  • Syncthing runs as user nelson via systemd user (with loginctl linger enabled so it runs without me being logged in). The GUI manages configs, they are stored in /home/nelson/.local/state/syncthing

Post-virtualization thoughts

Phew, my physical to virtual server migration using Proxmox mostly worked. I’ve now moved my main life server, the one I’ve been maintaining or evolving over 25+ years, for the first time into a VM. And it mostly works! Some collected thoughts after the fact.

Checkpoints and backups at the VM level are nice. Really looking forward to that.

This plan of virtualizing a server by first making one giant VM is nice. I can now hive off services to run in specific containers or VMs at my leisure.

Jeff N talked me into trying ZFS on the Proxmox host and so far I’m glad for it. ZFS seems complicated to me but Proxmox is clearly built to take advantage of it. Checkpoints already work better than on BTRFS.

I’m still working out where stuff should live and how it should be shared once I start containerizing services. The obvious thing is to put the primary home for everything in a ZFS pool maintained by the Proxmox server itself (just with ZFS, no Ceph.) My home directory, my Music library, my Video library, a place for backups. Share to containers via bindmounts. Sharing to VMs is harder. I think NFS is the best solution for now until virtiofs in Proxmox is a bit more finished.

Yes, I said NFS. Ugh. I’ve got it working with an NFS server on the Proxmox host itself and the VM mounting it. Setting up automount gave me bad flashbacks to the 1990s, although of course systemd has its own way of doing things. But NFS implies a lot of overhead. Also the confusion of user ID mappings. I’ve never really administered NFSv4 which has some nice things but I may gouge my eyeballs out of I have to set up Kerberos. OTOH I’m really not comfortable letting anything on my LAN mount stuff with root privileges. A work in progress.

Syncthing is working OK in the VM right now. Syncthing is peer to peer but I think of it as hub-and-spoke, with this server being the hub. I think I want to hive that Syncthing hub off to its own container. I see myself possibly also setting up a separate Syncthing instance in some containers or VMs but that sure seems dumb. More work in progress.

Syncthing + NFS is scary. The risk is that NFS is unreliable, so the directory for a synced folder might disappear. And in a bad case Syncthing might interpret that as a command “Delete all the files” and propagate that to all the clients. This really happens in practice and is very bad. They have a sentinel file to protect against this, the .stfolder. I still can’t help but think that syncthing is best run on a local filesystem and not a networked one.

I’ve got Plex running in a VM. Right now it doesn’t have access to the Intel GPU, so it can’t do hardware acceleration of transcoding with Quicksync. There’s ways to make that work but I think I should prioritize moving Plex first into a container, the tteck scripts work with hardware transcoding.

Backups are a big question mark. I’ve generally used rsnapshot but that requires root access to work well, since it’s setting file ownership. And root access to NFS is a no. I’m thinking of switching to Restic for backups instead. How this will work depends a bit on my “who should own what files” question.

I also want to make VM and container backups in Proxmox itself, separate from my personal data. And I’d like to back up the Proxmox server configuration itself; it’s crazy there’s no tool for that.

I need to rethink using RAM for tmpfs in the VM. Also using a swapfile. It’s all working but I bet it’s not optimal.

Syncthing and conflicts (also Joplin)

I’ve been using Syncthing for several years now to sync several gigabytes of files, mostly various kinds of user-generated documents. Like my entire personal source code repository. Also my Joplin notes. Across 3-5 systems: Windows, Linux, and an Android device. It works great. I’ve never had to think about it much. But something went wrong with Joplin recently and I learned something...

Syncthing has no conflict resolution tool.

Seriously. Syncthing detects conflicts and does something sensible with conflicted files but does not offer any sort of merge tool or UI to help you know about conflicts and deal with them. I got confused because SyncTrazor, the Windows UI for SyncThing I use, does have a simple GUI Conflict Resolver. But there’s nothing like that in the main SyncThing web-based GUI.

All the core SyncThing does if it detects a conflict is try to guess which version of the file should be canonical. It has some heuristics based on modification dates and will prefer a modified file to a deleted one. It then renames the discarded version as <filename>.sync-conflict-<date>-<time>-<modifiedBy>.<ext>. That gets kept forever as a regular file also in your syncthing store and gets synced just like any other file. It’s up to you to notice these conflicts and do something about them; syncthing will not tell you about them. (Hilariously, you can have conflicts on conflicts and end up with files named ...sync-conflict-…sync-conflict -…-sync-conflict...)

I’m not complaining about Syncthing; what it does is very simple and understandable. Conflict resolution is hard and subtle, better not to do anything than do a bad job. Automated merge strategies are possible but fraught with dangers, and manually requiring users to merge is not in keeping with SyncThing’s background nature. OTOH I’m a little spooked that these potential errors have crept in without any visibility. It’d be nice if the Web GUI at least showed a count of conflicts, but maybe that’d just cause anxiety?

I’ve got about 50,000 files in my Windows Documents folder (synced between two PCs) and just today learned I have 27 conflicts. Mostly saved game files; it’s possible Steam Sync was also involved which no doubt causes all sorts of confusion. FWIW none of these conflicts have caused any problems, so maybe I don’t really need to care about them. I just deleted them; nothing was going to be reading those conflict files anyway. The 3 conflicts in my source tree worry me a bit more, they’re all in git repo metadata. But those git repos are working fine and git fsck isn’t complaining, so going to just delete those too.

How do conflicts happen? When two separate syncthing instances update the same file before they sync them to each other. This happens surprisingly seldom for me, I think because I have an always-on hub that everything syncs to and Syncthing seems to be watching the file system for changes and uploading them quickly. Conflicts seem more likely to happen on my Android phone where running in the background is a challenge and it may not sync at all when I’m not on WiFi.

Which brings me to Joplin. I’m looking at all this because I’d had a lot of problems with Joplin/Android and file sync. I recently encrypted my Joplin notes and something weird happened on the phone when it synced to it. Not sure what was really wrong but I just deleted all the conflicts my phone generated and I seem to still have all my notes. Joplin itself only syncs to local files every few minutes, then Syncthing itself only syncs those files to the hub every few minutes. Seems a little delicate.

Fixing syncthing apt repository

It’s been six weeks since the Let’s Encrypt certificate expiration debacle and I’m still finding errors. This one today from running apt update

Err:3 https://apt.syncthing.net syncthing Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 82.196.13.137 443]
Reading package lists... Done
E: The repository 'https://apt.syncthing.net syncthing Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

The problem is syncthing is signing with a certificate in the expired chain. Or rather used to be. I tried various cargo cult solutions that did not work. The one that did was running apt install ca-certificates. That package was already installed but the command also forces an upgrade. Probably just running apt upgrade would have fixed it so the next apt update would have worked, too.

I’m fascinated by all the systemic failures from the certificate expiry. The Let’s Encrypt team thought carefully and tried really hard to head off problems. They failed. I found this one post-mortem but honestly there’s a masters thesis in systems complexity in analyzing all the global failures.

Syncthing status from the command line

I’ve written a little tool to show me the status of Syncthing on the command line. I now rely on it to get my files off of computers that will then be turned off and inaccessible. I didn’t have any way to know if it was really working. I don’t have a reliable outage monitoring system for all my personal tech crap. (I mean, who does? Hmm..)

Anyway this turned into a bit of a yak-shaving exercise. Syncthing does not really have a command line tool. There is a syncthing cli command (and formerly the syncthing-cli third party tool) but they don’t report the status I need. What syncthing does have is a very nice REST API for querying status, so I wrote a tool to check that.

The other tricky thing is defining what it means for syncthing to be synced. I’m not sure I got this right. The algorithm I’m using is it enumerates all folders and all remote devices and checks completion on each one. In practice folders seems to catch outgoing changes, remote devices catches incoming changes. It ends up being O(n) HTTP calls, not ideal, but here we are. It might be possible to get it down to 3; I didn’t quite understand how the bundling in rest/db/completion worked.

Anyway, the Python script below mostly works. I wonder if someone else has already done this and I reinvented the wheel? One last wrinkle; when to run this. I was originally thinking in MOTD (hence my earlier post) but for now I’m running it in .bash_login.

#!/usr/bin/env python3
"""
Status report for syncthing, suitable for including in /etc/motd.d. By Nelson Minar <nelson@monkey.org>

Note that this will show "completely synchronized" if a file was very recently created or altered and
syncthing is not yet aware the change has been made. See the scanning and fsnotify docs in Syncthing for details.
"""

import json, urllib.request, platform, itertools, sys
from pprint import pprint

"Configure the URL endpoint and API key based on hostname. API key is in Settings."
HOST = None
API_KEY = None
config_table = {
	'ub': ('http://127.0.0.1:8384', 'XXXXX'),
    'Nelson-Win10': ('http://127.0.0.1:2103', 'XXXXX')
}

def st_api(command):
	"Call the SyncThing REST API and return as JSON"
	req = urllib.request.Request(f'{HOST}/{command}')
	req.add_header('X-API-Key', API_KEY)
	resp = urllib.request.urlopen(req, timeout=2).read()
	return json.loads(resp)

def main():
	global HOST, API_KEY
	try:
		HOST, API_KEY = config_table[platform.node()]
	except:
		# Exit silently if we're not configured
		sys.exit(0)

	folder_report = []
	device_report = []
	try:
		# Explicit error handling for first REST connection. Others are YOLO.
		devices = st_api('rest/config/devices')
	except Exception as e:
		print(f'Syncthing: Error connecting to {HOST}.')
		sys.exit(0)

	# Check completion for all remote devices
	for device in devices:
		completion = st_api(f'rest/db/completion?device={device["deviceID"]}')
		device_report.append((device["name"], completion["completion"]))

	# Check completion for all folders
	for folder in st_api('rest/config/folders'):
		completion = st_api(f'rest/db/completion?folder={folder["id"]}')
		folder_report.append((folder["label"], completion["completion"]))

	# Show a short status message
	if all([c == 100 for n, c in itertools.chain(folder_report, device_report)]):
		print('Syncthing:', f'Completely synchronized.')
	else:
		incompletes = ((n, c) for n, c in itertools.chain(folder_report, device_report) if c != 100)
		print('Syncthing:', 'Incomplete.\n ', '\n  '.join(f'{n}: {c:.2f}%' for n, c in incompletes))
		print(f'Details at {HOST}')

if __name__ == '__main__':
	main()
	sys.exit(0)

syncthing and WSL 2: running in the background

I’ve been using syncthing a couple of years now and finally trust it to manage all of my source code. Part of that is getting it to sync files on my WSL Ubuntu images. They’re more or less like standalone Linux VMs and need their own syncthing, it won’t work to just sync files on the Windows host system.

Syncthing mostly just works in WSL, no drama. The challenge is that WSL doesn’t have a systemd or cron so there’s no easy way to start syncthing at system boot. Also syncthing itself is not really written as a daemon; if you just run “syncthing” it writes to stdout and listens to signals and stuff. Awkward.

There’s lots of advice on how to deal with this problem and most of it doesn’t work. The real problem I ran into is something weird about WSL, at least the WSL 2 I’m using. This GitHub issue discusses it: even with nohup and other efforts, background tasks launched by wsl.exe will sometimes disappear. You can write a script that looks like it runs a background process fine and test it in Linux and it works. But if you invoke the script via wsl.exe whatever processes it spawned disappear. No, nohup doesn’t help. This is all very mysterious and it’s worth remembering that WSL only started supporting background tasks a couple of year ago.

The solution that worked for me is to use the daemonize program. There’s an Ubuntu package for it. It’s pretty straightforward, it does all the Unix stuff you’re supposed to do for a daemon but don’t bother with (like cd / so that filesystems can be unmounted.)

Here’s the Linux shell script I use to run syncthing. The weird GUI port is because I also have Syncthing running on my Windows host.

#!/bin/bash
OPTS="
        --no-browser
        --home=/home/nelson/.config/syncthing
        --gui-address=http://127.0.0.1:2103
        --logfile=/home/nelson/.config/syncthing/syncthing.log
"
daemonize /usr/bin/syncthing serve $OPTS

The way I launch this at Windows boot time is I have a shortcut in shell:startup that has a target of

C:\Windows\System32\wsl.exe --exec /home/nelson/.bin/syncthing-server-wsl

A batch file might work too.

It’s not ideal. If I’m logged in and just launch the shortcut it works pretty nicely. A command shell window briefly pops up and disappears; if that annoys me enough there’s kludges to workaround that.

There’s a bigger problem on system startup: the console window pops up and hangs for ~30 seconds. I thought it was broken at first but it eventually goes away on its own. While that was going on I also tried to launch a WSL terminal window to see what was happening; that hung too, until the syncthing starter window closed. My guess is that WSL 2 actually has a significant hidden startup time at Windows boot. Normally a WSL window pops up the moment you ask for it, but maybe Windows actually sets up the VM first time in the background and hopes no one notices. Not really sure though, will need to keep an eye on it.

Update: I asked on Reddit and this delay at startup does seem to be a thing that happens to others.

It’s real nice having my source code auto-synced. I sure hope SyncThing never breaks and deletes all my files. (I do have backups.)

Android Scoped Storage, SyncThing, GPSLogger

I’m trying to synchronize data from Mendhak’s GPSLogger to other devices. I’m running the latest Android (11?) on a Pixel 3. GPSLogger supports a nice variety of sync options but none are quite right for me, so I thought I’d try using SyncThing on the data files on the phone instead. But I ran into a confusing permissions / security thing in Android where SyncThing couldn’t see GPSLogger’s data files. Here’s what’s going on.

First off, where are the files? The GPSLogger docs say they are in a folder with a name like /sdcard/Android/data/com.mendhak.gpslogger/files/. The first confusing this is that /sdcard prefix: apparently this is different on different devices. But the path from Android on down should be consistent.

If I access this files via the SolidExplorer Android file browser it shows up as a storage named “Internal Memory”, the default. (Presumably this could also be an SDcard or something). From there I can click Android and get three choices: data, media, and obb. Click data, search the giant list for com.mendhak.gpslogger, and there I am. Bottom line: GPSLogger stores its files in /sdcard/Android/data/com.mendhak.gpslogger under the root directory, at least on my phone. It’s just where the root is can be confusing.

If I plug in my phone and access it on my Windows machine as a USB drive, I can find my data with this path:
This PC\Pixel 3\Internal shared storage\Android\data\com.mendhak.gpslogger
Seems logically consistent; get to the root of the internal memory, then drill in on Android.

Unfortunately as of Android 11, ordinary apps can no longer access the data folder of other apps. This is presumably a security update, I guess the assumption is most of the time those files are private to the app and shouldn’t be visible. There’s an elaborate new system called “Scoped Storage” where apps can explicitly choose to share files but a lot of apps haven’t really caught up to that. It’s great that Android has a filesystem you can just access at all but over time they’ve complicated it.

There’s a couple of workarounds to the Android restrictions. A bunch of file explorer apps (including Solid) have hacked around it somehow to show you all the folders. Not sure how, I wonder if they’re using the opt-out procedure which is listed as “temporary”, a compatibly measure, and comes with other restrictions.

But this doesn’t help me with SyncThing; it doesn’t seem to support the workaround. All it shows me under “Android” is “media”, a sign that it’s stuck inside the scoped storage sandbox. Which is a little weird because I think it’s supposed to work thanks to including this patch. In particular there’s a “Use advanced Folder Picker: Select any folder on the device for syncing” that sounds like it should enable the workaround. It just doesn’t seem to work.

I also tried SyncThing-Fork, an experimental version. It has a little wheel next to the directory picker that gives you some “advanced” picker. It shows a data folder but that folder is empty. There’s so much drama getting Google Play Store approval I’m not sure it even can work. I briefly tried the FDroid version too (which is a bit more up to date) and it didn’t work there either. Anyway not thrilled at the idea of the fork, particularly if I have to install it via FDroid! So not pursuing that option further.

I finally gave up; the SyncThing app just can’t access that folder. Which is too bad. But fortunately there’s an easy other solution, which is just to get GPSLogger to write files to a different place instead. I chose to put them in /Documents/GPSLogger. Near as I can tell this directory is world-accessible. At least SyncThing can get at it, although IIRC I had to give it one-time permission to access it.

And so now I have SyncThing syncing GPSLogger’s files to my Linux server. Yay! Honestly it would have been a lot easier just to use SFTP or something from GPSLogger but I didn’t really want to set any of the GPSLogger options up. SyncThing seems to be working.

Adding a new SyncThing node

I’ve been using SyncThing for awhile now to keep several Windows PCs in sync. Mostly the Documents folder, also some saved games. It’s been working great since I set it up, so well I’ve nearly forgotten how it works.

I decided to add it to my laptop today. Which begs the question; what’s it like to bring in a new machine to an existing sync cluster, one with possible conflicts in the folders? It mostly went OK but some awkwardness.

To add a new machine to the node all you have to do is install SyncThing and then go to “Add New Device” on the new machine. I have a hub-and-spoke system (3 Windows spokes, one Linux hub that’s the primary copy) so I just added the Linux hub device. Approve it on the GUI of the hub machine, accept the folders it offers, and it all worked OK.

Well mostly. I had some file conflicts, as expected. There’s a conflict resolution tool but it’s very confusing. It talks in terms of “original” and “conflicted” file and I’m wondering; original to whom? It seems to have no idea of three way syncs or merges. I looked and realized I had a backup of all the files and none were important anyway, so I just blindly accepted “take the newest” for all the conflicts.

The uglier problem was errors that some files were not transferring, with an error in the GUI of “file modified but not rescanned; will try again later”. I looked online and found this is often a symptom of a case mismatch. Windows filesystem is case insensitive but still stores cases, maybe it got confused with the Linux copy. I finally resolved these by deleting the files everywhere across my cluster and then restoring it to the hub from a backup, then letting the new copy propagate. Ugly but effective.

The last problem I had was one file refused to copy: sync_ffs.db. That’s a file that a different sync system (FreeFileSync) uses. It has some magic properties that make it unwriteable or something. I simply instructed SyncThing to ignore that file, no more problem.

So all in all a bunch of ugly manual work. Which is in keeping with SyncThing; it’s a great tool but it’s not exactly civilian friendly. The good news is that once it’s set up and syncing it seems quite reliable.

I can’t imagine what topologies more complex than hub-and-spoke behave like.

SyncThing

After getting NextCloud set up I was uncomfortable with how complicated it was. So I gave SyncThing a try and it’s much more to my liking. It’s a much simpler system. NextCloud has a full database and users and passwords and APIs and stuff. SyncThing just synchronizes folders. In that way it’s a lot like Unison, or FreeFileSync. (More complicated than rsync, since it maintains state between synchronization runs). But it’s built for network synchronizing.

Installation is simple. Every machine that wants to sync a folder runs the SyncThing binary in the background. That publishes a nice Web UI on port 8384, also an application specific socket on port 22000. Getting two machines to sync is a little weird. Every machine has a name and you can just tell machine 2 “sync with machine 1”. A dialog pops up on machine 1 then to authorize the connection. No visible passwords, but presumably some public key crypto under the hood. Once the machines are talking to each other you then set up synchronizing folders.

I may have made things complicated myself but the folder setup seems complicated. For every new machine I add to my sync cluster I had to go through each folder and share it. There’s something called an “introducer” where one machine will offer a list of folders to the other machine, but I either don’t understand it or broke it somehow.

I also made things more complicated than necessary by disabling machine discovery. I mentioned way above machines have names; how do you find a machine on the Internet given its name? There’s some global discovery protocol built under the hood, a peer to peer network sharing names. It’s quite neat but I’d rather not be quite so promiscuous so I turned it off. You can manually configure via IP addresses if you want. (They also have a relay network for cases where two machines are so firewalled they can’t connect to each other. Neat!)

I haven’t stressed the sync algorithm too hard but it seems to be working for me. It even does something reasonable for conflicts.

I took a quick look at GitHub and the primary author is Jakob Borg, aka calmh. He also has a consulting business called Kastelo. He seems super nice and helpful on the community forum answering lots of questions. Development started late 2013.

All in all I’m quite impressed with SyncThing. It’s simpler and less featurful than DropBox/NextCloud/ownCloud, which is exactly what I want. Keep two folders in sync, that’s all I want.

(A thorough blog post would include an investigation of Resilio, formely BitTorrent Sync. By all accounts SyncThing is quite similar to it.)