added redis settings to config, changed config keys to uppercase
This commit is contained in:
committed by
Thomas Buchöster
parent
3a033eeec2
commit
2f8e936372
@@ -3,4 +3,6 @@ lastfm_api_key: ""
|
||||
facebook:
|
||||
app_id: ""
|
||||
secret: ""
|
||||
request_timeout: ""
|
||||
redis:
|
||||
development: ""
|
||||
production: ""
|
||||
@@ -3,10 +3,10 @@ if Rails.env !=~ /production/
|
||||
APP_CONFIG.each do |key, value|
|
||||
if value.is_a?(Hash)
|
||||
value.each do |k,v|
|
||||
ENV["#{key}_#{k}"] = v
|
||||
ENV["#{key}_#{k}".upcase] = v
|
||||
end
|
||||
else
|
||||
ENV[key] = value
|
||||
ENV[(key.upcase)] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -185,10 +185,10 @@ Devise.setup do |config|
|
||||
|
||||
# Facebook-Setting for Heroku
|
||||
if Rails.env =~ /production/
|
||||
config.omniauth :facebook, ENV['facebook_app_id'], ENV['facebook_secret']
|
||||
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
||||
{:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
|
||||
else
|
||||
config.omniauth :facebook, ENV['facebook_app_id'], ENV['facebook_secret']
|
||||
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
||||
end
|
||||
|
||||
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
ActionDispatch::Callbacks.to_prepare do
|
||||
LastFM::Request::api_key = ENV['lastfm_api_key']
|
||||
LastFM::Request::api_key = ENV['LASTFM_API_KEY']
|
||||
end
|
||||
@@ -1,8 +1,9 @@
|
||||
$redis = Redis.new(:host => 'localhost', :port => 6379)
|
||||
uri = Rails.env ==~ /production/ ? URI.parse(ENV['REDIS_PRODUCTION']) : URI.parse(ENV['REDIS_DEVELOPMENT'])
|
||||
$redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
|
||||
|
||||
begin
|
||||
$redis.ping
|
||||
puts "=> Established connection to redis server"
|
||||
puts "=> Established connection to redis server on '#{uri.host}' (port #{uri.port})!"
|
||||
rescue
|
||||
puts "=> CAUTION: cound not establish connection to redis server! Check settings in initializer!"
|
||||
puts "=> CAUTION: cound not establish connection to redis server on '#{uri.host}' (port #{uri.port})! Check settings in initializer!"
|
||||
end
|
||||
@@ -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.
|
||||
Nineminutes::Application.config.secret_token = ENV['secret_token']
|
||||
Nineminutes::Application.config.secret_token = ENV['SECRET_TOKEN']
|
||||
|
||||
Reference in New Issue
Block a user