Merge lp:~ed.so/duplicity/gdocs.pydrive into lp:~duplicity-team/duplicity/0.7-series

Proposed by edso
Status: Merged
Merged at revision: 1097
Proposed branch: lp:~ed.so/duplicity/gdocs.pydrive
Merge into: lp:~duplicity-team/duplicity/0.7-series
Diff against target: 380 lines (+138/-128)
3 files modified
bin/duplicity.1 (+129/-125)
duplicity/backends/gdocsbackend.py (+3/-2)
duplicity/backends/pydrivebackend.py (+6/-1)
To merge this branch: bzr merge lp:~ed.so/duplicity/gdocs.pydrive
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+260657@code.launchpad.net

Description of the change

make pydrive new gdocs default backend
keep gdata backend as gdata+gdocs://

To post a comment you must log in.
lp:~ed.so/duplicity/gdocs.pydrive updated
1098. By ede

manpage - some reordering, update "A NOTE ON SSH BACKENDS" to the new prefix+ changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/duplicity.1'
--- bin/duplicity.1 2015-05-30 11:53:02 +0000
+++ bin/duplicity.1 2015-05-31 14:31:15 +0000
@@ -1037,13 +1037,16 @@
1037ftp[s]://user[:password]@other.host[:port]/some_dir1037ftp[s]://user[:password]@other.host[:port]/some_dir
1038.PP1038.PP
1039.B NOTE:1039.B NOTE:
1040use lftp+, ncftp+ prefixes to enforce a specific backend, e.g. ncftp+ftp://...1040use lftp+, ncftp+ prefixes to enforce a specific backend, default is lftp+ftp://...
1041.RE1041.RE
1042.PP1042.PP
1043.B "Google Docs"1043.B "Google Docs"
1044.PP1044.PP
1045.RS1045.RS
1046gdocs://user[:password]@other.host/some_dir1046gdocs://user[:password]@other.host/some_dir
1047.PP
1048.B NOTE:
1049use pydrive+, gdata+ prefixes to enforce a specific backend, default is pydrive+gdocs://...
1047.RE1050.RE
1048.PP1051.PP
1049.B "Google Cloud Storage"1052.B "Google Cloud Storage"
@@ -1614,6 +1617,43 @@
1614.B from_address_prefix1617.B from_address_prefix
1615will distinguish between different backups.1618will distinguish between different backups.
16161619
1620.SH A NOTE ON MULTI BACKEND
1621
1622The multi backend allows duplicity to combine the storage available in
1623more than one backend store (e.g., you can store across a google drive
1624account and a onedrive account to get effectively the combined storage
1625available in both). The URL path specifies a JSON formated config
1626file containing a list of the backends it will use. Multibackend then
1627round-robins across the given backends. Each element of the list must
1628have a "url" element, and may also contain an optional "description"
1629and an optional "env" list of environment variables used to configure
1630that backend.
1631.PP
1632For example:
1633.nf
1634.RS
1635[
1636 {
1637 "description": "a comment about the backend"
1638 "url": "abackend://myuser@domain.com/backup",
1639 "env": [
1640 {
1641 "name" : "MYENV",
1642 "value" : "xyz"
1643 },
1644 {
1645 "name" : "FOO",
1646 "value" : "bar"
1647 }
1648 ]
1649 },
1650 {
1651 "url": "file:///path/to/dir"
1652 }
1653]
1654.RE
1655.fi
1656
1617.SH A NOTE ON PAR2 WRAPPER BACKEND1657.SH A NOTE ON PAR2 WRAPPER BACKEND
1618Par2 Wrapper Backend can be used in combination with all other backends to1658Par2 Wrapper Backend can be used in combination with all other backends to
1619create recovery files. Just add1659create recovery files. Just add
@@ -1632,6 +1672,62 @@
1632to adjust the size (and redundancy) of recovery files in1672to adjust the size (and redundancy) of recovery files in
1633.I percent.1673.I percent.
16341674
1675.SH A NOTE ON PYDRIVE BACKEND
1676The pydrive backend requires Python PyDrive package to be installed on the system. See
1677.B REQUIREMENTS
1678above.
1679
1680There are two ways to use PyDrive: with a regular account or with a
1681"service account". With a service account, a separate account is
1682created, that is only accessible with Google APIs and not a web login.
1683With a regular account, you can store backups in your normal Google
1684Drive.
1685
1686To use a service account, go to the Google developers
1687console at https://console.developers.google.com. Create a project,
1688and make sure Drive API is enabled for the project. Under "APIs and
1689auth", click Create New Client ID, then select Service Account with P12
1690key.
1691
1692Download the .p12 key file of the account and convert it to the .pem format:
1693.br
1694openssl pkcs12 -in XXX.p12 -nodes -nocerts > pydriveprivatekey.pem
1695
1696The content of .pem file should be passed to
1697.BR GOOGLE_DRIVE_ACCOUNT_KEY
1698environment variable for authentification.
1699
1700The email address of the account will be used as part of URL. See
1701.B URL FORMAT
1702above.
1703
1704The alternative is to use a regular account. To do this, start as above,
1705but when creating a new Client ID, select "Installed application" of
1706type "Other". Create a file with the following content, and pass its
1707filename in the
1708.BR GOOGLE_DRIVE_SETTINGS
1709environment variable:
1710.PP
1711.nf
1712.RS
1713client_config_backend: settings
1714client_config:
1715 client_id: <Client ID from developers' console>
1716 client_secret: <Client secret from developers' console>
1717save_credentials: True
1718save_credentials_backend: file
1719save_credentials_file: <filename to cache credentials>
1720get_refresh_token: True
1721.RE
1722.fi
1723
1724In this scenario, the username and host parts of the URL play no role;
1725only the path matters. During the first run, you will be prompted to
1726visit an URL in your browser to grant access to your drive. Once
1727granted, you will receive a verification code to paste back into
1728Duplicity. The credentials are then cached in the file references above
1729for future use.
1730
1635.SH A NOTE ON SSH BACKENDS1731.SH A NOTE ON SSH BACKENDS
1636The1732The
1637.I ssh backends1733.I ssh backends
@@ -1646,10 +1742,10 @@
1646.IR sftp " or"1742.IR sftp " or"
1647.I scp/ssh1743.I scp/ssh
1648access.1744access.
1649To make it even more confusing the user can choose between two ssh backends via1745To make it even more confusing the user can choose between several ssh backends via a scheme prefix:
1650.BR --ssh-backend " option."1746paramiko+ (default), pexpect+, lftp+... .
1651.br1747.br
1652Both support1748paramiko & pexpect support
1653.BR --use-scp ,1749.BR --use-scp ,
1654.BR --ssh-askpass " and"1750.BR --ssh-askpass " and"
1655.BR --ssh-options "."1751.BR --ssh-options "."
@@ -1659,7 +1755,7 @@
1659.BR --scp-command " and"1755.BR --scp-command " and"
1660.BR --sftp-command .1756.BR --sftp-command .
1661.PP1757.PP
1662.BR "SSH paramiko backend " "(selected by default)"1758.BR "SSH paramiko backend " "(default)"
1663is a complete reimplementation of ssh protocols natively in python. Advantages1759is a complete reimplementation of ssh protocols natively in python. Advantages
1664are speed and maintainability. Minor disadvantage is that extra packages are1760are speed and maintainability. Minor disadvantage is that extra packages are
1665needed as listed in1761needed as listed in
@@ -1686,6 +1782,10 @@
1686.I --use-scp1782.I --use-scp
1687option is used to revert to old behavior.1783option is used to revert to old behavior.
1688.PP1784.PP
1785.B SSH lftp backend
1786is simply there because lftp can interact with the ssh cmd line binaries.
1787It is meant as a last resort in case the above options fail for some reason.
1788.PP
1689.B Why use sftp instead of scp?1789.B Why use sftp instead of scp?
1690The change to sftp was made in order to allow the remote system to chroot the backup,1790The change to sftp was made in order to allow the remote system to chroot the backup,
1691thus providing better security and because it does not suffer from shell quoting issues like scp.1791thus providing better security and because it does not suffer from shell quoting issues like scp.
@@ -1750,99 +1850,6 @@
1750.B SWIFT_AUTHVERSION1850.B SWIFT_AUTHVERSION
1751is unspecified, it will default to version 1.1851is unspecified, it will default to version 1.
17521852
1753.SH A NOTE ON PYDRIVE BACKEND
1754The pydrive backend requires Python PyDrive package to be installed on the system. See
1755.B REQUIREMENTS
1756above.
1757
1758There are two ways to use PyDrive: with a regular account or with a
1759"service account". With a service account, a separate account is
1760created, that is only accessible with Google APIs and not a web login.
1761With a regular account, you can store backups in your normal Google
1762Drive.
1763
1764To use a service account, go to the Google developers
1765console at https://console.developers.google.com. Create a project,
1766and make sure Drive API is enabled for the project. Under "APIs and
1767auth", click Create New Client ID, then select Service Account with P12
1768key.
1769
1770Download the .p12 key file of the account and convert it to the .pem format:
1771.br
1772openssl pkcs12 -in XXX.p12 -nodes -nocerts > pydriveprivatekey.pem
1773
1774The content of .pem file should be passed to
1775.BR GOOGLE_DRIVE_ACCOUNT_KEY
1776environment variable for authentification.
1777
1778The email address of the account will be used as part of URL. See
1779.B URL FORMAT
1780above.
1781
1782The alternative is to use a regular account. To do this, start as above,
1783but when creating a new Client ID, select "Installed application" of
1784type "Other". Create a file with the following content, and pass its
1785filename in the
1786.BR GOOGLE_DRIVE_SETTINGS
1787environment variable:
1788.PP
1789.nf
1790.RS
1791client_config_backend: settings
1792client_config:
1793 client_id: <Client ID from developers' console>
1794 client_secret: <Client secret from developers' console>
1795save_credentials: True
1796save_credentials_backend: file
1797save_credentials_file: <filename to cache credentials>
1798get_refresh_token: True
1799.RE
1800.fi
1801
1802In this scenario, the username and host parts of the URL play no role;
1803only the path matters. During the first run, you will be prompted to
1804visit an URL in your browser to grant access to your drive. Once
1805granted, you will receive a verification code to paste back into
1806Duplicity. The credentials are then cached in the file references above
1807for future use.
1808
1809.SH A NOTE ON MULTI BACKEND
1810
1811The multi backend allows duplicity to combine the storage available in
1812more than one backend store (e.g., you can store across a google drive
1813account and a onedrive account to get effectively the combined storage
1814available in both). The URL path specifies a JSON formated config
1815file containing a list of the backends it will use. Multibackend then
1816round-robins across the given backends. Each element of the list must
1817have a "url" element, and may also contain an optional "description"
1818and an optional "env" list of environment variables used to configure
1819that backend.
1820.PP
1821For example:
1822.nf
1823.RS
1824[
1825 {
1826 "description": "a comment about the backend"
1827 "url": "abackend://myuser@domain.com/backup",
1828 "env": [
1829 {
1830 "name" : "MYENV",
1831 "value" : "xyz"
1832 },
1833 {
1834 "name" : "FOO",
1835 "value" : "bar"
1836 }
1837 ]
1838 },
1839 {
1840 "url": "file:///path/to/dir"
1841 }
1842]
1843.RE
1844.fi
1845
1846.SH A NOTE ON SYMMETRIC ENCRYPTION AND SIGNING1853.SH A NOTE ON SYMMETRIC ENCRYPTION AND SIGNING
1847Signing and symmetrically encrypt at the same time with the gpg binary on the1854Signing and symmetrically encrypt at the same time with the gpg binary on the
1848command line, as used within duplicity, is a specifically challenging issue.1855command line, as used within duplicity, is a specifically challenging issue.
@@ -1957,10 +1964,13 @@
1957.B python-urllib31964.B python-urllib3
1958- https://github.com/shazow/urllib31965- https://github.com/shazow/urllib3
1959.TP1966.TP
1960.BR "gdocs backend" " (Google Docs)"1967.BR "gdocs gdata backend" " (legacy Google Docs backend)"
1961.B Google Data APIs Python Client Library1968.B Google Data APIs Python Client Library
1962- http://code.google.com/p/gdata-python-client/1969- http://code.google.com/p/gdata-python-client/
1963.TP1970.TP
1971.BR "gdocs pydrive backend" "(default)"
1972see pydrive backend
1973.TP
1964.BR "gio backend" " (Gnome VFS API)"1974.BR "gio backend" " (Gnome VFS API)"
1965.B PyGObject1975.B PyGObject
1966- http://live.gnome.org/PyGObject1976- http://live.gnome.org/PyGObject
@@ -1976,6 +1986,17 @@
1976.B Python library for mega API1986.B Python library for mega API
1977- https://github.com/ckornacker/mega.py, ubuntu ppa - ppa:ckornacker/backup1987- https://github.com/ckornacker/mega.py, ubuntu ppa - ppa:ckornacker/backup
1978.TP1988.TP
1989.BR "multi backend"
1990.B Multi -- store to more than one backend
1991.br
1992(also see
1993.BR "A NOTE ON MULTI BACKEND"
1994) below.
1995.TP
1996.BR "ncftp backend" " (ftp, select via ncftp+ftp://)"
1997.B NcFTP
1998- http://www.ncftp.com/
1999.TP
1979.BR "OneDrive backend" " (Microsoft OneDrive)"2000.BR "OneDrive backend" " (Microsoft OneDrive)"
1980.B python-requests2001.B python-requests
1981- http://python-requests.org2002- http://python-requests.org
@@ -1983,24 +2004,23 @@
1983.B python-requests-oauthlib2004.B python-requests-oauthlib
1984- https://github.com/requests/requests-oauthlib2005- https://github.com/requests/requests-oauthlib
1985.TP2006.TP
1986.BR "ncftp backend" " (ftp, select via ncftp+ftp://)"
1987.B NcFTP
1988- http://www.ncftp.com/
1989.TP
1990.B "Par2 Wrapper Backend"2007.B "Par2 Wrapper Backend"
1991.B par2cmdline2008.B par2cmdline
1992- http://parchive.sourceforge.net/2009- http://parchive.sourceforge.net/
1993.TP2010.TP
2011.BR "pydrive backend"
2012.B PyDrive -- a wrapper library of google-api-python-client
2013- https://pypi.python.org/pypi/PyDrive
2014.br
2015(also see
2016.BR "A NOTE ON PYDRIVE BACKEND"
2017) below.
2018.TP
1994.B "rsync backend"2019.B "rsync backend"
1995.B rsync client binary2020.B rsync client binary
1996- http://rsync.samba.org/2021- http://rsync.samba.org/
1997.PP
1998There are two
1999.B ssh backends
2000for scp/sftp/ssh access (also see
2001.BR "A NOTE ON SSH BACKENDS" ).
2002.TP2022.TP
2003.BR "ssh paramiko backend" " (enabled by default)"2023.BR "ssh paramiko backend" " (default)"
2004.B paramiko2024.B paramiko
2005(SSH2 for python)2025(SSH2 for python)
2006- http://pypi.python.org/pypi/paramiko (downloads); http://github.com/paramiko/paramiko (project page)2026- http://pypi.python.org/pypi/paramiko (downloads); http://github.com/paramiko/paramiko (project page)
@@ -2030,22 +2050,6 @@
2030.br2050.br
2031(also see2051(also see
2032.BR "A NOTE ON SSL CERTIFICATE VERIFICATION" ).2052.BR "A NOTE ON SSL CERTIFICATE VERIFICATION" ).
2033.TP
2034.BR "pydrive backend"
2035.B PyDrive -- a wrapper library of google-api-python-client
2036- https://pypi.python.org/pypi/PyDrive
2037.br
2038(also see
2039.BR "A NOTE ON PYDRIVE BACKEND"
2040) below.
2041.TP
2042.BR "multi backend"
2043.B Multi -- store to more than one backend
2044.br
2045(also see
2046.BR "A NOTE ON MULTI BACKEND"
2047) below.
2048.br
20492053
2050.SH AUTHOR2054.SH AUTHOR
2051.TP2055.TP
20522056
=== modified file 'duplicity/backends/gdocsbackend.py'
--- duplicity/backends/gdocsbackend.py 2015-01-22 23:38:29 +0000
+++ duplicity/backends/gdocsbackend.py 2015-05-31 14:31:15 +0000
@@ -184,5 +184,6 @@
184 # Done!184 # Done!
185 return result185 return result
186186
187duplicity.backend.register_backend('gdocs', GDocsBackend)187""" gdata is an alternate way to access gdocs, currently 05/2015 lacking OAuth support """
188duplicity.backend.uses_netloc.extend(['gdocs'])188duplicity.backend.register_backend('gdata+gdocs', GDocsBackend)
189duplicity.backend.uses_netloc.extend(['gdata+gdocs'])
189190
=== modified file 'duplicity/backends/pydrivebackend.py'
--- duplicity/backends/pydrivebackend.py 2015-05-30 11:53:02 +0000
+++ duplicity/backends/pydrivebackend.py 2015-05-31 14:31:15 +0000
@@ -108,4 +108,9 @@
108 return {'size': size}108 return {'size': size}
109109
110duplicity.backend.register_backend('pydrive', PyDriveBackend)110duplicity.backend.register_backend('pydrive', PyDriveBackend)
111duplicity.backend.uses_netloc.extend(['pydrive'])111""" pydrive is an alternate way to access gdocs """
112duplicity.backend.register_backend('pydrive+gdocs', PyDriveBackend)
113""" register pydrive as the default way to access gdocs """
114duplicity.backend.register_backend('gdocs', PyDriveBackend)
115
116duplicity.backend.uses_netloc.extend(['pydrive','pydrive+gdocs','gdocs'])

Subscribers

People subscribed via source and target branches