From 0d45ddaaf2f36ad21c3b1f60fa7801e988f332f4 Mon Sep 17 00:00:00 2001 From: Carson Page Date: Tue, 17 Oct 2017 06:58:05 -0500 Subject: [PATCH] Added B2 to Backup, renamed B2Blaze to B2 Storage --- management/backup.py | 10 +++++++++- management/templates/system-backup.html | 8 ++++---- setup/system.sh | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/management/backup.py b/management/backup.py index 4e2f146a..7f78395d 100755 --- a/management/backup.py +++ b/management/backup.py @@ -473,10 +473,18 @@ def list_target_files(config): raise ValueError(e.reason) return [(key.name[len(path):], key.size) for key in bucket.list(prefix=path)] - + elif target.scheme == "b2": else: raise ValueError(config["target"]) +def b2_perform_authentication(acc_id, app_key): + # Perform Authentication with B2 Storage. Returns a tuple + # containing the auth token and the API endpoint to use. + from urllib.request import Request, urlopen + import base64 + import json + + req = Request() def backup_set_custom(env, target, target_user, target_pass, min_age): config = get_backup_config(env, for_save=True) diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html index 0db9a694..0e6d9a15 100644 --- a/management/templates/system-backup.html +++ b/management/templates/system-backup.html @@ -18,7 +18,7 @@ - + @@ -105,11 +105,11 @@ - +
-

Backups are stored in an B2Blaze bucket. You must have an B2Blaze account already.

-

You MUST manually copy the encryption password from to a safe and secure location. You will need this file to decrypt backup files. It is NOT stored in your B2Blaze bucket.

+

Backups are stored in an B2 Storage bucket. You must have an B2 Storage account already.

+

You MUST manually copy the encryption password from to a safe and secure location. You will need this file to decrypt backup files. It is NOT stored in your B2 Storage bucket.

diff --git a/setup/system.sh b/setup/system.sh index 85df1aa4..479b47b6 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -132,7 +132,7 @@ hide_output apt-get update # ### Add duplicity PPA # We would use the package in the system repository, but the version in the system repo -# does not support some backends like B2Blaze. This adds the stable PPA that should be +# does not support some backends like B2 Storage. This adds the stable PPA that should be # reasonably reliable. This also enables the ability for duplicity to be upgraded to the # latest version. Since the relibility of this package affects the stabillity of system # backups, unintended upgrades are not enabled.