This repository has been archived by the owner. It is now read-only.

Configure curator/mongo without a YAML config file? #27

Closed
brandonweiss opened this Issue Oct 30, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@brandonweiss
Contributor

brandonweiss commented Oct 30, 2012

After poking around a bit it seems the way curator is currently written it's not possible to manually set up a connection, and you have to use a YAML file? Or at least I couldn't figure out how. Is that correct?

I've always thought configuring databases connections with YAML files is kind of gross. Plus it makes it rather difficult if you keep your database connection strings in environment variables. Thoughts?

@pgr0ss

This comment has been minimized.

Show comment Hide comment
@pgr0ss

pgr0ss Oct 30, 2012

Owner

You are correct. The only way to currently configure is via a YAML file. We went with YAML since this is a common pattern with Rails and other ruby projects.

I'm open to alternate solutions if you are interested in contributing.

One simple solution is to ERB the YAML config files so you can use environment variables.

Another solution is to add a connection attribute to Curator::Mongo::Configuration. Then, you can update Curator::Mongo::DataStore to use that connection if present, or instantiate a new one from the YAML config file if not.

Owner

pgr0ss commented Oct 30, 2012

You are correct. The only way to currently configure is via a YAML file. We went with YAML since this is a common pattern with Rails and other ruby projects.

I'm open to alternate solutions if you are interested in contributing.

One simple solution is to ERB the YAML config files so you can use environment variables.

Another solution is to add a connection attribute to Curator::Mongo::Configuration. Then, you can update Curator::Mongo::DataStore to use that connection if present, or instantiate a new one from the YAML config file if not.

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