|
1 | | -# YAOS (Yet Another Obsidian Sync) |
| 1 | +# YAOS |
2 | 2 |
|
3 | | -**YAOS makes Obsidian sync feel like Apple Notes or Google Docs.** It is a free, self-hosted, and local-first sync engine that updates your notes instantly across all your devices. |
| 3 | +**A zero-terminal, real-time sync engine for Obsidian, powered by your own Cloudflare Worker.** |
4 | 4 |
|
5 | | -Under the hood, it is a real-time CRDT engine running on Cloudflare Durable Objects. For the average user, hosting it yourself costs exactly $0/month on Cloudflare's free tier. |
| 5 | +Your notes stay in sync instantly across devices, without conflicted copies, delayed file sync, or database-heavy self-hosting. |
6 | 6 |
|
7 | | -### Features |
| 7 | +[](https://deploy.workers.cloudflare.com/?url=https://github.com/kavinsood/yaos/tree/main/server) |
8 | 8 |
|
9 | | -- **Instant Sync:** Changes update in milliseconds. |
10 | | -- **Zero Conflicts:** You never see a "File modified externally" error again. |
11 | | -- **Offline-First:** Go offline, edit for days, and everything merges perfectly when you reconnect. |
12 | | -- **Zero-Config Setup:** Deploy with one click. Claim your server in the browser. Scan a link to pair your devices. *No terminal required.* |
13 | | -- **Attachments & Backups (Optional):** Sync your images/PDFs and automatic daily backups, allowing you to selectively restore files if you accidentally delete something. |
| 9 | +No terminal, no `.env` files, no database setup required. R2 is optional. |
14 | 10 |
|
15 | | -If you want the absolute best, zero-effort experience, you should pay for the official Obsidian Sync. If you want a free, instant, local-first alternative that you fully control, this is YAOS. |
| 11 | +The Worker setup page also walks you through the remaining steps, so you do not need to memorize the setup flow from this README. |
16 | 12 |
|
17 | | -### Quick Start (5 Minutes) |
| 13 | +## What YAOS gives you |
18 | 14 |
|
19 | | -YAOS requires two things: a free Cloudflare edge server, and the Obsidian plugin. |
| 15 | +- **Real-time sync:** changes show up across devices instantly. |
| 16 | +- **No conflicted copies:** YAOS keeps your vault in live agreement instead of asking devices to upload files later and hope for the best. |
| 17 | +- **Zero-terminal setup:** deploy your own backend in one click, claim it in the browser, and pair devices with a setup link or QR code. |
| 18 | +- **Local-first control:** your vault stays normal local Markdown files, and the server runs in your own Cloudflare account. |
| 19 | +- **Optional attachments and snapshots:** add R2 later for file sync and recovery. |
20 | 20 |
|
21 | | -**Step 1: Deploy your Server** |
22 | | -Click this button to deploy your personal sync server. It costs $0 and requires no terminal. |
| 21 | +If you want the official, fully managed experience, pay for Obsidian Sync and support the team. If you want a fast, self-hosted, local-first alternative that you fully control, this is YAOS. |
23 | 22 |
|
24 | | -[](https://deploy.workers.cloudflare.com/?url=https://github.com/kavinsood/yaos/tree/main/server) |
| 23 | +## Quick Start |
| 24 | + |
| 25 | +YAOS has two parts: the Obsidian plugin, and a small Cloudflare server that you deploy to your own account. |
| 26 | + |
| 27 | +**1. Deploy your server** |
| 28 | +Use the **Deploy to Cloudflare** button above. The Worker setup page will guide you through claim, pairing, and plugin setup from there. |
25 | 29 |
|
26 | | -**Step 2: Claim your Server** |
27 | | -Open the URL Cloudflare generates for you. Click "Claim" to generate your secure token and lock the server to you. **Keep this page open.** |
| 30 | +**2. Claim your server** |
| 31 | +Open the URL Cloudflare gives you. Click **Claim** to generate your setup token and lock the server to you. |
28 | 32 |
|
29 | | -**Step 3: Install the Plugin (Beta)** |
| 33 | +**3. Install the plugin (beta)** |
30 | 34 | *YAOS is currently in the Obsidian Marketplace review queue. To use it today:* |
31 | | -1. Install **BRAT** from the Obsidian Community Plugins. |
32 | | -2. Open BRAT settings, click "Add Beta plugin", and paste: `kavinsood/yaos` |
33 | | -3. Go back to Community Plugins and **enable YAOS**. |
| 35 | +1. Install **BRAT** from **Settings → Community plugins**. |
| 36 | +2. Open BRAT settings, click **Add Beta plugin**, and paste: `kavinsood/yaos` |
| 37 | +3. Go back to **Community plugins** and enable **YAOS**. |
| 38 | + |
| 39 | +**4. Connect your vault** |
| 40 | +From the claim page, open the setup link or scan the QR code. YAOS will fill in the connection details automatically. |
| 41 | + |
| 42 | +## Why YAOS exists |
| 43 | + |
| 44 | +Most ways to sync Obsidian do one of two things: |
| 45 | + |
| 46 | +- keep files in sync after the fact |
| 47 | +- ask you to self-host a full database stack |
34 | 48 |
|
35 | | -**Step 4: Connect** |
36 | | -Go back to your Claim page and check the box confirming you installed the plugin. Click the "Auto-Configure" button. Obsidian will open, and your vault is now syncing. |
| 49 | +The first category can work well, until it does not: |
37 | 50 |
|
38 | | -### How is this different from iCloud or Remotely Save? |
| 51 | +- a change on one device is still "not here yet" on another |
| 52 | +- a mobile app closes too fast and the latest edit never really makes it |
| 53 | +- two devices move independently and you end up with conflicted copies |
39 | 54 |
|
40 | | -*Most free ways to sync Obsidian (like Dropbox, iCloud, or community plugins) are just moving files back and forth on a timer. |
41 | | -- If you edit on your phone and quickly close the app, the file might not upload. |
42 | | -- If you edit the same note on your laptop and your phone, you get an annoying "Conflicted Copy". |
| 55 | +The second category can solve more of the sync problem, but often asks you to become your own infrastructure team. |
43 | 56 |
|
44 | | -**YAOS syncs keystrokes, not files.** If you edit on two devices at once, the text merges flawlessly. Go offline for days, and everything reconciles mathematically when you reconnect. |
| 57 | +YAOS takes a different path: |
45 | 58 |
|
46 | | -If you want the design rationale and internals, read these: |
| 59 | +- it keeps the **state of your vault** in sync in real time |
| 60 | +- it treats your notes as shared state, not just files to upload later |
| 61 | +- it gives you a browser-based, zero-terminal setup flow instead of asking you to wire up a database and secrets by hand |
47 | 62 |
|
48 | | -This repository keeps deep architecture notes under [`engineering/`](./engineering), with diagrams and operational limits documented alongside implementation details |
| 63 | +That is why it feels different in practice: less waiting, less drift, less weirdness. |
| 64 | + |
| 65 | +## Engineering docs |
| 66 | + |
| 67 | +If you want the design rationale and internals, this repository keeps deep architecture notes under [`engineering/`](./engineering): |
49 | 68 |
|
50 | 69 | - **[Monolithic vault CRDT](./engineering/monolith.md):** Why YAOS keeps one vault-level `Y.Doc`, what we gain (cross-file transactional behavior), and what we consciously trade off. |
51 | 70 | - **[Filesystem bridge](./engineering/filesystem-bridge.md):** How noisy Obsidian file events are converted into safe CRDT updates with dirty-set draining and content-acknowledged suppression. |
52 | 71 | - **[Attachment sync and R2 proxy model](./engineering/attachment-sync.md):** Native Worker proxy uploads, capability negotiation, and bounded fan-out under Cloudflare connection limits. |
53 | 72 | - **[Checkpoint + journal persistence](./engineering/checkpoint-journal.md):** The storage-engine rewrite that removed full-state rewrites and introduced state-vector-anchored delta journaling. |
54 | 73 | - **[Zero-config auth and claim flow](./engineering/zero-config-auth.md):** Browser claim UX, `obsidian://yaos` deep-link pairing, and env-token override behavior. |
55 | 74 | - **[Warts and limits](./engineering/warts-and-limits.md):** Canonical limits, safety invariants, and the pragmatic compromises currently in production. |
56 | | -- **[Queue pool behavior](./engineering/queue-pool.md):** Why attachment transfer queues currently favor deterministic behavior over maximal throughput. |
57 | | - |
58 | | - |
59 | | -### Configuration |
60 | 75 |
|
61 | | -After enabling, go to **Settings → YAOS**: |
| 76 | +## Configuration |
62 | 77 |
|
63 | | -| Setting | Description | |
64 | | -|---------|-------------| |
65 | | -| **Server host** | Your server URL (e.g., `https://sync.yourdomain.com`) | |
66 | | -| **Token** | Paste the token from the YAOS setup link (or from a manual `SYNC_TOKEN` override if you use one) | |
67 | | -| **Vault ID** | Unique ID for this vault (auto-generated if blank). Same ID = same vault across devices. | |
68 | | -| **Device name** | Shown in remote cursors | |
| 78 | +After enabling, go to **Settings → YAOS**. |
69 | 79 |
|
70 | | -### Optional settings |
| 80 | +**Key settings** |
71 | 81 |
|
72 | 82 | | Setting | Description | |
73 | 83 | |---------|-------------| |
74 | | -| **Exclude patterns** | Comma-separated prefixes to skip (e.g., `templates/, .trash/`) | |
75 | | -| **Max file size** | Skip files larger than this (default 2 MB) | |
| 84 | +| **Server URL** | Your Worker URL (for example, `https://sync.yourdomain.com`) | |
| 85 | +| **Sync token** | Filled automatically by the YAOS setup link after you claim the server | |
| 86 | +| **Device name** | Shown to other devices in live cursors and presence | |
| 87 | +| **Exclude paths** | Comma-separated path prefixes to skip (for example, `templates/, .trash/`) | |
| 88 | +| **Max text file size** | Skip text files larger than this for live document sync | |
| 89 | +| **Sync attachments** | Enable object-storage sync for images, PDFs, and other non-markdown files | |
76 | 90 | | **Max attachment size** | Skip attachments larger than this (default 10 MB) | |
77 | | -| **External edit policy** | How to handle edits from git/other tools: Always, Only when closed, Never | |
78 | | -| **Sync attachments** | Enable R2-based sync for non-markdown files | |
79 | | -| **Show remote cursors** | Display collaborator cursor positions | |
80 | | -| **Debug logging** | Verbose console output | |
| 91 | +| **Parallel transfers** | Number of simultaneous attachment upload/download slots | |
| 92 | +| **Show remote cursors** | Display cursor positions and selections from other devices | |
| 93 | +| **Edits from other apps** | Control how YAOS handles changes from git, scripts, or other editors | |
| 94 | +| **Debug logging** | Verbose console output for troubleshooting | |
81 | 95 |
|
82 | | -Changes to host/token/vault ID require reloading the plugin. |
| 96 | +`Manual connection` and `Advanced` sections are available in the settings UI when you need to inspect or override connection details. |
83 | 97 |
|
84 | 98 | ## Commands |
85 | 99 |
|
@@ -109,31 +123,35 @@ Requires R2 to be configured on the server. |
109 | 123 |
|
110 | 124 | ## How it works |
111 | 125 |
|
112 | | -1. Each markdown file gets a stable ID and a `Y.Text` CRDT for its content |
113 | | -2. Today, those per-file `Y.Text` values live inside one shared vault-level `Y.Doc`, which keeps collaboration simple and fast for normal-sized note vaults |
114 | | -3. Live editor edits flow through the Yjs binding to that shared document |
115 | | -4. One vault maps to one Durable Object-backed sync room, so the shared state survives server restarts |
116 | | -5. Offline edits are stored in IndexedDB and sync on reconnect |
117 | | -6. Attachments sync separately via content-addressed R2 storage instead of being forced through the text CRDT |
118 | | -7. Daily and on-demand snapshots exist as a safety net |
| 126 | +YAOS keeps your vault as normal local files, while also maintaining a shared real-time state for sync. |
| 127 | + |
| 128 | +1. Each markdown file gets a stable ID and a `Y.Text` CRDT for its content. |
| 129 | +2. Today, those per-file `Y.Text` values live inside one shared vault-level `Y.Doc`, which keeps collaboration simple and fast for normal-sized note vaults. |
| 130 | +3. Live editor edits flow through the Yjs binding to that shared document. |
| 131 | +4. One vault maps to one Durable Object-backed sync room, so the shared state survives server restarts. |
| 132 | +5. Offline edits are stored in IndexedDB and sync on reconnect. |
| 133 | +6. Attachments sync separately via content-addressed R2 storage instead of being forced through the text CRDT. |
| 134 | +7. Daily and on-demand snapshots exist as a safety net. |
119 | 135 |
|
120 | 136 | In practice, that means: |
121 | 137 |
|
122 | 138 | - your vault still exists locally as normal files |
123 | 139 | - Obsidian keeps behaving like Obsidian |
124 | 140 | - YAOS keeps the disk mirror and the shared CRDT state aligned instead of asking devices to take polite turns uploading files later |
125 | 141 |
|
| 142 | +Because Obsidian vaults are just local Markdown files, YAOS also plays unusually well with scripts, CLI tools, and AI agents that edit files directly on disk. Those edits can propagate cleanly across devices instead of falling back to conflicted-copy workflows. |
| 143 | + |
126 | 144 | ## Limits and Tradeoffs |
127 | 145 |
|
128 | | -YAOS is optimized for personal or small-team note vaults, not for arbitrarily huge filesystem trees. |
| 146 | +YAOS is optimized for personal or small-team note vaults, not for arbitrarily huge text archives. |
129 | 147 |
|
130 | | -It currently keeps one shared `Y.Doc` for the vault, which keeps collaboration simple but gives the design a memory ceiling for large vaults. |
| 148 | +It currently keeps one shared `Y.Doc` for a vault. That gives excellent real-time ergonomics and simpler cross-file behavior, but it also creates a practical ceiling for very large vaults. |
131 | 149 |
|
132 | | -If you're going to dump 100K line log files or scrape Wikipedia, a dumb sync platform like Google Drive or Syncthing is preferable. |
| 150 | +If your vault is normal notes, drafts, research, and attachments, YAOS is a great fit. If you want to sync giant text dumps or archival datasets, a simpler file-sync tool is a better choice. |
133 | 151 |
|
134 | | -YAOS trades infinite scalability for perfect real-time ergonomics. |
| 152 | +YAOS trades infinite scalability for instant, local-first sync ergonomics. |
135 | 153 |
|
136 | | -A vault of upto 50 MB of raw text (not including attachments like images and PDFs) will work beautifully. |
| 154 | +A practical rule of thumb: around 50 MB of raw text (not counting attachments like images and PDFs) is a comfortable target. |
137 | 155 |
|
138 | 156 | ## Troubleshooting |
139 | 157 |
|
|
0 commit comments