GithubHelp home page GithubHelp logo

carrierwave-cascade's Introduction

Carrierwave::Cascade

Build Status

A storage plugin for carrierwave that will retrieving files from a secondary storage if the file is not present in the primary storage. New files will always be stored in the primary storage. This is perfect for use while migrating from one storage to another, or to avoid polluting a production environment when running a staging mirror.

Installation

Add this line to your application's Gemfile:

gem 'carrierwave-cascade'

Usage

Configure carrierwave to use Cascade as its storage engine. Then set primary and secondary storages to be used. Supply other configuration as needed for the storages.

CarrierWave.configure do |config|
  config.storage    = :cascade
  config.primary_storage   = :file
  config.secondary_storage = :fog

  config.fog_credentials = {
    :provider               => 'AWS'
  }
end

By default, cascade will prevent files from being deleted out of the secondary storage. If you wish secondary storage file to be deleted, specify this in the configs.

CarrierWave.configure do |config|
  config.allow_secondary_file_deletion = true
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

carrierwave-cascade's People

Contributors

kjg avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

carrierwave-cascade's Issues

Cascading 2 of the same provider type

Is it possible to cascade 2 of the same provider types, such as S3, where each uses a different configuration? For instance, the primary storage works with bucket A while the secondary works with bucket B. Bucket A should be the read-write bucket, while bucket B is read-only.

From the look of things this isn't currently possible because no facility is provided to enable per storage configuration. Everything must be handled within the top level configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.