gunark-rubycas-server 0.8.0.20090427 → 0.8.0.20090430
Sign up to get free protection for your applications and to get access to all the features.
- data/config.ru +12 -4
- data/config/hoe.rb +1 -1
- data/lib/casserver/conf.rb +17 -16
- data/lib/casserver/controllers.rb +18 -18
- data/lib/casserver/models.rb +6 -1
- data/lib/casserver/views.rb +2 -0
- data/{lib → public}/themes/cas.css +0 -0
- data/{lib → public}/themes/notice.png +0 -0
- data/{lib → public}/themes/ok.png +0 -0
- data/{lib → public}/themes/simple/bg.png +0 -0
- data/{lib → public}/themes/simple/login_box_bg.png +0 -0
- data/{lib → public}/themes/simple/logo.png +0 -0
- data/{lib → public}/themes/simple/theme.css +0 -0
- data/{lib → public}/themes/urbacon/bg.png +0 -0
- data/{lib → public}/themes/urbacon/login_box_bg.png +0 -0
- data/{lib → public}/themes/urbacon/logo.png +0 -0
- data/{lib → public}/themes/urbacon/theme.css +0 -0
- data/{lib → public}/themes/warning.png +0 -0
- metadata +13 -13
data/config.ru
CHANGED
@@ -3,17 +3,25 @@ require 'rack'
|
|
3
3
|
|
4
4
|
$APP_NAME = 'rubycas-server'
|
5
5
|
$APP_ROOT = File.dirname(File.expand_path(__FILE__))
|
6
|
-
$: << $APP_ROOT + "/lib"
|
7
6
|
|
8
|
-
|
7
|
+
if File.exists?("#{$APP_ROOT}/tmp/debug.txt")
|
8
|
+
require 'ruby-debug'
|
9
|
+
Debugger.wait_connection = true
|
10
|
+
Debugger.start_remote
|
11
|
+
end
|
12
|
+
|
13
|
+
$: << $APP_ROOT + "/lib"
|
9
14
|
|
10
|
-
|
11
|
-
|
15
|
+
require 'casserver/load_picnic'
|
16
|
+
require 'picnic'
|
17
|
+
require 'casserver'
|
12
18
|
|
13
19
|
CASServer.create
|
14
20
|
|
15
21
|
if $CONF.uri_path
|
16
22
|
map($CONF.uri_path) do
|
23
|
+
# FIXME: this probably isn't the smartest way of remapping the themes dir to uri_path/themes
|
24
|
+
use Rack::Static, $CONF[:static] if $CONF[:static]
|
17
25
|
run CASServer
|
18
26
|
end
|
19
27
|
else
|
data/config/hoe.rb
CHANGED
data/lib/casserver/conf.rb
CHANGED
@@ -22,6 +22,20 @@ else
|
|
22
22
|
end
|
23
23
|
|
24
24
|
$AUTH = []
|
25
|
+
|
26
|
+
unless $CONF[:authenticator]
|
27
|
+
err = "
|
28
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
29
|
+
|
30
|
+
You have not yet defined an authenticator for your CAS server!
|
31
|
+
Please consult the documentation and make the necessary changes to
|
32
|
+
your config file.
|
33
|
+
|
34
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
35
|
+
"
|
36
|
+
raise Picnic::Config::Error, err
|
37
|
+
end
|
38
|
+
|
25
39
|
begin
|
26
40
|
# attempt to instantiate the authenticator
|
27
41
|
if $CONF[:authenticator].instance_of? Array
|
@@ -56,22 +70,9 @@ rescue NameError
|
|
56
70
|
end
|
57
71
|
end
|
58
72
|
|
59
|
-
unless $CONF[:authenticator]
|
60
|
-
$stderr.puts
|
61
|
-
$stderr.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
62
|
-
$stderr.puts
|
63
|
-
$stderr.puts "You have not yet defined an authenticator for your CAS server!"
|
64
|
-
$stderr.puts "Please consult your config file for details (most likely in"
|
65
|
-
$stderr.puts "/etc/rubycas-server/config.yml)."
|
66
|
-
$stderr.puts
|
67
|
-
$stderr.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
68
|
-
exit 1
|
69
|
-
end
|
70
73
|
|
71
|
-
|
72
|
-
|
73
|
-
:
|
74
|
-
:dir => File.expand_path(File.dirname(__FILE__))+"/themes"
|
74
|
+
$CONF[:static] = {
|
75
|
+
:urls => "/themes",
|
76
|
+
:root => "#{$APP_ROOT}/public"
|
75
77
|
}
|
76
78
|
|
77
|
-
|
@@ -426,24 +426,24 @@ module CASServer::Controllers
|
|
426
426
|
end
|
427
427
|
end
|
428
428
|
|
429
|
-
class Themes < R '/themes/(.+)'
|
430
|
-
MIME_TYPES = {'.css' => 'text/css', '.js' => 'text/javascript',
|
431
|
-
'.jpg' => 'image/jpeg'}
|
432
|
-
PATH = $CONF.themes_dir || File.expand_path(File.dirname(__FILE__))+'/../themes'
|
433
|
-
|
434
|
-
def get(path)
|
435
|
-
headers['Content-Type'] = MIME_TYPES[path[/\.\w+$/, 0]] || "text/plain"
|
436
|
-
unless path.include? ".." # prevent directory traversal attacks
|
437
|
-
headers['X-Sendfile'] = "#{PATH}/#{path}"
|
438
|
-
data = File.read(headers['X-Sendfile'])
|
439
|
-
headers['Content-Length'] = data.size.to_s # Rack Camping adapter chokes without this
|
440
|
-
return data
|
441
|
-
else
|
442
|
-
status = "403"
|
443
|
-
"403 - Invalid path"
|
444
|
-
end
|
445
|
-
end
|
446
|
-
end
|
429
|
+
# class Themes < R '/themes/(.+)'
|
430
|
+
# MIME_TYPES = {'.css' => 'text/css', '.js' => 'text/javascript',
|
431
|
+
# '.jpg' => 'image/jpeg'}
|
432
|
+
# PATH = $CONF.themes_dir || File.expand_path(File.dirname(__FILE__))+'/../themes'
|
433
|
+
#
|
434
|
+
# def get(path)
|
435
|
+
# headers['Content-Type'] = MIME_TYPES[path[/\.\w+$/, 0]] || "text/plain"
|
436
|
+
# unless path.include? ".." # prevent directory traversal attacks
|
437
|
+
# headers['X-Sendfile'] = "#{PATH}/#{path}"
|
438
|
+
# data = File.read(headers['X-Sendfile'])
|
439
|
+
# headers['Content-Length'] = data.size.to_s # Rack Camping adapter chokes without this
|
440
|
+
# return data
|
441
|
+
# else
|
442
|
+
# status = "403"
|
443
|
+
# "403 - Invalid path"
|
444
|
+
# end
|
445
|
+
# end
|
446
|
+
# end
|
447
447
|
|
448
448
|
def response_status_from_error(error)
|
449
449
|
case error.code.to_s
|
data/lib/casserver/models.rb
CHANGED
@@ -198,7 +198,12 @@ module CASServer::Models
|
|
198
198
|
|
199
199
|
class ChangeServiceToText < V 0.71
|
200
200
|
def self.up
|
201
|
-
change_column
|
201
|
+
# using change_column to change the column type from :string to :text
|
202
|
+
# doesn't seem to work, at least under MySQL, so we drop and re-create
|
203
|
+
# the column instead
|
204
|
+
remove_column :casserver_st, :service
|
205
|
+
say "WARNING: All existing service tickets are being deleted."
|
206
|
+
add_column :casserver_st, :service, :text
|
202
207
|
end
|
203
208
|
|
204
209
|
def self.down
|
data/lib/casserver/views.rb
CHANGED
@@ -17,6 +17,8 @@ module CASServer::Views
|
|
17
17
|
title { "#{organization} #{_(' Central Login')}" }
|
18
18
|
link(:rel => "stylesheet", :type => "text/css", :href => "/themes/cas.css")
|
19
19
|
link(:rel => "stylesheet", :type => "text/css", :href => "/themes/#{current_theme}/theme.css")
|
20
|
+
link(:rel => "icon", :type => "image/png", :href => "/themes/#{current_theme}/favicon.png") if
|
21
|
+
File.exists?("#{$APP_ROOT}/public/themes/#{current_theme}/favicon.png")
|
20
22
|
end
|
21
23
|
body(:onload => "if (document.getElementById('username')) document.getElementById('username').focus()") do
|
22
24
|
self << yield
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gunark-rubycas-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.0.
|
4
|
+
version: 0.8.0.20090430
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zukowski
|
@@ -117,18 +117,18 @@ files:
|
|
117
117
|
- lib/casserver/views.rb
|
118
118
|
- lib/rubycas-server.rb
|
119
119
|
- lib/rubycas-server/version.rb
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
120
|
+
- public/themes/cas.css
|
121
|
+
- public/themes/notice.png
|
122
|
+
- public/themes/ok.png
|
123
|
+
- public/themes/simple/bg.png
|
124
|
+
- public/themes/simple/login_box_bg.png
|
125
|
+
- public/themes/simple/logo.png
|
126
|
+
- public/themes/simple/theme.css
|
127
|
+
- public/themes/urbacon/bg.png
|
128
|
+
- public/themes/urbacon/login_box_bg.png
|
129
|
+
- public/themes/urbacon/logo.png
|
130
|
+
- public/themes/urbacon/theme.css
|
131
|
+
- public/themes/warning.png
|
132
132
|
- po/de_DE/rubycas-server.po
|
133
133
|
- po/es_ES/rubycas-server.po
|
134
134
|
- po/fr_FR/rubycas-server.po
|