Resilio Sync Watch Config
This tool was created to support the Resilio Sync Home software on headless devices.
Install locally
Just install it globally with npm:
npm i -g resilio-sync-watch-config
Usage
resilio-sync-watch-config [options] config.jsonUsage: index.js [options] config.json Options: -b, --resilioBin [FILE]Binary of Resilio. Can be used
Multiple config.json are possible in order to combine multiple configs into one.
When using --key
or --keyfile
every *.json
directly placed into the shared folder is combined and used.
systemd Service
Instructions for this are in the subfolder systemd
Install via docker
Use the Docker Image inside a Docker Swarm.
Provide the secret /run/secrets/resilio-share.txt
which will be used as --keyfile
.
See Usage and the Dockerfile CMD for more info what happens there.
Example compose file which is deployed as a docker stack:
version: '3.7' secrets: resilio-share.txt: file: secrets/resilio-share.txt volumes: folders: services: watch-config: image: edjopato/resilio-sync-watch-config:2 secrets: - resilio-share.txt volumes: - folders:/folders
Backstory
In my case I dont want to use the webgui so I created config files with the folders in it. Nearly every entry has the same content so it was much of a copy paste process to add something. With the config staying inside an sync folder to be edited on my local computer I had to connect to the remote servers and restart resilio manually.
So i needed an abstraction of a config that will be parsed and restarts Resilio Sync when its changed. So I created this tool.
Config
The config is a simple json file.
This config will lead to the following output config:
The device_name
is generated from the hostname of the running machine.
The input config of this tool (the above one) contains 3 keys: basedir
, folders
and passthrough
.
basedir
describes the root folder of the synced folders.
It will also contain the .sync
folder (storage_path
) for the offical resilio sync config folder.
folders
contains an object with the names and keys of the folders to be synced.
The folders will be synced to <basedir>/<foldername>
.
In this case, the tmp folder will be synced to /path/to/resilio/base/folder/tmp/
.
The passthrough
key contains an object, that can contain any offical resilio sync config setting.
These settings will override any other settings.
For example will this tool generate the device_name
key in the resilio config.
if the device_name
key is set in the passthrough section too, it will override it.