Skip to content

feat: add b2 bucket naming configuration #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ VIKUNJA_URL=
# Backblaze B2 Credentials (Optional)
B2_APP_KEY_ID=
B2_APP_KEY=
B2_BUCKET_NAME=

# Google Drive Settings
GOOGLE_SERVICE_ACCOUNT_FILE=/root/lazywarden/config/bitwarden-drive-backup-google.json
Expand Down
4 changes: 2 additions & 2 deletions app/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def upload_file_to_storj(file_path, access_key, secret_key, storj_endpoint):
# -----------------------------------------------------------------------------------------------

#--------------------------------New Backblaze B2 ------------------------------------------
def upload_file_to_backblaze(file_path, app_key_id, app_key, bucket_name="Bitwarden-Drive-Backup"):
def upload_file_to_backblaze(file_path, app_key_id, app_key, bucket_name):

try:
# Initialize Backblaze B2 API
Expand Down Expand Up @@ -1359,7 +1359,7 @@ def backup_bitwarden(env_vars, secrets, drive_service):
zip_filepath,
app_key_id=secrets["B2_APP_KEY_ID"],
app_key=secrets["B2_APP_KEY"],
bucket_name="Bitwarden-Drive-Backup"
bucket_name=secrets["B2_BUCKET_NAME"]
)
pbar.update(progress_stages[10]["update"]) # Actualiza la barra de progreso si usas tqdm
except Exception as e:
Expand Down
3 changes: 2 additions & 1 deletion app/secrets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def retrieve_secrets(bw_client):
"SEAFILE_USERNAME", "SEAFILE_PASSWORD", "FILEBASE_ACCESS_KEY", "FILEBASE_SECRET_KEY",
"KEEPASS_PASSWORD", "STORJ_ACCESS_KEY", "STORJ_SECRET_KEY", "STORJ_ENDPOINT",
"R2_ACCESS_KEY_ID", "R2_SECRET_ACCESS_KEY", "R2_ENDPOINT_URL",
"VIKUNJA_API_TOKEN", "VIKUNJA_URL", "B2_APP_KEY_ID", "B2_APP_KEY","BW_TOTP_SECRET"
"VIKUNJA_API_TOKEN", "VIKUNJA_URL", "B2_APP_KEY_ID", "B2_APP_KEY", "B2_BUCKET_NAME",
"BW_TOTP_SECRET"
]

secrets = {}
Expand Down