carrierwaveuploader / carrierwave-aws

AWS-SDK storage adapter for CarrierWave
MIT License
409 stars 107 forks source link

Support for "path_style" OFFICIALLY with a flag for the s3 hosts that use MinIO, DigitalOceanSpaces, and other software that support S3 API but not the default S3 virtualhost bucket names in the URL #177

Open mldev94 opened 1 year ago

mldev94 commented 1 year ago

Support for "path_style" OFFICIALLY for the s3 hosts with a flag for MinIO, DigitalOceanSpaces, and other software that support S3 API but not the default S3 virtualhost bucket names in the URL

https://github.com/fog/fog-aws/blob/b073ba81288af57bcce9144bdec4a77f5c6317b4/lib/fog/aws/storage.rb#L330

https://github.com/fog/fog-aws/issues/516

mldev94 commented 1 year ago

Even nginx has support for this: https://hub.docker.com/r/nginxinc/nginx-s3-gateway (scroll to path style section)

Also, I found a way to enable this for the people in the future who searches for this.

I found a flag that exists for this but this gem is using this in its rspec/testing files. However, it works in the code too:

config/initializers/carrierwave.rb

CarrierWave.configure do |config|
    config.aws_credentials = {
      endpoint:         "aaa",
      access_key_id:   "aaa",
      secret_access_key: "aaa",
      region:          "aaa",
      force_path_style: true # right-here
    }
end
mshibuya commented 1 year ago

What does that OFFICIALLY mean? If what you're talking about is just documentation, please go ahead with opening a PR.