bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 166 forks source link

Adding Authentication? #154

Closed cmpsoares91 closed 10 years ago

cmpsoares91 commented 10 years ago

Can't figure out how to protect Genghis with user and password... :-S

Is this even possible? Could be a nice feature though!

bobthecow commented 10 years ago

The easiest way is to configure your server to use HTTP Basic Auth. Instructions for that vary depending on what sort of server you're using. If you're using Ruby, a config.ru file like this would do the trick:

require 'genghis'

use Rack::Auth::Basic, 'Genghis' do |u, p|
  u == 'admin' && p == 'hunter2'
end

run Genghis::Server

Then run it with rackup instead of genghisapp.