forked from github-mirrorer/taskchampion-sync-server
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a08cda96ce
|
|||
| a862f02682 | |||
| 2e69bea5ea | |||
| c60e95bbf0 | |||
| 9cf07e9d80 | |||
| c3470f4756 | |||
| 789106b517 | |||
| 72aeebdda7 | |||
| eed6421a4e | |||
| 5d013073cb | |||
| 67524a0a91 | |||
| d206729d5e | |||
| bf19b76577 | |||
| 505dd3f442 | |||
| e10f3e6cfb | |||
| 213be852b8 | |||
| b57dd24d9e | |||
| a9cf67c8e2 | |||
| daf6855f14 | |||
| dbc9a6909b | |||
| 1ad9e344c7 | |||
| 3820a8deea | |||
| 2de70ac336 | |||
| c2b4c94fb5 | |||
| 0a317cd86d | |||
| 1b80398365 | |||
| a94be2649e | |||
| 624efa8b0d | |||
| ae9adf1572 |
18
.github/workflows/add-to-project.yml
vendored
Normal file
18
.github/workflows/add-to-project.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# This adds all new issues to the Taskwarrior project, for better tracking.
|
||||||
|
# It uses a PAT that belongs to @taskwarrior.
|
||||||
|
name: Add issues to Taskwarrior Project
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
add-to-project:
|
||||||
|
name: Add issue to project
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/add-to-project@v1.0.2
|
||||||
|
with:
|
||||||
|
project-url: https://github.com/orgs/GothenburgBitFactory/projects/4
|
||||||
|
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
|
||||||
19
.github/workflows/checks.yml
vendored
19
.github/workflows/checks.yml
vendored
@ -13,16 +13,16 @@ jobs:
|
|||||||
name: "Check & Clippy"
|
name: "Check & Clippy"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Cache cargo build
|
- name: Cache cargo build
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: target
|
path: target
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
@ -48,10 +48,10 @@ jobs:
|
|||||||
name: "Rustdoc"
|
name: "Rustdoc"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
@ -96,7 +96,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: "Formatting"
|
name: "Formatting"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@ -114,19 +114,18 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: "Cargo Semver Checks"
|
name: "Cargo Semver Checks"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: obi1kenobi/cargo-semver-checks-action@v2
|
- uses: obi1kenobi/cargo-semver-checks-action@v2
|
||||||
with:
|
with:
|
||||||
# exclude the binary package from semver checks, since it is not published as a crate.
|
# exclude the binary package from semver checks, since it is not published as a crate.
|
||||||
# exclude postgres temporarily until it is released
|
exclude: taskchampion-sync-server
|
||||||
exclude: taskchampion-sync-server,taskchampion-sync-server-storage-postgres
|
|
||||||
|
|
||||||
mdbook:
|
mdbook:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: "mdBook Documentation"
|
name: "mdBook Documentation"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
uses: peaceiris/actions-mdbook@v2
|
uses: peaceiris/actions-mdbook@v2
|
||||||
|
|||||||
6
.github/workflows/publish-docs.yml
vendored
6
.github/workflows/publish-docs.yml
vendored
@ -2,8 +2,8 @@ name: docs
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- main
|
- '*'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -13,7 +13,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
uses: peaceiris/actions-mdbook@v2
|
uses: peaceiris/actions-mdbook@v2
|
||||||
|
|||||||
6
.github/workflows/rust-tests.yml
vendored
6
.github/workflows/rust-tests.yml
vendored
@ -39,16 +39,16 @@ jobs:
|
|||||||
--health-retries 5
|
--health-retries 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Cache cargo build
|
- name: Cache cargo build
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: target
|
path: target
|
||||||
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|||||||
2
.github/workflows/security.yml
vendored
2
.github/workflows/security.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
permissions: write-all
|
permissions: write-all
|
||||||
name: "Audit Rust Dependencies"
|
name: "Audit Rust Dependencies"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: rustsec/audit-check@v2.0.0
|
- uses: rustsec/audit-check@v2.0.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
196
Cargo.lock
generated
196
Cargo.lock
generated
@ -21,9 +21,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.11.0"
|
version = "3.11.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "44dfe5c9e0004c623edc65391dfd51daa201e7e30ebd9c9bedf873048ec32bc2"
|
checksum = "7926860314cbe2fb5d1f13731e387ab43bd32bca224e82e6e2db85de0a3dba49"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
@ -85,9 +85,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-rt"
|
name = "actix-rt"
|
||||||
version = "2.10.0"
|
version = "2.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208"
|
checksum = "92589714878ca59a7626ea19734f0e07a6a875197eec751bb5d3f99e64998c63"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-macros",
|
"actix-macros",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
@ -133,9 +133,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.11.0"
|
version = "4.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea"
|
checksum = "2233f53f6cb18ae038ce1f0713ca0c72ca0c4b71fe9aaeb59924ce2c89c6dd85"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
@ -168,7 +168,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"socket2 0.5.10",
|
"socket2 0.6.0",
|
||||||
"time",
|
"time",
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
@ -186,33 +186,12 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "addr2line"
|
|
||||||
version = "0.24.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
|
|
||||||
dependencies = [
|
|
||||||
"gimli",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler2"
|
name = "adler2"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ahash"
|
|
||||||
version = "0.8.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"once_cell",
|
|
||||||
"version_check",
|
|
||||||
"zerocopy",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
@ -325,21 +304,6 @@ version = "1.5.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "backtrace"
|
|
||||||
version = "0.3.75"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
|
|
||||||
dependencies = [
|
|
||||||
"addr2line",
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
"miniz_oxide",
|
|
||||||
"object",
|
|
||||||
"rustc-demangle",
|
|
||||||
"windows-targets",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.22.1"
|
version = "0.22.1"
|
||||||
@ -460,7 +424,7 @@ dependencies = [
|
|||||||
"num-traits",
|
"num-traits",
|
||||||
"serde",
|
"serde",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"windows-link",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -654,7 +618,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
|
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -838,17 +802,11 @@ dependencies = [
|
|||||||
"wasi 0.14.2+wasi-0.2.4",
|
"wasi 0.14.2+wasi-0.2.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gimli"
|
|
||||||
version = "0.31.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h2"
|
name = "h2"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
|
checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"fnv",
|
"fnv",
|
||||||
@ -863,28 +821,22 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hashbrown"
|
|
||||||
version = "0.14.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
|
||||||
dependencies = [
|
|
||||||
"ahash",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.15.4"
|
version = "0.15.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
|
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
|
||||||
|
dependencies = [
|
||||||
|
"foldhash",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashlink"
|
name = "hashlink"
|
||||||
version = "0.9.1"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af"
|
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.14.5",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1063,18 +1015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.15.4",
|
"hashbrown",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "io-uring"
|
|
||||||
version = "0.7.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1147,9 +1088,9 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libsqlite3-sys"
|
name = "libsqlite3-sys"
|
||||||
version = "0.30.1"
|
version = "0.35.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
|
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
@ -1276,15 +1217,6 @@ dependencies = [
|
|||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "object"
|
|
||||||
version = "0.36.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.21.3"
|
version = "1.21.3"
|
||||||
@ -1606,9 +1538,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusqlite"
|
name = "rusqlite"
|
||||||
version = "0.32.1"
|
version = "0.37.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e"
|
checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"fallible-iterator 0.3.0",
|
"fallible-iterator 0.3.0",
|
||||||
@ -1618,12 +1550,6 @@ dependencies = [
|
|||||||
"smallvec",
|
"smallvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc-demangle"
|
|
||||||
version = "0.1.25"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
@ -1634,7 +1560,7 @@ dependencies = [
|
|||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1689,18 +1615,28 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.219"
|
version = "1.0.228"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
|
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
||||||
|
dependencies = [
|
||||||
|
"serde_core",
|
||||||
|
"serde_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_core"
|
||||||
|
version = "1.0.228"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.219"
|
version = "1.0.228"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1776,9 +1712,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.10"
|
version = "0.4.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
|
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
@ -1859,7 +1795,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taskchampion-sync-server"
|
name = "taskchampion-sync-server"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
@ -1883,7 +1819,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taskchampion-sync-server-core"
|
name = "taskchampion-sync-server-core"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1898,7 +1834,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taskchampion-sync-server-storage-postgres"
|
name = "taskchampion-sync-server-storage-postgres"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1921,7 +1857,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taskchampion-sync-server-storage-sqlite"
|
name = "taskchampion-sync-server-storage-sqlite"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -1946,15 +1882,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.20.0"
|
version = "3.23.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
|
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"getrandom",
|
"getrandom",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2035,29 +1971,26 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.47.0"
|
version = "1.48.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"
|
checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
|
||||||
"bytes",
|
"bytes",
|
||||||
"io-uring",
|
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"slab",
|
|
||||||
"socket2 0.6.0",
|
"socket2 0.6.0",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-macros"
|
name = "tokio-macros"
|
||||||
version = "2.5.0"
|
version = "2.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
|
checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -2209,13 +2142,13 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.17.0"
|
version = "1.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d"
|
checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"serde",
|
"serde_core",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2339,7 +2272,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-implement",
|
"windows-implement",
|
||||||
"windows-interface",
|
"windows-interface",
|
||||||
"windows-link",
|
"windows-link 0.1.3",
|
||||||
"windows-result",
|
"windows-result",
|
||||||
"windows-strings",
|
"windows-strings",
|
||||||
]
|
]
|
||||||
@ -2372,13 +2305,19 @@ version = "0.1.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-result"
|
name = "windows-result"
|
||||||
version = "0.3.4"
|
version = "0.3.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
|
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2387,7 +2326,7 @@ version = "0.4.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
|
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-link",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2408,6 +2347,15 @@ dependencies = [
|
|||||||
"windows-targets",
|
"windows-targets",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.61.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-targets"
|
name = "windows-targets"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
|
|||||||
@ -10,7 +10,7 @@ rust-version = "1.85.0" # MSRV
|
|||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
async-trait = "0.1.88"
|
async-trait = "0.1.88"
|
||||||
uuid = { version = "^1.17.0", features = ["serde", "v4"] }
|
uuid = { version = "^1.19.0", features = ["serde", "v4"] }
|
||||||
actix-web = "^4.11.0"
|
actix-web = "^4.11.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
@ -20,13 +20,13 @@ serde = { version = "^1.0.147", features = ["derive"] }
|
|||||||
clap = { version = "^4.5.6", features = ["string", "env"] }
|
clap = { version = "^4.5.6", features = ["string", "env"] }
|
||||||
log = "^0.4.17"
|
log = "^0.4.17"
|
||||||
env_logger = "^0.11.7"
|
env_logger = "^0.11.7"
|
||||||
rusqlite = { version = "0.32", features = ["bundled"] }
|
rusqlite = { version = "0.37", features = ["bundled"] }
|
||||||
chrono = { version = "^0.4.38", features = ["serde"] }
|
chrono = { version = "^0.4.38", features = ["serde"] }
|
||||||
actix-rt = "2"
|
actix-rt = "2"
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
pretty_assertions = "1"
|
pretty_assertions = "1"
|
||||||
temp-env = "0.3"
|
temp-env = "0.3"
|
||||||
tokio = { version = "1.47", features = ["rt", "macros"] }
|
tokio = { version = "1.48", features = ["rt", "macros"] }
|
||||||
tokio-postgres = { version = "0.7.13", features = ["with-uuid-1"] }
|
tokio-postgres = { version = "0.7.13", features = ["with-uuid-1"] }
|
||||||
bb8 = "0.9.0"
|
bb8 = "0.9.0"
|
||||||
bb8-postgres = { version = "0.9.0", features = ["with-uuid-1"] }
|
bb8-postgres = { version = "0.9.0", features = ["with-uuid-1"] }
|
||||||
|
|||||||
11
README.md
11
README.md
@ -74,20 +74,17 @@ To build the images, execute the following commands.
|
|||||||
|
|
||||||
SQLite:
|
SQLite:
|
||||||
```sh
|
```sh
|
||||||
source .env
|
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg RUST_VERSION=${RUST_VERSION} \
|
-t taskchampion-sync-server \
|
||||||
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
|
-f Dockerfile-sqlite
|
||||||
-t taskchampion-sync-server docker/sqlite
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Postgres:
|
Postgres:
|
||||||
```sh
|
```sh
|
||||||
source .env
|
source .env
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg RUST_VERSION=${RUST_VERSION} \
|
-t taskchampion-sync-server-postgres \
|
||||||
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
|
-f Dockerfile-postgres
|
||||||
-t taskchampion-sync-server-postgres docker/postgres
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Now to run it, simply exec.
|
Now to run it, simply exec.
|
||||||
|
|||||||
@ -12,9 +12,7 @@
|
|||||||
1. Run `git tag vX.Y.Z`
|
1. Run `git tag vX.Y.Z`
|
||||||
1. Run `git push upstream`
|
1. Run `git push upstream`
|
||||||
1. Run `git push upstream --tag vX.Y.Z`
|
1. Run `git push upstream --tag vX.Y.Z`
|
||||||
1. Run `cargo publish -p taskchampion-sync-server-core`
|
1. Run `cargo publish` to publish all packages in the workspace
|
||||||
1. Run `cargo publish -p taskchampion-sync-server-storage-sqlite`
|
|
||||||
1. Run `cargo publish -p taskchampion-sync-server-storage-postgres` (and add any other new published packages here)
|
|
||||||
1. Bump the patch version in `*/Cargo.toml` and add the `-pre` suffix. This allows `cargo-semver-checks` to check for changes not accounted for in the version delta.
|
1. Bump the patch version in `*/Cargo.toml` and add the `-pre` suffix. This allows `cargo-semver-checks` to check for changes not accounted for in the version delta.
|
||||||
1. Run `cargo build --release` again to update `Cargo.lock`
|
1. Run `cargo build --release` again to update `Cargo.lock`
|
||||||
1. Commit that change with comment "Bump to -pre version".
|
1. Commit that change with comment "Bump to -pre version".
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "taskchampion-sync-server-core"
|
name = "taskchampion-sync-server-core"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Core of sync protocol for TaskChampion"
|
description = "Core of sync protocol for TaskChampion"
|
||||||
|
|||||||
@ -43,7 +43,7 @@ services:
|
|||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
|
|
||||||
tss:
|
tss:
|
||||||
image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:0.7.0
|
image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:0.7.1
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- "RUST_LOG=info"
|
- "RUST_LOG=info"
|
||||||
|
|||||||
@ -10,16 +10,38 @@ One binary is provided for each storage backend:
|
|||||||
- `taskchampion-sync-server` (SQLite)
|
- `taskchampion-sync-server` (SQLite)
|
||||||
- `taskchampion-sync-server-postgres` (Postgres)
|
- `taskchampion-sync-server-postgres` (Postgres)
|
||||||
|
|
||||||
|
### Building the Binary
|
||||||
|
|
||||||
|
This is a standard Rust project, and can be built with `cargo build --release`.
|
||||||
|
|
||||||
|
By default, only the SQLite binary is built. To also build the Postgres binary,
|
||||||
|
use
|
||||||
|
```none
|
||||||
|
cargo build --release --features postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
To disable building the SQLite binary and build only the Postgres binary, use
|
||||||
|
|
||||||
|
```none
|
||||||
|
cargo build --release --no-default-features --features postgres
|
||||||
|
```
|
||||||
|
|
||||||
### Running the Binary
|
### Running the Binary
|
||||||
|
|
||||||
The server is configured with command-line options or environment variables.
|
The server is configured with command-line options or environment variables.
|
||||||
See the `--help` output for full details.
|
See the `--help` output for full details.
|
||||||
|
|
||||||
For the SQLite binary, the `--data-dir` option or `DATA_DIR` environment
|
For the SQLite binary, the `--data-dir` option or `DATA_DIR` environment
|
||||||
variable specifies where the server should store its data. For the Postgres
|
variable specifies where the server should store its data.
|
||||||
binary, the `--connection` option or `CONNECTION` environment variable
|
|
||||||
specifies the connection information, in the form of a [LibPQ-style connection
|
For the Postgres binary, the `--connection` option or `CONNECTION` environment
|
||||||
|
variable specifies the connection information, in the form of a [LibPQ-style
|
||||||
|
connection
|
||||||
URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS).
|
URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS).
|
||||||
|
Note that unlike LibPQ, the Rust client only supports `sslmode` values
|
||||||
|
`disable`, `prefer`, and `require`, and will always validate CA hostnames and
|
||||||
|
certificates when using TLS.
|
||||||
|
|
||||||
The remaining options are common to all binaries.
|
The remaining options are common to all binaries.
|
||||||
|
|
||||||
The `--listen` option specifies the interface and port the server listens on.
|
The `--listen` option specifies the interface and port the server listens on.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Docker Compose
|
# Docker Compose
|
||||||
|
|
||||||
The
|
The
|
||||||
[`docker-compose.yml`](https://raw.githubusercontent.com/GothenburgBitFactory/taskchampion-sync-server/refs/tags/v0.7.0/docker-compose.yml)
|
[`docker-compose.yml`](https://raw.githubusercontent.com/GothenburgBitFactory/taskchampion-sync-server/refs/tags/v0.7.1/docker-compose.yml)
|
||||||
file in this repository is sufficient to run taskchampion-sync-server,
|
file in this repository is sufficient to run taskchampion-sync-server,
|
||||||
including setting up TLS certificates using Lets Encrypt, thanks to
|
including setting up TLS certificates using Lets Encrypt, thanks to
|
||||||
[Caddy](https://caddyserver.com/). This setup uses the SQLite backend, which is
|
[Caddy](https://caddyserver.com/). This setup uses the SQLite backend, which is
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
set -e
|
set -e
|
||||||
echo "starting entrypoint script..."
|
echo "starting entrypoint script..."
|
||||||
if [ "$1" = "/bin/taskchampion-sync-server-postgres" ]; then
|
if [ "$1" = "/bin/taskchampion-sync-server-postgres" ]; then
|
||||||
|
: ${PUID:-1092}
|
||||||
|
: ${PGID:-1092}
|
||||||
|
|
||||||
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
||||||
export DATA_DIR
|
export DATA_DIR
|
||||||
echo "setting up data directory ${DATA_DIR}"
|
echo "setting up data directory ${DATA_DIR}"
|
||||||
mkdir -p "${DATA_DIR}"
|
mkdir -p "${DATA_DIR}"
|
||||||
chown -R taskchampion:users "${DATA_DIR}"
|
chown -R "${PUID}:${PGID}" "${DATA_DIR}"
|
||||||
chmod -R 700 "${DATA_DIR}"
|
chmod -R 700 "${DATA_DIR}"
|
||||||
|
|
||||||
: ${LISTEN:=0.0.0.0:8080}
|
: ${LISTEN:=0.0.0.0:8080}
|
||||||
@ -20,10 +23,8 @@ if [ "$1" = "/bin/taskchampion-sync-server-postgres" ]; then
|
|||||||
unset CLIENT_ID
|
unset CLIENT_ID
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(id -u)" = "0" ]; then
|
echo "Running server as user ${PUID} (group ${PGID})"
|
||||||
echo "Running server as user 'taskchampion'"
|
exec su-exec "${PUID}":"${PGID}" "$@"
|
||||||
exec su-exec taskchampion "$@"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
eval "${@}"
|
eval "${@}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
set -e
|
set -e
|
||||||
echo "starting entrypoint script..."
|
echo "starting entrypoint script..."
|
||||||
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
||||||
|
: ${PUID:-1092}
|
||||||
|
: ${PGID:-1092}
|
||||||
|
|
||||||
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
||||||
export DATA_DIR
|
export DATA_DIR
|
||||||
echo "setting up data directory ${DATA_DIR}"
|
echo "setting up data directory ${DATA_DIR}"
|
||||||
mkdir -p "${DATA_DIR}"
|
mkdir -p "${DATA_DIR}"
|
||||||
chown -R taskchampion:users "${DATA_DIR}"
|
chown -R ${PUID}:${PGID} "${DATA_DIR}"
|
||||||
chmod -R 700 "${DATA_DIR}"
|
chmod -R 700 "${DATA_DIR}"
|
||||||
|
|
||||||
: ${LISTEN:=0.0.0.0:8080}
|
: ${LISTEN:=0.0.0.0:8080}
|
||||||
@ -20,10 +23,8 @@ if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
|||||||
unset CLIENT_ID
|
unset CLIENT_ID
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(id -u)" = "0" ]; then
|
echo "Running server as user ${PUID} (group ${PGID})"
|
||||||
echo "Running server as user 'taskchampion'"
|
exec su-exec "${PUID}":"${PGID}" "$@"
|
||||||
exec su-exec taskchampion "$@"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
eval "${@}"
|
eval "${@}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "taskchampion-sync-server-storage-postgres"
|
name = "taskchampion-sync-server-storage-postgres"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
authors = ["Dustin J. Mitchell <dustin@v.igoro.us>"]
|
authors = ["Dustin J. Mitchell <dustin@v.igoro.us>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Postgres backend for TaskChampion-sync-server"
|
description = "Postgres backend for TaskChampion-sync-server"
|
||||||
@ -16,7 +16,7 @@ bb8.workspace = true
|
|||||||
chrono.workspace = true
|
chrono.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
taskchampion-sync-server-core = { path = "../core", version = "0.7.0" }
|
taskchampion-sync-server-core = { path = "../core", version = "0.7.2-pre" }
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tokio-postgres.workspace = true
|
tokio-postgres.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|||||||
@ -39,6 +39,26 @@ use uuid::Uuid;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod testing;
|
mod testing;
|
||||||
|
|
||||||
|
/// An `ErrorSink` implementation that logs errors to the Rust log.
|
||||||
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
pub struct LogErrorSink;
|
||||||
|
|
||||||
|
impl LogErrorSink {
|
||||||
|
fn new() -> Box<Self> {
|
||||||
|
Box::new(Self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl bb8::ErrorSink<tokio_postgres::Error> for LogErrorSink {
|
||||||
|
fn sink(&self, e: tokio_postgres::Error) {
|
||||||
|
log::error!("Postgres connection error: {e}");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn boxed_clone(&self) -> Box<dyn bb8::ErrorSink<tokio_postgres::Error>> {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A storage backend which uses Postgres.
|
/// A storage backend which uses Postgres.
|
||||||
pub struct PostgresStorage {
|
pub struct PostgresStorage {
|
||||||
pool: bb8::Pool<PostgresConnectionManager<MakeTlsConnector>>,
|
pool: bb8::Pool<PostgresConnectionManager<MakeTlsConnector>>,
|
||||||
@ -49,7 +69,10 @@ impl PostgresStorage {
|
|||||||
let connector = native_tls::TlsConnector::new()?;
|
let connector = native_tls::TlsConnector::new()?;
|
||||||
let connector = postgres_native_tls::MakeTlsConnector::new(connector);
|
let connector = postgres_native_tls::MakeTlsConnector::new(connector);
|
||||||
let manager = PostgresConnectionManager::new_from_stringlike(connection_string, connector)?;
|
let manager = PostgresConnectionManager::new_from_stringlike(connection_string, connector)?;
|
||||||
let pool = bb8::Pool::builder().build(manager).await?;
|
let pool = bb8::Pool::builder()
|
||||||
|
.error_sink(LogErrorSink::new())
|
||||||
|
.build(manager)
|
||||||
|
.await?;
|
||||||
Ok(Self { pool })
|
Ok(Self { pool })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,8 +272,13 @@ impl StorageTxn for Txn {
|
|||||||
"UPDATE clients
|
"UPDATE clients
|
||||||
SET latest_version_id = $1,
|
SET latest_version_id = $1,
|
||||||
versions_since_snapshot = versions_since_snapshot + 1
|
versions_since_snapshot = versions_since_snapshot + 1
|
||||||
WHERE client_id = $2 and latest_version_id = $3",
|
WHERE client_id = $2 and (latest_version_id = $3 or latest_version_id = $4)",
|
||||||
&[&version_id, &self.client_id, &parent_version_id],
|
&[
|
||||||
|
&version_id,
|
||||||
|
&self.client_id,
|
||||||
|
&parent_version_id,
|
||||||
|
&Uuid::nil(),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.context("error updating latest_version_id")?;
|
.context("error updating latest_version_id")?;
|
||||||
@ -666,4 +694,22 @@ mod test {
|
|||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
/// When an add_version call specifies a `parent_version_id` that does not exist in the
|
||||||
|
/// DB, but no other versions exist, the call succeeds.
|
||||||
|
async fn test_add_version_no_history() -> anyhow::Result<()> {
|
||||||
|
with_db(async |connection_string, db_client| {
|
||||||
|
let storage = PostgresStorage::new(connection_string).await?;
|
||||||
|
let client_id = make_client(&db_client).await?;
|
||||||
|
|
||||||
|
let mut txn = storage.txn(client_id).await?;
|
||||||
|
let version_id = Uuid::new_v4();
|
||||||
|
let parent_version_id = Uuid::new_v4();
|
||||||
|
txn.add_version(version_id, parent_version_id, b"v1".to_vec())
|
||||||
|
.await?;
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "taskchampion-sync-server"
|
name = "taskchampion-sync-server"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "taskchampion-sync-server-storage-sqlite"
|
name = "taskchampion-sync-server-storage-sqlite"
|
||||||
version = "0.7.0"
|
version = "0.7.2-pre"
|
||||||
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "SQLite backend for TaskChampion-sync-server"
|
description = "SQLite backend for TaskChampion-sync-server"
|
||||||
@ -9,7 +9,7 @@ repository = "https://github.com/GothenburgBitFactory/taskchampion-sync-server"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
taskchampion-sync-server-core = { path = "../core", version = "0.7.0" }
|
taskchampion-sync-server-core = { path = "../core", version = "0.7.2-pre" }
|
||||||
async-trait.workspace = true
|
async-trait.workspace = true
|
||||||
uuid.workspace = true
|
uuid.workspace = true
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
|
|||||||
@ -276,11 +276,12 @@ impl StorageTxn for Txn {
|
|||||||
SET
|
SET
|
||||||
latest_version_id = ?,
|
latest_version_id = ?,
|
||||||
versions_since_snapshot = versions_since_snapshot + 1
|
versions_since_snapshot = versions_since_snapshot + 1
|
||||||
WHERE client_id = ? and latest_version_id = ?",
|
WHERE client_id = ? and (latest_version_id = ? or latest_version_id = ?)",
|
||||||
params![
|
params![
|
||||||
StoredUuid(version_id),
|
StoredUuid(version_id),
|
||||||
StoredUuid(self.client_id),
|
StoredUuid(self.client_id),
|
||||||
StoredUuid(parent_version_id)
|
StoredUuid(parent_version_id),
|
||||||
|
StoredUuid(Uuid::nil())
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.context("Error updating client for new version")?;
|
.context("Error updating client for new version")?;
|
||||||
@ -489,4 +490,21 @@ mod test {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
/// When an add_version call specifies a `parent_version_id` that does not exist in the
|
||||||
|
/// DB, but no other versions exist, the call succeeds.
|
||||||
|
async fn test_add_version_no_history() -> anyhow::Result<()> {
|
||||||
|
let tmp_dir = TempDir::new()?;
|
||||||
|
let storage = SqliteStorage::new(tmp_dir.path())?;
|
||||||
|
let client_id = Uuid::new_v4();
|
||||||
|
let mut txn = storage.txn(client_id).await?;
|
||||||
|
txn.new_client(Uuid::nil()).await?;
|
||||||
|
|
||||||
|
let version_id = Uuid::new_v4();
|
||||||
|
let parent_version_id = Uuid::new_v4();
|
||||||
|
txn.add_version(version_id, parent_version_id, b"v1".to_vec())
|
||||||
|
.await?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user