Added entry exclusion functionality to KeePass synchronization script

This commit is contained in:
floriano committed 2026-09-09 20:52:47 +02:00
1 parent dffb61eeff
commit c03b482781
4 files changed
+23 -3

No files matched your search

+13
View File
@@ -92,6 +92,19 @@ python sync.py C:\your\database.kdbx
<b>Remember that your user should have the serial port privileges (like belonging to the `dialout` group on Linux)!</b> <b>Remember that your user should have the serial port privileges (like belonging to the `dialout` group on Linux)!</b>
## Excluding entries
Of course, not every password needs portability. The less passwords you carry with yourself, the better. Now deciding which passwords should PWDer include is easier, as there is no need to create a second database with only the required passwords.
In order to prevent your KeePass password from appearing in PWDer's vault, you should add a `!pwexclude` line in the notes of the entry.
<img src="./assets/photos/exclusion.png" alt="Entry excluded" width="480px">
During synchronization, the script will detect and ignore entry that has been marked as excluded.
<img src="./assets/photos/exclusion2.png" alt="Entry ignored" width="480px">
Then, it simply won't be sent to PWDer and won't appear there.
# Usage # Usage
## Main screen ## Main screen
This is where you can select a password to enter. The top bar represents the vault usage in %, and the bottom one is a scrollbar. This is where you can select a password to enter. The top bar represents the vault usage in %, and the bottom one is a scrollbar.
Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

+10 -3
View File
@@ -235,11 +235,18 @@ print(bcolors.OKGREEN + "OK" + bcolors.ENDC)
print() print()
### Fill vault with data ### Fill vault with data
print(bcolors.HEADER + "Reading KDBX data... " + bcolors.ENDC, end='') print(bcolors.HEADER + "Reading KDBX data... " + bcolors.ENDC)
i = 0 i = 0
ignored = 0
for entry in db.entries: for entry in db.entries:
if i < 100: if i < 100 + ignored:
if entry.notes:
if '!pwexclude' in entry.notes:
ignored += 1
print("Ignoring entry " + entry.title)
continue
vault.credential_count += 1 vault.credential_count += 1
if not entry.title: if not entry.title:
@@ -267,7 +274,7 @@ for entry in db.entries:
break break
i += 1 i += 1
print(bcolors.OKGREEN + "OK" + bcolors.ENDC) print(bcolors.OKGREEN + f'OK. Total entry count: {vault.credential_count}.' + bcolors.ENDC)
print() print()
### Encrypt vault data ### Encrypt vault data