anki/ftl
Damien Elmes cf45cbf429
Rework syncing code, and replace local sync server (#2329)
This PR replaces the existing Python-driven sync server with a new one in Rust.
The new server supports both collection and media syncing, and is compatible
with both the new protocol mentioned below, and older clients. A setting has
been added to the preferences screen to point Anki to a local server, and a
similar setting is likely to come to AnkiMobile soon.

Documentation is available here: <https://docs.ankiweb.net/sync-server.html>

In addition to the new server and refactoring, this PR also makes changes to the
sync protocol. The existing sync protocol places payloads and metadata inside a
multipart POST body, which causes a few headaches:

- Legacy clients build the request in a non-deterministic order, meaning the
entire request needs to be scanned to extract the metadata.
- Reqwest's multipart API directly writes the multipart body, without exposing
the resulting stream to us, making it harder to track the progress of the
transfer. We've been relying on a patched version of reqwest for timeouts,
which is a pain to keep up to date.

To address these issues, the metadata is now sent in a HTTP header, with the
data payload sent directly in the body. Instead of the slower gzip, we now
use zstd. The old timeout handling code has been replaced with a new implementation
that wraps the request and response body streams to track progress, allowing us
to drop the git dependencies for reqwest, hyper-timeout and tokio-io-timeout.

The main other change to the protocol is that one-way syncs no longer need to
downgrade the collection to schema 11 prior to sending.
2023-01-18 12:43:46 +10:00
..
core Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
core-repo@dae74b5783 Update translations 2023-01-09 11:09:02 +10:00
qt Add orientation toggle to browser view menu (#2074) 2022-09-20 12:56:59 +10:00
qt-repo@4c7dd7b6cc Update translations 2023-01-09 11:09:02 +10:00
.gitignore Don't store used FTL keys in git 2022-04-09 12:38:54 +10:00
Cargo.toml Use workspace package info in more crates; mark private for cargo-deny 2022-11-30 12:19:56 +10:00
duplicate-string.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
extract-strings.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
format_check.py run black/isort on Python scripts 2021-04-14 18:22:02 +10:00
format.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
README.md fix documentation links 2021-06-03 16:51:03 +10:00
remove-unused.sh Don't store used FTL keys in git 2022-04-09 12:38:54 +10:00
sync.rs Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
transform-string.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
update-ankimobile-usage.sh Don't store used FTL keys in git 2022-04-09 12:38:54 +10:00
update-desktop-usage.sh Garbage collect unused Fluent strings (#1482) 2021-11-12 18:19:01 +10:00

Files related to Anki's translations.

Please see https://translating.ankiweb.net/anki/developers