https://github.com/dangerdev004/bwbackup
Backup for Bitwarden
https://github.com/dangerdev004/bwbackup
Last synced: about 1 year ago
JSON representation
Backup for Bitwarden
- Host: GitHub
- URL: https://github.com/dangerdev004/bwbackup
- Owner: dangerdev004
- License: gpl-3.0
- Created: 2023-05-13T16:43:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T20:47:07.000Z (almost 2 years ago)
- Last Synced: 2025-02-05T23:26:08.599Z (over 1 year ago)
- Language: Shell
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://bitwarden.com/help/cli/)** & **[Direnv Installation Guide](https://github.com/direnv/direnv/blob/master/docs/installation.md)** 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](https://www.redhat.com/sysadmin/disk-encryption-luks)
**
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.
#
4. 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
5. Now create a .envrc file where you have stored the script
export DEVICEPASSWORD="Your encrypted drive password"
6. Enter the the command
direnv allow "The path of .envrc file"
7. 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](https://github.com/jstaf/onedriver)|[Rclone](https://rclone.org/)
**You are now all set with the prerequisites, make sure you are logged in your bitwarden vault through cli**
8. Download the script
9. Give permissions
sudo chmod +x ./bwbackup.sh
10. Run the script
./bwbackup.sh
11. Enter the sudo password
12. 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.