1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-26 09:57:23 +03:00

B #3751: validate by APP_ENV (#4015)

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Lobo 2019-12-03 13:10:33 +01:00 committed by Tino Vázquez
parent bd17138a91
commit f141633b26

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'