Default to a local server, so task sync works out of the box

This commit is contained in:
Dustin J. Mitchell 2020-12-26 15:21:23 +00:00
parent db85ff86a1
commit 57834848f2
3 changed files with 52 additions and 15 deletions

View file

@ -17,15 +17,33 @@ On OS X, it's `~/Library/Preferences`.
On Windows, it's `AppData/Roaming` in your home directory.
The path can be overridden by setting `$TASKCHAMPION_CONFIG`.
Individual configuration parameters can be overridden by environemnt variables, converted to upper-case and prefixed with `TASKCHAMPION_`, e.g., `TASKCHAMPION_DATA_DIR`.
Individual configuration parameters can be overridden by environment variables, converted to upper-case and prefixed with `TASKCHAMPION_`, e.g., `TASKCHAMPION_DATA_DIR`.
Nested configuration parameters cannot be overridden by environment variables.
The following configuration parameters are available:
* `data_dir` - path to a directory containing the replica's task data (which will be created if necessary).
Default: `taskchampion` in the local data directory
* `server_origin` - Origin of the taskchampion sync server, e.g., `https://taskchampion.example.com`
Default: `taskchampion` in the local data directory.
* `server_dir` - path to a directory containing the local server's data.
This is only used if `server_origin` or `server_client_id` are not set.
Default: `taskchampion-sync-server` in the local data directory.
* `server_origin` - Origin of the TaskChampion sync server, e.g., `https://taskchampion.example.com`.
If not set, then sync is done to a local server.
* `server_client_id` - Client ID to identify this replica to the sync server (a UUID)
If not set, then sync is done to a local server.
### Synchronization
A TaskChampion replica "synchronizes" its local task database with other replicas via a sync server.
This operation is triggered by running `task sync`.
Typically this runs frequently in a cron task.
The operation is quick, especially if no changes have occurred.
The replica expects to be synchronized frequently, even if no server is involved.
Without periodic syncs, the storage space used for the task database will grow quickly, and performance will suffer.
By default, TaskChampion syncs to a "local server", as specified by the `server_dir` configuration parameter.
It is possible to switch to a remote server later by setting `server_origin` and `server_client_id` appropriately.
## `taskchampion-sync-server`