Skip to content

Wraps the Qiniu Storage Service as an Active Storage service

License

Notifications You must be signed in to change notification settings

mycolorway/activestorage_qiniu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

abc9604 · Sep 29, 2021

History

84 Commits
Dec 12, 2017
Aug 27, 2021
Dec 12, 2017
Dec 12, 2017
Dec 12, 2017
Dec 12, 2017
Dec 12, 2017
Mar 9, 2020
Dec 12, 2017
Jul 27, 2018
Dec 12, 2017
Feb 29, 2020

Repository files navigation

ActivestorageQiniu

Wraps the Qiniu Storage Service as an Active Storage service

Installation

Add this line to your application's Gemfile:

gem 'activestorage_qiniu'

And then execute:

$ bundle

Or install it yourself as:

$ gem install activestorage_qiniu

Usage

you can set-up qiniu storage service through the generated config/storage.yml file.

  qiniu:
    service: Qiniu
    access_key: <%= ENV['QINIU_ACCESS_KEY'] %>
    secret_key: <%= ENV['QINIU_SECRET_KEY'] %>
    bucket: <%= ENV['QINIU_BUCKET'] %>
    domain: <%= ENV['QINIU_DOMAIN'] %>
    protocol: <%= ENV.fetch("QINIU_PROTOCOL") { "http" } %>
    bucket_private: <%= ENV['QINIU_BUCKET_PRIVATE'] || false  %>

more options. https://github.com/qiniu/ruby-sdk/blob/master/lib/qiniu/auth.rb#L49

Then, in your application's configuration, you can specify the service to use like this:

config.active_storage.service = :qiniu

Finally, config qiniu image and video analyzers.

config.active_storage.analyzers = [
  ActiveStorage::Analyzer::QiniuImageAnalyzer,
  ActiveStorage::Analyzer::QiniuVideoAnalyzer
]

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ActivestorageQiniu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Wraps the Qiniu Storage Service as an Active Storage service

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published