mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
This solves the error showed below when executed `bundle exec rake db2fog:backup RAILS_ENV=staging` on Katuma staging ``` Excon::Error::BadRequest: Expected(200) <=> Actual(400 Bad Request) excon.error.response :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-central-1'</Message><Region>eu-central-1</Region><RequestId>3DE2763883FC601D</RequestId><HostId>1E6UapnblBqVZM0SeeLrdPNDd+VaQ0nxCWwrQ9mi8HjRo2xevAUwtSq5V3fxhsj4Cj9ynnDroco=</HostId></Error>" ```
12 lines
356 B
Ruby
12 lines
356 B
Ruby
require_relative 'spree'
|
|
|
|
# See: https://github.com/yob/db2fog
|
|
DB2Fog.config = {
|
|
:aws_access_key_id => Spree::Config[:s3_access_key],
|
|
:aws_secret_access_key => Spree::Config[:s3_secret],
|
|
:directory => ENV['S3_BACKUPS_BUCKET'],
|
|
:provider => 'AWS'
|
|
}
|
|
|
|
DB2Fog.config[:region] = ENV['S3_REGION'] if ENV['S3_REGION']
|