From 4b265ae1235741aac548c1635c2235c1bd177a54 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Tue, 26 Dec 2017 21:15:48 -0800 Subject: [PATCH] Move the rest of RACK_ENV stuff to APP_ENV. --- .dockerenv.example | 2 +- Rakefile | 6 +++--- config/application.rb | 4 ++-- config/initializers/10-secure_headers.rb | 4 ++-- config/puma.rb | 6 +++--- config/unicorn.rb | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.dockerenv.example b/.dockerenv.example index f548b61..5f7f733 100644 --- a/.dockerenv.example +++ b/.dockerenv.example @@ -1,4 +1,4 @@ -RACK_ENV=deployment +APP_ENV=development REDIS_URL=redis://redis:6379 diff --git a/Rakefile b/Rakefile index 2dc8dec..ffe25e7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,13 @@ # frozen_string_literal: true -ENV["RACK_ENV"] ||= "development" +ENV["APP_ENV"] ||= "development" # Load secure_headers rake task require "bundler/setup" -Bundler.require(:default, ENV["RACK_ENV"]) +Bundler.require(:default, ENV["APP_ENV"]) load "tasks/tasks.rake" -if ENV["RACK_ENV"] == "development" +if ENV["APP_ENV"] == "development" require "github-release-party/tasks/heroku" end diff --git a/config/application.rb b/config/application.rb index a8d8ce1..bdd4442 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -ENV["RACK_ENV"] ||= "development" +ENV["APP_ENV"] ||= "development" require "bundler/setup" -Bundler.require(:default, ENV["RACK_ENV"]) +Bundler.require(:default, ENV["APP_ENV"]) # uncomment to get production error pages in development # set :environment, :production diff --git a/config/initializers/10-secure_headers.rb b/config/initializers/10-secure_headers.rb index c5a04c7..5278d02 100644 --- a/config/initializers/10-secure_headers.rb +++ b/config/initializers/10-secure_headers.rb @@ -23,7 +23,7 @@ config.csp[:report_uri] = ENV["CSP_REPORT_URI"].split(",") if ENV["CSP_REPORT_URI"] # Allow unsafe-inline for better_errors in development mode - if ENV["RACK_ENV"] == "development" + if ENV["APP_ENV"] == "development" config.csp.merge!({ script_src: %w('unsafe-inline'), style_src: %w('unsafe-inline'), @@ -49,7 +49,7 @@ }) # Allow unsafe-inline for better_errors in development mode - if ENV["RACK_ENV"] == "development" + if ENV["APP_ENV"] == "development" config.csp[:script_src] << "'unsafe-inline'" config.csp[:style_src] << "'unsafe-inline'" end diff --git a/config/puma.rb b/config/puma.rb index db03981..5e3913e 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -ENV["RACK_ENV"] ||= "development" -environment(ENV["RACK_ENV"]) +ENV["APP_ENV"] ||= "development" +environment(ENV["APP_ENV"]) -if ENV["RACK_ENV"] == "development" +if ENV["APP_ENV"] == "development" # better_errors and binding_of_caller works better with only one process and thread workers(1) threads(1, 1) diff --git a/config/unicorn.rb b/config/unicorn.rb index c7b8f9a..432323d 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -ENV["RACK_ENV"] ||= "development" -if ENV["RACK_ENV"] == "development" +ENV["APP_ENV"] ||= "development" +if ENV["APP_ENV"] == "development" # better_errors and binding_of_caller works better with only one process worker_processes 1 else