Skip to content
Snippets Groups Projects
Commit f8e1664e authored by intrigeri's avatar intrigeri
Browse files

dup handler: correctly handle Dropbox access token (Closes: #11260).

Thanks to Daniel Lo Nigro for the patch.
parent d297d0ff
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,4 @@ Christian Prause <cprause@suse.com> -- Support suse in the sys handler
Jools Wills <jools@oxfordinspire.co.uk> -- Bugfix in the sys helper, indentation fixes
Mark Janssen <mark@sig-io.nl> -- ignore jobs whose filename ends with "~"
shred <riseup@ml.shredzone.de> -- Initial patch for test mode support in the rsync handler
Daniel Lo Nigro <daniel@dan.cx> -- Dropbox support for Duplicity
......@@ -189,6 +189,7 @@ exclude = /var/cache/backupninja/duplicity
## desturl = rsync://user@other.host//var/backup/bla
## desturl = s3+http://
## desturl = ftp://myftpuser@ftp.example.org/remote/ftp/path
## desturl = dpbx:///myserver
## the default value of this configuration option is not set:
##
## Default:
......@@ -213,6 +214,16 @@ exclude = /var/cache/backupninja/duplicity
# cfapikey =
# cfauthurl =
## Dropbox requires a valid authentication token. To obtain one, you will need
## to create a Dropbox API application at https://www.dropbox.com/developers/apps/create.
## See the "A note on Dropbox access" section of the Duplicity manpage for more
## details: http://duplicity.nongnu.org/duplicity.1.html#sect12
##
## Default:
# dropboxappkey =
# dropboxappsecret =
# dropboxaccesstoken =
## FTP password, needed for backups using desturl = ftp://...
##
## Default:
......
......@@ -470,6 +470,7 @@ keepincroffulls = $dup_keepincroffulls
#desturl = rsync://user@other.host//var/backup/bla
#desturl = s3+http://your_bucket
#desturl = ftp://myftpuser@ftp.example.org/remote/ftp/path
#desturl = dpbx:///myserver
# Amazon Web Services Access Key ID and Secret Access Key, needed for backups
# to S3 buckets.
......@@ -486,6 +487,16 @@ keepincroffulls = $dup_keepincroffulls
# cfapikey =
# cfauthurl =
## Dropbox requires a valid authentication token. To obtain one, you will need
## to create a Dropbox API application at https://www.dropbox.com/developers/apps/create.
## See the "A note on Dropbox access" section of the Duplicity manpage for more
## details: http://duplicity.nongnu.org/duplicity.1.html#sect12
##
## Default:
# dropboxappkey =
# dropboxappsecret =
# dropboxaccesstoken =
# FTP password, needed for backups using desturl = ftp://...
#ftp_password =
......
......@@ -34,6 +34,9 @@ getconf awssecretaccesskey
getconf cfusername
getconf cfapikey
getconf cfauthurl
getconf dropboxappkey
getconf dropboxappsecret
getconf dropboxaccesstoken
getconf ftp_password
getconf sshoptions
getconf bandwidthlimit 0
......@@ -54,6 +57,16 @@ fi
if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "cf+http" ]; then
[ -n "$cfusername" -a -n "$cfapikey" ] || fatal "Cloudfiles access keys must be set for S3 backups."
fi
if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "dpbx" ]; then
[ -n "$dropboxappkey" -a -n "$dropboxappsecret" ] || fatal "Dropbox app ID and secret must be set for Dropbox backups."
if [ ! -n "$dropboxaccesstoken" ]; then
error "To obtain an access token for Dropbox, you will need to manually run this command:"
error "DPBX_APP_KEY=$dropboxappkey DPBX_APP_SECRET=$dropboxappsecret duplicity list-current-files $desturl"
fatal "Dropbox access token must be set"
fi
fi
if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "ftp" ]; then
[ -n "$ftp_password" ] || fatal "ftp_password must be set for FTP backups."
fi
......@@ -279,6 +292,13 @@ if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "cf+http" ]; then
fi
fi
### If desturl is a Dropbox URL, export the relevant environment variables
if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "dpbx" ]; then
export DPBX_APP_KEY="$dropboxappkey"
export DPBX_APP_SECRET="$dropboxappsecret"
export DPBX_ACCESS_TOKEN="$dropboxaccesstoken"
fi
### Cleanup commands (duplicity >= 0.4.4)
# cleanup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment