Merge remote-tracking branch 'origin/master' into 1971-show-image-thumbnails
[arvados.git] / services / api / script / rails
1 #!/usr/bin/env ruby
2 # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
4
5 ##### SSL - ward, 2012-10-15
6 require 'rubygems'
7 require 'rails/commands/server'
8 require 'rack'
9 require 'webrick'
10 require 'webrick/https'
11
12 module Rails
13     class Server < ::Rack::Server
14         def default_options
15             super.merge({
16                 :Port => 3001,
17                 :environment => (ENV['RAILS_ENV'] || "development").dup,
18                 :daemonize => false,
19                 :debugger => false,
20                 :pid => File.expand_path("tmp/pids/server.pid"),
21                 :config => File.expand_path("config.ru"),
22                 :SSLEnable => true,
23                 :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
24                 :SSLPrivateKey => OpenSSL::PKey::RSA.new(
25                        File.open("config/api.clinicalfuture.com.key.pem").read),
26                 :SSLCertificate => OpenSSL::X509::Certificate.new(
27                        File.open("config/api.clinicalfuture.com.crt.pem").read),
28                 :SSLCertName => [["CN", WEBrick::Utils::getservername]]
29             })
30         end
31     end
32 end 
33 ######### /SSL
34
35
36 APP_PATH = File.expand_path('../../config/application',  __FILE__)
37 require File.expand_path('../../config/boot',  __FILE__)
38 require 'rails/commands'