From 207319ae57d19411d02ca7cad4d4e39102b6fe12 Mon Sep 17 00:00:00 2001 From: James Mason Date: Sun, 12 Nov 2017 17:53:00 -0800 Subject: [PATCH 1/2] Control config.force_ssl with an ENV variable --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 4e2c2e79..a70ef729 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -33,7 +33,7 @@ Osem::Application.configure do # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = !!ENV['FORCE_SSL'] # See everything in the log (default is :info) config.log_level = :info From 668c7dede9a028a25c26cb2078290d18a172dbd1 Mon Sep 17 00:00:00 2001 From: James Mason Date: Tue, 14 Nov 2017 14:11:57 -0800 Subject: [PATCH 2/2] Add FORCE_SSL to the dotenv example --- dotenv.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotenv.example b/dotenv.example index 77c28e4c..b79068d6 100644 --- a/dotenv.example +++ b/dotenv.example @@ -63,3 +63,6 @@ OSEM_SMTP_OPENSSL_VERIFY_MODE="" # Enable the usage of the devise ichain plugin OSEM_ICHAIN_ENABLED=false + +# enable this to force SSL +# FORCE_SSL="1"