gitauth 0.0.5.1 → 0.0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/config.ru +0 -6
- data/lib/gitauth.rb +1 -1
- data/lib/gitauth/auth_setup_middleware.rb +10 -1
- data/views/auth_setup.erb +1 -1
- metadata +3 -3
data/config.ru
CHANGED
@@ -1,15 +1,9 @@
|
|
1
|
-
vendor_dir = File.join(File.dirname(__FILE__), "vendor")
|
2
|
-
|
3
|
-
require File.join(vendor_dir, "rack", "lib", "rack")
|
4
|
-
require File.join(vendor_dir, "sinatra", "lib", "sinatra")
|
5
|
-
|
6
1
|
require File.join(File.dirname(__FILE__), "lib", "gitauth")
|
7
2
|
require GitAuth::BASE_DIR.join("lib", "gitauth", "web_app")
|
8
3
|
|
9
4
|
GitAuth::Settings.setup!
|
10
5
|
|
11
6
|
output = File.open(GitAuth::Logger.default_logger_path, "a+")
|
12
|
-
|
13
7
|
STDOUT.reopen(output)
|
14
8
|
STDERR.reopen(output)
|
15
9
|
|
data/lib/gitauth.rb
CHANGED
@@ -29,16 +29,25 @@ module GitAuth
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def _call(env)
|
32
|
+
@request = Rack::Request.new(env)
|
32
33
|
if GitAuth::WebApp.has_auth?
|
33
34
|
@app.call(env)
|
34
35
|
elsif env["PATH_INFO"].include?("/gitauth.css")
|
35
36
|
@files.call(env)
|
36
37
|
else
|
37
|
-
content = ERB.new(File.read(GitAuth::BASE_DIR.join("views", "auth_setup.erb"))).result
|
38
|
+
content = ERB.new(File.read(GitAuth::BASE_DIR.join("views", "auth_setup.erb"))).result(binding)
|
38
39
|
headers = {"Content-Type" => "text/html", "Content-Length" => Rack::Utils.bytesize(content).to_s}
|
39
40
|
[403, headers, [content]]
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
44
|
+
def u(path)
|
45
|
+
"#{@request.script_name}#{path}"
|
46
|
+
end
|
47
|
+
|
48
|
+
def request
|
49
|
+
@request
|
50
|
+
end
|
51
|
+
|
43
52
|
end
|
44
53
|
end
|
data/views/auth_setup.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.5.
|
4
|
+
version: 0.0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darcy Laycock
|
@@ -120,7 +120,7 @@ files:
|
|
120
120
|
- views/layout.erb
|
121
121
|
- views/repo.erb
|
122
122
|
- views/user.erb
|
123
|
-
has_rdoc:
|
123
|
+
has_rdoc: false
|
124
124
|
homepage: http://brownbeagle.com.au/
|
125
125
|
licenses: []
|
126
126
|
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
requirements: []
|
145
145
|
|
146
146
|
rubyforge_project:
|
147
|
-
rubygems_version: 1.3.
|
147
|
+
rubygems_version: 1.3.2
|
148
148
|
signing_key:
|
149
149
|
specification_version: 3
|
150
150
|
summary: An authentication manager for Git repositories served over SSH
|