|
From: | Paul Barker |
Subject: | Re: [Duplicity-talk] Ubuntu One backend |
Date: | Wed, 08 Aug 2012 20:12:36 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 |
Hi again all,I've attached an initial implementation of a new Ubuntu One backend for duplicity, which has been tested with duplicity-0.6.19 running daily backups from my Gentoo home server for the last week or so. I've also tested a restore to make sure that functionality works as well. My python version is 2.7.3, and aside from the built-in libraries my code only relies on one external library, oauth2, to handle authentication, and this has been tested with oauth2-1.5.211.
The oauth keys are currently read in from environment variables (U1_TOKEN, U1_TOKEN_SECRET, U1_CONSUMER_KEY and U1_CONSUMER_SECRET). I've included a short python script which takes the username and password along with potentially a hostname and an application name and logs in to Ubuntu One. The environment variable values are printed to stdout in the correct format for use in Bash. Whilst it would be beneficial to handle login within duplicity itself, I haven't yet figured out how best to do this. Perhaps you could give me some advice on this? To my knowledge, the Ubuntu One web API doesn't include a method to log out and therefore logging in with a username and password every time duplicity is ran will produce a lot of open sessions which are stored on the Ubuntu One servers (listed under 'Devices' at https://one.ubuntu.com/account/ if you are logged in). I think it is best to log in once, store the oauth keys and use these on future invocations of duplicity but I can't see how to fit that usage model into the existing duplicity usage model.
Could anyone interested please take a look at the attached code and send me any comments you have.
Many Thanks, Paul Barker On 25/06/2012 03:31, Michael Terry wrote:
Hello! I wrote the current U1 backend. I was mostly interested in having a version that ran under X (for Deja Dup's purposes), and using GNOME bits was easiest. I'd certainly be interested in having a version that doesn't rely on X/DBus. I think email would be fine. I'd be happy to help review such a backend. -mt On 24 June 2012 16:32, Paul Barker <address@hidden> wrote:Hi all, I'm looking to backup a server to Ubuntu One using Duplicity and so I've taken a look at the backend code for U1. This seems to depend on DBUS, Gnome Keyring and a bunch of other stuff which won't be running on a headless server. Looking at the standard python-ubuntuone code, I'm gathering that the expectation is that this is ran while you're logged into an X session. As a quick weekend project I decided to write a command line Ubuntu One client which didn't depend on any of this - it talks directly to the U1 REST API using built in python libraries and one external library: python-oauth2. That's a requirement to properly authenticate. This now seems to work and I can use this client to get, put and list files. I've put the project up at https://bitbucket.org/elprb2/u1c So my question is, would you be interested in replacing the Ubuntu One backend with something simpler? Looks like I can edit my code a bit and use it to implement a Duplicity backend module without massive difficulties. I tend to license my code under an MIT license but am happy to put this under GPL. I've also never used bazaar version control system so if possible I'd just like to write the backend and email it to you. What's your thoughts on this? Thanks, -- Paul Barker address@hidden _______________________________________________ Duplicity-talk mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/duplicity-talk
u1backend.py
Description: Text document
u1login.py
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |