Browse Source

Merge pull request #2149 from borgbackup/release-1.0.10

Release 1.0.10
enkore 8 years ago
parent
commit
3a3dfcbef5
7 changed files with 82 additions and 28 deletions
  1. 6 3
      borg/paperkey.html
  2. 13 0
      borg/testsuite/archiver.py
  3. 22 20
      docs/api.rst
  4. 31 2
      docs/changes.rst
  5. 3 1
      docs/usage/key_export.rst.inc
  6. 3 1
      scripts/borg.exe.spec
  7. 4 1
      setup.py

+ 6 - 3
borg/paperkey.html

@@ -2171,8 +2171,11 @@ if (typeof define == 'function' && define.amd) define([], function() { return Sh
         }
     }
 
-
-
+    /* center the QR code on the page */
+    #qr {
+      width: 100%;
+      text-align: center;
+    }
 </style>
 </head>
 <body>
@@ -2217,7 +2220,7 @@ if (typeof define == 'function' && define.amd) define([], function() { return Sh
     <div id="printout">
         <div id="title" contenteditable>BorgBackup Printable Key Backup</div>
         <div contenteditable>To restore either scan the QR code below, decode it and import it using
-<pre>borg key-import /path/to/repo scannedfile</pre>
+<pre>borg key import /path/to/repo scannedfile</pre>
 
 Or run
 <pre>borg key import --paper /path/to/repo</pre> and type in the text below.<br><br></div>

+ 13 - 0
borg/testsuite/archiver.py

@@ -1318,6 +1318,19 @@ class ArchiverTestCase(ArchiverTestCaseBase):
 
         assert repo_key2.enc_key == repo_key2.enc_key
 
+    def test_key_export_qr(self):
+        export_file = self.output_path + '/exported.html'
+        self.cmd('init', self.repository_location, '--encryption', 'repokey')
+        repo_id = self._extract_repository_id(self.repository_path)
+        self.cmd('key', 'export', '--qr-html', self.repository_location, export_file)
+
+        with open(export_file, 'r', encoding='utf-8') as fd:
+            export_contents = fd.read()
+
+        assert bin_to_hex(repo_id) in export_contents
+        assert export_contents.startswith('<!doctype html>')
+        assert export_contents.endswith('</html>')
+
     def test_key_import_errors(self):
         export_file = self.output_path + '/exported'
         self.cmd('init', self.repository_location, '--encryption', 'keyfile')

+ 22 - 20
docs/api.rst

@@ -1,37 +1,39 @@
-.. highlight:: python
+
+.. IMPORTANT: this file is auto-generated by "setup.py build_api", do not edit!
+
 
 API Documentation
 =================
 
-.. automodule:: borg.archiver
+.. automodule:: borg.archive
     :members:
     :undoc-members:
 
-.. automodule:: borg.archive
+.. automodule:: borg.archiver
     :members:
     :undoc-members:
 
-.. automodule:: borg.repository
+.. automodule:: borg.cache
     :members:
     :undoc-members:
 
-.. automodule:: borg.remote
+.. automodule:: borg.chunker
     :members:
     :undoc-members:
 
-.. automodule:: borg.cache
-    :members:
+.. automodule:: borg.compress
+    :members: get_compressor, Compressor, CompressorBase
     :undoc-members:
 
-.. automodule:: borg.key
+.. automodule:: borg.crypto
     :members:
     :undoc-members:
 
-.. automodule:: borg.keymanager
+.. automodule:: borg.fuse
     :members:
     :undoc-members:
 
-.. automodule:: borg.logger
+.. automodule:: borg.hashindex
     :members:
     :undoc-members:
 
@@ -39,23 +41,23 @@ API Documentation
     :members:
     :undoc-members:
 
-.. automodule:: borg.locking
+.. automodule:: borg.key
     :members:
     :undoc-members:
 
-.. automodule:: borg.shellpattern
+.. automodule:: borg.keymanager
     :members:
     :undoc-members:
 
-.. automodule:: borg.lrucache
+.. automodule:: borg.locking
     :members:
     :undoc-members:
 
-.. automodule:: borg.fuse
+.. automodule:: borg.logger
     :members:
     :undoc-members:
 
-.. automodule:: borg.xattr
+.. automodule:: borg.lrucache
     :members:
     :undoc-members:
 
@@ -67,18 +69,18 @@ API Documentation
     :members:
     :undoc-members:
 
-.. automodule:: borg.hashindex
+.. automodule:: borg.remote
     :members:
     :undoc-members:
 
-.. automodule:: borg.compress
-    :members: get_compressor, Compressor, CompressorBase
+.. automodule:: borg.repository
+    :members:
     :undoc-members:
 
-.. automodule:: borg.chunker
+.. automodule:: borg.shellpattern
     :members:
     :undoc-members:
 
-.. automodule:: borg.crypto
+.. automodule:: borg.xattr
     :members:
     :undoc-members:

+ 31 - 2
docs/changes.rst

@@ -128,13 +128,42 @@ The best check that everything is ok is to run a dry-run extraction::
 Changelog
 =========
 
+Version 1.0.10 (2017-02-13)
+---------------------------
+
+Bug fixes:
+
+- Manifest timestamps are now monotonically increasing,
+  this fixes issues when the system clock jumps backwards
+  or is set inconsistently across computers accessing the same repository, #2115
+- Fixed testing regression in 1.0.10rc1 that lead to a hard dependency on
+  py.test >= 3.0, #2112
+
+New features:
+
+- "key export" can now generate a printable HTML page with both a QR code and
+  a human-readable "paperkey" representation (and custom text) through the
+  ``--qr-html`` option.
+
+  The same functionality is also available through `paperkey.html <paperkey.html>`_,
+  which is the same HTML page generated by ``--qr-html``. It works with existing
+  "key export" files and key files.
+
+Other changes:
+
+- docs:
+
+  - language clarification - "borg create --one-file-system" option does not respect
+    mount points, but considers different file systems instead, #2141
+- setup.py: build_api: sort file list for determinism
+
 Version 1.0.10rc1 (2017-01-29)
 ------------------------------
 
 Bug fixes:
 
 - borg serve: fix transmission data loss of pipe writes, #1268
-  This affects only the cygwin platform (not Linux, *BSD, OS X).
+  This affects only the cygwin platform (not Linux, BSD, OS X).
 - Avoid triggering an ObjectiveFS bug in xattr retrieval, #1992
 - When running out of buffer memory when reading xattrs, only skip the
   current file, #1993
@@ -187,7 +216,7 @@ Other changes:
 - remove .github from pypi package, #2051
 - add pip and setuptools to requirements file, #2030
 - SyncFile: fix use of fd object after close (cosmetic)
-- Manifest.in: simplify, exclude *.{so,dll,orig}, #2066
+- Manifest.in: simplify, exclude \*.{so,dll,orig}, #2066
 - ignore posix_fadvise errors in repository.py, #2095
   (works around issues with docker on ARM)
 - make LoggedIO.close_segment reentrant, avoid reentrance

+ 3 - 1
docs/usage/key_export.rst.inc

@@ -9,7 +9,7 @@ borg key export
     usage: borg key export [-h] [--critical] [--error] [--warning] [--info]
                            [--debug] [--lock-wait N] [--show-rc]
                            [--no-files-cache] [--umask M] [--remote-path PATH]
-                           [--paper]
+                           [--paper] [--qr-html]
                            [REPOSITORY] [PATH]
     
     Export the repository key for backup
@@ -34,6 +34,8 @@ borg key export
       --remote-path PATH    set remote path to executable (default: "borg")
       --paper               Create an export suitable for printing and later type-
                             in
+      --qr-html             Create an html file suitable for printing and later
+                            type-in or qr scan
     
 Description
 ~~~~~~~~~~~

+ 3 - 1
scripts/borg.exe.spec

@@ -10,7 +10,9 @@ block_cipher = None
 a = Analysis([os.path.join(basepath, 'borg/__main__.py'), ],
              pathex=[basepath, ],
              binaries=[],
-             datas=[],
+             datas=[
+                 ('../borg/paperkey.html', 'borg'),
+             ],
              hiddenimports=['borg.platform.posix'],
              hookspath=[],
              runtime_hooks=[],

+ 4 - 1
setup.py

@@ -230,10 +230,13 @@ class build_api(Command):
         print("auto-generating API documentation")
         with open("docs/api.rst", "w") as doc:
             doc.write("""
+.. IMPORTANT: this file is auto-generated by "setup.py build_api", do not edit!
+
+
 API Documentation
 =================
 """)
-            for mod in glob('borg/*.py') + glob('borg/*.pyx'):
+            for mod in sorted(glob('borg/*.py') + glob('borg/*.pyx')):
                 print("examining module %s" % mod)
                 mod = mod.replace('.pyx', '').replace('.py', '').replace('/', '.')
                 if "._" not in mod: