Skip to content

Commit

Permalink
Add custom s3 endpoint option. (#52)
Browse files Browse the repository at this point in the history
This addition enables the gem to be used with compatible s3 servers, such as DigitalOcean Spaces
  • Loading branch information
usiegl00 authored Jul 30, 2022
1 parent aa4cf80 commit 5055e50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/acmesmith/storages/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module Acmesmith
module Storages
class S3 < Base
def initialize(aws_access_key: nil, bucket:, prefix: nil, region:, use_kms: true, kms_key_id: nil, kms_key_id_account: nil, kms_key_id_certificate_key: nil, pkcs12_passphrase: nil, pkcs12_common_names: nil)
def initialize(aws_access_key: nil, bucket:, prefix: nil, region:, use_kms: true, kms_key_id: nil, kms_key_id_account: nil, kms_key_id_certificate_key: nil, pkcs12_passphrase: nil, pkcs12_common_names: nil, endpoint: nil)
@region = region
@bucket = bucket
@prefix = prefix
Expand All @@ -25,6 +25,7 @@ def initialize(aws_access_key: nil, bucket:, prefix: nil, region:, use_kms: true

@s3 = Aws::S3::Client.new({region: region}.tap do |opt|
opt[:credentials] = Aws::Credentials.new(aws_access_key['access_key_id'], aws_access_key['secret_access_key'], aws_access_key['session_token']) if aws_access_key
opt[:endpoint] = endpoint if endpoint
end)
end

Expand Down

0 comments on commit 5055e50

Please sign in to comment.