1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #3751: validate by APP_ENV (#4015)

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
(cherry picked from commit f141633b26d92d596904c834fd73f013c1c4010a)
This commit is contained in:
Jorge Lobo 2019-12-03 13:10:33 +01:00 committed by Tino Vazquez
parent ddc44de02e
commit 333feca1c8
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE

View File

@ -152,6 +152,19 @@ if (no_proxy = $conf[:no_proxy])
ENV['NO_PROXY'] = no_proxy
end
if ENV["APP_ENV"] &&
!ENV["APP_ENV"].empty? &&
%w{production development test}.include?(ENV["APP_ENV"])
set :environment, ENV["APP_ENV"].to_sym
else
case $conf[:env]
when "dev"
set :environment, :development
else
set :environment, :production
end
end
case $conf[:sessions]
when 'memory', nil
use Rack::Session::Pool, :key => 'sunstone'