The project is in a healthy, maintained state
Providing Storj Cloud Storage support for ActiveStorage in Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 7.0, >= 7.0.4
 Project Readme

ActiveStorage-Storj

ActiveStorage-Storj is a ruby gem that provides Storj cloud storage support for ActiveStorage in Rails.

Note: direct upload is not supported in this gem. To enable direct upload support, install activestorage-storj-s3 gem.

Requirements

  • Rails v7+

  • Install Active Storage on a Rails project.

    $ bin/rails active_storage:install
    $ bin/rails db:migrate
  • Build and install uplink-c library. Follow the guide at Prerequisites section.

Installation

  • Add this line to your Rails application's Gemfile:

    gem 'activestorage-storj', '~> 1.0'

    And then execute:

    $ bundle install
  • Declare a Storj Cloud Storage service in config/storage.yml:

    storj:
      service: storj
      access_grant: ""
      bucket: ""
      auth_service_address: auth.storjshare.io:7777
      link_sharing_address: https://link.storjshare.io

    Optionally provide upload and download options:

    storj:
      service: storj
      ...
      upload_chunk_size: 0
      download_chunk_size: 0

    Add public: true to prevent the generated URL from expiring. By default, the private generated URL will expire in 5 minutes.

    storj:
      service: storj
      ...
      public: true

Running the Tests

  • Create configurations.yml file in test/dummy/config/environments/service folder, or copy the existing configurations.example.yml as configurations.yml.

  • Provide Storj configurations for both storj and storj_public services in configurations.yml:

    storj:
      service: storj
      access_grant: ""
      bucket: ""
      auth_service_address: auth.storjshare.io:7777
      link_sharing_address: https://link.storjshare.io
    
    storj_public:
      service: storj
      access_grant: ""
      bucket: ""
      auth_service_address: auth.storjshare.io:7777
      link_sharing_address: https://link.storjshare.io
      public: true
  • Run the tests:

    $ bin/test