From 76226f64f38f949891c859c20208ff4c3d8349c8 Mon Sep 17 00:00:00 2001 From: Piavlo Date: Tue, 19 Nov 2013 02:08:54 +0200 Subject: [PATCH 1/2] add support for specifing s3 backet endpoint --- lib/astrails/safe/s3.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/astrails/safe/s3.rb b/lib/astrails/safe/s3.rb index 741c810..0d86ea7 100644 --- a/lib/astrails/safe/s3.rb +++ b/lib/astrails/safe/s3.rb @@ -18,7 +18,7 @@ def save raise RuntimeError, "pipe-streaming not supported for S3." unless @backup.path # needed in cleanup even on dry run - AWS::S3::Base.establish_connection!(:access_key_id => key, :secret_access_key => secret, :use_ssl => true) unless local_only? + AWS::S3::Base.establish_connection!(:access_key_id => key, :secret_access_key => secret, :s3_endpoint => endpoint, :use_ssl => true) unless local_only? puts "Uploading #{bucket}:#{full_path}" if verbose? || dry_run? unless dry_run? || local_only? @@ -64,6 +64,10 @@ def key config[:s3, :key] end + def endpoint + config[:s3, :endpoint] + end + def secret config[:s3, :secret] end From 3864f6f8a16a803296204be22dbf7133c6907538 Mon Sep 17 00:00:00 2001 From: Piavlo Date: Tue, 19 Nov 2013 02:24:48 +0200 Subject: [PATCH 2/2] add endpoint to config builder method list --- lib/astrails/safe/config/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/astrails/safe/config/builder.rb b/lib/astrails/safe/config/builder.rb index c40e136..80f284b 100644 --- a/lib/astrails/safe/config/builder.rb +++ b/lib/astrails/safe/config/builder.rb @@ -67,7 +67,7 @@ def collection(*names) end simple_value :verbose, :dry_run, :local_only, :path, :command, - :options, :user, :host, :port, :password, :key, :secret, :bucket, + :options, :user, :host, :port, :password, :key, :secret, :bucket, :endpoint, :api_key, :container, :socket, :service_net, :repo_path multi_value :skip_tables, :exclude, :files hash_value :mysqldump, :tar, :gpg, :keep, :pgdump, :tar, :svndump,