0.01
No commit activity in last 3 years
No release in over 3 years
Description of ActivestorageQiniu.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 6.9
~> 5.2
 Project Readme

Qiniu Rails

qiniu backend for activestorage and more

Features

  • Qiniu backend for activestorage;
  • QiniuHelper for simple independent use;
  • Qiniu extends for sprockets

Config

# config/storage.yml
qiniu:
  service: Qiniu
  host: assets.work.design  
  access_key: <%= Rails.application.credentials.dig(:qiniu, :access_key) %>
  secret_key: <%= Rails.application.credentials.dig(:qiniu, :secret_key) %>
  bucket: work_design 
  notify_url: xxx 
  private: true
  protocol: https
  keep: false # 是否真正删除
  block: false # 是否启用分片上传

Installation

Add this line to your application's Gemfile:

gem 'qiniu_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install qiniu_rails

Direct Upload

  • dependent on JS http client sdk axios, please add it to your rails project first;
  • then require qiniu_direct_upload in js file where you used qiniu direct upload;

Assets Sync(Sprockets) support

  • add Sprockets.sync = 'qiniu' to your initializers file

Contributing

Contribution directions go here.

License

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