Syncthing native app for macOS (Synctrain iOS based)

A little while ago I released Synctrain, an open-source Synchting app for iOS with native UI in SwiftUI:

As it turns out, it is very easy to also build a native macOS version from this. With some tweaking it is now a half decent app that can actually be used:

The current offering for macOS works really well, but is little more than a wrapper around the Syncthing binary providing a menu bar item with minimal UI, support for configuring start-on-login, auto-updates, deferring to the web UI for everything else. My app provides access to a subset of Syncthing’s features (although modifying the underlying config.xml is still possible), but adds a file-centered UI and support for selective synchronization and on-demand streaming of files. This is similar to the difference between MobiusSync and Synctrain on iOS. The macOS app has all the features the iOS app has, except for everything related to background synchronization (not needed on macOS) and scanning QR codes. It adds the ability to select custom folder paths (on iOS the app currently is only able to sync folders inside the app’s container).

The code for this is available in the GitHub repository. It should be fairly easy to build the app yourselves from there if you have XCode installed. For those who just want to try the app, download a notarized .app file here. (Note, no guarantees whatsoever. Do not complain if it eats your files or worse).

It is not as polished as the iOS edition yet, but I wanted to share this here now to see if there is any interest at all in this. Depending on the response I will decide whether it is worth to spend the effort also publishing this in i.e. the Mac App Store (and going through App Review etc.). Looking forward to your thoughts!

10 Likes

Hello,

I would like to thank you for your development and time. Your IOS/IPAD app are really great and having an app on the App store is great as well, particularly for the sandboxing capabilities.

Unless I’m mistaken, this sandbox could be achieved outside the App store as well? If that’s the case, for the freedom to choose to install the app outside the Apple identifiable store could be great in addition as well maybe directly via your github release page? (and why not on Altstore for Ios/Ipad in the future? :smiley:

However, for the moment I’m not able to test your app on MacOS as the target is MacOS 15. Would it be a possible to lower down this requirements to older versions, at least those still officially supported by Apple (by supported I mean security updates and maybe some bug fixes), macOS 13 (Ventura) is the oldest still supported.

Thanks for your reply,

EDIT: I saw your comments on the IOS thread about older version so that’s noted :slight_smile:

1 Like

The app is freely available on the App Store on both iOS and macOS, so I don’t see what value distribution outside it would bring users (except for users in regions where the app is currently unavailable, but working on it. For macOS I can provide Developer ID notarized binaries. Those indeed do have sandboxing by the way).

As for supporting older macOS: the user base for that is very small so I’m even less inclined to support older macOS versions than supporting older iOS :slight_smile: Additionally from my experience macOS is always a bit more fiddly than iOS due to the fact that it is simply an older and more complex environment. Luckily it is fairly easy to build the app yourself there (possible even without Developer account I think). So I would suggest to try and see if it builds on an older versions. I might give it a try when I have the time to see what the issues are but don’t expect too much from this.

Been looking for exactly this. THANK YOU. Please definitely keep working towards officially publishing this. The lack of a clean GUI and selective sync has frustrated me and this is wonderful.

1 Like

Could you please enable the feature to enable the syncing of iphone photo library as in the mobius sync app. Thanks and also the app is not available in the australia region and am using the test flight app in ios…is there any plan to release it in the Australia region and if so any eta….thanks so much for ur work

Mobius Sync implements a sort of ‘virtual file system’ to allow one-way sync of photos directly from the photo library. I would like to add this to Synctrain but unfortunately (1) vanilla Syncthing doesn’t (yet) offer a way to do this without having to maintain a separate fork, and (2) the Mobius implementation is not open sourced, so this requires quite some development work. Certainly not a matter of just ‘enabling’ it!

Will have to check the legal situation for Australia regarding crypto import. Depending on the outcome I can make the app available. I am not a lawyer nor do I particularly like to investigate these things, so this is very low on my list.

1 Like

I’m really loving this initiative!

Syncthing has ignore mechanics, but I’ve always missed the file oriented selective sync. So it became (for me) a requirement that each Device must have enough storage to sync Folders completely. This means expensive storage upgrades for our MacBooks and, depending on storage growth, it may not be something I can do forever.

In 2021 I attempted to solve this by building a Syncthing client wrapper, with the ability to sync placeholders files akin to Resilio Selective Sync (with the ultimate goal of creating a MacOS FinderSync extension. One of the reasons I abandoned it is the inability to delete (an ignored file) from the directory tree of the global model, without first downloading the file.

When playing with Synctrain on macOS I ran into the following.

  1. I share a folder to Synctrain on macOS
  2. Synctrain accepts and chooses to sync only “Selected files”
  3. I decide to sync a subfolder with Synctrain
  4. I browse this subfolder in the Finder, all good!
  5. I try to “unsync” this folder in Synctrain
  6. Error: “The synchronization setting for this item cannot be changed, as the local copy is the only copy currently available.”

The reason this happens is that by browsing in Finder new .DS_Store files are generated, which I ignored on the remote devices like this: #include .stglobalignore. The file looks like this:

// https://forum.syncthing.net/t/useful-stignore-patterns/1175
// Case insensitive match with (?i) because on macOS the FS is case insensitive
// I need the ignore rules to be exactly the same on all nodes,
// including the NAS, which has a case sensitive FS

(?d)(?i).DS_Store
(?d)(?i).Spotlight-V100
(?d)(?i).Trashes
(?d)(?i).DocumentRevisions-V100
(?d)(?i).TemporaryItems
(?d)(?i)$RECYCLE.BIN
(?d)(?i)desktop.ini
(?d)(?i)Thumbs.db
(?d)(?i)@eaDir

When I manually remove the .DS_Store I can successfully unsync the subfolder again. Not sure why, because I have “Ignore certain system files” checked in “Advanced settings”.

I realise your selective sync implementation relies on the .stignore file, and it’s a bit tricky. But would it be possible to append/prepend user config to the .stignore in addition to the lines managed by Synctrain? That way I could add my #include .stglobalignore line and have my ‘base ignores’ consistent on all Devices.

On the iOS version I see it’s possible to create ignore rules manually, in “Advanced folder settings”. But this seems to be enabled only for Folders synced completely (not selectively synced Folders).

Would be great if adding ignore rules would be possible for selectively synced Folders would be possible on both macOS and iOS. :slight_smile:

Hm, the issue is that when selecting a subdirectory for synchronization, any new files in that directory will automatically be synced as well (this is intended behavior). While Synctrain does have an option to ignore certain newly created local files outside of already selected subdirectories (see here for the list), it does not consult this list when deciding whether it is safe to delete a subdirectory (nor does it prevent these files from being synced inside a selected subdirectory - but that is considered appropriate).

The issue could be fixed by adding such a check right about here. I will put it on my list.

As for your use case for customizing .stignore: sorry, that’s not supported (the app wants full control over .stignore, because it cannot function reliably in the presence of other unknown ignore rules. It needs to edit .stignore and that brings up a few questions - are its own ignores to be put before or after the user’s?).

1 Like

I see. Fortunately for me I only want to edit the .stignore to have an identical list of system files to ignore on all devices. I could adapt my ignore rules on my non-Synctrain devices to match the default ignore rules Synctrain uses when “Ignore certain system files” is on. But I don’t actually see Synctrain create any ignore rules for e.g. .DS_Store files.

When I fully sync a Folder there’s no .stignore file. When I selectively sync “Subfolder” inside a Folder there’s a .stignore file but it only contains:

!/Subfolder
*

Based on defaultIgnoreLines I expected it to look more like this:

!/Subfolder

(?d).DS_Store
(?d)Thumbs.db
(?d)desktop.ini
.AppleDB
.AppleDesktop
.Trashes
.Spotlight-V100

*

Am I missing something? Cheers and thanks for your time!

In selective mode, Synctrain initially ignores every file by creating an .stignore file with just * as pattern. Then when you select files/subdirectories, these are added as exceptions (!/file.ext) before the *.

Default ignore lines are not editable from Synctrain nor are they applied for new (selective) folders.

The set of file/directory names that I mentioned above is ignored by Synctrain in the UI (when it sees a new file in your folder that is not yet in the global index, it will offer to select it so it will be added to the folder, but it won’t do this for files/subdirectories that match this list, such as .DS_Store). This ‘special’ ignore list is hardcoded at the moment (and can be disabled wholesale by disabling the ‘Ignore specific system files’ setting).

Hello, Tommy. Do you have plans to implement the “track changes” feature, similar to the one in the Android version of Syncthing?

I am not familiar with the Android app, could you elaborate on what that feature is supposed to do?

If by ‘track changes’ you are referring to the Syncthing feature called ‘FS watcher’ which asks the OS to notify it about changes to the file system so it does not need to scan periodically: I will have to look into this! I was under the assumption Syncthing did not support this on iOS due to some missing API. Interestingly however MobiusSync patches Syncthing to make it use the kqueue APIs for this, see here. It turns out that my original patch to Syncthing (inspired by Mobius’ changes at the time) does the exact opposite and disable the kqueue watcher on iOS specifically.

Yes, you understood me perfectly. I actually asked this question because Mobius Sync has this feature. It’s really handy when you’re using two devices at the same time, and you can be sure you’re always looking at the most up-to-date version of your files.

OK, I figured out what is necessary to support this on iOS. I have a working build, hopefully this can be merged to mainline Syncthing:

Thank you for your responsiveness and hard work. You’re creating an excellent product!

Is Synctrain available in the United States? Or would I have to join the beta?

Not available in the US currently (see elsewhere in this thread or the iOS app thread) and yes, the beta does not have a country restriction.

Hi. I’m running into an unknown problem. I’m hearing that there isn’t enough space available in the mobile directory, but I don’t know how to solve it.

I use IOS (IPhone 12 mini)


Error Messages

insufficient space on disk for database

var/mobile/Containers/Data/Application/ BBAAAA-AAA-AAA-AAA284FB9F/Library/Application Support/index-v0.14.0.db

: current 0.92 % < required 1 %

Welcome here @hajongon !

The solution is simple, yet difficult: You need to delete stuff from your phone.

As the message says, less than 1% of the total storage space is available. This is why Syncthing have stopped. It does this as a precaution, to not contribute more to completely filling the storage.

Hi, I’d love to start using Synctrain but has anyone reviewed the security and privacy of this app as it doesn’t have too many users? There was a reddit post a day ago too that made me a bit skeptical: https://www.reddit.com/r/Syncthing/s/CgC3Mcj25J