diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 189493f1..3a23a975 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -69,7 +69,7 @@ def init initialize_breadcrumbs_and_title @seo_description = '' - ActionMailer::Base.default_url_options[:host] = ENV['RABEL_HOST_NAME'] + ActionMailer::Base.default_url_options[:host] = Figaro.env['RABEL_HOST_NAME'] end def initialize_breadcrumbs_and_title diff --git a/app/controllers/upyun_images_controller.rb b/app/controllers/upyun_images_controller.rb index 3564113f..7686e013 100644 --- a/app/controllers/upyun_images_controller.rb +++ b/app/controllers/upyun_images_controller.rb @@ -2,7 +2,7 @@ class UpyunImagesController < ApplicationController before_filter :authenticate_user! def create - redirect_to root_path if ENV['RABEL_UPYUN_SWITCH'] != 'on' + redirect_to root_path if Figaro.env['RABEL_UPYUN_SWITCH'] != 'on' respond_to do |f| f.json { diff --git a/app/uploaders/upyun_image_uploader.rb b/app/uploaders/upyun_image_uploader.rb index a520af13..a390c45f 100644 --- a/app/uploaders/upyun_image_uploader.rb +++ b/app/uploaders/upyun_image_uploader.rb @@ -17,10 +17,10 @@ class UpyunImageUploader < CarrierWave::Uploader::Base # storage :fog storage :upyun - self.upyun_username = ENV['RABEL_UPYUN_OP_NAME'] - self.upyun_password = ENV['RABEL_UPYUN_OP_PASSWORD'] - self.upyun_bucket = ENV['RABEL_UPYUN_BUCKET'] - self.upyun_bucket_domain = ENV['RABEL_UPYUN_BUCKET_DOMAIN'] + self.upyun_username = Figaro.env['RABEL_UPYUN_OP_NAME'] + self.upyun_password = Figaro.env['RABEL_UPYUN_OP_PASSWORD'] + self.upyun_bucket = Figaro.env['RABEL_UPYUN_BUCKET'] + self.upyun_bucket_domain = Figaro.env['RABEL_UPYUN_BUCKET_DOMAIN'] process :resize_to_limit => [570, 0] diff --git a/config/application.yml.example b/config/application.yml.example index 80465d1a..4eeaa049 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -1,6 +1,9 @@ RAILS_ENV: 'production' RABEL_HOST_NAME: 'DOMAIN' RABEL_SYSTEM_EMAIL: 'hello@DOMAIN' +RABEL_MEMCACHED_SERVER: '127.0.0.1:11011' +RABEL_MEMCACHED_NAMESPACE: 'example' +SESSION_KEY: '_example_session' SECRET_TOKEN: '' RABEL_UPYUN_SWITCH: 'off' RABEL_UPYUN_OP_NAME: 'example' diff --git a/config/environments/production.rb b/config/environments/production.rb index 1a4cc6b2..10204474 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -37,7 +37,7 @@ # config.logger = SyslogLogger.new # Use a different cache store in production - config.cache_store = :dalli_store, ENV['RABEL_MEMCACHED_SERVER'], {:namespace => ENV['RABEL_MEMCACHED_NAMESPACE'], :compress => true} + config.cache_store = :dalli_store, Figaro.env['RABEL_MEMCACHED_SERVER'], {:namespace => Figaro.env['RABEL_MEMCACHED_NAMESPACE'], :compress => true} # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index e69b7178..67c68117 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -4,7 +4,7 @@ # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class with default "from" parameter. - config.mailer_sender = ENV['RABEL_SYSTEM_EMAIL'] + config.mailer_sender = Figaro.env['RABEL_SYSTEM_EMAIL'] # Configure the class responsible to send e-mails. # config.mailer = "Devise::Mailer" diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 5a8d7c37..57d2cfa2 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -4,4 +4,4 @@ # 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. -Rabel::Application.config.secret_token = ENV['SECRET_TOKEN'] +Rabel::Application.config.secret_token = Figaro.env['SECRET_TOKEN'] diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index f5e1fd0c..2341e320 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Rabel::Application.config.session_store :cookie_store, key: '_rabel_session' +Rabel::Application.config.session_store :cookie_store, key: Figaro.env['SESSION_KEY'] # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information