Add export-caldav and export-carddav #32

Merged
jcoffey-dev merged 1 commits from feat/export-dav into main 2026-10-30 08:15:51 +00:00
Owner

export-caldav and export-carddav write an archive's calendars and address books into any CalDAV or CardDAV server. This is the last part of the 27.1 neutral-export item, after export-managesieve (#31).

  • The account's home comes from the signed-in principal, so --url can be the server's root and a fresh, empty account works.
  • Collections are matched by display name. Missing ones are made with MKCALENDAR or an extended MKCOL, carrying their name, description and color.
  • Items go to <UID>.ics / <UID>.vcf. A new item is sent with If-None-Match: *. An existing one is read, compared, and replaced under If-Match only when it differs.
  • The comparison ignores what servers rewrite on their own: folding, parameter order and case, PRODID, DTSTAMP and REV. N and ADR are compared on their vCard 3 parts, because Radicale drops the newer ones.
  • If the server refuses an item or a collection, it's counted and the run goes on. Nothing is deleted.

Tests:

  • tests/mock_export_dav.rs runs in CI against an in-memory DAV server. It covers name matching, an etag replace, a refused card, and a second run that writes nothing.
  • tests/integration_export_dav.rs does live round trips on Radicale and Baikal. It exports into an empty account, re-runs to check convergence, reads the result back to compare, and changes one event. Both pass.
  • The Baikal rig's digest hashes didn't match its test password. They're fixed, and the existing Baikal tests pass again.

Checks: cargo fmt, cargo clippy --all-targets -D warnings, cargo test --locked (1469 passed).

`export-caldav` and `export-carddav` write an archive's calendars and address books into any CalDAV or CardDAV server. This is the last part of the 27.1 neutral-export item, after `export-managesieve` (#31). - The account's home comes from the signed-in principal, so `--url` can be the server's root and a fresh, empty account works. - Collections are matched by display name. Missing ones are made with `MKCALENDAR` or an extended `MKCOL`, carrying their name, description and color. - Items go to `<UID>.ics` / `<UID>.vcf`. A new item is sent with `If-None-Match: *`. An existing one is read, compared, and replaced under `If-Match` only when it differs. - The comparison ignores what servers rewrite on their own: folding, parameter order and case, `PRODID`, `DTSTAMP` and `REV`. `N` and `ADR` are compared on their vCard 3 parts, because Radicale drops the newer ones. - If the server refuses an item or a collection, it's counted and the run goes on. Nothing is deleted. Tests: - `tests/mock_export_dav.rs` runs in CI against an in-memory DAV server. It covers name matching, an etag replace, a refused card, and a second run that writes nothing. - `tests/integration_export_dav.rs` does live round trips on Radicale and Baikal. It exports into an empty account, re-runs to check convergence, reads the result back to compare, and changes one event. Both pass. - The Baikal rig's digest hashes didn't match its test password. They're fixed, and the existing Baikal tests pass again. Checks: `cargo fmt`, `cargo clippy --all-targets -D warnings`, `cargo test --locked` (1469 passed).
jcoffey-dev added 1 commit 2026-10-30 08:12:36 +00:00
Add export-caldav and export-carddav
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m50s
ci / announce (pull_request) Skipped
9d38b3a7f1
Write an archive's calendars and address books into any CalDAV or
CardDAV server. The home is found from the signed-in principal (the
URL can be the server root), collections are matched by display name
or made with MKCALENDAR / extended MKCOL, and each event or card is
written with If-None-Match: * when new, or under If-Match on its etag
when it differs. The comparison ignores folding, parameter order and
case, PRODID, DTSTAMP and REV, and compares N and ADR on their vCard 3
parts, so a second run writes nothing on Radicale and Baikal. Refused
items are counted and the run goes on; nothing is deleted.

Live round trips against Radicale and Baikal, a mock test with an
in-memory DAV server, and the Baikal rig's digest hashes fixed to
match its test password.
jcoffey-dev merged commit 73f66f43c0 into main 2026-10-30 08:15:51 +00:00
jcoffey-dev deleted branch feat/export-dav 2026-10-30 08:15:51 +00:00
Sign in to join this conversation.