bobthecow / genghis

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

Genghis.php Single File Host #196

Closed sagargulati closed 9 years ago

sagargulati commented 9 years ago

Hello, I am using https://github.com/bobthecow/genghis/blob/master/genghis.php This single file to manage my mongodb, but when i add support auth=true in my mongodb.conf. It shows me error, how can i add support for authentication to this php file, please reply as soon as possible. I want to use only single file i.e genghis.php not any other source or something hosted. Since I have only genghis.php on my server.

Thanks!

bobthecow commented 9 years ago

You have to add auth to the server URL, e.g.:

user:pass@hostname/dbname
sagargulati commented 9 years ago

Where i have to add it? Any line in the php file? and what should i find for? Also my file is located at https://mydomain.com/tools/file.php so this is what i get when i login -> http://prntscr.com/5oh6b7

I have also added a htaccess file that protects my file but the username and password are not same as the one in database. Now isn't there a way to predefine login to mongo using php file instead of url auth as it contains some special characters too.

bobthecow commented 9 years ago

Not in the file at all. In the UI. Boot up Genghis, and add a server :)

sagargulati commented 9 years ago

BootUp Genghis? I am just hosting genghis.php file. That's all. and my mongodb.conf contains auth = true. and this is the error i am getting http://prntscr.com/5oh6b7 Please help!

bobthecow commented 9 years ago
  1. Start Genghis
  2. Navigate to it in a browser
  3. Click this button: this-button
  4. Enter your server with auth (e.g. username:password@localhost/dbname)
sagargulati commented 9 years ago

Thanks! :) It finally worked :) Also do i need to add this everytime i login?

bobthecow commented 9 years ago

Nope. Just if you clear your cookies, or change browsers, or something.

If you want to make it permanent, you can add a GENGHIS_SERVERS environment variable with semicolon delimited server URLs. (Do it like this if you're using Apache).

sagargulati commented 9 years ago

Thanks :+1: :)

bobthecow commented 9 years ago

No problem!