Marcos2k downloadsEnd-to-end encrypted bidirectional sync of your vault with Proton Drive, with three-way conflict remediation for offline edits.
Bidirectional sync between an Obsidian vault and a folder in Proton Drive, built on Proton's official Drive SDK. Your notes are end-to-end encrypted by the SDK before they leave the device, with the same implementation Proton's own clients use.
[!WARNING] This plugin is vibe-coded. It was written largely by an AI coding assistant, with a human directing and reviewing the work rather than writing every line. It has automated tests, but it has not been through a security audit or long real-world use, and it syncs, and can delete, the files in your vault. Try it on a copy of a vault first, keep backups, and expect bugs.
Status: alpha, and it depends on a pre-release SDK. Read Before you rely on this first. Keep a backup.
.obsidian settings.git mv): the next full sync recognises the file by its content and moves it on
Drive instead of deleting and uploading it again.-, lines only in the other in green with +, and the changed
words highlighted. Then pick which version to keep from the same window.A few things are worth knowing before you point this at a vault you care about.
"Almost instant" is one-way. Local edits upload within about two seconds of you stopping typing. Changes made on another device take up to the poll interval to arrive. The pace follows Proton's own SDK: every 30 seconds for a few minutes after anything changes, the Check Drive every setting otherwise (30 seconds by default), and every 10 minutes after ten quiet minutes or while the window is hidden. The Proton Drive API has no push or websocket channel, so there is no way to do better than polling, and Proton's usage guidelines ask third-party clients not to poll aggressively: an account that does can be rate-limited. The setting cannot go below 30 seconds, Proton's own rate. This is a limit of the service, not of this plugin.
The SDK is not released for third-party use yet. Proton's README allows personal, non-commercial projects like this one and asks that they go through the SDK rather than the raw API — which is what this does — but it also says the interface may still change, and it describes a cryptographic model change targeted for late 2026 / early 2027 after which clients that have not been updated will stop interoperating. If this plugin is not updated by then, it will stop working.
Desktop and mobile. The plugin runs on Windows, macOS, Linux, Android and
iOS. Requests go out through Obsidian's requestUrl on every platform, and
sign-in and encryption use only web APIs. Differences on mobile:
Mobile support is new and has had far less testing than desktop.
Encryption runs on the UI thread. The SDK encrypts and decrypts in-process, so a very large attachment can make Obsidian stutter while it transfers. On desktop, files over 32 MB are streamed to and from disk rather than held in memory, so size is not a hard limit, but use Skip files larger than in settings if the stutter bites.
Requires Obsidian 1.13.7 or later.
There is no community-plugin listing. Build it and copy it in:
npm install
npm run build
Then copy main.js, manifest.json and styles.css into
<your vault>/.obsidian/plugins/proton-drive-sync/, and enable the plugin in
Settings → Community plugins.
On Android and iOS, put the same three files in that folder of the vault on the device, using a file manager, a USB cable, or a plugin installer such as BRAT.
For development, npm run dev rebuilds on change; point it at a test vault by
building into that vault's plugin folder.
The first time the plugin loads, a setup window walks you through it. It only appears once. To see it again, run Open setup assistant from the command palette. Everything it sets is also in Settings → Proton Drive Sync.
If both the vault and the Drive folder already hold notes, the first sync shows a preview first: how many files will be downloaded, uploaded, or are on both sides with different content, with the file names one click away. Start syncing goes ahead; Not now pauses syncing until you resume it. A first sync never deletes anything on either side. The same preview appears after Rebuild sync state or a change of Drive folder, which are first syncs too.
On each additional device, sign in and pick the same folder. The first sync
pairs up files that already match, byte for byte, without transferring them.
Settings from Drive take precedence over a new device's defaults, without being
reported as conflicts. Obsidian only loads its settings, plugins, themes and CSS
snippets at startup, so a first sync brings the .obsidian folder down before
any note, and a dialog then lists what came down and offers Reload now.
Reloading at that point is quick, since the notes have not arrived yet, and
safe: if you reload, the notes pick up where they left off afterwards; if you
choose Later, they keep syncing in the meantime. Until you reload, settings changes on that device are not
uploaded, so the defaults it is still running on cannot replace your settings on
Drive; changes coming from Drive still arrive. If Drive's list of enabled
plugins does not include Proton Drive Sync, it is added back, so the reload
never switches syncing off.
Joining with a brand-new vault, one that holds nothing but Obsidian's default settings, skips the preview described below: there is nothing of yours in it for Drive's files to clash with.
A conflict is when a file changed on both sides since they last agreed. An edit on one side only is not a conflict; it is just a sync.
| Setting | What happens |
|---|---|
| Keep both versions (default) | This device's version keeps its filename. The other is saved beside it as note (conflict 2026-09-18 1431 from laptop).md. Both then sync everywhere. |
| Merge the changes | Combines edits to different parts of a note, down to different words of the same line — the usual shape after a device has been offline. Falls back to keeping both when the edits overlap, when the file is not text, or when the previous version is no longer in Drive's revision history. |
| Keep whichever was edited last | Uses modification times. Falls back to keeping both when they tie, or when Drive has no recorded time for the file. |
| Keep this device's / Keep Drive | The chosen side keeps the filename; the other is kept as a conflict copy unless you turn copies off. |
| Ask me each time | Nothing is written. The file is skipped until you choose, via Show sync conflicts in the command palette or the status bar's right-click menu. |
Show sync conflicts (command palette, status bar menu, or the sync panel's Conflicts button) lists two things. Waiting on you has the files Ask me each time left for a decision. History has every conflict this device has seen, newest first, however it was settled: when it happened, what happened, and buttons to open the note or compare it with its conflict copy while the copy is still there. Remove entries one by one or clear the lot; the most recent 200 are kept. The history belongs to each device and is not synced.
Under Ask me each time, each file in Show sync conflicts has a
Compare button. It shows this device's version against the one on Drive as
a diff: lines only on this device in red with -, lines only on Drive in green
with +, a few unchanged lines around each change, and the rest folded away.
The Markdown is shown as source, so a changed link target or heading level is as
visible as a changed word. The choices are right underneath, each in the colour
and sign of the version it keeps: red − Keep this device's version, green
+ Keep the Drive version, and a neutral Keep both.
Under the other policies, a conflict usually leaves a conflict copy beside the note. Open either file and run Compare with conflict copy from the command palette, or click Compare in the conflict notice. From the diff you can keep the note and delete the copy (red, −), or replace the note with the copy (green, +). The copy goes to Obsidian's trash either way, so a wrong choice can be undone.
Two cases ignore the setting, because there is no second version to choose between: if a file was deleted on one device and edited on the other, the edit always wins. A deletion can be repeated; a lost edit cannot be recovered.
Deletions that aren't contested do propagate, and locally a deleted note goes
wherever you chose under Settings → Files and links → Deleted files (system
trash, the vault's .trash folder, or permanently), as if you had deleted it
yourself. Files in the config folder, which Obsidian does not index, go to the
system trash. A file is only removed from the vault when Drive
confirms it was deleted or trashed. A file that is merely missing from the Drive
folder — moved elsewhere in Drive, or not found because a request failed — is
kept, and uploaded again if needed.
Files in the .obsidian folder never get conflict copies, since Obsidian would
never read them, and never raise a conflict notice, since there is nothing to
decide. When a new device joins, Drive's copy wins. Otherwise the most recent
edit wins.
Click the status bar item to sync now, or to resume when paused. Right-click it for Pause syncing, Show sync conflicts, the sync panel and the settings.
The sync panel shows the same status in the right sidebar: when the vault last synced, in green, or in red once that is over an hour ago, which means syncing has stopped (paused, offline, failing or waiting for Wi-Fi); the details (progress, last error); and its buttons, one to a row and each the full width of the panel: Sync now, Pause/Resume, Share link for the note you are viewing (see below), Conflicts, Versions of that note, Recently deleted and Settings. Below them are the changes not synced yet. A check of Drive that finds nothing new counts as a sync, so a quiet vault stays green.
Versions of opens the versions of the note you are viewing on Proton Drive: up to the last 50, newest first, ten to a page, each with its date and size, the current one marked. Choose one to compare it with the note as it is now, in the same red and green diff as conflicts, and Restore this version to bring it back; All versions goes back to the list. A restore is written into the note and synced as a new version, so the version it replaces stays in the history and the restore can itself be undone. The panel lists the versions whenever you open a note, and again when it syncs a new version, so the list is ready when you open it.
Recently deleted opens the vault's files in Drive's trash: up to 50, most recently deleted first, ten to a page, from any device. Restore asks first, then takes the file out of the trash, and the next check brings it back into the vault. A file whose folder was deleted too comes back with that folder; a folder deleted as a whole, from Proton's apps say, is listed for itself. The panel lists the trash once the sync is up and again as often as Drive is checked for changes, but not while syncing is paused, offline or waiting for Wi-Fi; opening the dialog lists it then. Files deleted from Drive's trash, or after it was emptied, are gone.
Sharing a note. Copy Proton Drive share link opens a dialog for the
note in view. If it has no link yet, choose an optional password and an expiry
(never, 1, 7 or 30 days) and Create and copy link. Anyone with the link can
open the note, read-only, as it is on Drive at the time; the key is in the
part of the link after #, which browsers do not send to Proton. If the note
has a link already, the dialog shows it with Copy link and Stop
sharing. A note has to be synced before it can be shared. Open the
panel with Open sync panel from the command palette. The full sync log is in
the settings, under Recent activity.
On mobile, where Obsidian has no status bar, the panel takes its place, out of the way of the note until you swipe the right sidebar in. A sync icon in the ribbon shows the current state and opens the panel. Every command has an icon, so you can also put Sync now in the mobile toolbar (Settings → Toolbar), or make it the pull-down gesture (Settings → Mobile → Quick action).
While paused, nothing is uploaded, downloaded or polled. Edits made in the meantime, on this device or elsewhere, are found by the full sync that runs when you resume. The pause is remembered across restarts.
While a sync runs, the status bar shows how many files of the current pass have
been checked (Syncing 120/4000), or the progress of a large transfer
(↑ lecture.mp4 45%). When idle, it says how long ago the last sync finished.
The dot beside the icon is about the note you are looking at: pulsing green when it is in sync, pulsing red when it has changes that have not reached Drive yet (hover for why), grey when it is excluded from sync. On mobile it appears in the note's header instead, turns into a spinning sync icon while that note transfers, and opens the sync panel when tapped.
The sync panel's Not synced yet list shows every change still waiting, with the reason: about to sync, uploading, downloading, being removed after a deletion elsewhere, waiting for Wi-Fi, failed and retrying (with when it tries next), over this device's size limit, a name clash, or a conflict waiting for you. Tap a file to open it.
Notes open in an editor. When a new version of a note arrives while it is open, it is brought into the editor as an edit, so the cursor stays where it is. If you have typing that is not saved yet, the two are merged in the editor instead of the file being replaced underneath you; once Obsidian saves, the merged note goes up without a conflict copy. Only typing that overlaps the incoming change is left for your conflict setting to settle.
If something goes wrong, Copy sync log (in the command palette, or under Recent activity in settings) copies the recent log with the plugin and Obsidian versions, ready to paste into a bug report. It includes file names, so look it over before sharing it.
Regardless of settings: .obsidian/workspace.json and the other pane-layout and
cache files (devices fight over them), this plugin's own folder (its settings
and sync state belong to each device, and each device updates the plugin itself
through Obsidian), the device list's .proton-drive-sync folder (see
Seeing and managing the devices that sync a vault),
.trash/, .git/, .DS_Store, Thumbs.db, and editor scratch files.
.obsidian as a whole is excluded if you turn off Sync Obsidian settings.
These are matched however a path is spelled, so .Obsidian/ or .obsidian./,
which Windows and macOS treat as the same folder, are excluded too.
Nor is anything on Drive whose name could lead out of the vault: .., a name
made only of dots and spaces, or one containing / or \. Names on Drive are
end-to-end encrypted, so Proton cannot check them, and anyone who can write to
a shared folder could otherwise use them to write files outside the vault.
Such items are left alone on Drive and named in the sync log.
Add your own exclusions as globs — Private/, **/*.pdf — in settings. A
pattern that would not do what it looks like, such as one with a leading / or
Windows \ separators, is flagged under the field as you type.
A vault can live in a Drive folder shared between Proton accounts. The owner shares the folder in Proton Drive with editor access; each person accepts the invitation there, then picks the folder under Shared with me in the folder picker. Who can use the vault is whatever Proton Drive's sharing says.
.obsidian/plugins/) and the list of enabled ones
(community-plugins.json) are never synced with a folder other people can
write to, even with config sync on: anyone with editor access could otherwise
put a plugin into the vault that runs on everyone's computer. This applies as
soon as the folder, or a folder above it, is shared with another account,
also when it was shared after you chose it. A public link does not count.Each device keeps its own record of the last version it agreed on with Drive, so devices never need to be online together. What to expect when they are:
Note.md and note.md, can
exist side by side on Drive and Linux, but are one file on Windows, macOS,
iOS and usually Android. On a device that can keep them apart, both simply
sync. On one that cannot, the plugin settles the clash on Drive: the name
that was already synced, or the one in this vault, stays, and the other is
renamed to note (case conflict).md, so both keep syncing everywhere. The
same goes for folders, such as Notes and notes. Each rename shows up in the
conflict notice and history. A pair that cannot be renamed is left unsynced,
and you are told.aux.md (a reserved device name),
Meeting 10:30.md, or note. (Windows drops the trailing dot, so it would
land on note), are fine on macOS, Linux and Android. When a Windows device
meets one, it renames it on Drive, for example to
Meeting 10-30 (renamed for Windows).md, so every device syncs it under a
name all of them can store. A vault no Windows device syncs keeps its names.
If the rename fails, the file is not synced on that Windows device, and
Not synced yet says why.Café.md with its accent stored as a separate character (as macOS and some
Linux tools write it), or a name with a non-breaking space, are renamed on
Drive to the spelling Obsidian uses, on every device. Without that, the vault
would hold the note under one spelling and Drive under the other, and the two
would sync as different files. If a file with that spelling is already on
Drive, the other is renamed to Café (name conflict).md instead, so both are
kept, and the rename shows up in the conflict notice and history.Each device that syncs the vault lists itself, shortly after its first sync: its name (the Device name setting), platform, plugin version and account, how it stands, and when it last synced, updated hourly while it syncs and whenever that changes. Show devices under Devices in the settings, or Show devices syncing this vault in the command palette, opens the list.
From there you can Pause, Resume or Remove any other device. Each acts on it the next time it checks Drive, which for a device that is closed is when Obsidian next opens on it; until then the list says it was asked. A paused device stops syncing as if it had been paused by hand, and can be resumed from the list or on the device itself; while paused it still checks the list every two minutes, so a resume or removal reaches it. A removed device stops syncing and signs out, and syncs the vault again only once someone signs in on it with the account's password. Nothing is deleted, on the device or on Drive. Forget takes a removed device, or one not heard from in a month, off the list.
The list lives in a hidden .proton-drive-sync folder in the Drive folder,
with one small file per device that only that device writes, and one for the
requests left for it. Devices on versions from before the list sync that folder
like any other hidden folder, which does no harm: they never write to it.
It asks devices to cooperate; it cannot make them. Versions from before the list, Proton's own apps and anything else signed in to your account neither list themselves nor take requests, so the list shows who syncs with this plugin, not everyone who can reach the folder. To cut a device off for good, change your Proton password, or revoke its session in Proton's account settings under Security. If a device is reinstalled, or Obsidian's data is cleared on it, it lists itself again as a new device; forget the old entry.
The list is off for a vault in someone else's Drive or shared with other people, whose devices would otherwise see yours, and could pause or remove them.
vault events ─┐ ┌─ Drive events (polled)
├─→ batched ─→ reconcile() ─→ apply ┤
sync state ───┘ │ └─ upload / download
└─→ conflict ─→ policy ─→ merge / copy
src/sync/reconcile.ts is the core: a pure function from
(last-agreed version, local file, remote node) to one decision. It does all the
interesting thinking and none of the I/O, which is why the awkward cases have
tests rather than anecdotes.
| Path | What lives there |
|---|---|
src/sync/reconcile.ts |
The decision table. Pure. |
src/sync/merge.ts |
Line-level three-way merge. Pure. |
src/sync/engine.ts |
Watches both sides and applies decisions. |
src/sync/engine/ |
The engine's parts: polling pace, transfer pace, progress, case clashes, rename detection, first-sync plan. |
src/sync/state.ts |
What the last sync agreed on, per path. |
src/proton/ |
SDK wiring: transport, session, credentials. |
src/proton/account/ |
Vendored from Proton's SDK repo — see its VENDORED.md. |
Run the tests with npm test and the Obsidian review rules with npm run lint;
CI runs both. tests/simulation.test.ts runs three simulated devices through
random sequences of edits, renames, deletions, restarts and missed events, and
checks that they always end up with the same notes and that no typed text is
lost. Set SIM_SEEDS and SIM_STEPS to run more of them, or SIM_SEED to
replay a failing one. The tests cover the reconciliation table, the merge, the diff,
path filtering, the state store and the HTTP transport — everything that can be
exercised without a real vault and a real Proton account.
The Proton session — access token, refresh token, and the password that unlocks
your keys — is kept in Obsidian's secret storage. That storage belongs to the
device, not the vault, and uses the platform's keystore where there is one. It
is never written inside the vault, so it is never synced, and a copied vault
does not carry your sign-in with it. Each device signs in on its own. Sessions
saved by version 0.1.0 in session.json are moved into secret storage on the
first launch, and the file is deleted.
The Drive SDK's file metadata cache (decrypted names, sizes and revisions of the files it has seen) is kept between sessions in an IndexedDB database of Obsidian's, outside the vault, so it is never synced. Each entry is encrypted with AES-256-GCM under a key kept inside the stored session, so it is protected by the PIN when there is one and useless after signing out, which also deletes it. It is saved together with the sync state's position in Drive's event feed, and thrown away when the two do not match (a crash between saves, a rebuilt sync state, another folder), since a stale cache could hide a change. The SDK's other cache, which holds decrypted keys, is only ever kept in memory.
The sync state in sync-state.json holds paths, node ids and content hashes. No
file contents, and no key material. It is saved so that a crash or a killed app
never leaves only a half-written copy: the new state is written beside it and
then swapped in, with the previous copy kept as sync-state.json.bak. If no
copy can be read, the plugin says so and pauses, showing what a sync would do
before anything moves, instead of quietly starting from scratch.
Signing out ends the session on Proton's side (DELETE /auth/v4) before
the local copy is deleted, so a copy of it that anyone might have taken stops
working too. If Proton cannot be reached, the local copy is deleted anyway and
you are told to revoke the session under account.proton.me → Security →
Sessions. Signing out also forgets the chosen Drive folder and its sync state,
since both belong to that account: after signing in again, choose the folder
anew. Nothing is deleted on Drive or in the vault, and the first sync pairs up
the files that already match.
Obsidian's keychain is encrypted by the operating system, which protects it while the device is locked, but not from someone using it unlocked: Obsidian's own Keychain settings can reveal a stored secret. Without a PIN, that secret is a working Proton session, key password included.
An optional PIN closes that gap. Set it up in the setup assistant or under Settings → Proton Drive Sync → Account → PIN. The session is then stored encrypted (AES-256-GCM, with a key derived from the PIN by PBKDF2-SHA256 at 600,000 iterations), and Obsidian asks for the PIN when it starts; nothing syncs until it is entered. While locked, the sync icon in the status bar (desktop) and the ribbon (mobile) shows a lock. Changing or removing the PIN, and signing out, ask for it first. After a few wrong tries each further try waits, longer every time. The eye button next to each PIN field shows what you typed.
Ask for the PIN sets when it is asked for again: every time Obsidian opens (the default), or after 1, 5, 10, 30 or 60 minutes without using Obsidian. With a time limit, syncing stops and the PIN is asked for once the time runs out, and reopening Obsidian within the limit does not ask. That convenience has a cost: to survive a restart, the unlocked key is kept in Obsidian's keychain until the limit runs out, and while it is there the sign-in is protected only as well as without a PIN. If Obsidian stays closed past the limit, the key stays in the keychain until it next runs, when it is deleted. "Every time Obsidian opens" never keeps it.
Obsidian's plugin review flags some of what this plugin does. Here is each one and why it is there.
*.proton.me) and nothing
else, through Obsidian's requestUrl. File contents and names are encrypted
on the device before they leave it.fs can read and write any file on the system. This plugin only opens
paths inside the vault, resolved through the adapter's own getFullPath. On
desktop, files over 32 MB are streamed with Node's fs and hashed with Node's
crypto instead of being read whole into memory, and large downloads are
written to a temporary file in the plugin's own folder and moved into place
once complete; one left unfinished by a crash is cleared at the next start.
Obsidian's API has no way to read a file in pieces, so without fs a
multi-gigabyte video would have to fit in memory whole. On mobile, where there
is no Node, everything goes through the adapter and large files are read
whole. Everywhere else, notes are written, renamed and deleted through
Obsidian's Vault API, and settings files in the config folder, which that API
cannot reach, through the adapter.src/proton/telemetry.ts).Function / new Function). Not in the plugin's own code.
It comes from two bundled libraries: ttag, the translation library inside
Proton's Drive SDK, which compiles plural-form rules, and core-js, whose
polyfills use it for feature detection (Function("return this") and an
async-generator probe). None of it runs on file contents or on anything
received from the network.Copyright (C) 2026 MarckFp.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE for the full text.
GPL-3.0 because the built plugin bundles @protontech/crypto, which Proton
publishes under GPL-3.0, so the main.js users install has to be distributed
under the GPL anyway. Other bundled packages keep their own licences and are
listed in a header at the top of main.js, among them Proton's OpenPGP.js fork
(LGPL-3.0+) and several MIT and BSD packages, all compatible with the GPL.
src/proton/account/ is vendored from
ProtonDriveApps/sdk and stays under
its original MIT licence (© Proton AG); see src/proton/account/LICENSE.md and
src/proton/account/VENDORED.md.
Not affiliated with or endorsed by Proton AG.