diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 5 | ||||
-rw-r--r-- | config/database.yml-example | 2 | ||||
-rw-r--r-- | config/httpd.conf-example | 2 | ||||
-rw-r--r-- | config/initializers/alaveteli.rb | 11 | ||||
-rw-r--r-- | config/initializers/secret_token.rb | 7 | ||||
-rw-r--r-- | config/packages | 3 |
6 files changed, 22 insertions, 8 deletions
diff --git a/config/application.rb b/config/application.rb index f5b525a36..92fd30685 100644 --- a/config/application.rb +++ b/config/application.rb @@ -55,8 +55,11 @@ module Alaveteli # will be in this time zone config.time_zone = ::AlaveteliConfiguration::time_zone - config.after_initialize do + config.after_initialize do |app| require 'routing_filters.rb' + # Add a catch-all route to force routing errors to be handled by the application, + # rather than by middleware. + app.routes.append{ match '*path', :to => 'general#not_found' } end config.autoload_paths << "#{Rails.root.to_s}/lib/mail_handler" diff --git a/config/database.yml-example b/config/database.yml-example index b1597e6fe..e48577f23 100644 --- a/config/database.yml-example +++ b/config/database.yml-example @@ -19,6 +19,8 @@ test: password: <password> host: localhost port: 5432 +# Uncomment the following if the user is not a postgres superuser +# constraint_disabling: false production: adapter: postgresql diff --git a/config/httpd.conf-example b/config/httpd.conf-example index 0115ad8d9..06170a5e2 100644 --- a/config/httpd.conf-example +++ b/config/httpd.conf-example @@ -51,7 +51,7 @@ RewriteRule ^/request/((\d{1,3})\d*)/(response/\d+/attach/(html/)?\d+/.+) /views # Recommend setting this to 3 or less on servers with 512MB RAM PassengerMaxPoolSize 6 # The RackEnv variable applies to Rails 3 applications, while - # the RailsEnv variable applies to applicatoins for earlier + # the RailsEnv variable applies to applications for earlier # versions of Rails. There doesn't seem to be any harm in # setting both, however. RailsEnv production diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 35d486837..263e5cf7b 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -43,15 +43,11 @@ I18n.locale = default_locale I18n.available_locales = available_locales.map {|locale_name| locale_name.to_sym} I18n.default_locale = default_locale -# Customise will_paginate URL generation -WillPaginate::ViewHelpers.pagination_options[:renderer] = 'WillPaginateExtension::LinkRenderer' - # Load monkey patches and other things from lib/ require 'ruby19.rb' require 'activesupport_cache_extensions.rb' require 'use_spans_for_errors.rb' require 'activerecord_errors_extensions.rb' -require 'willpaginate_extension.rb' require 'i18n_fixes.rb' require 'world_foi_websites.rb' require 'alaveteli_external_command.rb' @@ -59,3 +55,10 @@ require 'quiet_opener.rb' require 'mail_handler' require 'public_body_categories' require 'ability' +require 'normalize_string' +require 'alaveteli_file_types' + +# Allow tests to be run under a non-superuser database account if required +if Rails.env == 'test' and ActiveRecord::Base.configurations['test']['constraint_disabling'] == false + require 'no_constraint_disabling' +end diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index f82348169..d120b94ae 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -4,4 +4,9 @@ # 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. -Alaveteli::Application.config.secret_token = AlaveteliConfiguration::cookie_store_session_secret + +# Just plopping an extra character on the secret_token so that any sessions on upgrading from +# Rails 2 to Rails 3 version of Alaveteli are invalidated. +# See http://blog.carbonfive.com/2011/03/19/rails-3-upgrade-tip-invalidate-session-cookies/ + +Alaveteli::Application.config.secret_token = "3" + AlaveteliConfiguration::cookie_store_session_secret diff --git a/config/packages b/config/packages index db51e5bdd..fc67cda6b 100644 --- a/config/packages +++ b/config/packages @@ -36,4 +36,5 @@ rake (>= 0.9.2.2) build-essential bundler sqlite3 -libsqlite3-dev
\ No newline at end of file +libsqlite3-dev +libicu-dev |