aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/application.rb1
-rw-r--r--config/environments/development.rb10
-rw-r--r--config/general.yml-example13
3 files changed, 24 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index 472077f06..a16e5eb0a 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -77,6 +77,7 @@ module Alaveteli
ENV['RECAPTCHA_PUBLIC_KEY'] = ::AlaveteliConfiguration::recaptcha_public_key
ENV['RECAPTCHA_PRIVATE_KEY'] = ::AlaveteliConfiguration::recaptcha_private_key
+
# Insert a bit of middleware code to prevent uneeded cookie setting.
require "#{Rails.root}/lib/whatdotheyknow/strip_empty_sessions"
config.middleware.insert_before ::ActionDispatch::Cookies, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true
diff --git a/config/environments/development.rb b/config/environments/development.rb
index b334a1e19..b77fa2fe9 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -54,4 +54,14 @@ Alaveteli::Application.configure do
Bullet.add_footer = true
end
end
+
+ if AlaveteliConfiguration.use_rack_insight_in_development
+ config.middleware.insert_before ::WhatDoTheyKnow::StripEmptySessions,
+ Rack::Insight::App,
+ :secret_key => AlaveteliConfiguration.rack_insight_secret_key,
+ :database_path => AlaveteliConfiguration.rack_insight_database_path,
+ :password => nil,
+ :ip_masks => false
+ end
+
end
diff --git a/config/general.yml-example b/config/general.yml-example
index a6980b71c..76640380d 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -681,6 +681,19 @@ USE_MAILCATCHER_IN_DEVELOPMENT: true
# ---
USE_BULLET_IN_DEVELOPMENT: false
+# Debugging toolbar for Rack applications
+# https://github.com/pboling/rack-insight
+#
+# USE_RACK_INSIGHT_IN_DEVELOPMENT - Boolean (default: false)
+#
+# Examples:
+#
+# USE_RACK_INSIGHT_IN_DEVELOPMENT: true
+# RACK_INSIGHT_SECRET_KEY: some-secret-key
+# RACK_INSIGHT_DATABASE_PATH: /tmp/rack_insight.sqlite
+# ---
+USE_RACK_INSIGHT_IN_DEVELOPMENT: false
+
# Use memcached to cache HTML fragments for better performance. This will
# only have an effect in environments where
# config.action_controller.perform_caching is set to true