add a circumvent_ssl_requirement option to application.yml.example; sending out a mail to diaspora-dev for more info

This commit is contained in:
Maxwell Salzberg 2012-01-18 15:50:22 -08:00
parent 18e895c247
commit ed45789403
3 changed files with 8 additions and 1 deletions

View file

@ -125,6 +125,7 @@ defaults: &defaults
# Diaspora is only tested against this default pubsub server. You probably don't want to change this.
pubsub_server: 'https://pubsubhubbub.appspot.com/'
circumvent_ssl_requirement: false
# Email
# Setting this to true enables Diaspora's "send email" functionality,

View file

@ -2,6 +2,8 @@
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require File.join(Rails.root, 'lib', 'enviroment_configuration')
Diaspora::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
@ -38,7 +40,7 @@ Diaspora::Application.configure do
config.serve_static_assets = false
#force ssl in production
config.middleware.insert_before ActionDispatch::Static, "Rack::SSL"
config.middleware.insert_before ActionDispatch::Static, "Rack::SSL" unless EnviromentConfiguration.circumvent_ssl?
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

View file

@ -29,6 +29,10 @@ module EnviromentConfiguration
end
end
def self.circumvent_ssl?
ENV['NO_SSL'] || AppConfig[:circumvent_ssl_requirement].present?
end
def self.ca_cert_file_location
if self.heroku?
"/usr/lib/ssl/certs/ca-certificates.crt"