This is a script to remove duplicate entries and folders from a BitWarden vault. This script also prunes empty folders. No dependencies except the JSON standard library.
This is a fork of https://github.com/DustinWehr/minimal-bitwarden-dedup
I'd like to thank Dustin Wehr for his wonderful script.
Because you'll restart your computer at the end.
Don't save your unencrypted vault to persistent storage (HDD/SSD), as you'd need to securely erase it, which is not as easy as some might expect.
Makes a 10MB RAM disk.
$ sudo mkdir /mnt/ramdisk
$ sudo mount --types tmpfs --options rw,size=10M tmpfs /mnt/ramdisk
If you know an easy way (without external software?), please tell me, or better yet open a pull request with your tested instructions.
Check that I'm not stealing all your passwords.
Save it to your mounted RAM disk.
Google how to do this for your BitWarden client.
Replace the path values VAULT_WITH_DUPS_PATH
and VAULT_DEDUPED_OUTPUT_PATH
in bitwarden_dedup.py
with the appropriate ones for your RAM disk and exported vault, then do:
$ python3 bitwarden_dedup.py
Which writes to the file at VAULT_DEDUPED_OUTPUT_PATH
.
Google how to do this for your BitWarden client.
We could overwrite your secrets on the RAM disk, but I can't do anything foolproof in python about the temporary memory that the script uses, which also contained your unencrypted secrets, so turn off and then on your computer now to clear your RAM.