-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
41 lines (33 loc) · 1.22 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
36
37
38
39
40
41
# This is the Rackup initialization script for running RubyCAS-Server under Passenger/Rack.
#
# This file doesn't really have anything to do with your server's "configuration",
# and you almost certainly don't need to modify it. Instead, a config file should
# have been created for you (probably under /etc/rubycas-server/config.yml) -- this
# is the file you'll want to modify. If for some reason the configuration file
# was not created for you, have a look at the config.example.yml template and
# go from there.
require 'rubygems'
require 'rack'
$APP_NAME = 'rubycas-server'
$APP_ROOT = ::File.dirname(::File.expand_path(__FILE__))
# This makes it possible to have multiple rubycas installations
$CONFIG_FILE_LOCATION = "#{$APP_ROOT}/config/config.yml"
if ::File.exist?("#{$APP_ROOT}/tmp/debug.txt")
require 'ruby-debug'
Debugger.wait_connection = true
Debugger.start_remote
end
$: << $APP_ROOT + "/lib"
require 'casserver/load_picnic'
require 'picnic'
require 'casserver'
CASServer.create
if $CONF.uri_path
map($CONF.uri_path) do
# FIXME: this probably isn't the smartest way of remapping the themes dir to uri_path/themes
use Rack::Static, $CONF[:static] if $CONF[:static]
run CASServer
end
else
run CASServer
end