<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 Originally by Simon Rozet (http://atonie.org/2008/02/git-wiki)
 
 Modified by:
+ - Jesse Newland (http://jnewland.com/) - http auth
  - Alex Payne (http://www.al3x.net)
  - Jesse Andrews (http://www.overstimulate.com)
  - Timoni Grone (http://www.timoni.org) - stylesheet and design aid </diff>
      <filename>AUTHORS</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,35 @@ h1. git-wiki
 
 A wiki engine that uses a Git repository as its data store.
 
-h2. Status
+h2. Getting Started
 
-Alex Payne (see AUTHORS file) is no longer actively developing this branch.
-Please fork from here and continue development!
+@git submodule init@
+
+@git submodule update@
+
+h2. Running
+
+h3. Basics
+
+@ruby git-wiki.rb@
+
+h3. Options
+
+h4. Run in production
+
+@ruby git-wiki.rb -e production@
+
+h4. Run in production on port 8777
+
+@ruby git-wiki.rb -e production -p 8080@
+
+h4. HTTP Basic Auth
+
+@cp config.yml.sample config.yml@
+
+@vim config.yml@
+
+@CONFIG=config.yml ruby git-wiki.rb -e production -p 8080@
 
 h2. Requirements
 </diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,10 @@
+require 'fileutils'
 require 'rubygems'
+require 'sinatra/lib/sinatra'
 require 'extensions'
 require 'page'
 
-%w(git redcloth rubypants).each do |gem| 
+%w(git redcloth rubypants yaml).each do |gem| 
   require_gem_with_feedback gem
 end
 
@@ -14,4 +16,16 @@ unless File.exists?(GIT_REPO) &amp;&amp; File.directory?(GIT_REPO)
   Git.init(GIT_REPO)
 end
 
-$repo = Git.open(GIT_REPO)
\ No newline at end of file
+$repo = Git.open(GIT_REPO)
+
+config = nil
+begin
+  config = YAML.load(File.read(ENV['CONFIG']))
+rescue
+  config = {
+    'username' =&gt;  nil,
+    'password' =&gt;  nil
+  }
+end
+
+CONFIG = config
\ No newline at end of file</diff>
      <filename>environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,3 +22,57 @@ class Time
     &quot;#{(self.to_i * 1000)}&quot;
   end
 end
+
+module HttpAuthentication
+  module Basic
+
+    def authenticate_or_request_with_http_basic(realm = &quot;Application&quot;, &amp;login_procedure)
+      authenticate_with_http_basic(&amp;login_procedure) || request_http_basic_authentication(realm)
+    end
+
+    def authenticate_with_http_basic(&amp;login_procedure)
+      authenticate(&amp;login_procedure)
+    end
+
+    def request_http_basic_authentication(realm = &quot;Application&quot;)
+      authentication_request(realm)
+    end
+
+    private
+
+      def authenticate(&amp;login_procedure)
+        if authorization
+          login_procedure.call(*user_name_and_password)
+        end
+      end
+
+      def user_name_and_password
+        decode_credentials.split(/:/, 2)
+      end
+
+      def authorization
+        request.env['HTTP_AUTHORIZATION']   ||
+        request.env['X-HTTP_AUTHORIZATION'] ||
+        request.env['X_HTTP_AUTHORIZATION'] ||
+        request.env['REDIRECT_X_HTTP_AUTHORIZATION']
+      end
+
+      # Base64
+      def decode_credentials
+        (authorization.split.last || '').unpack(&quot;m&quot;).first
+      end
+
+      def authentication_request(realm)
+        status(401)
+        header(&quot;WWW-Authenticate&quot; =&gt; %(Basic realm=&quot;#{realm.gsub(/&quot;/, &quot;&quot;)}&quot;))
+        throw :halt, &quot;HTTP Basic: Access denied.\n&quot;
+      end
+
+  end
+end
+
+module Sinatra
+  class EventContext
+    include HttpAuthentication::Basic
+  end
+end</diff>
      <filename>extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,14 @@
 #!/usr/bin/env ruby
 
-require 'fileutils'
 require 'environment'
-require 'sinatra/lib/sinatra'
+
+before do
+  unless CONFIG['username'].nil? &amp;&amp; CONFIG['password'].nil?
+    authenticate_or_request_with_http_basic &quot;git-wiki&quot; do
+      |user, pass| user == CONFIG['username'] &amp;&amp; pass == CONFIG['password']
+    end
+  end
+end
 
 get('/') { redirect &quot;/#{HOMEPAGE}&quot; }
 </diff>
      <filename>git-wiki.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
       &lt;/form&gt;
       &lt;%= yield %&gt;
       &lt;div id=&quot;footer&quot;&gt;
-        powered by &lt;a href=&quot;http://github.com/sr/git-wiki/network&quot;&gt;git-wiki&lt;/a&gt;
+        powered by &lt;a href=&quot;http://github.com/jnewland/git-wiki/network&quot;&gt;git-wiki&lt;/a&gt;
       &lt;/div&gt;
     &lt;/div&gt;
   &lt;/body&gt;</diff>
      <filename>views/layout.erb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>README.markdown</filename>
    </removed>
    <removed>
      <filename>sinatra_http_auth.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>384d75aabb3401a8787f343ca4fe6236887e6ecc</id>
    </parent>
  </parents>
  <author>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </author>
  <url>http://github.com/jnewland/git-wiki/commit/ecd24885479fcf956c5f6491f04177e98de115c2</url>
  <id>ecd24885479fcf956c5f6491f04177e98de115c2</id>
  <committed-date>2008-05-14T20:10:10-07:00</committed-date>
  <authored-date>2008-05-14T20:03:42-07:00</authored-date>
  <message>rework http auth to fit in with al3x's refactoring</message>
  <tree>231224fd3946a27577f11649f35b9ec51884680a</tree>
  <committer>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </committer>
</commit>
