No commit activity in last 3 years
No release in over 3 years
Manta data store for Dragonfly
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0

Runtime

~> 1.0
~> 2.1.0
 Project Readme

Dragonfly::MantaDataStore

Build Status

Joyent Manta data store for use with the Dragonfly gem. Inspired by the S3 Dragonfly gem.

Gemfile

gem 'dragonfly-manta_data_store'

Usage

Configuration (remember the require)

require 'dragonfly/manta_data_store'

Dragonfly.app.configure do
  # ...

  datastore :manta,
    directory: 'my_images',
    url: 'https://us-east.manta.joyent.com',
    user: 'myuser,
    key: 'actual ASCII ssh key (load from file or ENV)',
    durability_level: 2
  # ...
end

Available configuration options

:directory         # base directory within your public directory
:url               # defaults to "https://us-east.manta.joyent.com"
:user              # your joyent user
:key               # SSH ASCII key
:durability_level  # defaults to 2
:region            # defaults to 'us-east'
:url_scheme        # defaults to 'http'
:url_host          # maybe useful for a CDN?
:root_path         # another base directory on top of :directory (mostly to match the S3 store)
:storage_headers   # headers to include for all stored objects

Serving directly from Manta

You can get the Manta url using

Dragonfly.app.remote_url_for('some/uid')

or

my_model.attachment.remote_url

or with an expiring url:

my_model.attachment.remote_url(expires: 3.days.from_now)

or with an https url:

my_model.attachment.remote_url(scheme: 'https')   # also configurable for all urls with 'url_scheme'

or with a custom host:

my_model.attachment.remote_url(host: 'custom.domain')   # also configurable for all urls with 'url_host'