aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/crontab.ugly2
-rw-r--r--config/deploy.rb4
-rw-r--r--config/environment.rb25
-rw-r--r--config/general.yml-example18
-rw-r--r--config/initializers/fast_gettext.rb2
-rw-r--r--config/memcached.yml-example15
-rw-r--r--config/memcached.yml-test2
-rw-r--r--config/packages3
-rw-r--r--config/routes.rb25
-rw-r--r--config/test.yml9
10 files changed, 28 insertions, 77 deletions
diff --git a/config/crontab.ugly b/config/crontab.ugly
index 894b464cf..ef3455113 100644
--- a/config/crontab.ugly
+++ b/config/crontab.ugly
@@ -35,7 +35,7 @@ MAILTO=cron-!!(*= $site *)!!@mysociety.org
48 2 * * * !!(*= $user *)!! /data/vhost/!!(*= $vhost *)!!/!!(*= $vcspath *)!!/script/user-use-graph
# Once a year :)
-@yearly !!(*= $user *)!! /bin/echo "A year has passed, please update the bank holidays for the Freedom of Information site, thank you."
+0 0 1 11 * !!(*= $user *)!! /bin/echo "A year has passed, please update the bank holidays for the Freedom of Information site, thank you."
diff --git a/config/deploy.rb b/config/deploy.rb
index 5c7c181c9..5e660434a 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -19,7 +19,7 @@ server configuration['server'], :app, :web, :db, :primary => true
namespace :rake do
namespace :themes do
task :install do
- run "cd #{release_path} && bundle exec rake themes:install RAILS_ENV=#{rails_env}"
+ run "cd #{latest_release} && bundle exec rake themes:install RAILS_ENV=#{rails_env}"
end
end
end
@@ -48,9 +48,9 @@ namespace :deploy do
links = {
"#{release_path}/config/database.yml" => "#{shared_path}/database.yml",
"#{release_path}/config/general.yml" => "#{shared_path}/general.yml",
- "#{release_path}/config/memcached.yml" => "#{shared_path}/memcached.yml",
"#{release_path}/config/rails_env.rb" => "#{shared_path}/rails_env.rb",
"#{release_path}/config/newrelic.yml" => "#{shared_path}/newrelic.yml",
+ "#{release_path}/config/aliases" => "#{shared_path}/aliases",
"#{release_path}/public/foi-live-creation.png" => "#{shared_path}/foi-live-creation.png",
"#{release_path}/public/foi-user-use.png" => "#{shared_path}/foi-user-use.png",
"#{release_path}/public/favicon.ico" => "#{shared_path}/favicon.ico",
diff --git a/config/environment.rb b/config/environment.rb
index 492446a43..4621c6a02 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -9,6 +9,8 @@ if RUBY_VERSION.to_f >= 1.9
require 'active_support/inflector'
# Activate warning messages again.
$VERBOSE = original_verbose
+ require 'yaml'
+ YAML::ENGINE.yamler = "syck"
end
# Uncomment below to force Rails into production mode when
@@ -16,7 +18,7 @@ end
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.17' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -41,7 +43,7 @@ require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch')
require 'configuration'
# Application version
-ALAVETELI_VERSION = '0.6.8'
+ALAVETELI_VERSION = '0.7'
Rails::Initializer.run do |config|
# Load intial mySociety config
@@ -92,6 +94,8 @@ Rails::Initializer.run do |config|
require 'routing_filters.rb'
end
+ config.autoload_paths << "#{RAILS_ROOT}/lib/mail_handler"
+
# See Rails::Configuration for more options
ENV['RECAPTCHA_PUBLIC_KEY'] = Configuration::recaptcha_public_key
ENV['RECAPTCHA_PRIVATE_KEY'] = Configuration::recaptcha_private_key
@@ -110,22 +114,9 @@ end
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register "application/x-mobile", :mobile
-# 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] = Configuration::domain
-# So that javascript assets use full URL, so proxied admin URLs read javascript OK
-if (Configuration::domain != "")
- ActionController::Base.asset_host = Proc.new { |source, request|
- if ENV["RAILS_ENV"] != "test" && request.fullpath.match(/^\/admin\//)
- Configuration::admin_public_url
- else
- Configuration::domain
- end
- }
-end
-
# fallback locale and available locales
available_locales = Configuration::available_locales.split(/ /)
default_locale = Configuration::default_locale
@@ -140,20 +131,18 @@ WillPaginate::ViewHelpers.pagination_options[:renderer] = 'WillPaginateExtension
# Load monkey patches and other things from lib/
require 'ruby19.rb'
-require 'tmail_extensions.rb'
require 'activesupport_cache_extensions.rb'
require 'timezone_fixes.rb'
require 'use_spans_for_errors.rb'
-require 'make_html_4_compliant.rb'
require 'activerecord_errors_extensions.rb'
require 'willpaginate_extension.rb'
require 'sendmail_return_path.rb'
-require 'tnef.rb'
require 'i18n_fixes.rb'
require 'rack_quote_monkeypatch.rb'
require 'world_foi_websites.rb'
require 'alaveteli_external_command.rb'
require 'quiet_opener.rb'
+require 'mail_handler'
if !Configuration.exception_notifications_from.blank? && !Configuration.exception_notifications_to.blank?
ExceptionNotification::Notifier.sender_address = Configuration::exception_notifications_from
diff --git a/config/general.yml-example b/config/general.yml-example
index fd134b0c2..6bf54f400 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -32,6 +32,10 @@ AVAILABLE_LOCALES: 'en es'
DEFAULT_LOCALE: 'en'
USE_DEFAULT_BROWSER_LANGUAGE: true
+# If you don't want the default locale to be included in URLs generated
+# by the application, set this to false
+INCLUDE_DEFAULT_LOCALE_IN_URLS: true
+
# How many days should have passed before an answer to a request is officially late?
REPLY_LATE_AFTER_DAYS: 20
REPLY_VERY_LATE_AFTER_DAYS: 40
@@ -49,7 +53,6 @@ FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
# script). Earlier in the list means the templates have a higher
# priority.
THEME_URLS:
- - 'git://github.com/mysociety/adminbootstraptheme.git'
- 'git://github.com/mysociety/alavetelitheme.git'
# When rails-post-deploy installs the themes it will try this branch first
@@ -96,19 +99,6 @@ TRACK_SENDER_NAME: 'Alaveteli Webmaster'
# this up!
RAW_EMAILS_LOCATION: 'files/raw_emails'
-# The base URL for admin pages, must always end with a '/'
-# e.g. https://www.example.com/secure/alaveteli-admin/
-# If not specified, it will default to the path to the admin controller,
-# which is usually what you want. It is useful in situations where admin
-# requests are proxied via a secure server, for example.
-ADMIN_BASE_URL: ''
-
-# Where /stylesheets sits under for admin pages. See asset_host in
-# config/environment.rb. Can be full domain or relative path (not an
-# absolute path beginning with /). Again, unlikely to want to change
-# this.
-ADMIN_PUBLIC_URL: ''
-
# Secret key for signing cookie_store sessions
COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'
diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb
index 2ecf5cb5d..1cd6440e4 100644
--- a/config/initializers/fast_gettext.rb
+++ b/config/initializers/fast_gettext.rb
@@ -3,4 +3,4 @@ FastGettext.default_text_domain = 'app'
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
-
+RoutingFilter::Locale.include_default_locale = Configuration::include_default_locale_in_urls \ No newline at end of file
diff --git a/config/memcached.yml-example b/config/memcached.yml-example
deleted file mode 100644
index e5d486674..000000000
--- a/config/memcached.yml-example
+++ /dev/null
@@ -1,15 +0,0 @@
-defaults:
- namespace: whatdotheyknow
- sessions: false
- client: memcache-client
-development:
- disabled: true
- # servers:
- # - 127.0.0.1:11211 # Default host and port
-production:
- servers:
- - 127.0.0.1:11211 # Default host and port
- # debug: true
- # memory: 256
- # benchmarking: false
-
diff --git a/config/memcached.yml-test b/config/memcached.yml-test
deleted file mode 100644
index 18d959876..000000000
--- a/config/memcached.yml-test
+++ /dev/null
@@ -1,2 +0,0 @@
-test:
- disabled: true \ No newline at end of file
diff --git a/config/packages b/config/packages
index ded8dc9a5..db51e5bdd 100644
--- a/config/packages
+++ b/config/packages
@@ -23,7 +23,6 @@ unzip
wdg-html-validator
mutt
tnef (>= 1.4.5)
-memcached
gettext
python-yaml
wkhtmltopdf-static
@@ -33,7 +32,7 @@ libpq-dev
uuid-dev
ruby1.8-dev
rubygems
-rake
+rake (>= 0.9.2.2)
build-essential
bundler
sqlite3
diff --git a/config/routes.rb b/config/routes.rb
index 5fc0075a4..adc8663c5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -10,7 +10,7 @@ $alaveteli_route_extensions.each do |f|
end
ActionController::Routing::Routes.draw do |map|
-
+
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
@@ -32,8 +32,6 @@ ActionController::Routing::Routes.draw do |map|
general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true
general.random_request '/random', :action => 'random_request'
-
- general.fai_test '/test', :action => 'fai_test'
end
map.with_options :controller => 'request' do |request|
@@ -45,7 +43,7 @@ ActionController::Routing::Routes.draw do |map|
request.request_list '/list', :action => 'list'
request.select_authority '/select_authority', :action => 'select_authority'
-
+
request.new_request '/new', :action => 'new'
request.new_request_to_body '/new/:url_name', :action => 'new'
@@ -66,7 +64,7 @@ ActionController::Routing::Routes.draw do |map|
request.upload_response "/upload/request/:url_title", :action => 'upload_response'
request.download_entire_request '/request/:url_title/download', :action => 'download_entire_request'
-
+
# It would be nice to add :conditions => { :method => :post } to this next one,
# because it ought not really to be available as a GET request since it changes
# the server state. Unfortunately this doesn’t play well with the PostRedirect
@@ -163,9 +161,9 @@ ActionController::Routing::Routes.draw do |map|
end
map.with_options :controller => 'request_game' do |game|
- game.play '/categorise/play', :action => 'play'
- game.request '/categorise/request/:url_title', :action => 'show'
- game.stop '/categorise/stop', :action => 'stop'
+ game.categorise_play '/categorise/play', :action => 'play'
+ game.categorise_request '/categorise/request/:url_title', :action => 'show'
+ game.categorise_stop '/categorise/stop', :action => 'stop'
end
map.with_options :controller => 'admin_public_body' do |body|
@@ -187,6 +185,7 @@ ActionController::Routing::Routes.draw do |map|
admin.admin_timeline '/admin/timeline', :action => 'timeline'
admin.admin_debug '/admin/debug', :action => 'debug'
admin.admin_stats '/admin/stats', :action => 'stats'
+ admin.admin_js '/admin/javascripts/admin.js', :action => 'admin_js'
end
map.with_options :controller => 'admin_request' do |admin|
@@ -219,7 +218,7 @@ ActionController::Routing::Routes.draw do |map|
user.admin_user_list_banned '/admin/user/banned', :action => 'list_banned'
user.admin_user_show '/admin/user/show/:id', :action => 'show'
user.admin_user_edit '/admin/user/edit/:id', :action => 'edit'
- user.admin_user_show '/admin/user/show_bounce_message/:id', :action => 'show_bounce_message'
+ user.admin_user_show_bounce '/admin/user/show_bounce_message/:id', :action => 'show_bounce_message'
user.admin_user_update '/admin/user/update/:id', :action => 'update'
user.admin_user_clear_bounce '/admin/user/clear_bounce/:id', :action => 'clear_bounce'
user.admin_user_destroy_track '/admin/user/destroy_track', :action => 'destroy_track'
@@ -238,16 +237,16 @@ ActionController::Routing::Routes.draw do |map|
rule.admin_rule_update '/admin/censor/update/:id', :action => 'update'
rule.admin_rule_destroy '/admin/censor/destroy/:censor_rule_id', :action => 'destroy'
end
-
+
map.with_options :controller => 'api' do |api|
api.api_create_request '/api/v2/request.json', :action => 'create_request', :conditions => { :method => :post }
-
+
api.api_show_request '/api/v2/request/:id.json', :action => 'show_request', :conditions => { :method => :get }
api.api_add_correspondence '/api/v2/request/:id.json', :action => 'add_correspondence', :conditions => { :method => :post }
-
+
api.api_body_request_events '/api/v2/body/:id/request_events.:feed_type', :action => 'body_request_events', :feed_type => '^(json|atom)$'
end
-
+
map.filter('conditionallyprependlocale')
# Allow downloading Web Service WSDL as a file with an extension
diff --git a/config/test.yml b/config/test.yml
index ef270dcf2..f40b11764 100644
--- a/config/test.yml
+++ b/config/test.yml
@@ -71,15 +71,6 @@ CONTACT_NAME: 'Alaveteli Webmaster'
# this up!
RAW_EMAILS_LOCATION: 'files/raw_emails'
-# The base URL for admin pages. You probably don't want to change this.
-ADMIN_BASE_URL: ''
-
-# Where /stylesheets sits under for admin pages. See asset_host in
-# config/environment.rb. Can be full domain or relative path (not an
-# absolute path beginning with /). Again, unlikely to want to change
-# this.
-ADMIN_PUBLIC_URL: ''
-
# Secret key for signing cookie_store sessions
COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'