Skip to content

dangerdev004/bwbackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

bwbackup (BitWarden Backup)

This is a shell script to backup your bitwarden vault onto a cloud server & a local encrypted storage with encryption.

This script also creates different versions everytime and keeps the old one as well and it will shred the .csv file and the container at the end as well.

You will need some additional setup to do this securely.

Setting up Dependencies

This script requires bitwarden-cli & direnv installed on your system. To install bitwarden-cli & direnv refer to Bitwarden CLI Installation Guide & Direnv Installation Guide respectively

  1. We will create a separate partition which will be password protected. We will use LUKS to achieve this. This guide will help you in doing so

    LUKS Encryption Guide

  2. Once created create a .txt file inside this encrypted partition and keep it hidden by putting a .(dot) before the filename.
  3. You will need to type the following inside it:

    export BITPASS="Your bitwarden vault password"

    export ZIPASS="The password of the file you want to keep"

Explaination for prior steps

These are environment variables that are needed to be set prior to the running of the script. We are using a zip file encryption to encrypt the .csv file which will be exported at the time of creating backup.

  1. There is one final setup that is setting up direnv

    eval "$(direnv hook zsh)"

    This will enable direnv to read environment variables from the files you want it to. Direnv is kind of like setting a local environment variable that only works in a certain folder
  2. Now create a .envrc file where you have stored the script

    export DEVICEPASSWORD="Your encrypted drive password"

  3. Enter the the command

    direnv allow "The path of .envrc file"

  4. You will need a cloud storage mounted on your system. I use onedriver for this purpose but you can use anything else if you want. You can use Rclone if you want to use Google Drive

    Onedriver|Rclone

You are now all set with the prerequisites, make sure you are logged in your bitwarden vault through cli

  1. Download the script
  2. Give permissions

    sudo chmod +x ./bwbackup.sh

  3. Run the script

    ./bwbackup.sh

  4. Enter the sudo password
  5. The backup will be created

Disclaimer

Read the GPL 3.0 License

This is a personal project please be patient if any issue arises.

Note: There my be some security risks while using this script please be cautious.

About

Backup for Bitwarden

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages