Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lyz
backupninja
Commits
f8e1664e
Commit
f8e1664e
authored
7 years ago
by
intrigeri
Browse files
Options
Downloads
Patches
Plain Diff
dup handler: correctly handle Dropbox access token (Closes: #11260).
Thanks to Daniel Lo Nigro for the patch.
parent
d297d0ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AUTHORS
+1
-0
1 addition, 0 deletions
AUTHORS
examples/example.dup
+11
-0
11 additions, 0 deletions
examples/example.dup
handlers/dup.helper.in
+11
-0
11 additions, 0 deletions
handlers/dup.helper.in
handlers/dup.in
+20
-0
20 additions, 0 deletions
handlers/dup.in
with
43 additions
and
0 deletions
AUTHORS
+
1
−
0
View file @
f8e1664e
...
...
@@ -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
This diff is collapsed.
Click to expand it.
examples/example.dup
+
11
−
0
View file @
f8e1664e
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
handlers/dup.helper.in
+
11
−
0
View file @
f8e1664e
...
...
@@ -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 =
...
...
This diff is collapsed.
Click to expand it.
handlers/dup.in
+
20
−
0
View file @
f8e1664e
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment