shun-shobon35 downloadsSync personal vaults and collaboratively edit Markdown through your Cloudflare account.
English | 日本語
An Obsidian plugin that syncs notes and attachments across devices using Cloudflare Workers, Durable Objects, and R2. You host the server in your own Cloudflare account.
https://github.com/user-attachments/assets/b756b66e-3c62-4bcb-9710-f038a03f7667
For up to five devices, the targets are about 0.5 seconds for text and 0.2 seconds for cursors. These targets have not been measured; the collaboration changes still need testing on desktop, iOS, and Android devices.
Clone this repository and install dependencies with pnpm install --frozen-lockfile.
bucket_name in packages/worker/wrangler.toml to your bucket name. To create a bucket, run pnpm --filter @cf-sync/worker exec wrangler r2 bucket create <bucket-name>./api/* with an Access self-hosted application, allow only your email address, and enable Managed OAuth.https://<hostname>/oauth/callback.packages/worker/.dev.vars.| Variable | Value |
|---|---|
ACCESS_TEAM_DOMAIN |
Your team domain, such as example.cloudflareaccess.com, without a scheme |
ACCESS_AUD |
The Application Audience of your Access application |
pnpm --filter @cf-sync/worker exec wrangler login
pnpm --filter @cf-sync/worker exec wrangler secret put ACCESS_TEAM_DOMAIN
pnpm --filter @cf-sync/worker exec wrangler secret put ACCESS_AUD
pnpm deploy
In Obsidian, open Settings → Community plugins → Browse, search for CF Sync, and install and enable it. If restricted mode is on, turn on community plugins first.
Each local vault connects to one remote vault. To use a different remote vault, create a separate local vault.
Sync a Vault without Obsidian on macOS or Linux with Node.js 24 or later. Create an Access service token and allow it with a Service Auth policy.
npm install -g obsidian-cf-sync
export CF_SYNC_SERVER_URL=https://sync.example.com
export CF_ACCESS_CLIENT_ID='your-client-id'
export CF_ACCESS_CLIENT_SECRET='your-client-secret'
obsidian-cf-sync vault list
obsidian-cf-sync init ./vault --vault REMOTE_VAULT_ID
obsidian-cf-sync sync ./vault
See obsidian-cf-sync --help for more options.
CF Sync requires a Cloudflare account and a server that you deploy and maintain in that account, using Workers, Durable Objects, R2, and Cloudflare Access with Managed OAuth. You also need a custom domain for the server and an email address allowed by your Access policy.
Cloudflare charges may apply depending on your plan and usage. Review the pricing for Workers, Durable Objects, and R2 before deploying.
The plugin communicates with your configured server over HTTPS and secure WebSockets. It sends synced file contents and paths, edits and deletion operations, file metadata, remote vault names and identifiers, device names and identifiers, cursor positions and selections in the active note, and sync exclusion settings. Your server processes this data in Cloudflare Workers and Durable Objects and stores files in your R2 bucket. Cursor information is used only for live display and is not stored in files, edit history, or R2. Durable Objects retain the Yjs state of deleted notes to recover edits made concurrently with deletion.
Sign-in uses your server's Cloudflare Access OAuth endpoints and, in your browser, the identity provider configured in Access. OAuth registration, authorization, and token exchange send the information needed to authenticate. Your Access policy controls who can sync, and your server verifies the Access JWT's signature, issuer, audience, and expiration.
CF Sync does not provide end-to-end encryption. Transport is encrypted, but the server can read synced content, and the latest notes and attachments are stored in R2 as regular files.