# Sync — Dondori Docs

> Private peer-to-peer sync between your Macs: pairing tickets, QR codes, and a trusted-device list — no account, end-to-end encrypted, CRDT merge.

Sync runs on iroh (https://iroh.computer): devices connect directly to each other over an end-to-end encrypted channel. Data is merged with CRDTs, so two machines can edit offline and reconcile without conflicts when they next see each other. If a task changed on both sides, the merge keeps both edits field-by-field instead of asking you to pick a winner.

## Enable sync

1. Open **Settings (⌘,) → Sync**.
2. Click **Enable sync**. The device generates an identity and shows its **pairing ticket** — as text and as a QR code.

## Pair a device

Pairing is **mutual** — each device must add the other's ticket:

1. On device A, copy the ticket (or show the QR).
2. On device B, paste it into **Paste peer ticket** and add it.
3. Repeat in the other direction: hand B's ticket to A.

Once both sides trust each other, they sync — on demand with **Sync now**, and automatically in the background when auto-sync is on.

## The trust list

Only devices on your **Trusted devices** list can connect. There is no discovery and no open port for strangers — a peer not in the allow-list is refused before any data flows. Remove a device from the list and it's cut off.

## What syncs

- Tasks, statuses, labels, priorities, time blocks, notes, and time sessions.
- Tracker credentials **don't** sync — they stay in each machine's Keychain.

**Offline-first:** sync is opportunistic. Work offline for a week; the next time two trusted devices are both online, they reconcile. Nothing queues on a server in between.

## Encryption at rest

Independent of transport encryption, the local database itself can be encrypted — envelope encryption over a passphrase-derived key stored in the macOS Keychain, with key slots and rotation. Enable it in **Settings → Security**.
