mirror of
https://github.com/martinlegend/neogdsync.git
synced 2026-07-22 06:08:29 +00:00
No description
1. deleteFile now PATCHes trashed=true instead of HTTP DELETE. The previous DELETE was a permanent removal that bypassed Drive trash, so any accidental local deletion (or buggy delete propagation) became unrecoverable. Switching to trashed=true gives users the standard ~30-day recovery window. 2. unknownChanges in smartSync now skips changes whose file is currently trashed. When a file is trashed on Drive, the changes batch typically contains both an earlier "modified" event (removed=false) and the later trashed event. If the fileId was no longer in the local pathIndex (e.g. just rebuilt or a sibling device cleaned up), the modified event walked the unknownChanges path, fetched metadata, and re-pulled the file locally — silently undoing the trash. The fix skips such changes when file.trashed is set on the change event, and double- checks meta.trashed after the live metadata fetch as defence-in-depth. DriveFileInfo and DriveChange.file gain optional `trashed?: boolean`, and the getFileMeta + getChanges fields lists request the trashed property explicitly. Bumps version to 0.1.19. |
||
|---|---|---|
| src | ||
| .gitignore | ||
| esbuild.config.mjs | ||
| eslint.config.mjs | ||
| LICENSE | ||
| main.js | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| styles.css | ||
| tsconfig.json | ||
NeoGDSync
Lightweight Google Drive sync plugin for Obsidian.
Features
- Smart Sync — auto conflict detection, only syncs changed files
- Force Push — local vault → Google Drive
- Force Pull — Google Drive → local vault
- Conflict handling — saves Drive copy as a conflict file, never overwrites silently
- Path-based index — fast, no full crawl needed after first sync
- Version history — optionally keep file revisions on Drive
- Configurable excludes — glob patterns to skip files/folders
- URI handler —
obsidian://neogdsync?mode=smart|push|pullfor automation
Setup
- Install the plugin
- Go to Settings → NeoGDSync
- Enter your Google OAuth2 Refresh Token
- Enter your Google Drive Vault Root Folder ID (the Drive folder that maps to your vault root)
- Click the ☁ ribbon icon or run a command to sync
Getting a Refresh Token
This plugin uses a standard OAuth2 refresh token with read/write access to Google Drive.
You can obtain one via:
- The Google Drive for Desktop OAuth flow
- Any OAuth2 tool using scope
https://www.googleapis.com/auth/drive
The token is stored locally in your vault's plugin data and never leaves your device except to authenticate with Google.
Commands
| Command | Description |
|---|---|
| Smart Sync | Detect and sync only changed files, with conflict detection |
| Force Push | Upload all local changes to Drive |
| Force Pull | Download all Drive changes to local |
| Rebuild Drive Index | Re-crawl Drive vault folder to rebuild index |
| Show Conflicts | View detected conflicts |
URI Handler
Trigger sync from outside Obsidian (Shortcuts, scripts, etc.):
obsidian://neogdsync?mode=smart
obsidian://neogdsync?mode=push
obsidian://neogdsync?mode=pull
License
MIT