@@ -9,103 +9,20 @@ and other applications embedding TaskChampion can sync.
99
1010## Status
1111
12- This repository was spun off from Taskwarrior itself after the 3.0.0
13- release. It is still under development and currently best described as
14- a reference implementation of the Taskchampion sync protocol .
12+ This project provides both pre-built images for common use-cases and Rust
13+ libraries that can be used to build more sophisticated applications. See [ the documentation ] [ documentation ]
14+ for more on how to use this project .
1515
16- It is comprised of three crates:
16+ [ documentation ] : https://gothenburgbitfactory.org/taskchampion-sync-server
17+
18+ ## Repository Guide
19+
20+ The repository is comprised of three crates:
1721
1822 - ` taskchampion-sync-server-core ` implements the core of the protocol
1923 - ` taskchmpaion-sync-server-sqlite ` implements an SQLite backend for the core
2024 - ` taskchampion-sync-server ` implements a simple HTTP server for the protocol
2125
22- ## Running the Server
23-
24- The server is a simple binary that serves HTTP requests on a TCP port. The
25- server does not implement TLS; for public deployments, the recommendation is to
26- use a reverse proxy such as Nginx, haproxy, or Apache httpd.
27-
28- ### Using Docker-Compose
29-
30- Every release of the server generates a Docker image in
31- ` ghcr.io/gothenburgbitfactory/taskchampion-sync-server ` . The tags include
32- ` latest ` for the latest release, and both minor and patch versions, e.g., ` 0.5 `
33- and ` 0.5.1 ` .
34-
35- The
36- [ ` docker-compose.yml ` ] ( https://raw.githubusercontent.com/GothenburgBitFactory/taskchampion-sync-server/refs/tags/v0.6.1/docker-compose.yml )
37- file in this repository is sufficient to run taskchampion-sync-server,
38- including setting up TLS certificates using Lets Encrypt, thanks to
39- [ Caddy] ( https://caddyserver.com/ ) .
40-
41- You will need a server with ports 80 and 443 open to the Internet and with a
42- fixed, publicly-resolvable hostname. These ports must be available both to your
43- Taskwarrior clients and to the Lets Encrypt servers.
44-
45- On that server, download ` docker-compose.yml ` from the link above (it is pinned
46- to the latest release) into the current directory. Then run
47-
48- ``` sh
49- TASKCHAMPION_SYNC_SERVER_HOSTNAME=taskwarrior.example.com \
50- TASKCHAMPION_SYNC_SERVER_CLIENT_ID=your-client-id \
51- docker compose up
52- ```
53-
54- The ` TASKCHAMPION_SYNC_SERVER_CLIENT_ID ` limits the server to the given client
55- ID; omit it to allow all client IDs.
56-
57- It can take a few minutes to obtain the certificate; the caddy container will
58- log a message "certificate obtained successfully" when this is complete, or
59- error messages if the process fails. Once this process is complete, configure
60- your ` .taskrc ` 's to point to the server:
61-
62- ```
63- sync.server.url=https://taskwarrior.example.com
64- sync.server.client_id=your-client-id
65- sync.encryption_secret=your-encryption-secret
66- ```
67-
68- The docker-compose images store data in a docker volume named
69- ` taskchampion-sync-server_data ` . This volume contains all of the task data, as
70- well as the TLS certificate information. It will persist over restarts, in a
71- typical Docker installation. The docker containers will start automatically on
72- system startup. See the docker-compose documentation for more information.
73-
74- ### Running the Binary
75-
76- The server is configured with command-line options. See
77- ` taskchampion-sync-server --help ` for full details.
78-
79- The ` --listen ` option specifies the interface and port the server listens on.
80- It must contain an IP-Address or a DNS name and a port number. This option is
81- mandatory, but can be repeated to specify multiple interfaces or ports. This
82- value can be specified in environment variable ` LISTEN ` , as a comma-separated
83- list of values.
84-
85- The ` --data-dir ` option specifies where the server should store its data. This
86- value can be specified in the environment variable ` DATA_DIR ` .
87-
88- By default, the server will allow all clients and create them in the database
89- on first contact. There are two ways to limit the clients the server will
90- interact with:
91-
92- - To limit the accepted client IDs, specify them in the environment variable
93- ` CLIENT_ID ` , as a comma-separated list of UUIDs. Client IDs can be specified
94- with ` --allow-client-id ` , but this should not be used on shared systems, as
95- command line arguments are visible to all users on the system. This convenient
96- option is suitable for personal and small-scale deployments.
97-
98- - To disable the automatic creation of clients, use the ` --no-create-clients `
99- flag or the ` CREATE_CLIENTS=false ` environment variable. You are now
100- responsible for creating clients in the database manually, so this option is
101- more suitable for large scale deployments.
102-
103- The server only logs errors by default. To add additional logging output, set
104- environment variable ` RUST_LOG ` to ` info ` to get a log message for every
105- request, or to ` debug ` to get more verbose debugging output.
106-
107- ## Building
108-
10926### Building From Source
11027
11128#### Installing Rust
@@ -129,7 +46,7 @@ rustup override set stable
12946
13047[ rustup ] : https://rustup.rs/
13148
132- #### Installing TaskChampion Sync-Server
49+ #### Building TaskChampion Sync-Server
13350
13451To build TaskChampion Sync-Server binary simply execute the following
13552commands.
@@ -144,7 +61,8 @@ After build the binary is located in
14461
14562### Building the Container
14663
147- To build the container execute the following commands.
64+ To build the container, execute the following commands.
65+
14866``` sh
14967source .env
15068docker build \
@@ -161,7 +79,7 @@ docker run -t -d \
16179 taskchampion-sync-server
16280```
16381
164- This start TaskChampion Sync-Server and publish the port to host. Please
82+ This starts TaskChampion Sync-Server and publishes port 8080 to the host. Please
16583note that this is a basic run, all data will be destroyed after stop and
16684delete container. You may also set ` DATA_DIR ` , ` CLIENT_ID ` , or ` LISTEN ` with ` -e ` , e.g.,
16785
0 commit comments