Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config to disable ACL in fog storage #2666

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CarrierWave thrives on a large number of [contributors](https://github.com/carrierwaveuploader/carrierwave/contributors),
and pull requests are very welcome. Before submitting a pull request, please make sure that your changes are well tested.

First, make sure you have `imagemagick` and `ghostscript` installed. You may need `libmagic` as well.
First, make sure you have `imagemagick`, `ghostscript` and `vips` installed. You may need `libmagic` as well.

Then, you'll need to install the gem dependencies:

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ CarrierWave.configure do |config|
config.fog_directory = 'name_of_bucket' # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = { cache_control: "public, max-age=#{365.days.to_i}" } # optional, defaults to {}
config.fog_acl = false # optional, defaults to true
# For an application which utilizes multiple servers but does not need caches persisted across requests,
# uncomment the line :file instead of the default :storage. Otherwise, it will use AWS as the temp cache store.
# config.cache_storage = :file
Expand Down
2 changes: 2 additions & 0 deletions lib/carrierwave/storage/fog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ def copy_options
end

def acl_header
return {} unless @uploader.fog_acl

case fog_provider
when 'AWS'
{ 'x-amz-acl' => @uploader.fog_public ? 'public-read' : 'private' }
Expand Down
2 changes: 2 additions & 0 deletions lib/carrierwave/uploader/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module Configuration
add_config :fog_authenticated_url_expiration
add_config :fog_use_ssl_for_aws
add_config :fog_aws_accelerate
add_config :fog_acl

# Mounting
add_config :ignore_integrity_errors
Expand Down Expand Up @@ -196,6 +197,7 @@ def reset_config
config.fog_authenticated_url_expiration = 600
config.fog_use_ssl_for_aws = true
config.fog_aws_accelerate = false
config.fog_acl = true
config.store_dir = 'uploads'
config.cache_dir = 'uploads/tmp'
config.delete_tmp_file_after_storage = true
Expand Down
Loading