How to share Syncthing's own config folder?

I would like to share Syncthing’s own configuration folder but I cannot find it in the list of folders that are made available when I tap on the Folder entry (I think this is the right name, I have the French version).

I see all kinds of folders but nowhere can I find the folder where Syncthing has its configuration (the one with config.xml). How can I share it?

It’s on the /data partition and you need root access to access it. You will also need to input the path manually. The actual path should be something like /data/data/com.nutomic.syncthingandroid.

For the record, if you only need to grab the config.xml file, you can simply use the backup function within the app. Alternatively, you can also enable GUI debugging in the Advanced Configuration in the Web GUI, and then use Actions → Support Bundle which will also come with the file.

1 Like

Yes, this is what I did but was hoping to access the real file (since Syncthing can access it for its own use, I was hoping it would have access for sharing as well).

Well, I will be one click short to complete automation then :slight_smile:

How about using the API to get the file?

https://docs.syncthing.net/rest/debug.html#get-rest-debug-support

Unless you want to share it in order to use for processing on a different device. You could still use the API to get it first, and then simply copy to a shared folder. All automatically using some kind of a script, of course.

That was an idea but, as you can imagine, my question was driven by the need to share the config from Android to use it in GitHub - wsw70/syncthing-map. One of the reasons to use Syncthing to share its config is to be able to get the configuration from external networks.

I think you could still use the script set to run periodically (e.g. once per day) to grab the file and copy it to the shared folder. This way, it would remain up-to-date.

However, the problem is that this would likely need to run Android itself, and while running scripts is not a problem (since it can be done with any automation app), I think the main obstacle is that there is no curl binary in the OS. There are third party curl builds for Android, but I don’t believe there is a way to run them without root or outside of ADB, so they probably won’t be of any use here.

Be very careful when adding the Syncthing config folder as a shared folder. It is asking for trouble!

By default (and also on Android I suppose), the index database sits next to the config.xml file that you want to have synced. When that gets scanned, the results will be written to the database, causing a change in the files, requiring a new scan, writing to … That’s an endless loop that can kill Syncthing on your phone pretty quickly.

Make sure to ignore everything in that folder except config.xml, with appropriate .stignore patterns.

1 Like

Very good point. I myself ignore just index-v0.14.0.db and csrftokens.txt (and syncthing*.log on Windows). The key and certificate files are useful for backup purposes, and also Syncthing will save panic logs (if any) to that folder as well, so having access to them everywhere is useful.

Thank you @acolomb and @tomasz86 for the inputs. Too late, though, as I already shared the folders. And, fortunately, nothing happened. I will look closely why nothing happened, though. And add the ignores.

A miracle happened and I was able to share that folder without root rights. What needs to be shared is actually /data/data/com.nutomic.syncthingandroid/files (config.xml` is there). Thanks a bunch for the tip!

I’d rather rely on #include to share ignore patterns

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.