Narigo / keepass-diff

A CLI-tool to diff Keepass (.kdbx) files. Useful, if syncing with Dropbox or NextCloud and getting multiple files due to conflicts.
https://keepass-diff.narigo.dev/
MIT License
297 stars 27 forks source link

Allow diffing files with attachments and history entries #36

Open Narigo opened 2 years ago

Narigo commented 2 years ago

Thanks to report #35 it looks like attachments are currently not handled at all. If an entry diffs because of attached files, keepass-diff will currently say that there is no difference at all. This should not be the case.

Same for history entries.

Tasks

Use reproducer files from #35 for checking the attachments vs no attachments and create an additional one for changing the current attachment with something else.

PaBox commented 2 years ago

Is this still gonna be fixed? Because diffing without diffing EVERYTHING is essentially quite useless. It would be nice to see this feature in the near future, though I saw that you created an issue on keepass-rs after having problems with the attachments in keepass-rs and it still hasnt been answered. For now it would be nice to at least compare the name and filesize, while it is not a perfect workaround, you could still list all the files with another flag added to the command.

Apart from this problem, this is a great tool and I really hope you keep the work up :)

Narigo commented 2 years ago

Hi @PaBox and thank you for your message!

This tool doesn't really do too much though, it only checks which entries differ from each other. The entries come from the underlying dependency keepass-rs. As long as it doesn't allow opening and checking any information of an attachment, I can't really do anything in this regard.

Please try to reach out to @sseemayer and check whether he's able to contribute to keepass-rs still. He's been very kind and helpful to this project before as he has re-written most of the integration code when he did some breaking changes to his module. It looks like he wasn't very active lately - there are a couple of cool open PRs in keepass-rs by @DavidVentura last year regarding that weren't merged or commented on yet. Maybe he wants to hand over maintenance to someone else...?

sseemayer commented 2 years ago

thanks for the ping and the kind words.

You are right in that I have less spare time to spend on maintaining open source code than I had previously, so I would be happy to accept a co-maintainer on the project if that helps in moving progress along.

Narigo commented 2 years ago

@sseemayer thanks for the reply! I totally understand the time constraints. Maybe if you look into the pull requests at keepass-rs you can find someone who could help maintaining it? 🙂 It looks like there are people who contribute to it already - maybe someone wants to contribute even more?

sergiofagostinho commented 2 years ago

@Narigo For comparing files, I would suggest comparing the file name and the content's checksum, i.e. MD5.

DavidVentura commented 2 years ago

I can give this a shot in my keepass fork -- however I don't feel like my rust skills are good enough to be a maintainer

DavidVentura commented 2 years ago

I've looked at this - the biggest thing missing is that the Meta header is not currently stored in the original keepass-rs. When I was trying to implement write support on the DB I got this partially implemented (here), extending this is a fairly small amount of work, but now I remember that this branch had drifted "significantly" from the original

And here is a PR to add that basic parsing of binaries from DB/entry metadata -- the API is very clunky with a string ref to a hashmap in meta

Narigo commented 2 years ago

@sergiofagostinho yes, that would definitely be a good idea - the problem is that the keepass-rs is currently not supporting attachments at all and hence keepass-diff cannot access information about included files...

@DavidVentura about:

I don't feel like my rust skills are good enough to be a maintainer

I'd say that maintainers need motivation to learn new things and have time to spare. I'd see that as an opportunity to grow 😉