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

adds scheme, port and connection_options to fog connection #220

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions lib/asset_sync/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Invalid < StandardError; end
attr_accessor :fog_provider # Currently Supported ['AWS', 'Rackspace']
attr_accessor :fog_directory # e.g. 'the-bucket-name'
attr_accessor :fog_region # e.g. 'eu-west-1'
attr_accessor :fog_connection_options
attr_accessor :fog_scheme
attr_accessor :fog_port
attr_accessor :fog_endpoint

# Amazon AWS
attr_accessor :aws_access_key_id, :aws_secret_access_key, :aws_reduced_redundancy
Expand Down Expand Up @@ -172,6 +176,11 @@ def load_yml!

def fog_options
options = { :provider => fog_provider }
options.merge!({ scheme: fog_scheme }) if fog_scheme.present?
options.merge!({ port: fog_port }) if fog_port.present?
options.merge!({ endpoint: fog_endpoint }) if fog_endpoint.present?
options.merge!({ connection_options: fog_connection_options }) if fog_connection_options.present?

if aws?
options.merge!({
:aws_access_key_id => aws_access_key_id,
Expand Down
4 changes: 4 additions & 0 deletions lib/asset_sync/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ def upload_file(f)
})
end

if ENV['AWS_SERVER_SIDE_ENCRYPTION'] or ENV['PROD_S3_SERVER_SIDE_ENCRYPTION']
file[:encryption] = 'AES256'
end

file = bucket.files.create( file ) unless ignore
end

Expand Down