diff --git a/config/application.rb b/config/application.rb index 65b8dac..481978d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,9 +15,6 @@ Bundler.require(:default, Rails.env) if defined?(Bundler) module Errbit class Application < Rails::Application - - config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/ - # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/config.example.yml b/config/config.example.yml index 9d0cf6e..ecda37e 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -11,6 +11,9 @@ # The host of your errbit server host: errbit.example.com +# Enforce SSL connections +enforce_ssl: false + # The email address which email notifications # will be sent from. email_from: errbit@example.com diff --git a/config/initializers/ssl_enforcer.rb b/config/initializers/ssl_enforcer.rb new file mode 100755 index 0000000..57b6428 --- /dev/null +++ b/config/initializers/ssl_enforcer.rb @@ -0,0 +1,7 @@ +# +# Enforce SSL connections, if configured +if Errbit::Config.enforce_ssl + Errbit::Application.configure do + config.middleware.use Rack::SslEnforcer, :except => /^\/deploys/ + end +end -- libgit2 0.21.2