diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/environment.rb | 11 | ||||
-rw-r--r-- | config/general.yml-example | 13 | ||||
-rw-r--r-- | config/routes.rb | 22 | ||||
-rw-r--r-- | config/test.yml | 9 |
4 files changed, 11 insertions, 44 deletions
diff --git a/config/environment.rb b/config/environment.rb index 7ffbe8701..268a44e65 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -117,17 +117,6 @@ end # 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 diff --git a/config/general.yml-example b/config/general.yml-example index 406fe69fa..6bf54f400 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -99,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/routes.rb b/config/routes.rb index c0e79f2cd..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: @@ -43,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' @@ -64,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 @@ -161,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| @@ -218,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' @@ -237,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' |