Skip to content

feat: GDrive File Scope implementation with file picker#86

Open
desmaraisp wants to merge 11 commits into
walterpg:masterfrom
desmaraisp:master
Open

feat: GDrive File Scope implementation with file picker#86
desmaraisp wants to merge 11 commits into
walterpg:masterfrom
desmaraisp:master

Conversation

@desmaraisp

@desmaraisp desmaraisp commented Dec 9, 2024

Copy link
Copy Markdown

This PR reimplements #51, which aimed to fix #79. With this PR, the plugin uses the file scope only, avoiding the "Google blocked this access issue", without requiring any App Review from Google. It also adds a new button in the plugin config that serves to grant access to existing files in the gDrive so that we can avoid creating duplicate files when syncing across multiple devices

You can find a compiled release of the plugin here: KPSyncForDrive-5.0.0.zip, using my own ClientId, certificate and AutoUpdate Url

This will serve to replace the GenClientId process by using commandLine args to pass values to be inlined into the plugin
This allows us to grant access to specific files to our application, instead of granting global access. That'll help us get around both the google blocking issue, and the kdbx file duplication issue when using limited file scope

The UI elements wrapping around this will be added in a later commit
This PR adds a UI element that displays a cancellation button, and calls the file picker service. This will allows us to add a button in the plugin config that makes this form show up and redirect the user to their browser
Since we've already implemented a new process to read some configuration items from build params, we no longer need the T4 generation to build the clientId into the app
This flow will allow us to build and upload our artifacts whenever we cut a new release. It also lays the groundwork for simplifying how we manage autoupdate files
This will allow the plugin to be built from any repo without code changes, and allows us to have the auto-update file in our release artifacts instead of the repo

@retlok retlok left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My knowledge of C# is limited because I'm mainly a java dev, but I don't see anything sketchy, and I've tested this E2E so it looks good to me

@snvoid

snvoid commented Dec 20, 2024

Copy link
Copy Markdown

ClientId, certificate and AutoUpdate Url

Would we need to change these if we were to use your compiled plugin ? Hoping this PR gets implemented since my entire workflow using this plugin and keepass has suffered since the google changes.

Thank you @desmaraisp for working on this ❤️

@desmaraisp

Copy link
Copy Markdown
Author

ClientId, certificate and AutoUpdate Url

Would we need to change these if we were to use your compiled plugin ? Hoping this PR gets implemented since my entire workflow using this plugin and keepass has suffered since the google changes.

Thank you @desmaraisp for working on this ❤️

Only if you want to build the plugin yourself (ie when this is merged, we'll need to add the values to the repo's vars). People installing the plugin shouldn't need to touch that at all

@dregad

dregad commented Jan 19, 2026

Copy link
Copy Markdown

This was a life saver ! Thanks @desmaraisp for fixing the issue.

@walterpg any chance this PR can be merged and a new official release cut ?

@johnfoxii

Copy link
Copy Markdown

I was syncing between android and PC
Google security killed GoogleSyncPlugin
KPSyncForDrive-4.1.0 creating duplicates directories/files

KPSyncForDrive-5.0.0 still creating duplicate directories/files EXCEPT WHEN
I tried
adding / to end of Target Sync Folder (why is this on both config tabs?)
renaming the kdbx file KPSyncForDrive-5.0.0 created and placing kdbx file I needed to sync into folder - dup created
placed kdbx file I needed to sync into folder and then clicked Authorize and choose file - app places a message on bottom bar (see image attached) "Trying previous Google Drive Authorization" message just hangs there for minute or so and created dup.

Deleted kdbx file from the duplicate folder and moved kdbx from where it was being synced by android to this new duplicate folder and it seemed to sync.

I will update when I sync between devices several times

keepass

@johnfoxii

Copy link
Copy Markdown

Renamed old Gdrive folder. Leaving dup as only folder with valid kdbx file. Sync from android then PC all data present.
I think I read that having a duplicate .kdbx file anywhere on the drive causes the duplication??

First time executing KeePass on PC. The KeePass update check reported that
a newer version of KPsync 5.0.0.0 was available showing a version 5.1.x.x as the suggested new version?

@desmaraisp

Copy link
Copy Markdown
Author

Heya, a couple of notes

  • 5.1.1 is just a couple of security patches, mostly optional

  • By default the upload creates duplicates as you saw when sybcing across multiple devices unless you jumps through a bunch of hoops. That's because it's how google drive does things.

  • To get around this, we tell gdrive "this app can access this preexisting file". Thats what this pr adds, but you have to do explicitly do it through the gdrive file explorer that opens in a web browser

  • IIRC that also includes directories, that might be what was causing you issues. So if the plugin syncs to a folder, you might have to authorize that folder

  • Good to hear you managed to fix it yourself anyway, nicely done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google blocked this access

5 participants