public
Fork of jnewland/git-wiki
Description: A wiki engine that uses a Git repository as its data store.
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/bmizerany/git-wiki.git
http auth
jnewland (author)
Wed May 14 19:17:40 -0700 2008
commit  1786144a30eab355df675d39123b1e5eda41a820
tree    2aac854c34a5f5fc0043763dc3719e1698055e55
parent  5b90bba39a8c4992b62fab7e6622319f6f113170
...
 
1
2
...
1
2
3
0
@@ -1,2 +1,3 @@
0
+config.yml
0
 *.log
0
 *.swp
...
1
2
 
3
4
5
...
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
...
93
94
95
 
 
 
 
 
96
97
98
...
1
 
2
3
4
5
...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
105
106
107
108
109
110
111
112
113
114
115
0
@@ -1,5 +1,5 @@
0
 #!/usr/bin/env ruby
0
-%w(sinatra haml sass rubygems git redcloth).each do |dependency|
0
+%w(sinatra haml sass rubygems git redcloth yaml).each do |dependency|
0
   begin
0
     $: << File.expand_path(File.dirname(__FILE__) + "/vendor/#{dependency}/lib")
0
     require dependency
0
@@ -8,6 +8,18 @@
0
   end
0
 end
0
 
0
+#included until http://sinatra.lighthouseapp.com/projects/9779/tickets/16-patch-http-authentication is in a released version
0
+require File.dirname(__FILE__) + '/sinatra_http_auth'
0
+
0
+begin
0
+ config = YAML.load(File.read(ENV['CONFIG']))
0
+rescue
0
+ config = {
0
+ 'username' => nil,
0
+ 'password' => nil
0
+ }
0
+end
0
+
0
 class Page
0
   class << self
0
     attr_accessor :repo
0
@@ -93,6 +105,11 @@ helpers do
0
 end
0
 
0
 before do
0
+ # unless config['username'].nil? && config['password'].nil?
0
+ authenticate_or_request_with_http_basic "GitWiki" do
0
+ |user, pass| user == config['username'] && pass == config['password']
0
+ end
0
+ # end
0
   content_type 'text/html', :charset => 'utf-8'
0
 end
0
 

Comments

    No one has commented yet.