Skip to content

Configuring browse everything

James R. Griffin III edited this page Oct 11, 2018 · 4 revisions

Using the Generator

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.

Configuring Providers

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:

Optional Configuration Parameters

You may optionally set a maximum upload size for each provider

 :max_upload_file_size: 5368709120

Adding the Routes

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.