Sha256: 5fd2f7541f32dea1cef0cb42903c0e28163fe3c8014a57b7ea97ac2c663f6c3f

Contents?: true

Size: 691 Bytes

Versions: 5

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

desc 'Set up the environment for running your web application'
task :environment => :log do |task|
	require SITE_ROOT + 'config/environment'
	
	# We ensure this is part of the shell environment so if other commands are invoked they will work correctly.
	ENV['RACK_ENV'] = RACK_ENV.to_s if defined?(RACK_ENV)
	ENV['DATABASE_ENV'] = DATABASE_ENV.to_s if defined?(DATABASE_ENV)
	
	# This generates a consistent session secret if one was not already provided:
	if ENV['UTOPIA_SESSION_SECRET'].nil?
		require 'securerandom'
		
		Utopia.logger.warn 'Generating transient session key for development...'
		ENV['UTOPIA_SESSION_SECRET'] = SecureRandom.hex(32)
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
utopia-2.12.4 setup/site/tasks/environment.rake
utopia-2.12.3 setup/site/tasks/environment.rake
utopia-2.12.2 setup/site/tasks/environment.rake
utopia-2.12.1 setup/site/tasks/environment.rake
utopia-2.12.0 setup/site/tasks/environment.rake