浏览代码

init: add warning to store both key and passphrase at safe place(s)

(cherry picked from commit 4b31ad123fddddd42d9ea411f59ed0d5b89479b2)
Thomas Waldmann 6 年之前
父节点
当前提交
d21da08f85
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/borg/archiver.py

+ 7 - 0
src/borg/archiver.py

@@ -286,6 +286,13 @@ class Archiver:
                 '\n'
                 'See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability '
                 'for details about the security implications.', shlex.quote(path))
+
+        if key.NAME != 'plaintext':
+            logger.warning(
+                '\n'
+                'IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!\n'
+                'Use "borg key export" to export the key, optionally in printable format.\n'
+                'Write down the passphrase. Store both at safe place(s).\n')
         return self.exit_code
 
     @with_repository(exclusive=True, manifest=False)