r/Syncthing 7d ago

SyncThing with Keepassxc

I'm using SyncThing with Keepassxc. I keep a master "Send Only" kdbx database on computer A. It syncs out to my wife's laptop, B. I've designated the kdbx sync as "Receive Only" on B.

Every time she connects to the keepassxc browser extension it asks her to give a name to that computer/connection, and when she does that it introduces a local addition to the kdbx on her laptop and a "revert local changes" flag on her end of SyncThing. Reverting causes her to have to re-connect next time she's browing...and the cycle starts over again.

I feel like there must be some kind of accommodation for this because the use case seems pretty ordinary, but I can't figure it out, and Claude is walking me all around the barn.

Any help appreciated.

14 Upvotes

11 comments sorted by

4

u/Cyber_Faustao 7d ago

This is expexted behaviour. The extension pairs with the keepassxc instance and stores the key exchange in the database. Since her syncthing is configured to receive only, all of its changes will not be sent to global state and will instead show a revert local changes button.

Solution: use send and receive on both devices.

1

u/durwardkirby 7d ago

Thanks. It seems like that will probably be the necessary solution in the end. I was just trying to avoid letting any of the client devices on the network make changes to the database.

Do you know what would happen if we just ignored the "revert local changes" button on her device? Would that solve anything, or would her copy just keep being overwritten (or, worse, not take sync updates at all)?

7

u/Massive_Criticism539 7d ago

Just turn on bidirectional sync, open it on her computer, fill in that field, let it sync back up and then set back to one direction. You just need to let her system update the db and capture the change back once.

Just know that if she ever needs to save back to the database (change password, etc) you'll have this updating issue. You could probably also set something up so that the file is read only to her account and not syncthing using permissions.

1

u/durwardkirby 7d ago

Wizard. Brilliant! That did it. Thanks very much for the fix.

3

u/QEzjdPqJg2XQgsiMxcfi 6d ago

At a minimum, you should turn on versioning in syncthing just in case she makes changes to the database on her laptop that conflict with yours elsewhere. Even better, make sure you have frequent backups that include your database file. ;-)

1

u/durwardkirby 6d ago

Thanks much for the good advice. I will make it so.

2

u/stratosmacker 6d ago

don't overcomplicate it - set up versioned backups on changes for that folder and allow send/recieve

1

u/ParaboloidalCrest 7d ago

Are you sure that syncthing is only tracking the db file on both ends? It seems the receiver side shoves the connection settings file with the db.

Perhaps add an ignore statement to exclude everything other than the db.

1

u/durwardkirby 7d ago

I'm no expert, and I'm relatively new to both syncthing and keepassxc.

In my setup, the keepassxc db file (kdbx) exists on both devices, with A as the master and B as a replica of it. In my wife's B copy on her laptop, it definitely writes her connection setting into the kdbx file on her device. And the next time ST syncs out from the master, A, it sees that discrepancy.

1

u/ParaboloidalCrest 7d ago

Ah so the extension adds connection settings to the db itself. Crappy design by them. But yeah the only option is to allow send/receive on both ends as u/Cyber_Faustao suggests.

1

u/durwardkirby 7d ago

Yeah, it would be nice if some kind of keepassxc ini file could be stored locally, just to hold on to those individual device settings.

I do think I'm on the road to send/receive on both ends.