summaryrefslogtreecommitdiffhomepage
path: root/keysafe.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-14 14:02:29 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-14 14:28:56 -0400
commit0a3eb9be07a7514f5544384bc914f22ea88c24a8 (patch)
tree3e9ef44c3d61d4ed451d04b8a1d3e8f9de0dcf7a /keysafe.hs
parent8d1185c3884f8125cedf9c4c8060cb5d360e9ef4 (diff)
downloadkeysafe-0a3eb9be07a7514f5544384bc914f22ea88c24a8.tar.gz
Warn when uploads fail and are put in the upload queue.
Diffstat (limited to 'keysafe.hs')
-rw-r--r--keysafe.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/keysafe.hs b/keysafe.hs
index e2b112c..33ea1a2 100644
--- a/keysafe.hs
+++ b/keysafe.hs
@@ -94,7 +94,7 @@ backup cmdline storagelocations ui tunables secretkeysource secretkey = do
kek <- promptkek name
let sis = shareIdents tunables name secretkeysource
let cost = getCreationCost kek <> getCreationCost sis
- r <- withProgressIncremental ui "Encrypting and storing data"
+ (r, queued) <- withProgressIncremental ui "Encrypting and storing data"
(encryptdesc cost cores) $ \addpercent -> do
let esk = encrypt tunables kek secretkey
shares <- genShares esk tunables
@@ -103,7 +103,9 @@ backup cmdline storagelocations ui tunables secretkeysource secretkey = do
let step = 50 `div` sum (map S.size shares)
storeShares storagelocations sis shares (addpercent step)
case r of
- StoreSuccess -> showInfo ui "Success" "Your secret key was successfully encrypted and backed up."
+ StoreSuccess
+ | queued -> showInfo ui "Backup queued" "Some data was not sucessfully uploaded to servers, and has been queued for later upload. Run keysafe --uploadqueued at a later point to finish the backup."
+ | otherwise -> showInfo ui "Backup success" "Your secret key was successfully encrypted and backed up."
StoreFailure s -> showError ui ("There was a problem storing your encrypted secret key: " ++ s)
StoreAlreadyExists -> do
showError ui $ unlines