-
Notifications
You must be signed in to change notification settings - Fork 22
Configuring browse everything
If you want to auto-generate a sample config/browse_everything_providers.yml and automatically add BrowseEverything to your routes, run this generator:
$ rails g browse_everything:config
Below is an explanation of how to do these things manually.
To use the gem you need to configure the providers by providing applcation keys that are required by each provider
An example config/browse_everything_providers.yml:
---
file_system:
home: /<location for server file drop>
box:
client_id: <your client id>
client_secret: <your client secret>
max_upload_file_size: 5368709120
dropbox:
client_id: <your client id>
client_secret: <your app secret>
google_drive:
client_id: <your client id>
client_secret: <your client secret>
s3:
bucket: <your AWS S3 bucket>
app_key: <your AWS S3 key>
app_secret: <your AWS S3 secret>
region: <your AWS region>
You must register your application with each cloud provider separately:
- Box: https://app.box.com/developers/services/edit/
- Dropbox: https://www.dropbox.com/developers/apps/create
- GoogleDrive: https://code.google.com/apis/console
- Amazon S3: https://s3.console.aws.amazon.com/s3/home
You may optionally set a maximum upload size for each provider
:max_upload_file_size: 5368709120
You must mount the engine in your routes.rb. You can mount it to any path you wish. If you use the generator, it will automatically mount the engine as shown here:
mount BrowseEverything::Engine => '/browse'
Note: If you are loading browse-everything into your views via JavaScript, you will need to provide this path in the 'route:' option that you pass into the browseEverything() method.