aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/database.yml-test4
-rw-r--r--config/httpd.conf13
-rw-r--r--config/packages4
-rw-r--r--config/routes.rb6
4 files changed, 24 insertions, 3 deletions
diff --git a/config/database.yml-test b/config/database.yml-test
new file mode 100644
index 000000000..ff6e2013a
--- /dev/null
+++ b/config/database.yml-test
@@ -0,0 +1,4 @@
+test:
+ adapter: postgresql
+ database: foi_test
+ username: postgres
diff --git a/config/httpd.conf b/config/httpd.conf
index 3bbe50fb3..6428a2006 100644
--- a/config/httpd.conf
+++ b/config/httpd.conf
@@ -32,6 +32,19 @@ RequestHeader add X-Forwarded-User %{RU}e
# files for archiving.
RewriteRule /files/(.+) http://files.whatdotheyknow.com/$1
+# Serve attachments directly from the cache, if possible.
+#
+# The file names are URL-encoded on disk, and sharded by the first
+# three digits of the request id, which is why this is as complicated
+# as it is. The RewriteMap directive makes the URL-escaping function
+# available to use in the other directives.
+#
+# The condition means that the rule will fire only if the cached
+# file exists.
+RewriteMap escape int:escape
+RewriteCond %{DOCUMENT_ROOT}/views_cache/request/$2/$1/${escape:$3} -f
+RewriteRule ^/request/((\d{1,3})\d*)/(response/\d+/attach/\d+/.+) /views_cache/request/$2/$1/${escape:$3} [L]
+
<IfModule mod_passenger.c>
# Set this to something like 100 if you have memory leak issues
PassengerMaxRequests 20
diff --git a/config/packages b/config/packages
index b59c61b47..d059d2906 100644
--- a/config/packages
+++ b/config/packages
@@ -8,7 +8,7 @@ rdoc
irb
wv
poppler-utils
-pdftk (> 1.41+dfsg-1) | pdftk (< 1.41+dfsg-1) # that version has a non-functionining uncompress option
+pdftk (>> 1.41+dfsg-1) | pdftk (<< 1.41+dfsg-1) # that version has a non-functionining uncompress option
gs-gpl
catdoc
links
@@ -32,5 +32,7 @@ libmagickwand-dev
libpq-dev
uuid-dev
ruby1.8-dev
+rubygems
+rake
build-essential
bundler
diff --git a/config/routes.rb b/config/routes.rb
index 13ab6669e..a9c2c889a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -244,8 +244,10 @@ ActionController::Routing::Routes.draw do |map|
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_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')