Skip to content

Commit

Permalink
Merge pull request #3726 from Matt-Yorkley/db2fog_patch
Browse files Browse the repository at this point in the history
Db2fog patch
  • Loading branch information
sauloperez authored Apr 12, 2019
2 parents 6e727e1 + 7373fff commit e0fd2fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/initializers/db2fog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
DB2Fog.config = {
:aws_access_key_id => Spree::Config[:s3_access_key],
:aws_secret_access_key => Spree::Config[:s3_secret],
:directory => Spree::Config[:s3_bucket],
:directory => ENV['S3_BACKUPS_BUCKET'],
:provider => 'AWS'
}
7 changes: 7 additions & 0 deletions config/initializers/spree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
# Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.
config.auto_capture = true
#config.override_actionmailer_config = false

# S3 settings
config.s3_bucket = ENV['S3_BUCKET'] if ENV['S3_BUCKET']
config.s3_access_key = ENV['S3_ACCESS_KEY'] if ENV['S3_ACCESS_KEY']
config.s3_secret = ENV['S3_SECRET'] if ENV['S3_SECRET']
config.use_s3 = true if ENV['S3_ACCESS_KEY'] && ENV['S3_SECRET']
config.s3_protocol = ENV.fetch('S3_PROTOCOL', 'https')
end

# Don't log users out when setting a new password
Expand Down
4 changes: 2 additions & 2 deletions config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
end

every 1.day, at: '2:45am' do
rake 'db2fog:clean'
rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET']
end

every 4.hours do
rake 'db2fog:backup'
rake 'db2fog:backup' if ENV['S3_BACKUPS_BUCKET']
end

every 5.minutes do
Expand Down

0 comments on commit e0fd2fb

Please sign in to comment.