-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge multiple databases at once with the option to have redundant databases deleted. #5024
Comments
@rtevans01 My main issues also are related to synchronizing databases on different devices using cloud services. Maybe the request could be more general:
|
Yes I think a syntax should be used. My conflicted databases are all in the same directory path as my non-conflicted database, so I don't think it would be very difficult to search for them. Just start out with the name of the non-conflicted database and look for any other database that has the same name plus "sync-conflict-2020...". I think opening separate tabs would be a waste of time. I'd rather have it taken care of in one step but to each his own. |
After reading a lot of related issues, I think there is quiet some confusion in the acual issues and responsibilities related to cloud syncing in combination with KeePassXC, but I think this issue hits it best, so I am adding some details to it. After analysing it for quiet some time now, let me use this comment to document it in detail and hopefully also motivate for a new feature of KeePassXC as I think it will affect many users out there. I think using KeePassXC on multiple devices accessing a single remote kdbx file works seamlessly as long as direct file system access to the actual and only kdbx file is used (such as an SMB share)! Changes done to the file while still open in KeePassXC can be automatically merged if configured. If the file is not accessible anymore on the other hand, KeePassXC will notify you. It therefore only works properly though in local networks or anywhere where connectivity to the original kdbx file is stable, so that you can use a file system based access to the file. We use this method in a team already since a year and I recommend everyone who is able to use this method to use it as it's easy to setup, very reliable and has great usability as changes are merged immediately. Thank you for this awesome feature! However, at the point where KeePassXC is supposed to be used with cloud sync (like Dropbox, Syncthing, etc.), there is one major issue making it very annoying to use as described already by @rtevans01. It is actually not a bug, but a major usability issue due to the nature of how cloud sync works and how tasks/responsibilities are distributed across different software (such as KeePass and a sync software in this case). The main issue are conflicts happening whenever two devices do not have a continuous connection. See this example with devices A and B:
The general situation is not unusual as in practice the connection between the device and a cloud server is not always reliable. Think of mobile phones or home-driven cloud servers for example. With a LAN-only Syncthing setup, this even is every day practice. Note that I tagged some positions with #usability_issueX. I think the major usability issues are:
Note that the file name patterns for conflict files are well documented for the popular sync providers:
I therefore would like to encourage to add new features to KeePassXC that increase the usability for this very regular usecase of combining KeePassXC with cloud sync. I am not too familiar with best practices and no-gos in terms of security, but here are some ideas I have:
I hope this clarifies and motivates for some solution of the usability issue. That was a long run. Thanks for reading down to here! :) I was tempted to open a new issue for that, but I think there is quiet some confusion already due to many related tasks and some of the aspects described are already somewhere else, so I don't wanna mess it up more. These are some related tasks which might be worth considering: #90, #2937, #4192, #5072, #5024. |
Can you TLDR the above |
@boernsen1 And that's why my solution with Keepass was (and is)
That's why I still hope to get bi-directional merge. And, to go back to my comment above: KeepassX should try to use the same password as for the current opened file. This is how Keepass works: I will not be asked to enter the password again for each file I want to synchronize. I can just "synchronize" and that's it. |
I'll try to sum up my indeed very long comment. Current situation
Inconvenient due to
Desired
|
Great thank you |
Hey @droidmonkey, is there any news about that? At least there should be a comment about it at: https://keepassxc.org/docs/#faq-cloudsync Just to make it clear: cloud synchronisation currently only works flawlessly if only one device is writing and all others are reading only. Otherwise conflicts are very likely, especially with deferred sync tools like Syncthing. |
No there hasn't been any effort put forth on this one. Personally, I use cloud sync all the time and write to my database on mobile device and laptop, never had a conflict yet. This doesn't appear to be a common problem for our user base, this is the only discussion about sync conflicts we ever had. |
Can't agree with that - whenever I try (every few months in last few years) to switch back from Bitwarden (because of no auto-type function there) I ALWAYS get conflicts in matter of max few days, where most of the time it happens much quicker. |
You might be confusing the request to have a direct cloud sync solution with this request for conflict resolution. Also the original keepass does not have this conflict resolution either so it's not like we are alone here. |
bad synchronization support is the main issue in KeepassXC. The normal Keepass doesn't have this issue, because it can sync in both directions. And it doesn't require to reenter the password again and again, when both databases have the same password. Keepass for Android also can sync in in both directions, but it needs to be online, and this is sometimes not the case. Currently, you must be careful if you want to change the database on different devices and there is no connection to the cloud in the meantime. In fact, it only works if you make sure that changes to the database end up in the cloud immediately. As soon as you change the database on any device that is not online, there are often problems. And it's when you're on the road and you change the database on a mobile device and the changes don't immediately end up in the cloud that the problems start. Therefore, one solution would be to use a master database that is not changed directly, but with which device-specific databases are synchronized. For me would be OK, if this is not done in one step, but in 2 steps:
But then at least it should be recognized that both databases have the same password, so you must enter it only once: in the database you are working with. |
I've had this issue intermittently for the last couple of years using Syncthing. This thread has been useful for some workarounds e.g. making sure at least one device is always on and running with Syncthing to avoid deferred sync, and confirms my suspicions about what was causing it. The ability to merge databases automatically would be a handy feature for me, given it seems like the heavy lifting has already been done by the Merge database feature. However if it's not a common issue, it could be resolved by mentioning it in the docs when choosing a sync provider. https://keepassxc.org/docs/#faq-cloudsync Really nice piece of software that keeps getting better. Thanks for all the effort 🙂 |
I'll just chime in with my experience. I used to use Dropbox for syncing, but switched to syncthing when Dropbox enforced their nr. of devices on Linux. My workflow is probably what triggers this; I have:
... which all share that one syncthing volume where my Since I don't like waiting too much, I usually suspend/hibernate the desktop and laptops when I'm done using them. This is probably what triggers the merge problem. My hunch: Is it possible that KeepassXC saves an update to disk when it comes out of suspend mode (because time has passed), before syncthing had a chance of syncing? |
Make sure your syncthing is actually syncing your database when it is changed. Are you using always save after every change? |
I do |
I can share my settings, if you wish |
Most likely syncthing daemon not actually syncing in a timely manner. We don't hold a lock on files, as soon as it is written we release the file. |
I suddenly had a hunch and tested it. I realized the sync-issue started manifesting itself after I configured KeepassXC Secret Service Integration. The options are rather limited, here are my settings: [FdoSecrets]
Enabled=true
NoConfirmDeleteItem=false
ShowNotification=false I think one of the programs using the Secret Service (probably Evolution) is updating a secret right after coming back from hibernation, which is then saved in KeepassXC, before syncthing had a change of syncing the remote changes back. Not sure who to "blame" here... On a tangential note, I don't really like this Secret Service thing too much, since it was a serious PITA to kill the default in Gnome and have KeepassXC reliably fulfil that role... |
Ok, neither of those problems are our fault. |
Just another attempt from my side to make this issue and possible solutions more obvious. Issue:
Workarounds:
Some suggestions for development (collected from the discussions above):
I think it's not necessary to implement all of them. Maybe just the simplest ones would be enough to overcome the usability drawbacks of finding the conflict databases, merging them one by one and entering the same password again and again. Please let me know if you have more suggestions and I'll add them. Alternatively, the OP could also add such a list to the description if he wants to. |
IMHO the simplest thing that can be implemented to overcome the usability problem are these 2 small features:
These features can be implemented independently, and they bring usability value independently as well. |
Good ideas! |
@erikvanoosten I would say that it is also important to automatically (this is important since most of the time people won't even realize there is a conflict) start the merge process whenever keepassxc sees that a new conflicting file has been created, potentially with a message:
By default we could automatically search for conflict files using the syntax used by famous cloud providers, and provide to the user a function to add a regex to find conflicting files (I guess we can search for files in the current directory only, it is certainly quicker and safer). This regex could certainly be saved in the database, just see the below security concern in that case. In term of security implication, I can only imagine one scenario (really special I guess) where storing the regex in the database could be a problem:
then A could learn the database P by adding the regex Of course, this attack is quite unlikely to happen in a real life since B has no reasons to use the same password for both databases and put them in the same folder… (with a regular cloud provider both files would have been shared to B which is already an issue). But anyway this "attack" can be mitigated by asking for a confirmation if the database uses a custom regex, while printing a warning if a database is created with a name containing the word |
I agree with these solutions. They solve most. For me the last step would be to automate the merge and record the paths of the databases to auto-merge. That would allow me to open my local copy, and merge with paths in the FS when opening/saving the database, if those files are available. |
Long time user of KeePassXC here. Love it, thank you! ❤️ What i am missing in merging kdbx files is the option to not import deleted entrys again. Maybe show new entrys with older modification or creation date and ask which ones to import? |
It shouldn't. When you delete an entry, a record of that deletion is stored in the database file (the UUID of the entry). This is used to "re-delete" the entry if it is ever seen again on a merge. This is actually the root cause of #6477 |
I tested again and turns out that my original kdbx file does not have a recycle bin, as the new ones have. I created a new database and merged with my original one and now it behaves like you say. So thanks! Does the merge functionality rely on the recycle bin folder? It does feel a little odd that all my internet password history is in the recycle bin forever now. But i can live with that probably or delete them for good, as long as i dont have conflicting database files lying around. |
Recycle Bin doesn't mean the entry was deleted, it was just moved to that group. The deleted UUID only gets written when it is actually deleted. When you empty your recycle bin this will occur. |
I'm not sure I completely understand the problem with sync of multiple databases. Say I have two devices: A and B. On each device, I have it's own .kdbx file. I do sync only in one direction, and then merge that with the "origin". For example:
Am I doing something wrong? (apart from the fact that it does have a manual step to merge things, which I don't really much mind, at least at this point) |
@serpro69 that is certainly a way to do it that would avoid A and B conflicting with each other on writes (ie, they both make a change at nearly the same time before a sync can occur). However, if that is not possible because you are the only one making changes, then you are actually wasting your time. Just use one database and sync (send the file) between A and B. |
Thanks for the reply @droidmonkey ! |
You could setup a raspberry pi as a third party. Syncthing should create a conflict file, it does keep a version history anyway. You can always test with a dummy database. |
I use Syncthing to sync my database with the all devices I use. Unfortunately, I often run into the issue of getting conflicting databases. I think this is solely due to the nature of Syncthing since it's not centralized and can get messy.
I'm requesting the existing merging feature in KeePassXC be expanded to open multiple conflicting databases at once, merge them, and then automatically delete them afterwards. This would make maintenance easier for me. I don't know if this is a common issue for most other users though.
EDIT: I just had an idea. How about allowing an option to open the regular database as well as all the conflicting databases from the unlocked screen? That would save a step.
The text was updated successfully, but these errors were encountered: