Skip to content

Commit

Permalink
config.ru: set RACK_ENV to deployment if RUBYWARDEN_ENV is production
Browse files Browse the repository at this point in the history
If RACK_ENV is not set, which it may not be since RUBYWARDEN_ENV now
has to be used, it will default to development, which will cause
Sinatra to print stack traces and things to the public.

Protect users by setting RACK_ENV to "deployment" when
RUBYWARDEN_ENV is set to "production".
  • Loading branch information
jcs committed Sep 20, 2018
1 parent e6f7e9e commit 68da064
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

if ENV["RUBYWARDEN_ENV"] == "production"
# prevent printing stack traces and other nonsense
ENV["RACK_ENV"] = "deployment"
end

require File.dirname(__FILE__) + "/lib/rubywarden.rb"
require "#{APP_ROOT}/lib/app.rb"

Expand Down

0 comments on commit 68da064

Please sign in to comment.