-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.ru
36 lines (27 loc) · 1 KB
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'rubygems'
require 'bundler'
require 'webrick'
require 'webrick/https'
require 'net/http'
require 'openssl'
CERT_PATH = "#{File.join(File.dirname(__FILE__), '/certs')}"
webrick_options = {
:Port => 8443,
:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
#:DocumentRoot => "/ruby/htdocs",
:SSLEnable => true,
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
:SSLCertificate => OpenSSL::X509::Certificate.new(File.open(File.join(CERT_PATH, "ufactory_org.crt")).read),
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.open(File.join(CERT_PATH, "ufactory.key")).read),
:SSLCertName => [ [ "CN", "ufactory.org"] ]
}
Bundler.require
require "#{File.dirname(__FILE__)}/lib/mdm"
require "mdm/server"
=begin
err_log = open("#{File.dirname(__FILE__)}/log/error.log", "a+")
$stderr.reopen(err_log)
log = open("#{File.dirname(__FILE__)}/log/server.log", "a+")
$stdout.reopen(log)
=end
Rack::Handler::WEBrick.run MDM::Server, webrick_options