diff --git a/shopinvader/config/initializers/carrierwave.rb b/shopinvader/config/initializers/carrierwave.rb index fa83462..0fd5e16 100644 --- a/shopinvader/config/initializers/carrierwave.rb +++ b/shopinvader/config/initializers/carrierwave.rb @@ -30,27 +30,26 @@ config.aws_bucket = ENV['S3_BUCKET'] config.aws_acl = 'public-read' - # Use a different endpoint (eg: another provider such as Exoscale) - if ENV['S3_ENDPOINT'].present? - config.aws_credentials[:endpoint] = ENV['S3_ENDPOINT'] - end - # For some endpoint like minio you need to rewrite path - if ENV['S3_PATH_STYLE'].present? - config.aws_credentials[:force_path_style] = ENV['S3_PATH_STYLE'] - end - config.aws_attributes = { cache_control: ENV['S3_CACHE_CONTROL'] } - config.aws_credentials = { access_key_id: ENV['S3_KEY_ID'], secret_access_key: ENV['S3_SECRET_KEY'], region: ENV['S3_BUCKET_REGION'] } + # Use a different endpoint (eg: another provider such as Exoscale) + if ENV['S3_ENDPOINT'].present? + config.aws_credentials[:endpoint] = ENV['S3_ENDPOINT'] + end + + # For some endpoint like minio you need to rewrite path + if ENV['S3_PATH_STYLE'].present? + config.aws_credentials[:force_path_style] = ENV['S3_PATH_STYLE'] + end end