Commit c0b20bb8143b93cec3eb7f7b144e5f080fd2141c

Authored by Nathan Broadbent
1 parent 085ef265
Exists in master and in 1 other branch production

Made RackSslEnforcer configurable via the 'enforce_ssl' key in config.yml, turned off by default.

config/application.rb
... ... @@ -15,9 +15,6 @@ Bundler.require(:default, Rails.env) if defined?(Bundler)
15 15  
16 16 module Errbit
17 17 class Application < Rails::Application
18   -
19   - config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/
20   -
21 18 # Settings in config/environments/* take precedence over those specified here.
22 19 # Application configuration should go into files in config/initializers
23 20 # -- all .rb files in that directory are automatically loaded.
... ...
config/config.example.yml
... ... @@ -11,6 +11,9 @@
11 11 # The host of your errbit server
12 12 host: errbit.example.com
13 13  
  14 +# Enforce SSL connections
  15 +enforce_ssl: false
  16 +
14 17 # The email address which email notifications
15 18 # will be sent from.
16 19 email_from: errbit@example.com
... ...
config/initializers/ssl_enforcer.rb 0 → 100755
... ... @@ -0,0 +1,7 @@
  1 +#
  2 +# Enforce SSL connections, if configured
  3 +if Errbit::Config.enforce_ssl
  4 + Errbit::Application.configure do
  5 + config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/
  6 + end
  7 +end
... ...