Merge remote-tracking branch 'origin/config' into config

This commit is contained in:
Rohan Mitchell
2014-11-20 15:41:15 +11:00
8 changed files with 40 additions and 10 deletions

4
.gitignore vendored
View File

@@ -15,6 +15,7 @@ tmp/
.#*
*~
*.~lock.*
tags
.emacs.desktop
.DS_Store
*.sublime-project*
@@ -36,5 +37,4 @@ config/initializers/feature_toggle.rb
NERD_tree*
coverage
libpeerconnection.log
tags
app/assets/javascripts/tags
/config/application.yml

View File

@@ -43,6 +43,7 @@ gem 'spinjs-rails'
gem 'rack-ssl', :require => 'rack/ssl'
gem 'custom_error_message', :github => 'jeremydurham/custom-err-msg'
gem 'angularjs-file-upload-rails', '~> 1.1.0'
gem 'figaro'
gem 'foreigner'
gem 'immigrant'

View File

@@ -244,6 +244,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)
@@ -529,6 +532,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

@@ -0,0 +1,16 @@
# Add application configuration variables here, as shown below.
#
# Change this, it has serious security implications.
# Minimum 30 but usually 128 characters. To obtain run 'rake secret', or faster, 'openssl rand -hex 128'
SECRET_TOKEN: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TIMEZONE: "Melbourne"
# Default country for dropdowns etc.
DEFAULT_COUNTRY: "Australia"
# Locale for translation.
I18N_LOCALE: "en"
# Spree zone.
CHECKOUT_ZONE: "Australia"
# Contact name for emails.
CONTACT_STRING: "Joe Bloggs and the OFN Team"

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.