From b62dcc5b21896592887d9b3504bfecbc590af2ff Mon Sep 17 00:00:00 2001
From: hija <hilko.j@wwu.de>
Date: Fri, 4 Sep 2020 18:28:12 +0200
Subject: [PATCH 1/4] Assigning targetPath to a new var

---
 management/templates/system-backup.html | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html
index 297c21fe..94536e90 100644
--- a/management/templates/system-backup.html
+++ b/management/templates/system-backup.html
@@ -273,9 +273,10 @@ function show_custom_backup() {
           $("#backup-target-s3-path").val(hostpath.join('/'));
         } else if (r.target.substring(0, 5) == "b2://") {
           $("#backup-target-type").val("b2");
-          var b2_application_keyid = r.target.substring(5).split(':')[0];
-          var b2_applicationkey = r.target.substring(5).split(':')[1].split('@')[0];
-          var b2_bucket = r.target.substring(5).split('@')[1];
+          var targetPath = r.target.substring(5);
+          var b2_application_keyid = targetPath.split(':')[0];
+          var b2_applicationkey = targetPath.split(':')[1].split('@')[0];
+          var b2_bucket = targetPath.split('@')[1];
           $("#backup-target-b2-user").val(b2_application_keyid);
           $("#backup-target-b2-pass").val(b2_applicationkey);
           $("#backup-target-b2-bucket").val(b2_bucket);

From eecf32890e4b3d954095114e2c0d679e5ef98000 Mon Sep 17 00:00:00 2001
From: hija <hilko.j@wwu.de>
Date: Fri, 4 Sep 2020 18:29:03 +0200
Subject: [PATCH 2/4] Added link to backblaze

---
 management/templates/system-backup.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html
index 94536e90..f89242cf 100644
--- a/management/templates/system-backup.html
+++ b/management/templates/system-backup.html
@@ -115,7 +115,7 @@
   <!-- Backblaze -->
   <div class="form-group backup-target-b2">
       <div class="col-sm-10 col-sm-offset-2">
-      <p>Backups are stored in a Backblaze B2 bucket. You must have a Backblaze account already.</p>
+      <p>Backups are stored in a <a href="https://www.backblaze.com/" target="_blank" rel="noreferrer">Backblaze</a> B2 bucket. You must have a Backblaze account already.</p>
       <p>You MUST manually copy the encryption password from <tt class="backup-encpassword-file"></tt> to a safe and secure location. You will need this file to decrypt backup files. It is NOT stored in your Backblaze B2 bucket.</p>
       </div>
   </div>

From 14bbaafe0b0dd8a5bd591a3a61cb0f07359b4ed7 Mon Sep 17 00:00:00 2001
From: hija <hilko.j@wwu.de>
Date: Fri, 4 Sep 2020 18:29:53 +0200
Subject: [PATCH 3/4] Fixed indentation

---
 management/templates/system-backup.html | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html
index f89242cf..e8dc4cbf 100644
--- a/management/templates/system-backup.html
+++ b/management/templates/system-backup.html
@@ -115,26 +115,26 @@
   <!-- Backblaze -->
   <div class="form-group backup-target-b2">
       <div class="col-sm-10 col-sm-offset-2">
-      <p>Backups are stored in a <a href="https://www.backblaze.com/" target="_blank" rel="noreferrer">Backblaze</a> B2 bucket. You must have a Backblaze account already.</p>
-      <p>You MUST manually copy the encryption password from <tt class="backup-encpassword-file"></tt> to a safe and secure location. You will need this file to decrypt backup files. It is NOT stored in your Backblaze B2 bucket.</p>
+        <p>Backups are stored in a <a href="https://www.backblaze.com/" target="_blank" rel="noreferrer">Backblaze</a> B2 bucket. You must have a Backblaze account already.</p>
+        <p>You MUST manually copy the encryption password from <tt class="backup-encpassword-file"></tt> to a safe and secure location. You will need this file to decrypt backup files. It is NOT stored in your Backblaze B2 bucket.</p>
       </div>
   </div>
   <div class="form-group backup-target-b2">
       <label for="backup-target-b2-user" class="col-sm-2 control-label">B2 Application KeyID</label>
       <div class="col-sm-8">
-      <input type="text" class="form-control" rows="1" id="backup-target-b2-user">
+        <input type="text" class="form-control" rows="1" id="backup-target-b2-user">
       </div>
   </div>
   <div class="form-group backup-target-b2">
       <label for="backup-target-b2-pass" class="col-sm-2 control-label">B2 Application Key</label>
       <div class="col-sm-8">
-      <input type="text" class="form-control" rows="1" id="backup-target-b2-pass">
+        <input type="text" class="form-control" rows="1" id="backup-target-b2-pass">
       </div>
   </div>
   <div class="form-group backup-target-b2">
       <label for="backup-target-b2-bucket" class="col-sm-2 control-label">B2 Bucket</label>
       <div class="col-sm-8">
-      <input type="text" class="form-control" rows="1" id="backup-target-b2-bucket">
+        <input type="text" class="form-control" rows="1" id="backup-target-b2-bucket">
       </div>
   </div>
   <!-- Common -->

From 8185b76f07df0e3f0d7632137558b7e5ad82f36f Mon Sep 17 00:00:00 2001
From: hija <hilko.j@wwu.de>
Date: Fri, 4 Sep 2020 18:34:44 +0200
Subject: [PATCH 4/4] removed python2 boto package

---
 setup/management.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/setup/management.sh b/setup/management.sh
index aac7c126..c83ced1d 100755
--- a/setup/management.sh
+++ b/setup/management.sh
@@ -18,11 +18,7 @@ while [ -d /usr/local/lib/python3.4/dist-packages/acme ]; do
 	pip3 uninstall -y acme;
 done
 
-# duplicity is used to make backups of user data. It uses boto
-# (via Python 2) to do backups to AWS S3. boto from the Ubuntu
-# package manager is too out-of-date -- it doesn't support the newer
-# S3 api used in some regions, which breaks backups to those regions.
-# See #627, #653.
+# duplicity is used to make backups of user data.
 #
 # virtualenv is used to isolate the Python 3 packages we
 # install via pip from the system-installed packages.
@@ -30,10 +26,11 @@ done
 # certbot installs EFF's certbot which we use to
 # provision free TLS certificates.
 apt_install duplicity python-pip virtualenv certbot
-hide_output pip2 install --upgrade boto
 
-# b2sdk is installed outside the pipenv, so it can be used by duplicity
-hide_output pip3 install b2sdk
+# b2sdk is used for backblaze backups.
+# boto is used for amazon aws backups.
+# Both are installed outside the pipenv, so they can be used by duplicity
+hide_output pip3 install --upgrade b2sdk boto
 
 # Create a virtualenv for the installation of Python 3 packages
 # used by the management daemon.