Upgrade aws-sdk and set s3 host name using the provided url config.

This will enable us to set hostnames with the s3 region defined and that
will make our image upload work for all s3 regions.
This commit is contained in:
Luis Ramos
2020-10-22 18:16:47 +01:00
committed by Matt-Yorkley
parent 6114dfb4ef
commit 94a815a9ef
3 changed files with 11 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ gem 'kaminari', '~> 0.14.1'
gem 'andand'
gem 'angularjs-rails', '1.5.5'
gem 'aws-sdk', '1.11.1' # temporarily locked down due to https://github.com/aws/aws-sdk-ruby/issues/273
gem 'aws-sdk', '1.67.0'
gem 'bugsnag'
gem 'db2fog'
gem 'haml'

View File

@@ -117,10 +117,11 @@ GEM
awesome_nested_set (3.0.3)
activerecord (>= 4.0.0, < 5)
awesome_print (1.8.0)
aws-sdk (1.11.1)
aws-sdk (1.67.0)
aws-sdk-v1 (= 1.67.0)
aws-sdk-v1 (1.67.0)
json (~> 1.4)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
nokogiri (~> 1)
bcrypt (3.1.13)
bugsnag (6.18.0)
concurrent-ruby (~> 1.0)
@@ -648,7 +649,6 @@ GEM
unicorn-worker-killer (0.4.4)
get_process_mem (~> 0)
unicorn (>= 4, < 6)
uuidtools (2.1.5)
warden (1.2.7)
rack (>= 1.0)
webdrivers (4.2.0)
@@ -688,7 +688,7 @@ DEPENDENCIES
atomic
awesome_nested_set (~> 3.0.0.rc.1)
awesome_print
aws-sdk (= 1.11.1)
aws-sdk (= 1.67.0)
bugsnag
byebug (~> 11.0.0)
cancan (~> 1.6.10)

View File

@@ -61,6 +61,11 @@ module Spree
set_attachment_attributes(:s3_headers,
ActiveSupport::JSON.decode(Spree::Config[:s3_headers]))
set_attachment_attributes(:bucket, Spree::Config[:s3_bucket])
# When using S3, we set the URL on property s3_host_name
set_attachment_attributes(:s3_host_name, attachment_definitions[:attachment][:url])
set_attachment_attributes(:url, ":s3_domain_url")
# :s3_alias_url
else
attachment_definitions[:attachment].delete :storage
end