From c15a78d93d23c0782fa1634a46d45abb68bde716 Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Thu, 15 Aug 2013 12:27:01 +0200 Subject: [PATCH 1/6] adds scheme, port and connection_options to fog connection --- lib/asset_sync/config.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/asset_sync/config.rb b/lib/asset_sync/config.rb index 1ffe41e1..1642edd0 100644 --- a/lib/asset_sync/config.rb +++ b/lib/asset_sync/config.rb @@ -24,6 +24,9 @@ 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 # Amazon AWS attr_accessor :aws_access_key_id, :aws_secret_access_key, :aws_reduced_redundancy @@ -172,6 +175,10 @@ 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!({ connection_options: fog_connection_options }) if fog_connection_options.present? + if aws? options.merge!({ :aws_access_key_id => aws_access_key_id, From 5ee345a7cd8b805a3f6b79c1b450254a6c208a6a Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Thu, 10 Oct 2013 19:07:12 +0200 Subject: [PATCH 2/6] adds fog endpoint configuration parameter --- lib/asset_sync/config.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/asset_sync/config.rb b/lib/asset_sync/config.rb index 1642edd0..c32914fe 100644 --- a/lib/asset_sync/config.rb +++ b/lib/asset_sync/config.rb @@ -27,6 +27,7 @@ class Invalid < StandardError; end attr_accessor :fog_connection_options attr_accessor :fog_scheme attr_accessor :fog_port + attr_accessor :fog_enpoint # Amazon AWS attr_accessor :aws_access_key_id, :aws_secret_access_key, :aws_reduced_redundancy @@ -177,6 +178,7 @@ 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: endpoint }) if endpoint.present? options.merge!({ connection_options: fog_connection_options }) if fog_connection_options.present? if aws? From 8728c7e041650cac3e74df89c62151183a4ca6ae Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Thu, 10 Oct 2013 19:11:26 +0200 Subject: [PATCH 3/6] type in accessor --- lib/asset_sync/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/asset_sync/config.rb b/lib/asset_sync/config.rb index c32914fe..a37daf0d 100644 --- a/lib/asset_sync/config.rb +++ b/lib/asset_sync/config.rb @@ -27,7 +27,7 @@ class Invalid < StandardError; end attr_accessor :fog_connection_options attr_accessor :fog_scheme attr_accessor :fog_port - attr_accessor :fog_enpoint + attr_accessor :fog_endpoint # Amazon AWS attr_accessor :aws_access_key_id, :aws_secret_access_key, :aws_reduced_redundancy From 6bab979aa7a35c285ca67372aaf20e5cb58594c7 Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Thu, 10 Oct 2013 19:16:28 +0200 Subject: [PATCH 4/6] updates config --- lib/asset_sync/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/asset_sync/config.rb b/lib/asset_sync/config.rb index a37daf0d..3c0ef115 100644 --- a/lib/asset_sync/config.rb +++ b/lib/asset_sync/config.rb @@ -178,7 +178,7 @@ 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: endpoint }) if endpoint.present? + options.merge!({ endpoint: fog_endpoint }) if fog_endpoint.present? options.merge!({ connection_options: fog_connection_options }) if fog_connection_options.present? if aws? From 87990de5e4d6de066f5ebd52c771d46b05ea313b Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Mon, 3 Feb 2014 12:46:15 +0100 Subject: [PATCH 5/6] adds ENV setting AWS_SERVER_SIDE_ENCRYPTION to file storage --- lib/asset_sync/storage.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/asset_sync/storage.rb b/lib/asset_sync/storage.rb index 822b11a7..b26edbf9 100644 --- a/lib/asset_sync/storage.rb +++ b/lib/asset_sync/storage.rb @@ -203,6 +203,10 @@ def upload_file(f) }) end + if ENV['AWS_SERVER_SIDE_ENCRYPTION'] + file[:encryption] = 'AES256' + end + file = bucket.files.create( file ) unless ignore end From 8ef2894f0b76696e6d9315cc42a3c9063a81194a Mon Sep 17 00:00:00 2001 From: Frederik Vollert Date: Wed, 12 Feb 2014 11:55:43 +0100 Subject: [PATCH 6/6] adds current production prefix ENV var name to encryption check --- lib/asset_sync/storage.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/asset_sync/storage.rb b/lib/asset_sync/storage.rb index b26edbf9..c302ec25 100644 --- a/lib/asset_sync/storage.rb +++ b/lib/asset_sync/storage.rb @@ -203,7 +203,7 @@ def upload_file(f) }) end - if ENV['AWS_SERVER_SIDE_ENCRYPTION'] + if ENV['AWS_SERVER_SIDE_ENCRYPTION'] or ENV['PROD_S3_SERVER_SIDE_ENCRYPTION'] file[:encryption] = 'AES256' end