New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for extra_opts in connection string (like {:ssl => true, :... => ...}) #42

Closed
ghost opened this Issue Oct 11, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@ghost

ghost commented Oct 11, 2012

Since we run all our MongoDB instances with SSL it would be nice, if there is a possibility to specify these extra_options in the connection string:

http://docs.mongodb.org/manual/administration/ssl/

Since genghis uses Mongo::Connection.from_uri this should be an easy task ;-)

http://www.rubydoc.info/github/mongodb/mongo-ruby-driver/master/Mongo/Connection#from_uri-class_method

Connection options and extra options of the mongo driver (GENERIC_OPTS and CONNECTION_OPTS):

http://api.mongodb.org/ruby/current/Mongo/Connection.html

Example of a working connection string:

con = Mongo::Connection.from_uri('mongodb://dummy:pass4dummy@db1.dev.example.org/admin', :ssl => true)

Thanks for this great app!

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Nov 12, 2012

Owner

Support for ssl has been added to the develop branch. Check it out and let me know if anything's broken :)

A style note: since the server URIs use the standard Mongo connection string format, I'm expecting the query param style rather than the ruby opt style names. For example, you would use connectTimeoutMS rather than :connection_timeout.

Genghis (.rb) currently only supports replicaSet, connectTimeoutMS and ssl. All queries are done with safe, so that option doesn't make sense to set at the server level. I don't want to support slaveOkay (at least until Genghis supports read-only users, but possibly ever). If you need to connect to a slave, just connect directly to the slave...

The rest of the options seem to be unsupported at the connection level by the Ruby driver, so they'll take a bit more to integrate.

Owner

bobthecow commented Nov 12, 2012

Support for ssl has been added to the develop branch. Check it out and let me know if anything's broken :)

A style note: since the server URIs use the standard Mongo connection string format, I'm expecting the query param style rather than the ruby opt style names. For example, you would use connectTimeoutMS rather than :connection_timeout.

Genghis (.rb) currently only supports replicaSet, connectTimeoutMS and ssl. All queries are done with safe, so that option doesn't make sense to set at the server level. I don't want to support slaveOkay (at least until Genghis supports read-only users, but possibly ever). If you need to connect to a slave, just connect directly to the slave...

The rest of the options seem to be unsupported at the connection level by the Ruby driver, so they'll take a bit more to integrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment