5 Commits

Author SHA1 Message Date
a9b9921833 v0.6.1 2025-03-03 22:41:40 +00:00
a7dc9e84b4 Allow specifying client ID when running docker-compose (#101)
This also fixes up some handling of default values in the entrypoint.
2025-03-03 17:39:59 -05:00
7430d6feec add homepage / repository to published crates (#100) 2025-03-03 16:59:09 -05:00
ecdfb6bdfd Use DATA_DIR and taskchampion username in entrypoint (#99)
In fact, there is no taskchampion group (1092 is not a defined gid).
Instead taskchampion is in the `users` group.
2025-03-03 16:53:53 -05:00
55892d3b2d Bump to -pre version 2025-03-01 18:21:09 +00:00
7 changed files with 52 additions and 18 deletions

6
Cargo.lock generated
View File

@ -1570,7 +1570,7 @@ dependencies = [
[[package]]
name = "taskchampion-sync-server"
version = "0.6.0"
version = "0.6.1"
dependencies = [
"actix-rt",
"actix-web",
@ -1593,7 +1593,7 @@ dependencies = [
[[package]]
name = "taskchampion-sync-server-core"
version = "0.6.0"
version = "0.6.1"
dependencies = [
"anyhow",
"chrono",
@ -1606,7 +1606,7 @@ dependencies = [
[[package]]
name = "taskchampion-sync-server-storage-sqlite"
version = "0.6.0"
version = "0.6.1"
dependencies = [
"anyhow",
"chrono",

View File

@ -33,7 +33,7 @@ Every release of the server generates a Docker image in
and `0.5.1`.
The
[`docker-compose.yml`](https://raw.githubusercontent.com/GothenburgBitFactory/taskchampion-sync-server/refs/tags/v0.6.0/docker-compose.yml)
[`docker-compose.yml`](https://raw.githubusercontent.com/GothenburgBitFactory/taskchampion-sync-server/refs/tags/v0.6.1/docker-compose.yml)
file in this repository is sufficient to run taskchampion-sync-server,
including setting up TLS certificates using Lets Encrypt, thanks to
[Caddy](https://caddyserver.com/).
@ -46,9 +46,14 @@ On that server, download `docker-compose.yml` from the link above (it is pinned
to the latest release) into the current directory. Then run
```sh
TASKCHAMPION_SYNC_SERVER_HOSTNAME=taskwarrior.example.com docker compose up
TASKCHAMPION_SYNC_SERVER_HOSTNAME=taskwarrior.example.com \
TASKCHAMPION_SYNC_SERVER_CLIENT_ID=your-client-id \
docker compose up
```
The `TASKCHAMPION_SYNC_SERVER_CLIENT_ID` limits the server to the given client
ID; omit it to allow all client IDs.
It can take a few minutes to obtain the certificate; the caddy container will
log a message "certificate obtained successfully" when this is complete, or
error messages if the process fails. Once this process is complete, configure
@ -56,8 +61,8 @@ your `.taskrc`'s to point to the server:
```
sync.server.url=https://taskwarrior.example.com
sync.server.client_id=[your client-id]
sync.encryption_secret=[your encryption secret]
sync.server.client_id=your-client-id
sync.encryption_secret=your-encryption-secret
```
The docker-compose images store data in a docker volume named
@ -149,4 +154,12 @@ docker run -t -d \
This start TaskChampion Sync-Server and publish the port to host. Please
note that this is a basic run, all data will be destroyed after stop and
delete container.
delete container. You may also set `DATA_DIR`, `CLIENT_ID`, or `LISTEN` with `-e`, e.g.,
```sh
docker run -t -d \
--name=taskchampion \
-e LISTEN=0.0.0.0:9000 \
-p 9000:9000 \
taskchampion-sync-server
```

View File

@ -1,9 +1,11 @@
[package]
name = "taskchampion-sync-server-core"
version = "0.6.0"
version = "0.6.1"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021"
description = "Core of sync protocol for TaskChampion"
homepage = "https://github.com/GothenburgBitFactory/taskchampion"
repository = "https://github.com/GothenburgBitFactory/taskchampion-sync-server"
license = "MIT"
[dependencies]

View File

@ -43,12 +43,13 @@ services:
condition: service_completed_successfully
tss:
image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:0.6.0
image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:0.6.1
restart: unless-stopped
environment:
- "RUST_LOG=info"
- "DATA_DIR=/var/lib/taskchampion-sync-server/data"
- "LISTEN=0.0.0.0:8080"
- "CLIENT_ID=${TASKCHAMPION_SYNC_SERVER_CLIENT_ID}"
volumes:
- type: volume
source: data

View File

@ -2,12 +2,28 @@
set -e
echo "starting entrypoint script..."
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
echo "setting data directories"
mkdir -p "/var/lib/taskchampion-sync-server/data"
chown -R 1092:1092 "/var/lib/taskchampion-sync-server/data"
chmod -R 700 "/var/lib/taskchampion-sync-server/data"
: ${DATA_DIR:=/var/lib/taskchampion-sync-server}
export DATA_DIR
echo "setting up data directory ${DATA_DIR}"
mkdir -p "${DATA_DIR}"
chown -R taskchampion:users "${DATA_DIR}"
chmod -R 700 "${DATA_DIR}"
: ${LISTEN:=0.0.0.0:8080}
export LISTEN
echo "Listen set to ${LISTEN}"
if [ -n "${CLIENT_ID}" ]; then
export CLIENT_ID
echo "Limiting to client ID ${CLIENT_ID}"
else
unset CLIENT_ID
fi
if [ "$(id -u)" = "0" ]; then
echo "switching to user 'taskchampion'"
echo "Running server as user 'taskchampion'"
exec su-exec taskchampion "$@"
fi
else
eval "${@}"
fi

View File

@ -1,6 +1,6 @@
[package]
name = "taskchampion-sync-server"
version = "0.6.0"
version = "0.6.1"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021"
publish = false

View File

@ -1,13 +1,15 @@
[package]
name = "taskchampion-sync-server-storage-sqlite"
version = "0.6.0"
version = "0.6.1"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021"
description = "SQLite backend for TaskChampion-sync-server"
homepage = "https://github.com/GothenburgBitFactory/taskchampion"
repository = "https://github.com/GothenburgBitFactory/taskchampion-sync-server"
license = "MIT"
[dependencies]
taskchampion-sync-server-core = { path = "../core", version = "0.6.0" }
taskchampion-sync-server-core = { path = "../core", version = "0.6.1" }
uuid.workspace = true
anyhow.workspace = true
thiserror.workspace = true