Re-add db2fog

Turns out it works with Rails 5
This commit is contained in:
Matt-Yorkley
2021-02-15 18:23:50 +00:00
parent 096b693461
commit 7bc63e6e81
3 changed files with 47 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ gem 'rails-i18n'
gem 'rails_safe_tasks', '~> 1.0'
gem "activerecord-import"
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-5"
gem "fog-aws", ">= 0.6.0"
gem "catalog", path: "./engines/catalog"
gem 'dfc_provider', path: './engines/dfc_provider'

View File

@@ -4,6 +4,16 @@ GIT
specs:
custom_error_message (1.1.1)
GIT
remote: https://github.com/openfoodfoundation/db2fog.git
revision: 8ceef362c64e6573d62d26db5ebb0c0f33cd3d61
branch: rails-5
specs:
db2fog (0.9.1)
activerecord (>= 3.2.0, < 6.0)
fog-core (~> 1.0)
rails (>= 3.2.0, < 6.0)
GIT
remote: https://github.com/openfoodfoundation/ofn-qz.git
revision: 467f6ea1c44529c7c91cac4c8211bbd863588c0b
@@ -202,6 +212,7 @@ GEM
docile (1.3.4)
erubis (2.7.0)
eventmachine (1.2.7)
excon (0.79.0)
execjs (2.7.0)
factory_bot (5.2.0)
activesupport (>= 4.2.0)
@@ -214,6 +225,22 @@ GEM
ffi (1.13.1)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
fog-aws (2.0.1)
fog-core (~> 1.38)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (1.45.0)
builder
excon (~> 0.58)
formatador (~> 0.2)
fog-json (1.2.0)
fog-core
multi_json (~> 1.10)
fog-xml (0.1.3)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
formatador (0.2.5)
foundation-icons-sass-rails (3.0.0)
railties (>= 3.1.1)
sass-rails (>= 3.1.1)
@@ -243,6 +270,7 @@ GEM
i18n (>= 0.6.6)
immigrant (0.3.6)
activerecord (>= 3.0)
ipaddress (0.8.3)
jquery-migrate-rails (1.2.1)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
@@ -588,6 +616,7 @@ DEPENDENCIES
daemons
dalli
database_cleaner
db2fog!
ddtrace
debugger-linecache
delayed_job_active_record
@@ -600,6 +629,7 @@ DEPENDENCIES
factory_bot_rails (= 5.2.0)
ffaker
figaro
fog-aws (>= 0.6.0)
foundation-icons-sass-rails
foundation-rails (= 5.5.2.1)
fuubar (~> 2.5.1)

View File

@@ -0,0 +1,15 @@
require_relative 'spree'
# See: https://github.com/itbeaver/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'
}
region = ENV['S3_BACKUPS_REGION'] || ENV['S3_REGION']
# If no region is defined we leave this config key undefined (instead of nil),
# so that db2fog correctly applies it's default
DB2Fog.config[:region] = region if region