Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen authored Oct 2, 2021
1 parent ee5115e commit 0ad29a1
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,12 @@ Add this line to your application's Gemfile:
gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3'
```

For now you also need the main branch of AlchemyCMS*

```ruby
gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'main'
```

*only necessary until Alchemy 5.1 has been released.

And then execute:

```
$ bundle install
```

Install the picture thumbs migration from Alchemy 5.1

```
$ bin/rake alchemy:install:migrations
$ bin/rake db:migrate
```

## Setup

Configure a S3 datastore for Dragonfly
Expand All @@ -50,23 +35,17 @@ Configure a S3 datastore for Dragonfly

require "dragonfly/s3_data_store"

Dragonfly.app(:alchemy_pictures).configure do
plugin :imagemagick
plugin :svg

datastore :s3,
bucket_name: ENV.fetch("ALCHEMY_S3_BUCKET_NAME"),
access_key_id: ENV.fetch("ALCHEMY_S3_ACCESS_KEY_ID"),
secret_access_key: ENV.fetch("ALCHEMY_S3_SECRET_ACCESS_KEY"),
region: ENV.fetch("ALCHEMY_S3_REGION")
end

Dragonfly.app(:alchemy_attachments).configure do
datastore :s3,
bucket_name: ENV.fetch("ALCHEMY_S3_BUCKET_NAME"),
access_key_id: ENV.fetch("ALCHEMY_S3_ACCESS_KEY_ID"),
secret_access_key: ENV.fetch("ALCHEMY_S3_SECRET_ACCESS_KEY"),
region: ENV.fetch("ALCHEMY_S3_REGION")
Rails.application.credentials.aws.tap do |aws_config|
Dragonfly.app(:alchemy_pictures).configure do
plugin :imagemagick
plugin :svg
secret: Rails.application.credentials.secret_key_base
datastore :s3, aws_config
end

Dragonfly.app(:alchemy_attachments).configure do
datastore :s3, aws_config
end
end
```

Expand Down

0 comments on commit 0ad29a1

Please sign in to comment.