* Update set-up-dropbox.md Updated text for explanation of DROPBOX_REMOTE_PATH environment variable usage accordingly to how the Dropbox App was scoped during creation. * Update set-up-dropbox.md Minor style edit * Update index.md Replaced /Apps/my-test-app/some_subdir with /somedir in example value for DROPBOX_REMOTE_PATH environment variable under "Backing up to Dropbox" section, to align with updates done to related "how-to" text
2.2 KiB
title | layout | parent | nav_order |
---|---|---|---|
Set up Dropbox storage backend | default | How Tos | 12 |
Set up Dropbox storage backend
Acquiring authentication tokens
- Create a new Dropbox App in the App Console
- Open your new Dropbox App and set
DROPBOX_APP_KEY
andDROPBOX_APP_SECRET
in your environment (e.g. docker-compose.yml) accordingly - Click on
Permissions
in your app and make sure, that the following permissions are cranted (or more):
files.metadata.write
files.metadata.read
files.content.write
files.content.read
- Replace APPKEY in
https://www.dropbox.com/oauth2/authorize?client_id=APPKEY&token_access_type=offline&response_type=code
with the app key from step 2 - Visit the URL and confirm the access of your app. This gives you an
auth code
-> save it somewhere! - Replace AUTHCODE, APPKEY, APPSECRET accordingly and perform the request:
curl https://api.dropbox.com/oauth2/token \
-d code=AUTHCODE \
-d grant_type=authorization_code \
-d client_id=APPKEY \
-d client_secret=APPSECRET
- Execute the request. You will get a JSON formatted reply. Use the value of the
refresh_token
for the last environment variableDROPBOX_REFRESH_TOKEN
- You should now have
DROPBOX_APP_KEY
,DROPBOX_APP_SECRET
andDROPBOX_REFRESH_TOKEN
set. These don't expire.
Note: Using the "Generated access token" in the app console is not supported, as it is only very short lived and therefore not suitable for an automatic backup solution. The refresh token handles this automatically - the setup procedure above is only needed once.
Other parameters
Important: If you chose App folder
access during the creation of your Dropbox app in step 1 above, DROPBOX_REMOTE_PATH
will be a relative path under the App folder!
(For example, DROPBOX_REMOTE_PATH=/somedir means the backup file will be uploaded to /Apps/myapp/somedir)
On the other hand if you chose Full Dropbox
access, the value for DROPBOX_REMOTE_PATH
will represent an absolute path inside your Dropbox storage area.
(Still considering the same example above, the backup file will be uploaded to /somedir in your Dropbox root)