RT::ExternalStorage::Dropbox - Store files in the Dropbox cloud
Set(%ExternalStorage,
Type => 'Dropbox',
AccessKey => '...',
AccessSecret => '...',
RefreshToken => '...',
);
This storage option places attachments in the Dropbox shared file service. The files are de-duplicated when they are saved; as such, if the same file appears in multiple transactions, only one copy will be stored in Dropbox.
Files in Dropbox must not be modified or removed; doing so may cause internal inconsistency. It is also important to ensure that the Dropbox account used has sufficient space for the attachments, and to monitor its space usage.
In order to use this storage type, a new application must be registered with Dropbox:
Log into Dropbox as the user you wish to store files as.
Click Create app on https://www.dropbox.com/developers/apps
Choose Scoped access as the API.
Choose App folder as the type of access.
Enter a descriptive name -- Request Tracker files is fine.
After creation, grant the following permissions on Permissions tab:
files.metadata.write
files.metadata.read
files.content.write
files.content.read
On Settings tab, get App key/App secret and then access the following URL:
https://www.dropbox.com/oauth2/authorize?token_access_type=offline&response_type=code&client_id=<App key>
Where <App key> is the one you got earlier.
After a confirmation page, you will receive a code, use it along with App key and App secret in the following command and run it:
curl https://api.dropbox.com/oauth2/token -d code=<received code> -d grant_type=authorization_code -u <App key>:<App secret>
The response shall contain refresh_token value.
Copy the provided values into your RT_SiteConfig.pm:
Set(%ExternalStorage,
Type => 'Dropbox',
AccessKey => '...',
AccessSecret => '...',
RefreshToken => '...', # Replace the value here, between the quotes
);