From 631271e941b879a3c64ed55cb7e602197047d792 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Wed, 13 Apr 2022 17:21:46 -0600 Subject: [PATCH 1/5] added base Dockerfile --- docker/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..8b0fc43 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM node:17.9.0-bullseye + +COPY . /app + +WORKDIR /app + +RUN npm install \ + && mv /app/dat /data \ + && ln -s /data /app/dat ## Assumes /data will store configuration and vaults + +VOLUME /data + +ENTRYPOINT ["npm", "run", "dev"] From f90ac32864468d012a7b02b0d9eaba4bd9d4242a Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Wed, 13 Apr 2022 17:30:10 -0600 Subject: [PATCH 2/5] added base Docker readme --- docker/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docker/README.md diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..b480214 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,39 @@ +## Build the image: + +From the root directory of the [vrtmrz/filesystem-livesync](https://github.com/vrtmrz/filesystem-livesync) repository run the following to build the image: + +``` +docker build -t filesystem-livesync -f docker/Dockerfile . +``` + +## Configure the image: + +Assuming a folder at `/tmp/data` was going to store your config and vaults, write the following to `/tmp/data/config.json`: + +``` +{ + "config_1": { + "server": { + "uri": "http://example-uri/private1_vault", + "auth": { + "username": "couch_db_username", + "password": "couch_db_password", + "passphrase": "passphrase_of_private_vault" + }, + "path": "shared/" + }, + "local": { + "path": "/data/vault1", + "processor": "utils/build.sh", + "initialScan": false + }, + "auto_reconnect": true + } +} +``` + +## Run the image: + +``` +docker run -it --rm -v /tmp/data:/data filesystem-livesync +``` From e49be551f55e9f79afca84162e94412667d7aca1 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Mon, 25 Apr 2022 11:49:59 -0600 Subject: [PATCH 3/5] minor documentation updates --- docker/README.md | 14 +++++++------- readme.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index b480214..7eab76f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,18 +16,18 @@ Assuming a folder at `/tmp/data` was going to store your config and vaults, writ "server": { "uri": "http://example-uri/private1_vault", "auth": { - "username": "couch_db_username", - "password": "couch_db_password", - "passphrase": "passphrase_of_private_vault" + "username": "couchdb_username", + "password": "couchdb_password", + "passphrase": "" }, - "path": "shared/" + "initialScan": true }, "local": { "path": "/data/vault1", - "processor": "utils/build.sh", - "initialScan": false + "initialScan": true }, - "auto_reconnect": true + "auto_reconnect": true, + "sync_on_connect": true } } ``` diff --git a/readme.md b/readme.md index 973c460..2646638 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ The configuration file consists of the following structure. "auth": { "username": "username_of_private_vault", "password": "password_of_private_vault", - "passphrase": "passphrase_of_private_vault" + "passphrase": "passphrase_of_private_vault" // Required -- leave empty if no passphrase }, "path": "shared/", // All documents under this path will synchronized. "initialScan": false // If you enable this, all server files will be synchronized to local storage once when daemon has been started. From b37f78e55d8956465b1a09cedab8bfc521eb61d8 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Tue, 26 Apr 2022 10:18:55 -0600 Subject: [PATCH 4/5] updated docs for passphrase to be removed if none set --- docker/README.md | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 7eab76f..75921e5 100644 --- a/docker/README.md +++ b/docker/README.md @@ -18,7 +18,7 @@ Assuming a folder at `/tmp/data` was going to store your config and vaults, writ "auth": { "username": "couchdb_username", "password": "couchdb_password", - "passphrase": "" + "passphrase": "mypassphrase" // Remove if no passphrase is set for Vault }, "initialScan": true }, diff --git a/readme.md b/readme.md index 2646638..3660740 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ The configuration file consists of the following structure. "auth": { "username": "username_of_private_vault", "password": "password_of_private_vault", - "passphrase": "passphrase_of_private_vault" // Required -- leave empty if no passphrase + "passphrase": "passphrase_of_private_vault" // Remove if no passphrase is set for your vault }, "path": "shared/", // All documents under this path will synchronized. "initialScan": false // If you enable this, all server files will be synchronized to local storage once when daemon has been started. From 1ae1a3a71c3162c82682459cd57fc1e76bc3c816 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Wed, 27 Apr 2022 14:14:30 -0600 Subject: [PATCH 5/5] added note for CHOKIDAR_USEPOLLING environment variable --- docker/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/README.md b/docker/README.md index 75921e5..b1dd6cc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -37,3 +37,9 @@ Assuming a folder at `/tmp/data` was going to store your config and vaults, writ ``` docker run -it --rm -v /tmp/data:/data filesystem-livesync ``` + +If you would like to be able to edit files from your host running Docker, it is recommended to set the `CHOKIDAR_USEPOLLING` environment variable to equal `1`: + +``` +docker run -it --rm -v /tmp/data:/data -e CHOKIDAR_USEPOLLING=1 filesystem-livesync +```