diff options
author | rautenberg <rautenberg@in-silico.ch> | 2012-05-07 18:09:32 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2012-05-07 18:09:32 +0200 |
commit | 11aec73756dd72ba37684d870352121e63b8819c (patch) | |
tree | 71753bb7f7f9e37de5140971a794de179cc53b64 /lib/environment.rb | |
parent | e7dd33d05f111cd25b9fb24e91ebb5f362413eb2 (diff) | |
parent | 20f7289875c3b928663e421c717d9e06b89fe6f1 (diff) |
Merge branch 'development' of github.com:opentox/opentox-server into development
Diffstat (limited to 'lib/environment.rb')
-rw-r--r-- | lib/environment.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/environment.rb b/lib/environment.rb deleted file mode 100644 index 3889dfb..0000000 --- a/lib/environment.rb +++ /dev/null @@ -1,41 +0,0 @@ -# set default environment -ENV['RACK_ENV'] = 'production' unless ENV['RACK_ENV'] - -# load/setup configuration -basedir = File.join(ENV['HOME'], ".opentox") -config_dir = File.join(basedir, "config") -config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml") - -TMP_DIR = File.join(basedir, "tmp") -LOG_DIR = File.join(basedir, "log") - -=begin -if File.exist?(config_file) - CONFIG = YAML.load_file(config_file) - not_found_error "Could not load configuration from \"#{config_file.to_s}\"" unless CONFIG -else - FileUtils.mkdir_p TMP_DIR - FileUtils.mkdir_p LOG_DIR - FileUtils.mkdir_p config_dir - puts "Please edit #{config_file} and restart your application." - exit -end -=end - -logfile = "#{LOG_DIR}/#{ENV["RACK_ENV"]}.log" -$logger = OTLogger.new(logfile) - -=begin -if CONFIG[:logger] and CONFIG[:logger] == "debug" - $logger.level = Logger::DEBUG -else - $logger.level = Logger::WARN -end - -# TODO: move to opentox-client??? -AA_SERVER = CONFIG[:authorization] ? (CONFIG[:authorization][:server] ? CONFIG[:authorization][:server] : nil) : nil -CONFIG[:authorization][:authenticate_request] = [""] unless CONFIG[:authorization][:authenticate_request] -CONFIG[:authorization][:authorize_request] = [""] unless CONFIG[:authorization][:authorize_request] -CONFIG[:authorization][:free_request] = [""] unless CONFIG[:authorization][:free_request] -=end - |