Skip to content

Commit

Permalink
aws s3 for file storage
Browse files Browse the repository at this point in the history
  • Loading branch information
yshmarov committed May 8, 2021
1 parent f177523 commit ea323d3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'devise'
gem "faker"
gem "aws-sdk-s3", require: false
18 changes: 18 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ GEM
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
aws-eventstream (1.1.1)
aws-partitions (1.452.0)
aws-sdk-core (3.114.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.43.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.94.1)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.3)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.7.4)
Expand Down Expand Up @@ -95,6 +111,7 @@ GEM
concurrent-ruby (~> 1.0)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jmespath (1.4.0)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -215,6 +232,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
aws-sdk-s3
bootsnap (>= 1.4.4)
byebug
capybara (>= 3.26)
Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eGRw3Esc7RbjfB5xlOBdj8xNXy5nBfeWJeS6SAr7wIFIfVgSZbtArmF40+RJMpiAxv/4m/fwvACwGTjhVka1hLG7Rc9A/QA7NTYEqn6XvQlfk0kGuv6IsF6HPwvuVtrWEyqEwjFrQ036lP8WQMJVRyL+EjEFCZRYVJlb6na+9mPiqllXFiYrj5BEFFpzbE3BEUzWOZGUiM3q5knO2Ge2enkmvCUbhpaXzqBMoOjIVkEmEU6NMiqRFNHszcvVh9pCxVKfQdFWpLNiE3K1loY2LPnZqmHmvtWhPKtLWmUEOtyoSVPaD0ixvaE9Gbfh4o0dJ1bfZXR8yUIYIbDyhNYte29ypJ8bOVu7FWGrdmANsLkmQB6PyDhav8Y5/0d4pGkE130Sp53b8DT2JseMXg3G4BolyE9GeiAS4X8K--5ZjlzBqkJXostLTY--xKcjBFCUAglIHgmP71Pupw==
bZdxOaQDZJLZxWBO86+e4DIhVT1l6a4XIm/gZpHF4AyGpUCLYOSnTmrCuh0sOoE41tqusQny0WrFx3PhqsgkpVluznfs+ApFo4/2vSQgNU+/JO01E9Pd9CLsxo4CEO21uRN6gWj94Pq2Kajp0H6mRnv+83ho7GtQAyIFwHbqVoiwwMk1OUU7N9iwQhjxJIP+0B4m6z4qwP78HD+qYWSMt7G5CYnbHOkV07vT3U4APpLeazyur1k7nKCcDt0LCFIXV+ffZNIGRsmoRcLSA4Fyaf3An0jIuoUK1/caeQydNfx1ReAHhXL+cHjzj6WrqkeNLOJ6gqr1osclxhWHYqz0D89ick89cNmo7vrtgVe4nbeA2MLH49wwYm7XN/rPuznz/yeSFwoV872QhnsyOrat9+cjPevl8PTugISZHYL9NBqDkCjp3mx1qiRP2vsGjjy66905ekP1M0jv1KdHP97wPhj28fsG--C98SkOmkUzEvpycy--PL6ra6+iFx9m9txriZPFvw==
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
config.active_storage.service = :amazon

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
Expand Down
12 changes: 6 additions & 6 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ local:
root: <%= Rails.root.join("storage") %>

# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket
amazon:
service: S3
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
region: eu-central-1
bucket: superails

# Remember not to checkin your GCS keyfile to a repository
# google:
Expand Down

0 comments on commit ea323d3

Please sign in to comment.