diff options
Diffstat (limited to 'config')
-rwxr-xr-x[-rw-r--r--] | config/alert-tracks-debian.ugly | 2 | ||||
-rw-r--r-- | config/crontab-example | 28 | ||||
-rw-r--r-- | config/database.yml-example | 10 | ||||
-rw-r--r-- | config/database.yml-test | 1 | ||||
-rw-r--r-- | config/deploy.rb | 2 | ||||
-rw-r--r-- | config/general.yml-example | 5 | ||||
-rw-r--r-- | config/httpd.conf-example | 2 | ||||
-rw-r--r-- | config/initializers/alaveteli.rb | 1 | ||||
-rw-r--r-- | config/packages | 1 | ||||
-rw-r--r-- | config/packages.debian-squeeze | 1 | ||||
-rw-r--r-- | config/packages.debian-wheezy | 36 | ||||
-rw-r--r-- | config/packages.ubuntu-precise | 1 | ||||
-rw-r--r-- | config/purge-varnish-debian.ugly | 2 | ||||
-rw-r--r-- | config/routes.rb | 5 | ||||
-rw-r--r-- | config/varnish-alaveteli.vcl | 2 |
15 files changed, 73 insertions, 26 deletions
diff --git a/config/alert-tracks-debian.ugly b/config/alert-tracks-debian.ugly index 29a350a0e..c7d82d8c8 100644..100755 --- a/config/alert-tracks-debian.ugly +++ b/config/alert-tracks-debian.ugly @@ -16,7 +16,7 @@ NAME=!!(*= $daemon_name *)!! DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner DAEMON_ARGS="--daemon TrackMailer.alert_tracks_loop" PIDFILE=!!(*= $vhost_dir *)!!/alert-tracks.pid -LOGFILE=!!(*= $vhost_dir *)!!/logs/alert-tracks.log +LOGFILE=!!(*= $vhost_dir *)!!/alaveteli/log/alert-tracks.log DUSER=!!(*= $user *)!! # Set RAILS_ENV - not needed if using config/rails_env.rb # RAILS_ENV=your_rails_env diff --git a/config/crontab-example b/config/crontab-example index 8fe13151b..79ba70beb 100644 --- a/config/crontab-example +++ b/config/crontab-example @@ -5,32 +5,32 @@ # Email: hello@mysociety.org. WWW: http://www.mysociety.org/ PATH=/usr/local/bin:/usr/bin:/bin -MAILTO=cron-!!(*= $site *)!!@mysociety.org +MAILTO=!!(*= $mailto *)!! # Every 5 minutes -*/5 * * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-xapian-index verbose=true" >> !!(*= $vhost_dir *)!!/logs/update-xapian-index.log || echo "stalled?" +*/5 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-xapian-index verbose=true" >> !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/log/update-xapian-index.log || echo "stalled?" # Every 10 minutes 5,15,25,35,45,55 * * * * !!(*= $user *)!! /etc/init.d/foi-alert-tracks check 5,15,25,35,45,55 * * * * !!(*= $user *)!! /etc/init.d/foi-purge-varnish check -0,10,20,30,40,50 * * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/send-batch-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/send-batch-requests || echo "stalled?" +0,10,20,30,40,50 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/send-batch-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/send-batch-requests || echo "stalled?" # Once an hour -09 * * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/alert-comment-on-request.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-comment-on-request || echo "stalled?" +09 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-comment-on-request.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-comment-on-request || echo "stalled?" # Only root can read the log files -31 * * * * root run-with-lockfile -n !!(*= $vhost_dir *)!!/load-mail-server-logs.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/load-mail-server-logs || echo "stalled?" +31 * * * * root !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/load-mail-server-logs.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/load-mail-server-logs || echo "stalled?" # Once a day, early morning -23 4 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/delete-old-things.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/delete-old-things || echo "stalled?" -0 6 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/alert-overdue-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-overdue-requests || echo "stalled?" -0 7 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/alert-new-response-reminders.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-new-response-reminders || echo "stalled?" -0 8 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/alert-not-clarified-request.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-not-clarified-request || echo "stalled?" -2 4 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/check-recent-requests-sent.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/check-recent-requests-sent || echo "stalled?" -45 3 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/stop-new-responses-on-old-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/stop-new-responses-on-old-requests || echo "stalled?" -55 4 * * * !!(*= $user *)!! run-with-lockfile -n !!(*= $vhost_dir *)!!/update-public-body-stats.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-public-body-stats || echo "stalled?" +23 4 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/delete-old-things.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/delete-old-things || echo "stalled?" +0 6 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-overdue-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-overdue-requests || echo "stalled?" +0 7 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-new-response-reminders.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-new-response-reminders || echo "stalled?" +0 8 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-not-clarified-request.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-not-clarified-request || echo "stalled?" +2 4 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/check-recent-requests-sent.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/check-recent-requests-sent || echo "stalled?" +45 3 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/stop-new-responses-on-old-requests.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/stop-new-responses-on-old-requests || echo "stalled?" +55 4 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/update-public-body-stats.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-public-body-stats || echo "stalled?" # Only root can restart apache -31 1 * * * root run-with-lockfile -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/compact-xapian-database production" || echo "stalled?" +31 1 * * * root !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/compact-xapian-database production" || echo "stalled?" # Once a day on all servers @@ -38,7 +38,7 @@ MAILTO=cron-!!(*= $site *)!!@mysociety.org 48 2 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/user-use-graph # Once a year :) -0 0 1 11 * !!(*= $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 public holidays for the Freedom of Information site, thank you." diff --git a/config/database.yml-example b/config/database.yml-example index e48577f23..126e5a264 100644 --- a/config/database.yml-example +++ b/config/database.yml-example @@ -3,7 +3,8 @@ development: adapter: postgresql - database: foi_development + template: template_utf8 + database: alaveteli_development username: <username> password: <password> host: localhost @@ -14,7 +15,8 @@ development: # Do not set this db to the same as development or production. test: adapter: postgresql - database: foi_test + template: template_utf8 + database: alaveteli_test username: <username> password: <password> host: localhost @@ -24,9 +26,9 @@ test: production: adapter: postgresql - database: foi_production + template: template_utf8 + database: alaveteli_production username: <username> password: <password> host: localhost port: 5432 - diff --git a/config/database.yml-test b/config/database.yml-test index ff6e2013a..64eafd82d 100644 --- a/config/database.yml-test +++ b/config/database.yml-test @@ -1,4 +1,5 @@ test: adapter: postgresql + template: template_utf8 database: foi_test username: postgres diff --git a/config/deploy.rb b/config/deploy.rb index c73d16f53..9cc847dba 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -56,6 +56,7 @@ namespace :deploy do "#{release_path}/public/foi-user-use.png" => "#{shared_path}/foi-user-use.png", "#{release_path}/files" => "#{shared_path}/files", "#{release_path}/cache" => "#{shared_path}/cache", + "#{release_path}/log" => "#{shared_path}/log", "#{release_path}/lib/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs", } @@ -66,6 +67,7 @@ namespace :deploy do after 'deploy:setup' do run "mkdir -p #{shared_path}/files" run "mkdir -p #{shared_path}/cache" + run "mkdir -p #{shared_path}/log" run "mkdir -p #{shared_path}/xapiandbs" end end diff --git a/config/general.yml-example b/config/general.yml-example index 6e223406e..a6f68c52e 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -26,7 +26,7 @@ ISO_COUNTRY_CODE: GB TIME_ZONE: Australia/Sydney # These feeds are displayed accordingly on the Alaveteli "blog" page: -BLOG_FEED: 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/' +BLOG_FEED: 'https://www.mysociety.org/category/projects/whatdotheyknow/feed/' TWITTER_USERNAME: 'whatdotheyknow' # Set the widget_id to get the Twitter sidebar on the blog page. # To get one https://twitter.com/settings/widgets @@ -245,6 +245,7 @@ SHARED_DIRECTORIES: - files/ - cache/ - lib/acts_as_xapian/xapiandbs/ + - log/ - vendor/bundle - public/assets @@ -255,4 +256,4 @@ SHARED_DIRECTORIES: ALLOW_BATCH_REQUESTS: false # Should we use the responsive stylesheets? -RESPONSIVE_STYLING: false +RESPONSIVE_STYLING: true diff --git a/config/httpd.conf-example b/config/httpd.conf-example index dc2e4966e..8d549d363 100644 --- a/config/httpd.conf-example +++ b/config/httpd.conf-example @@ -16,7 +16,7 @@ RewriteEngine On #RewriteLog /var/log/apache2/rewrite.log #RewriteLogLevel 9 -# XXX do we need this now we use Passenger? +# TODO: do we need this now we use Passenger? # Pass through the HTTP basic authentication to mongrel. See also # admin_http_auth_user in app/controllers/application.rb # Note: Apache 2 only. Doesn't work in Apache 1.3, you'll need to live without diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 6fb6b1420..d9879b5d1 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -53,6 +53,7 @@ require 'message_prominence' require 'theme' require 'xapian_queries' require 'date_quarter' +require 'public_body_csv' AlaveteliLocalization.set_locales(AlaveteliConfiguration::available_locales, AlaveteliConfiguration::default_locale) diff --git a/config/packages b/config/packages index 9a07c5f20..fda09cbc1 100644 --- a/config/packages +++ b/config/packages @@ -39,3 +39,4 @@ sqlite3 libsqlite3-dev libicu-dev memcached +ttf-bitstream-vera diff --git a/config/packages.debian-squeeze b/config/packages.debian-squeeze index 6cdf2f9d6..d82d66324 100644 --- a/config/packages.debian-squeeze +++ b/config/packages.debian-squeeze @@ -37,3 +37,4 @@ libsqlite3-dev libicu-dev postgresql postgresql-client +ttf-bitstream-vera diff --git a/config/packages.debian-wheezy b/config/packages.debian-wheezy new file mode 100644 index 000000000..509cde56e --- /dev/null +++ b/config/packages.debian-wheezy @@ -0,0 +1,36 @@ +ruby1.9.3 +wv +poppler-utils +pdftk +ghostscript +catdoc +links +elinks +unrtf +xlhtml +xapian-tools +gnuplot-nox +php5-cli +sharutils +unzip +mutt +tnef +gettext +python-yaml +wkhtmltopdf-static +libmagic-dev +libmagickwand-dev +libpq-dev +libxml2-dev +libxslt-dev +uuid-dev +ruby-dev +rubygems +rake +build-essential +bundler +sqlite3 +libsqlite3-dev +libicu-dev +postgresql +postgresql-client diff --git a/config/packages.ubuntu-precise b/config/packages.ubuntu-precise index 177d504e2..68911359a 100644 --- a/config/packages.ubuntu-precise +++ b/config/packages.ubuntu-precise @@ -33,3 +33,4 @@ libsqlite3-dev libicu-dev postgresql postgresql-client +ttf-bitstream-vera diff --git a/config/purge-varnish-debian.ugly b/config/purge-varnish-debian.ugly index 3f11344f2..ebd4d9e5c 100644 --- a/config/purge-varnish-debian.ugly +++ b/config/purge-varnish-debian.ugly @@ -16,7 +16,7 @@ NAME=!!(*= $daemon_name *)!! DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner DAEMON_ARGS="--daemon PurgeRequest.purge_all_loop" PIDFILE=!!(*= $vhost_dir *)!!/purge-varnish.pid -LOGFILE=!!(*= $vhost_dir *)!!/logs/purge-varnish.log +LOGFILE=!!(*= $vhost_dir *)!!/alaveteli/log/purge-varnish.log DUSER=!!(*= $user *)!! # Set RAILS_ENV - not needed if using config/rails_env.rb # RAILS_ENV=your_rails_env diff --git a/config/routes.rb b/config/routes.rb index d9d21f0bd..9f426fabf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,7 +16,7 @@ Alaveteli::Application.routes.draw do match '/blog' => 'general#blog', :as => :blog match '/search' => 'general#search_redirect', :as => :search_redirect match '/search/all' => 'general#search_redirect', :as => :search_redirect - # XXX combined is the search query, and then if sorted a "/newest" at the end. + # `combined` is the search query, and then if sorted a "/newest" at the end. # Couldn't find a way to do this in routes which also picked up multiple other slashes # and dots and other characters that can appear in search query. So we sort it all # out in the controller. @@ -130,7 +130,7 @@ Alaveteli::Application.routes.draw do match '/:feed/list/:view' => 'track#track_list', :as => :track_list, :view => nil, :feed => /(track|feed)/ match '/:feed/body/:url_name' => 'track#track_public_body', :as => :track_public_body, :feed => /(track|feed)/ match '/:feed/user/:url_name' => 'track#track_user', :as => :track_user, :feed => /(track|feed)/ - # XXX :format doesn't work. See hacky code in the controller that makes up for this. + # TODO: :format doesn't work. See hacky code in the controller that makes up for this. match '/:feed/search/:query_array' => 'track#track_search_query', :as => :track_search, :feed => /(track|feed)/, @@ -261,6 +261,7 @@ Alaveteli::Application.routes.draw do match '/api/v2/request/:id.json' => 'api#show_request', :as => :api_show_request, :via => :get match '/api/v2/request/:id.json' => 'api#add_correspondence', :as => :api_add_correspondence, :via => :post + match '/api/v2/request/:id/update.json' => 'api#update_state', :as => :api_update_state, :via => :post match '/api/v2/body/:id/request_events.:feed_type' => 'api#body_request_events', :as => :api_body_request_events, :feed_type => '^(json|atom)$' #### diff --git a/config/varnish-alaveteli.vcl b/config/varnish-alaveteli.vcl index 5dd0ac83c..d3726682c 100644 --- a/config/varnish-alaveteli.vcl +++ b/config/varnish-alaveteli.vcl @@ -92,7 +92,7 @@ sub vcl_recv { # ban lists, see # http://kristianlyng.wordpress.com/2010/07/28/smart-bans-with-varnish/ - # XXX in Varnish 2.x, the following would be + # TODO: in Varnish 2.x, the following would be # purge("obj.http.x-url ~ " req.url); ban("obj.http.x-url ~ " + req.url); error 200 "Banned"; |