This includes: - Building a Docker image for Postgres as well as SQLite - Fuller instructions for usage of the package, including the Postgres builds. A few related things changed here: - `.env` is not used anymore -- the defaults in the Dockerfiles are sufficient - The Rust version in the Dockerfiles is increased to match the MSRV, and with it the Alpine version bumped to one built with that Rust version. - Cargo dependencies on native-tls and openssl updated to include only the `vendored` feature, so as not to require a system openssl installation. - Two GitHub jobs are set up, to build the two different Docker images - The documentation incorrectly suggested using `DELETE .. CASCADE` to delete clients. This syntax does not exist, as the cascading delete is configured in the schema.
3.2 KiB
TaskChampion Sync-Server
TaskChampion is the task database Taskwarrior uses to store and sync tasks. This repository implements a sync server against which Taskwarrior and other applications embedding TaskChampion can sync.
Status
This project provides both pre-built images for common use-cases and Rust libraries that can be used to build more sophisticated applications. See the documentation for more on how to use this project.
Repository Guide
The repository is comprised of four crates:
taskchampion-sync-server-coreimplements the core of the protocoltaskchampion-sync-server-storage-sqliteimplements an SQLite backend for the coretaskchampion-sync-server-storage-postgresimplements a Postgres backend for the coretaskchampion-sync-serverimplements a simple HTTP server for the protocol
Building From Source
Installing Rust
TaskChampion Sync-Server build has been tested with current Rust stable
release version. You can install Rust from your distribution package or use
rustup.
rustup default stable
The minimum supported Rust version (MSRV) is given in
Cargo.toml. Note that package repositories typically do not
have sufficiently new versions of Rust.
If you prefer, you can use the stable version only for installing TaskChampion Sync-Server (you must clone the repository first).
rustup override set stable
Building TaskChampion Sync-Server
To build TaskChampion Sync-Server binary simply execute the following commands.
git clone https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
cd taskchampion-sync-server
cargo build --release
After build the binary is located in
target/release/taskchampion-sync-server.
Building the Postgres Backend
The storage backend is controlled by Cargo features postres and sqlite.
By default, only the sqlite feature is enabled.
To enable building the Postgres backend, add --features postgres.
The Postgres binary is located in
target/release/taskchampion-sync-server-postgres.
Building the Docker Images
To build the images, execute the following commands.
SQLite:
source .env
docker build \
--build-arg RUST_VERSION=${RUST_VERSION} \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
-t taskchampion-sync-server docker/sqlite
Postgres:
source .env
docker build \
--build-arg RUST_VERSION=${RUST_VERSION} \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
-t taskchampion-sync-server-postgres docker/postgres
Now to run it, simply exec.
docker run -t -d \
--name=taskchampion \
-p 8080:8080 \
taskchampion-sync-server
This starts TaskChampion Sync-Server and publishes port 8080 to the host. Please
note that this is a basic run, all data will be destroyed after stop and
delete container. You may also set DATA_DIR, CLIENT_ID, or LISTEN with -e, e.g.,
docker run -t -d \
--name=taskchampion \
-e LISTEN=0.0.0.0:9000 \
-p 9000:9000 \
taskchampion-sync-server