Sync files with Baidu Netdisk using conflict copies, optional end-to-end encryption, and recoverable desktop file replacement.
Baidu Sync Safe synchronizes an Obsidian desktop vault with Baidu Netdisk. It supports manual and scheduled bidirectional sync, conflict copies, optional AES-256-GCM end-to-end encryption, and encrypted configuration transfer between desktop devices.
Requirements: Obsidian 1.14.4 or later on desktop, a Baidu Netdisk account, and a personal Baidu developer application with AppKey/AppSecret. Mobile support is not released.
Install: Download main.js, manifest.json, and styles.css from this repository's latest release. Place them in <vault>/.obsidian/plugins/baidu-sync/ and enable Baidu Sync Safe under Community plugins. For a custom configuration folder, replace .obsidian with your configuration folder.
Set up: Create an application in the Baidu Netdisk developer console, enter its AppKey and AppSecret in plugin settings, open the authorization page, exchange the authorization code for a token, and test connectivity. Choose a remote directory before starting sync. To enable encryption, set a nonempty encryption password on every device. Keep an independent backup before the first sync.
File safety: Desktop replacement uses native filesystem rename with verified backup and journal files and pre-commit fsync. Startup recovery only processes plugin-owned journal entries. This is single-file replacement and recovery, not a distributed transaction across the vault and Baidu Netdisk or a guarantee against arbitrary physical power loss. The plugin makes requests to Baidu for authorization, uploads and downloads and uses the clipboard for user-triggered configuration transfer.
Credits: The link to owl234's project in the Chinese acknowledgements below is intentional attribution for encryption and configuration-sharing design references; installation and downloads for this plugin use the minLaoGe repository linked above.
为 Obsidian 桌面版打造的百度网盘双向同步插件。当前 1.0.4 仅支持桌面端,最低 Obsidian 版本为 1.14.4;移动端尚未实机验证,暂不发布移动端支持。依托百度网盘大容量云存储,提供单设备串行执行、单文件替换与事务恢复、3-Way 冲突副本保护,并支持端到端零知识加密 (E2EE) 与多设备一键跨端快速配对机制。
特别感谢社区优秀开源项目 owl234/obsidian-baidu-netdisk-sync 在端到端加密(E2EE)与多设备跨端配对设计上带来的启发与技术参考。
只需在电脑端首次操作一次,后续多设备可直接通过加密配对码一键导入!
ObsidianSync 或 MyObsidian);basic,netdisk)即可,无需额外特殊申请;💡 小贴士:百度网盘 Token 到期前插件会自动无感续期,日常无需手动维护。
插件支持桌面设备之间的加密配置迁移。以下配对机制不代表当前版本支持手机或平板:
BDSYNC:v1:... 开头)。rename 覆盖目标,不先删除旧文件;替换前对新内容、旧版本备份及事务记录执行写入、重读 MD5 校验和 fsync。如果文件系统不支持替换,直接报错,不退化成先删后写。fsync,采用校验过的新文件、旧文件副本和事务记录实现可恢复替换。替换期间目标路径可能短暂不存在,不能宣称运行时原子可见。plugins/baidu-sync/transactions/ 内有事务记录的文件。已完成替换则清理;目标缺失则恢复已验证的旧版本(新建文件恢复新内容)。遇到损坏记录、内容不明或恢复失败会停止同步并保留恢复材料。sync-state.json 使用同一事务写入机制;恢复先于基线加载,保存失败可重试,损坏的基线不会静默重置。npm test 覆盖持久化步骤后的重启、写入/删除/重命名故障、损坏临时内容、用户备份保护、基线重试和加密冲突回归;npm run typecheck 检查类型。基于【当前本地】、【当前网盘】、【上次成功同步基准(Base Snapshot)】进行三方对比:
${文件名}.conflict-${时间戳}.${扩展名},并在 Obsidian 界面弹出 Notice 提示,保留两个版本供用户检查与合并。.obsidian/plugins/;baidu-sync;main.js、manifest.json、styles.css 放入该文件夹;# 安装依赖
npm install
# 生产环境编译打包
npm run build
# 开发监听模式
npm run dev
本项目基于 MIT License 开源。 特别感谢社区项目 owl234/obsidian-baidu-netdisk-sync。