Skip to content

Commit 2430893

Browse files
authored
Merge pull request nimmis#3 from davide/master
Add RSLSYNC_PATH environment variable to improve usage with --volumes-from
2 parents 0fc47d1 + a58d3d4 commit 2430893

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Diff for: README.md

+8
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ The sync mode version is made for syncing one directory only (you can manualy co
9292

9393
This variable contains the secret key fore this directory, if empty or missing a new secret key is generated. This key can then be used to start more sync klient for the data.
9494

95+
### RSLSYNC_PATH
96+
97+
This variable controls which folder is synced (default = /data) and comes in handy when using data containers.
98+
To use it add the necessary --volumes-from option and set the RSLSYNC_PATH value to a VOLUME path from the the data container:
99+
100+
docker run -d --volumes-from <data-container> -e RSLSYNC_PATH=/other/location/in/data/container --name sync -p 33333:33333 nimmis/resilio-sync
101+
102+
95103
### Run container on first sync node
96104

97105
The first nod creates a uniq secret used to sync all nodes, map the directory you wan't to be syncronized to /data in the container.

Diff for: root/etc/run_once/config_rslsync

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ if [ -z $RSLSYNC_NAME ]; then
1515
RSLSYNC_NAME=`hostname`
1616
fi
1717

18+
# check sync path
19+
20+
if [ -z $RSLSYNC_PATH ]; then
21+
RSLSYNC_PATH="/data"
22+
fi
23+
1824
# create base configuration
1925

2026
cat <<EOT > /etc/rslsync/rslsync.conf
@@ -33,7 +39,7 @@ EOT
3339
if [ -z $RSLSYNC_USER ] ; then
3440
# non webui version
3541

36-
echo "non-WEBUI mode activated, /data is synced"
42+
echo "non-WEBUI mode activated, $RSLSYNC_PATH is synced"
3743

3844
# handle secret key
3945
if [ -z $RSLSYNC_SECRET ]; then
@@ -47,7 +53,7 @@ if [ -z $RSLSYNC_USER ] ; then
4753
[
4854
{
4955
"secret" : "$RSLSYNC_SECRET", // required field - use --generate-secret in command line to create new secret
50-
"dir" : "/data", // * required field
56+
"dir" : "$RSLSYNC_PATH", // * required field
5157
"use_relay_server" : true, // use relay server when direct connection fails
5258
"use_tracker" : true,
5359
"search_lan" : true,

0 commit comments

Comments
 (0)