Merge lp:~ed.so/duplicity/gdocs.pydrive into lp:~duplicity-team/duplicity/0.7-series
- gdocs.pydrive
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
duplicity-team | Pending | ||
Review via email: mp+260657@code.launchpad.net |
Commit message
Description of the change
make pydrive new gdocs default backend
keep gdata backend as gdata+gdocs://
To post a comment you must log in.
- 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
1 | === modified file 'bin/duplicity.1' |
2 | --- bin/duplicity.1 2015-05-30 11:53:02 +0000 |
3 | +++ bin/duplicity.1 2015-05-31 14:31:15 +0000 |
4 | @@ -1037,13 +1037,16 @@ |
5 | ftp[s]://user[:password]@other.host[:port]/some_dir |
6 | .PP |
7 | .B NOTE: |
8 | -use lftp+, ncftp+ prefixes to enforce a specific backend, e.g. ncftp+ftp://... |
9 | +use lftp+, ncftp+ prefixes to enforce a specific backend, default is lftp+ftp://... |
10 | .RE |
11 | .PP |
12 | .B "Google Docs" |
13 | .PP |
14 | .RS |
15 | gdocs://user[:password]@other.host/some_dir |
16 | +.PP |
17 | +.B NOTE: |
18 | +use pydrive+, gdata+ prefixes to enforce a specific backend, default is pydrive+gdocs://... |
19 | .RE |
20 | .PP |
21 | .B "Google Cloud Storage" |
22 | @@ -1614,6 +1617,43 @@ |
23 | .B from_address_prefix |
24 | will distinguish between different backups. |
25 | |
26 | +.SH A NOTE ON MULTI BACKEND |
27 | + |
28 | +The multi backend allows duplicity to combine the storage available in |
29 | +more than one backend store (e.g., you can store across a google drive |
30 | +account and a onedrive account to get effectively the combined storage |
31 | +available in both). The URL path specifies a JSON formated config |
32 | +file containing a list of the backends it will use. Multibackend then |
33 | +round-robins across the given backends. Each element of the list must |
34 | +have a "url" element, and may also contain an optional "description" |
35 | +and an optional "env" list of environment variables used to configure |
36 | +that backend. |
37 | +.PP |
38 | +For example: |
39 | +.nf |
40 | +.RS |
41 | +[ |
42 | + { |
43 | + "description": "a comment about the backend" |
44 | + "url": "abackend://myuser@domain.com/backup", |
45 | + "env": [ |
46 | + { |
47 | + "name" : "MYENV", |
48 | + "value" : "xyz" |
49 | + }, |
50 | + { |
51 | + "name" : "FOO", |
52 | + "value" : "bar" |
53 | + } |
54 | + ] |
55 | + }, |
56 | + { |
57 | + "url": "file:///path/to/dir" |
58 | + } |
59 | +] |
60 | +.RE |
61 | +.fi |
62 | + |
63 | .SH A NOTE ON PAR2 WRAPPER BACKEND |
64 | Par2 Wrapper Backend can be used in combination with all other backends to |
65 | create recovery files. Just add |
66 | @@ -1632,6 +1672,62 @@ |
67 | to adjust the size (and redundancy) of recovery files in |
68 | .I percent. |
69 | |
70 | +.SH A NOTE ON PYDRIVE BACKEND |
71 | +The pydrive backend requires Python PyDrive package to be installed on the system. See |
72 | +.B REQUIREMENTS |
73 | +above. |
74 | + |
75 | +There are two ways to use PyDrive: with a regular account or with a |
76 | +"service account". With a service account, a separate account is |
77 | +created, that is only accessible with Google APIs and not a web login. |
78 | +With a regular account, you can store backups in your normal Google |
79 | +Drive. |
80 | + |
81 | +To use a service account, go to the Google developers |
82 | +console at https://console.developers.google.com. Create a project, |
83 | +and make sure Drive API is enabled for the project. Under "APIs and |
84 | +auth", click Create New Client ID, then select Service Account with P12 |
85 | +key. |
86 | + |
87 | +Download the .p12 key file of the account and convert it to the .pem format: |
88 | +.br |
89 | +openssl pkcs12 -in XXX.p12 -nodes -nocerts > pydriveprivatekey.pem |
90 | + |
91 | +The content of .pem file should be passed to |
92 | +.BR GOOGLE_DRIVE_ACCOUNT_KEY |
93 | +environment variable for authentification. |
94 | + |
95 | +The email address of the account will be used as part of URL. See |
96 | +.B URL FORMAT |
97 | +above. |
98 | + |
99 | +The alternative is to use a regular account. To do this, start as above, |
100 | +but when creating a new Client ID, select "Installed application" of |
101 | +type "Other". Create a file with the following content, and pass its |
102 | +filename in the |
103 | +.BR GOOGLE_DRIVE_SETTINGS |
104 | +environment variable: |
105 | +.PP |
106 | +.nf |
107 | +.RS |
108 | +client_config_backend: settings |
109 | +client_config: |
110 | + client_id: <Client ID from developers' console> |
111 | + client_secret: <Client secret from developers' console> |
112 | +save_credentials: True |
113 | +save_credentials_backend: file |
114 | +save_credentials_file: <filename to cache credentials> |
115 | +get_refresh_token: True |
116 | +.RE |
117 | +.fi |
118 | + |
119 | +In this scenario, the username and host parts of the URL play no role; |
120 | +only the path matters. During the first run, you will be prompted to |
121 | +visit an URL in your browser to grant access to your drive. Once |
122 | +granted, you will receive a verification code to paste back into |
123 | +Duplicity. The credentials are then cached in the file references above |
124 | +for future use. |
125 | + |
126 | .SH A NOTE ON SSH BACKENDS |
127 | The |
128 | .I ssh backends |
129 | @@ -1646,10 +1742,10 @@ |
130 | .IR sftp " or" |
131 | .I scp/ssh |
132 | access. |
133 | -To make it even more confusing the user can choose between two ssh backends via |
134 | -.BR --ssh-backend " option." |
135 | +To make it even more confusing the user can choose between several ssh backends via a scheme prefix: |
136 | +paramiko+ (default), pexpect+, lftp+... . |
137 | .br |
138 | -Both support |
139 | +paramiko & pexpect support |
140 | .BR --use-scp , |
141 | .BR --ssh-askpass " and" |
142 | .BR --ssh-options "." |
143 | @@ -1659,7 +1755,7 @@ |
144 | .BR --scp-command " and" |
145 | .BR --sftp-command . |
146 | .PP |
147 | -.BR "SSH paramiko backend " "(selected by default)" |
148 | +.BR "SSH paramiko backend " "(default)" |
149 | is a complete reimplementation of ssh protocols natively in python. Advantages |
150 | are speed and maintainability. Minor disadvantage is that extra packages are |
151 | needed as listed in |
152 | @@ -1686,6 +1782,10 @@ |
153 | .I --use-scp |
154 | option is used to revert to old behavior. |
155 | .PP |
156 | +.B SSH lftp backend |
157 | +is simply there because lftp can interact with the ssh cmd line binaries. |
158 | +It is meant as a last resort in case the above options fail for some reason. |
159 | +.PP |
160 | .B Why use sftp instead of scp? |
161 | The change to sftp was made in order to allow the remote system to chroot the backup, |
162 | thus providing better security and because it does not suffer from shell quoting issues like scp. |
163 | @@ -1750,99 +1850,6 @@ |
164 | .B SWIFT_AUTHVERSION |
165 | is unspecified, it will default to version 1. |
166 | |
167 | -.SH A NOTE ON PYDRIVE BACKEND |
168 | -The pydrive backend requires Python PyDrive package to be installed on the system. See |
169 | -.B REQUIREMENTS |
170 | -above. |
171 | - |
172 | -There are two ways to use PyDrive: with a regular account or with a |
173 | -"service account". With a service account, a separate account is |
174 | -created, that is only accessible with Google APIs and not a web login. |
175 | -With a regular account, you can store backups in your normal Google |
176 | -Drive. |
177 | - |
178 | -To use a service account, go to the Google developers |
179 | -console at https://console.developers.google.com. Create a project, |
180 | -and make sure Drive API is enabled for the project. Under "APIs and |
181 | -auth", click Create New Client ID, then select Service Account with P12 |
182 | -key. |
183 | - |
184 | -Download the .p12 key file of the account and convert it to the .pem format: |
185 | -.br |
186 | -openssl pkcs12 -in XXX.p12 -nodes -nocerts > pydriveprivatekey.pem |
187 | - |
188 | -The content of .pem file should be passed to |
189 | -.BR GOOGLE_DRIVE_ACCOUNT_KEY |
190 | -environment variable for authentification. |
191 | - |
192 | -The email address of the account will be used as part of URL. See |
193 | -.B URL FORMAT |
194 | -above. |
195 | - |
196 | -The alternative is to use a regular account. To do this, start as above, |
197 | -but when creating a new Client ID, select "Installed application" of |
198 | -type "Other". Create a file with the following content, and pass its |
199 | -filename in the |
200 | -.BR GOOGLE_DRIVE_SETTINGS |
201 | -environment variable: |
202 | -.PP |
203 | -.nf |
204 | -.RS |
205 | -client_config_backend: settings |
206 | -client_config: |
207 | - client_id: <Client ID from developers' console> |
208 | - client_secret: <Client secret from developers' console> |
209 | -save_credentials: True |
210 | -save_credentials_backend: file |
211 | -save_credentials_file: <filename to cache credentials> |
212 | -get_refresh_token: True |
213 | -.RE |
214 | -.fi |
215 | - |
216 | -In this scenario, the username and host parts of the URL play no role; |
217 | -only the path matters. During the first run, you will be prompted to |
218 | -visit an URL in your browser to grant access to your drive. Once |
219 | -granted, you will receive a verification code to paste back into |
220 | -Duplicity. The credentials are then cached in the file references above |
221 | -for future use. |
222 | - |
223 | -.SH A NOTE ON MULTI BACKEND |
224 | - |
225 | -The multi backend allows duplicity to combine the storage available in |
226 | -more than one backend store (e.g., you can store across a google drive |
227 | -account and a onedrive account to get effectively the combined storage |
228 | -available in both). The URL path specifies a JSON formated config |
229 | -file containing a list of the backends it will use. Multibackend then |
230 | -round-robins across the given backends. Each element of the list must |
231 | -have a "url" element, and may also contain an optional "description" |
232 | -and an optional "env" list of environment variables used to configure |
233 | -that backend. |
234 | -.PP |
235 | -For example: |
236 | -.nf |
237 | -.RS |
238 | -[ |
239 | - { |
240 | - "description": "a comment about the backend" |
241 | - "url": "abackend://myuser@domain.com/backup", |
242 | - "env": [ |
243 | - { |
244 | - "name" : "MYENV", |
245 | - "value" : "xyz" |
246 | - }, |
247 | - { |
248 | - "name" : "FOO", |
249 | - "value" : "bar" |
250 | - } |
251 | - ] |
252 | - }, |
253 | - { |
254 | - "url": "file:///path/to/dir" |
255 | - } |
256 | -] |
257 | -.RE |
258 | -.fi |
259 | - |
260 | .SH A NOTE ON SYMMETRIC ENCRYPTION AND SIGNING |
261 | Signing and symmetrically encrypt at the same time with the gpg binary on the |
262 | command line, as used within duplicity, is a specifically challenging issue. |
263 | @@ -1957,10 +1964,13 @@ |
264 | .B python-urllib3 |
265 | - https://github.com/shazow/urllib3 |
266 | .TP |
267 | -.BR "gdocs backend" " (Google Docs)" |
268 | +.BR "gdocs gdata backend" " (legacy Google Docs backend)" |
269 | .B Google Data APIs Python Client Library |
270 | - http://code.google.com/p/gdata-python-client/ |
271 | .TP |
272 | +.BR "gdocs pydrive backend" "(default)" |
273 | +see pydrive backend |
274 | +.TP |
275 | .BR "gio backend" " (Gnome VFS API)" |
276 | .B PyGObject |
277 | - http://live.gnome.org/PyGObject |
278 | @@ -1976,6 +1986,17 @@ |
279 | .B Python library for mega API |
280 | - https://github.com/ckornacker/mega.py, ubuntu ppa - ppa:ckornacker/backup |
281 | .TP |
282 | +.BR "multi backend" |
283 | +.B Multi -- store to more than one backend |
284 | +.br |
285 | +(also see |
286 | +.BR "A NOTE ON MULTI BACKEND" |
287 | +) below. |
288 | +.TP |
289 | +.BR "ncftp backend" " (ftp, select via ncftp+ftp://)" |
290 | +.B NcFTP |
291 | +- http://www.ncftp.com/ |
292 | +.TP |
293 | .BR "OneDrive backend" " (Microsoft OneDrive)" |
294 | .B python-requests |
295 | - http://python-requests.org |
296 | @@ -1983,24 +2004,23 @@ |
297 | .B python-requests-oauthlib |
298 | - https://github.com/requests/requests-oauthlib |
299 | .TP |
300 | -.BR "ncftp backend" " (ftp, select via ncftp+ftp://)" |
301 | -.B NcFTP |
302 | -- http://www.ncftp.com/ |
303 | -.TP |
304 | .B "Par2 Wrapper Backend" |
305 | .B par2cmdline |
306 | - http://parchive.sourceforge.net/ |
307 | .TP |
308 | +.BR "pydrive backend" |
309 | +.B PyDrive -- a wrapper library of google-api-python-client |
310 | +- https://pypi.python.org/pypi/PyDrive |
311 | +.br |
312 | +(also see |
313 | +.BR "A NOTE ON PYDRIVE BACKEND" |
314 | +) below. |
315 | +.TP |
316 | .B "rsync backend" |
317 | .B rsync client binary |
318 | - http://rsync.samba.org/ |
319 | -.PP |
320 | -There are two |
321 | -.B ssh backends |
322 | -for scp/sftp/ssh access (also see |
323 | -.BR "A NOTE ON SSH BACKENDS" ). |
324 | .TP |
325 | -.BR "ssh paramiko backend" " (enabled by default)" |
326 | +.BR "ssh paramiko backend" " (default)" |
327 | .B paramiko |
328 | (SSH2 for python) |
329 | - http://pypi.python.org/pypi/paramiko (downloads); http://github.com/paramiko/paramiko (project page) |
330 | @@ -2030,22 +2050,6 @@ |
331 | .br |
332 | (also see |
333 | .BR "A NOTE ON SSL CERTIFICATE VERIFICATION" ). |
334 | -.TP |
335 | -.BR "pydrive backend" |
336 | -.B PyDrive -- a wrapper library of google-api-python-client |
337 | -- https://pypi.python.org/pypi/PyDrive |
338 | -.br |
339 | -(also see |
340 | -.BR "A NOTE ON PYDRIVE BACKEND" |
341 | -) below. |
342 | -.TP |
343 | -.BR "multi backend" |
344 | -.B Multi -- store to more than one backend |
345 | -.br |
346 | -(also see |
347 | -.BR "A NOTE ON MULTI BACKEND" |
348 | -) below. |
349 | -.br |
350 | |
351 | .SH AUTHOR |
352 | .TP |
353 | |
354 | === modified file 'duplicity/backends/gdocsbackend.py' |
355 | --- duplicity/backends/gdocsbackend.py 2015-01-22 23:38:29 +0000 |
356 | +++ duplicity/backends/gdocsbackend.py 2015-05-31 14:31:15 +0000 |
357 | @@ -184,5 +184,6 @@ |
358 | # Done! |
359 | return result |
360 | |
361 | -duplicity.backend.register_backend('gdocs', GDocsBackend) |
362 | -duplicity.backend.uses_netloc.extend(['gdocs']) |
363 | +""" gdata is an alternate way to access gdocs, currently 05/2015 lacking OAuth support """ |
364 | +duplicity.backend.register_backend('gdata+gdocs', GDocsBackend) |
365 | +duplicity.backend.uses_netloc.extend(['gdata+gdocs']) |
366 | |
367 | === modified file 'duplicity/backends/pydrivebackend.py' |
368 | --- duplicity/backends/pydrivebackend.py 2015-05-30 11:53:02 +0000 |
369 | +++ duplicity/backends/pydrivebackend.py 2015-05-31 14:31:15 +0000 |
370 | @@ -108,4 +108,9 @@ |
371 | return {'size': size} |
372 | |
373 | duplicity.backend.register_backend('pydrive', PyDriveBackend) |
374 | -duplicity.backend.uses_netloc.extend(['pydrive']) |
375 | +""" pydrive is an alternate way to access gdocs """ |
376 | +duplicity.backend.register_backend('pydrive+gdocs', PyDriveBackend) |
377 | +""" register pydrive as the default way to access gdocs """ |
378 | +duplicity.backend.register_backend('gdocs', PyDriveBackend) |
379 | + |
380 | +duplicity.backend.uses_netloc.extend(['pydrive','pydrive+gdocs','gdocs']) |