diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/environment.rb | 22 | ||||
-rw-r--r-- | config/initializers/session_store.rb | 2 | ||||
-rw-r--r-- | config/initializers/theme_loader.rb | 3 |
3 files changed, 13 insertions, 14 deletions
diff --git a/config/environment.rb b/config/environment.rb index 250d3eed0..3348ef92a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -29,7 +29,7 @@ load "util.rb" # without effecting method behaviour # and adds fallback gem call removed in https://github.com/rails/rails/commit/4c3725723f15fab0a424cb1318b82b460714b72f require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch') - +require 'configuration' # Application version ALAVETELI_VERSION = '0.6.6' @@ -78,8 +78,8 @@ Rails::Initializer.run do |config| end # See Rails::Configuration for more options - ENV['RECAPTCHA_PUBLIC_KEY'] = MySociety::Config::get("RECAPTCHA_PUBLIC_KEY", 'x'); - ENV['RECAPTCHA_PRIVATE_KEY'] = MySociety::Config::get("RECAPTCHA_PRIVATE_KEY", 'x'); + ENV['RECAPTCHA_PUBLIC_KEY'] = Configuration::recaptcha_public_key + ENV['RECAPTCHA_PRIVATE_KEY'] = Configuration::recaptcha_private_key end # Add new inflection rules using the following format @@ -98,22 +98,22 @@ end # The Rails cache is set up by the Interlock plugin to use memcached # Domain for URLs (so can work for scripts, not just web pages) -ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", 'localhost:3000') +ActionMailer::Base.default_url_options[:host] = Configuration::domain # So that javascript assets use full URL, so proxied admin URLs read javascript OK -if (MySociety::Config.get("DOMAIN", "") != "") +if (Configuration::domain != "") ActionController::Base.asset_host = Proc.new { |source, request| if ENV["RAILS_ENV"] != "test" && request.fullpath.match(/^\/admin\//) - MySociety::Config.get("ADMIN_PUBLIC_URL", "") + Configuration::admin_public_url else - MySociety::Config.get("DOMAIN", 'localhost:3000') + Configuration::domain end } end # fallback locale and available locales -available_locales = MySociety::Config.get('AVAILABLE_LOCALES', '').split(/ /) -default_locale = MySociety::Config.get('DEFAULT_LOCALE', '') +available_locales = Configuration::available_locales.split(/ /) +default_locale = Configuration::default_locale FastGettext.default_available_locales = available_locales I18n.locale = default_locale @@ -140,5 +140,5 @@ require 'world_foi_websites.rb' require 'alaveteli_external_command.rb' require 'quiet_opener.rb' -ExceptionNotification::Notifier.sender_address = MySociety::Config::get('EXCEPTION_NOTIFICATIONS_FROM') -ExceptionNotification::Notifier.exception_recipients = MySociety::Config::get('EXCEPTION_NOTIFICATIONS_TO') +ExceptionNotification::Notifier.sender_address = Configuration::exception_notifications_from +ExceptionNotification::Notifier.exception_recipients = Configuration::exception_notifications_to diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index a05d2c7d1..8cfa333f2 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -7,7 +7,7 @@ ActionController::Base.session = { :key => '_wdtk_cookie_session', - :secret => MySociety::Config.get("COOKIE_STORE_SESSION_SECRET", 'this default is insecure as code is open source, please override for live sites in config/general; this will do for local development') + :secret => Configuration::cookie_store_session_secret } ActionController::Base.session_store = :cookie_store diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index 8908dc07e..877149e9d 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -2,9 +2,8 @@ # It is used by our config/routes.rb to decide which route extension files to load. $alaveteli_route_extensions = [] -theme_urls = MySociety::Config.get("THEME_URLS", []) if ENV["RAILS_ENV"] != "test" # Don't let the themes interfere with Alaveteli specs - for url in theme_urls.reverse + for url in Configuration::theme_urls.reverse theme_name = url.sub(/.*\/(.*).git/, "\\1") theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ if File.exists? theme_main_include |