diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/boot.rb | 2 | ||||
-rw-r--r-- | config/crontab.ugly | 2 | ||||
-rw-r--r-- | config/initializers/theme_loader.rb | 6 | ||||
-rw-r--r-- | config/packages | 1 | ||||
-rw-r--r-- | config/purge-varnish-debian.ugly | 14 | ||||
-rw-r--r-- | config/routes.rb | 12 |
6 files changed, 25 insertions, 12 deletions
diff --git a/config/boot.rb b/config/boot.rb index 943029408..906a2bace 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -6,7 +6,7 @@ # better. Look for a config/rails_env file, and read stuff from there if # it exists. Put just a line like this in there: # ENV['RAILS_ENV'] = 'production' -rails_env_file = File.join(File.dirname(__FILE__), 'rails_env.rb') +rails_env_file = File.expand_path(File.join(File.dirname(__FILE__), 'rails_env.rb')) if File.exists?(rails_env_file) require rails_env_file end diff --git a/config/crontab.ugly b/config/crontab.ugly index 0bbcd2616..dc660e18f 100644 --- a/config/crontab.ugly +++ b/config/crontab.ugly @@ -13,7 +13,7 @@ MAILTO=cron-!!(*= $site *)!!@mysociety.org */5 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/change-xapian-database.lock "/data/vhost/!!(*= $vhost *)!!/!!(*= $vcspath *)!!/script/update-xapian-index verbose=true" >> /data/vhost/!!(*= $vhost *)!!/logs/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/purge-varnish check +5,15,25,35,45,55 * * * * !!(*= $user *)!! /etc/init.d/foi-purge-varnish check # Once an hour 09 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/alert-comment-on-request.lock /data/vhost/!!(*= $vhost *)!!/!!(*= $vcspath *)!!/script/alert-comment-on-request || echo "stalled?" diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index 4ddce6910..8908dc07e 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -1,5 +1,9 @@ +# This is a global array of route extensions. Alaveteli modules may add to it. +# 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 theme interfere with Alaveteli specs +if ENV["RAILS_ENV"] != "test" # Don't let the themes interfere with Alaveteli specs for url in theme_urls.reverse theme_name = url.sub(/.*\/(.*).git/, "\\1") theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ diff --git a/config/packages b/config/packages index 47d84a380..b59c61b47 100644 --- a/config/packages +++ b/config/packages @@ -33,3 +33,4 @@ libpq-dev uuid-dev ruby1.8-dev build-essential +bundler diff --git a/config/purge-varnish-debian.ugly b/config/purge-varnish-debian.ugly index 3e77c09c3..1a9259da8 100644 --- a/config/purge-varnish-debian.ugly +++ b/config/purge-varnish-debian.ugly @@ -6,11 +6,11 @@ # Required-Stop: $local_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: purge-varnish is a daemon running the Alaveteli email alerts -# Description: purge-varnish send Alaveteli email alerts as required +# Short-Description: purge-varnish is a daemon purging the Alaveteli varnish cache +# Description: purge-varnish purge the Alaveteli varnish cache ### END INIT INFO # -# !!(*= $daemon_name *)!! Start the Alaveteli email alert daemon +# !!(*= $daemon_name *)!! Start the Alaveteli email purge-varnish daemon NAME=!!(*= $daemon_name *)!! DAEMON=/data/vhost/!!(*= $vhost *)!!/alaveteli/script/runner @@ -42,7 +42,7 @@ case "$1" in quietly_start_daemon if [ $? -ne 1 ] then - echo "Alaveteli alert daemon was not running; now restarted" + echo "Alaveteli purge-varnish daemon was not running; now restarted" exit 1 else exit 0 @@ -50,17 +50,17 @@ case "$1" in ;; start) - echo -n "Starting Alaveteli alert daemon: $NAME" + echo -n "Starting Alaveteli purge-varnish daemon: $NAME" start_daemon ;; stop) - echo -n "Stopping Alaveteli alert daemon: $NAME" + echo -n "Stopping Alaveteli purge-varnish daemon: $NAME" stop_daemon ;; restart) - echo -n "Restarting Alaveteli alert daemon: $NAME" + echo -n "Restarting Alaveteli purge-varnish daemon: $NAME" stop_daemon start_daemon ;; diff --git a/config/routes.rb b/config/routes.rb index 0ba8139c2..814deb760 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,9 @@ # $Id: routes.rb,v 1.92 2009-10-14 22:01:27 francis Exp $ # Allow easy extension from themes. Note these will have the highest priority. -load File.join('config', 'custom-routes.rb') +$alaveteli_route_extensions.each do |f| + load File.join('config', f) +end ActionController::Routing::Routes.draw do |map| @@ -66,7 +68,13 @@ 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' - request.report '/request/:url_title/report', :action => 'report_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 + # mechanism, which assumes all post-login actions are available via GET, so we + # refrain. + request.report '/request/:url_title/report', :action => 'report_request' end |