-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Have you searched for an existing feature request?
- Yes, I tried searching
Brief Summary
The current remote sync implementation only allows for two simple actions - uploading and downloading a database. It does not allow for file locking, or progress to be reflected in the UI.
My proposal is to abstract the remote sync interface to introduce the concept of providers which would give support for merging more than simple upload/download commands.
I propose a RemoteSyncProvider base class with methods for:
- Start Synchronisation (this could be used to lock the remote file)
- Download Database (to a byte-stream in memory - no need to hit the disk)
- Upload Database
- Finish Synchronisation (either abort, or finished cleanly)
Signals for: - Reporting progress as a percentage
- Reporting logging messages
On top of this RemoteSyncProvide, I propose 2 providers:
- External tool (as we have currently, with additional scripts for start/finish)
- WebDAV
It would also be nice if we could recall credentials contained within the open database when synchronising. I propose doing this through nominating credentials in the UI, which would be passed through environment variables
I would also like to see a sync-on-save option, so every time I save my database it will be synchronised if possible.
Example
This feature ideally should allow me to configure a remote path to synchronise my database to which would be housed on my NextCloud server.
Each time I save my database after making changes, I should have my database merged automagically with the file stored on my configured remote server.
I would get progress bars for all of downloading, merging and re-uploading my database, with logging output from the provider, see the mockup below:
I could also foresee additional providers for other cloud storage solutions such as Google Drive, OneDrive and others.
Context
Issues such as #11854 and #9409 seem to provide minimal additional reasoning, and get closed with 'mount the WebDAV folder natively'.
I sometimes work in locations without internet access, so mounting the WebDAV folder doesn't work in my case.
When using tools such as the Nextcloud Desktop client, if I modify entries in two places, the synchronisation this provides is not aware of how to merge two Keepass databases, and will end up losing changes.
While simply using a tool such as rclone may work, I have run into a situation at least once where two devices have still managed to overwrite each other because the file was not locked between the download and upload phases of the merge. Providing a native way to synchronise with WebDAV could overcome this issue.
I synchronise with Nextcloud, for which my credentials are stored in the database.
I found no good way to get credentials out of my database when synchronising, instead resorting to hard-coding an access token into my script, which is not ideal.
The CLI last I used it was not interfacing with the GUI application, and required me to unlock my database with my master password - which would be even worse to store on disk.