
Strumento di backup automatizzato del vault Bitwarden con crittografia AES-256, derivazione della chiave Argon2, supporto per il caricamento multi-cloud e notifiche in tempo reale tramite Discord, Telegram e Slack.
Lazywarden è uno strumento di automazione Python progettato per eseguire il backup e il ripristino dei dati dal tuo vault, inclusi gli allegati di Bitwarden. Ti consente di caricare i backup su più servizi di archiviazione cloud e di ricevere notifiche su diverse piattaforme. Offre anche backup crittografati con AES e utilizza la derivazione delle chiavi con Argon2, garantendo la massima sicurezza per i tuoi dati.
Caratteristiche
Compatibilità delle Piattaforme

Requisiti di Sistema Sistema Operativo: Compatibile con le principali distribuzioni Linux
Installazione git clone https://github.com/querylab/lazywarden.git
cd lazywarden
.env basato sull'esempio .env.sample e inserisci le variabili necessarie.#---------------------------------------------------------------------------------------
# These are the 6 variables that are mandatory requirements for Bitwarden Secret Manager
BW_URL=f22bba66-e55d-1111-9a93-abf0dfad069e
BW_USERNAME=5eb0f2bb-1111-4e42-94f8-9333fda803cf
BW_PASSWORD=ba4dc990-1111-4d18-ae6b-0b899d513759
ENCRYPTION_PASSWORD=103c803c-1111-40d4-8578-8b3134c6e93e
ZIP_PASSWORD=2f9fb3a2-96a3-1111-990d-5d6399153e11
ZIP_ATTACHMENT_PASSWORD=b2abc553-1111-4b49-9172-1a94f9072715
#---------------------------------------------------------------------------------------
# TOTP Seed for Aegis,Authy,Ente,GoogleAuth (Optional)
BW_TOTP_SECRET=
# pCloud Credentials (Optional)
PCLOUD_USERNAME=
PCLOUD_PASSWORD=
# Mega Credentials (Optional)
MEGA_EMAIL=
MEGA_PASSWORD=
# Dropbox Credentials (Optional)
DROPBOX_ACCESS_TOKEN=
DROPBOX_REFRESH_TOKEN=
DROPBOX_APP_KEY=
DROPBOX_APP_SECRET=
# Todoist Credentials (Optional)
TODOIST_TOKEN=
# CalDAV Credentials (Optional)
CALDAV_URL=
CALDAV_USERNAME=
CALDAV_PASSWORD=
# Nextcloud Credentials (Optional)
NEXTCLOUD_URL=
NEXTCLOUD_USERNAME=
NEXTCLOUD_PASSWORD=
# Seafile Credentials (Optional)
SEAFILE_SERVER_URL=
SEAFILE_USERNAME=
SEAFILE_PASSWORD=
# Filebase Credentials (Optional)
FILEBASE_ACCESS_KEY=
FILEBASE_SECRET_KEY=
# KeePass Password (Optional)
KEEPASS_PASSWORD=
# Storj Credentials (Optional)
STORJ_ACCESS_KEY=
STORJ_SECRET_KEY=
STORJ_ENDPOINT=
# R2 Credentials (Optional)
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
R2_ENDPOINT_URL=
# Vikunja Credentials (Optional)
VIKUNJA_API_TOKEN=
VIKUNJA_URL=
# Backblaze B2 Credentials (Optional)
B2_APP_KEY_ID=
B2_APP_KEY=
# Google Drive Settings
GOOGLE_SERVICE_ACCOUNT_FILE=/root/lazywarden/config/bitwarden-drive-backup-google.json
GOOGLE_FOLDER_ID=
# Backup Settings
BACKUP_DIR=/root/lazywarden/backup-drive/
CRON_SCHEDULE="0 0 23 * *"
TIMEZONE=America/New_York
TIMESTAMP=2024_10_31_13_03_29
# API URLs for Bitwarden
API_URL=https://vault.bitwarden.com/api
IDENTITY_URL=https://vault.bitwarden.com/identity
# Organization ID
ORGANIZATION_ID=
# Access Token for Bitwarden Authentication
ACCESS_TOKEN=
# Notifications and Alerts (Optional)
TELEGRAM_TOKEN=
TELEGRAM_CHAT_ID=
DISCORD_WEBHOOK_URL=
SLACK_WEBHOOK_URL=
NTFY_URL=
# SMTP Configuration for Email Notifications (Optional)
SMTP_SERVER=mail.smtp2go.com
SMTP_PORT=8025
SMTP_USERNAME=
SMTP_PASSWORD=
EMAIL_RECIPIENT=
SENDER_EMAIL=
cd lazywarden/scripts
chmod +x setup-ubuntu-env.sh
./setup-ubuntu-env.sh
chmod +x docker-ubuntu.sh
./docker-ubuntu.sh
lazywarden/:cd ..
source venv/bin/activate
bitwarden-cli-install.py, che installerà tutte le dipendenze CLI:python3 scripts/bitwarden-cli-install.py
Region/City con il fuso orario desiderato (ad es., America/New_York):timedatectl set-timezone Region/City
America/New_York, esegui:timedatectl set-timezone America/New_York
app/ ed esegui main.py:cd app
python3 main.py
main.py, potrebbe essere dovuto a librerie mancanti o obsolete. Per risolvere, ti consiglio di eseguire il seguente comando per installare tutte le dipendenze necessarie: pip install -r requirements.txt
cd lazywarden/scripts
chmod +x setup-debian-env.sh
./setup-debian-env.sh
chmod +x docker-debian.sh
./docker-debian.sh
lazywarden/:cd ..
source venv/bin/activate
bitwarden-cli-install.py, che installerà tutte le dipendenze CLI:python3 scripts/bitwarden-cli-install.py
Region/City con il fuso orario desiderato (ad es., America/New_York):timedatectl set-timezone Region/City
America/New_York, esegui:timedatectl set-timezone America/New_York
app/ ed esegui main.py:cd app
python3 main.py
main.py, potrebbe essere dovuto a librerie mancanti o obsolete. Per risolvere, ti consiglio di eseguire il seguente comando per installare tutte le dipendenze necessarie: pip install -r requirements.txt
lazywarden/
├── app/ # This directory to contain the main application code
│ ├── backup.py # Backup functions
│ ├── bitwarden_client.py # Client to interact with Bitwarden
│ ├── config.py # General application configurations
│ ├── imports.py # Handles common imports
│ ├── main.py # Main entry point of the application
│ ├── notifications.py # Handles notifications
│ ├── secrets_manager.py # Manages secrets
│ ├── import_to_bitwarden.py # Import your bitwarden vault
│ ├── import_to_keepass.py # Create kdbx database
│ ├── schedule_backup.py # For create Schedule Backup
├── config/ # Directory for configuration files
│ ├── bitwarden-drive-backup-google.json # Configuration for Google Drive
├── scripts/ # Directory for installation and setup scripts
│ ├── bitwarden-cli-install.py # Script to install the Bitwarden CLI
│ ├── docker-debian.sh # Setup script for Debian with Docker
│ ├── docker-ubuntu.sh # Setup script for Ubuntu with Docker
│ ├── setup-debian-env.sh # Environment setup for Debian
│ ├── setup-ubuntu-env.sh # Environment setup for Ubuntu
│ ├── alldecrypt-zip.py # Decrypt all zip files
│ ├── json-only-decrypt.py # Decrypt only json files (optional)
├── backup-drive/
│ ├── (This is where the generated backups will be stored local)
├── .env # File for environment variables
├── Dockerfile # Docker configuration file to create an application image
├── docker-compose.yml # Docker Compose Configuration
├── entrypoint.sh # Entrypoint script for Docker
└── requirements.txt # File that lists the project Python dependencies
Il container Docker eseguirà lo script main.py ogni 24 ore per eseguire il backup di Bitwarden e caricarlo sui servizi cloud configurati. Le notifiche verranno inviate ai servizi specificati in caso di successo o fallimento. Puoi modificare la frequenza del backup secondo le tue esigenze, ad esempio mensile, giornaliero o orario.
services:
lazywarden:
container_name: lazywarden
hostname: lazywarden
image: querylab/lazywarden:latest
env_file:
- .env
environment:
UNLOCK_VAULT: "true"
volumes:
- /root/lazywarden/config:/root/lazywarden/config
- /root/lazywarden/backup-drive:/root/lazywarden/backup-drive/
- /root/lazywarden/.env:/app/.env
restart: unless-stopped
docker compose up -d
Dockerfile configura l'ambiente, installa le dipendenze e copia i file necessari nel container.docker-compose.yml definisce il servizio lazywarden e imposta le variabili d'ambiente e i volumi per l'archiviazione persistente.bw logout prima di accedere a un nuovo account.Ho creato Lazywarden per automatizzare i backup di Bitwarden senza sforzo manuale o esposizione di dati sensibili. Dopo aver lottato con strumenti complessi, ho sfruttato Bitwarden Secret Manager per gestire in modo sicuro i segreti. Lazywarden automatizza i backup e li carica su più servizi cloud (Google Drive, Dropbox, pCloud, MEGA, Seafile, Nextcloud, Filebase, Storj, Cloudflare R2, Backblaze B2) e si integra con Telegram, Discord, Ntfy, Slack, Todoist, Vikunja e CalDAV per notifiche e tracciamento. La sua caratteristica distintiva è la capacità di ripristinare i backup crittografati in Bitwarden, rendendo la gestione dei backup semplice, sicura ed efficiente.
Se ti piace questo progetto, considera di lasciare una ⭐