Strong access control for Gollum?

Joshua Hoblitt picture Joshua Hoblitt · Mar 9, 2012 · Viewed 7.7k times · Source

What is the best way to add multiple role access to a Gollum wiki?

I understand how to add Basic HTTP auth via, Rack middleware. However, I would like to know what's required to have full multi user/role authentication and authorization.

Can Devise or OmniAuth be used in a similar way to a Rails app?

What is required?

Answer

vigntom picture vigntom · Nov 13, 2012

With this hint http://www.sinatrarb.com/faq.html#auth my configuration file like this

# authentication.rb
module Precious
  class App < Sinatra::Base
    use Rack::Auth::Basic, "Restricted Area" do |username, password|
      [username, password] == ['admin', 'admin']
    end
  end
end

and running as:

$ gollum --config authentication.rb

In the running gollum instance, it will ask for user name and password