add figaro env config

This commit is contained in:
Rafael Schouten
2014-09-16 00:13:43 +10:00
parent 5cf09d264c
commit 9448e1cbe4
6 changed files with 22 additions and 8 deletions

View File

@@ -42,6 +42,7 @@ gem 'gmaps4rails'
gem 'spinjs-rails'
gem 'rack-ssl', :require => 'rack/ssl'
gem 'custom_error_message', :github => 'jeremydurham/custom-err-msg'
gem 'figaro'
gem 'foreigner'
gem 'immigrant'

View File

@@ -243,6 +243,9 @@ GEM
railties (>= 3.0.0)
ffaker (1.15.0)
ffi (1.9.3)
figaro (0.7.0)
bundler (~> 1.0)
rails (>= 3, < 5)
fog (1.14.0)
builder
excon (~> 0.25.0)
@@ -520,6 +523,7 @@ DEPENDENCIES
debugger-linecache
deface!
factory_girl_rails
figaro
foreigner
foundation-icons-sass-rails
foundation-rails

View File

@@ -1,6 +1,6 @@
Hello,
Welcome to Australia's Open Food Network! Your login email is <%= @user.email %>
Welcome to #{ENV['DEFAULT_COUNTRY']}'s Open Food Network! Your login email is #{@user.email}
You can go online and start shopping through food hubs and local producers you like at http://openfoodnetwork.org.au
@@ -9,5 +9,5 @@ We welcome all your questions and feedback; you can use the Send Feedback button
Thanks for getting on board and we look forward to introducing you to many more great farmers, food hubs and food!
Cheers,
Kirsten Larsen and the OFN Team
#{ENV['CONTACT_STRING']}

View File

@@ -57,11 +57,11 @@ module Openfoodnetwork
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'Melbourne'
config.time_zone = ENV["TIMEZONE"]
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = 'en'
config.i18n.default_locale = ENV["LOCALE"]
# Setting this to true causes a performance regression in Rails 3.2.17
# When we're on a version with the fix below, we can set it to true

View File

@@ -3,5 +3,9 @@
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Openfoodnetwork::Application.config.secret_token = '6d784d49173d0ec820f20cfce151717bd12570e9d261460e9d3c295b90c1fd81e3843eb1bec79d9e6d4a7f04d0fd76170ca0c326ffb0f2da5b7a0b50c7442a4c'
# no regular words or you'll be exposed to dictionary attacks.
Openfoodnetwork::Application.config.secret_token = if Rails.env.development? or Rails.env.test?
('x' * 30) # Meets basic minimum of 30 chars.
else
ENV["SECRET_TOKEN"]
end

View File

@@ -11,11 +11,16 @@ require 'spree/product_filters'
Spree.config do |config|
config.shipping_instructions = true
config.checkout_zone = 'Australia'
config.checkout_zone = ENV["CHECKOUT_ZONE"]
config.address_requires_state = true
# 12 should be Australia. Hardcoded for CI (Jenkins), where countries are not pre-loaded.
config.default_country_id = 12
if Rails.env.test? or Rails.env.development?
config.default_country_id = 12
else
country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"])
config.default_country_id = country.id if country.present?
end
# -- spree_paypal_express
# Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.