From 9d93857647badadea4a4d26f2d9f41282dbca434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Thu, 28 Apr 2022 09:13:20 +0200 Subject: [PATCH] docs(sync): improved README for aw-sync with basic MVP usage instructions --- aw-sync/README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/aw-sync/README.md b/aw-sync/README.md index d4086b1d..48f758bf 100644 --- a/aw-sync/README.md +++ b/aw-sync/README.md @@ -8,14 +8,35 @@ Works by syncing local buckets with a special folder, which in turn should be sy ## Usage -TODO: Write usage instructions for how to use with a normal testing/staging (5666) instance, to actually sync between devices. +NOTE: Basic usage not quite ready yet, see the below testing sections for MVP usage. ``` cargo run --bin aw-sync-rust -- --port 5666 --help ``` +## Testing with real data on a testing instance -## Testing +To test syncing real events to a sync folder which can then be pulled from, we will use some helper scripts to do the following: + +1. `./test-sync.sh` + - Creates a sync directory which we will sync with Syncthing/Dropbox/rclone/whatever + - By default `~/ActivityWatchSync` + - Creates a datastore for the current host in the sync folder + - Sync all local buckets of interest (window & afk buckets, by default) to the sync dir + +2. `./test-server.sh` + - Starts a testing server **on port 5667** using a temporary directory as datastore (`/tmp/...`) + +3. `./test-import-sync.sh` + - Imports all the events from sync folder into the testing server on port 5667 + +4. You should now have all events synced to a local testing instance! + - You can now set up syncing for `~/ActivityWatchSync` on more devices, and on each one use the script `./test-sync.sh` to push their events into the sync folder, then run `./test-import-sync.sh` on the device where you have the testing instance to update the data there. + +In the end, You should get something like this: https://twitter.com/ErikBjare/status/1519399784234246147 + + +## Testing with fake data **Note:** this documents usage for testing, it is not yet ready for production usage.