ActiveStorage-Storj-S3
ActiveStorage-Storj-S3 is a ruby gem extension for activestorage-storj gem to provide Storj S3 Compatible Gateway support for some ActiveStorage features, e.g. direct upload which requires S3 presigned URL.
Requirements
- activestorage-storj gem installed in a Rails project.
Installation
-
Add this line to your Rails application's Gemfile:
gem 'activestorage-storj-s3', '~> 1.0'
And then execute:
$ bundle install
-
Modify Storj configuration in
config/storage.yml
:storj: service: storj_s3 # change from "storj" to "storj_s3" ... # provide the Storj S3 gateway credentials s3_gateway: access_key_id: "" secret_access_key: "" endpoint: "" region: global
The rest configurations are same as in
activestorage-storj
gem.
Running the Tests
-
Create
configurations.yml
file intest/dummy/config/environments/service
folder, or copy the existingconfigurations.example.yml
asconfigurations.yml
. -
Provide Storj configurations for both
storj
andstorj_public
services inconfigurations.yml
:storj: service: storj_s3 access_grant: "" bucket: "" auth_service_address: auth.storjshare.io:7777 link_sharing_address: https://link.storjshare.io s3_gateway: access_key_id: "" secret_access_key: "" endpoint: "" region: global storj_public: service: storj_s3 access_grant: "" bucket: "" auth_service_address: auth.storjshare.io:7777 link_sharing_address: https://link.storjshare.io s3_gateway: access_key_id: "" secret_access_key: "" endpoint: "" region: global public: true
-
Run the tests:
$ bin/test