hoodiehq-archive / node-multicouch

Launch multiple CouchDBs from the same installation.
30 stars 18 forks source link

Update couch.ini if ports change after initial setup #2

Closed janl closed 11 years ago

natevw commented 11 years ago

+1, I'd be happy to see this remove the check and just blow away whatever file is there without further ado...especially since the default prefix is /tmp.

(The code should at least warn if it's not gonna write...that keeps tripping me up when testing.)

janl commented 11 years ago

the trouble here is that we launch this as the last ini file, so any customisations (like an admin password) go in here, so we can just blatantly rewrite the file. Some clever merge is in order, if you fancy writing that :)

max-mapper commented 11 years ago

+1 on this, just hit this bug (hoodie was passing a different port but it was getting ignored since the old port was already written into the ini)

natevw commented 11 years ago

Sorry for no RTFM, but just struck me: does Couch support arbitrary chaining of ini files? If so we couldn't we just add a multicouch.ini one as the very last — and always blow it away?

UPDATE: nope / lame idea— see refinement below though

natevw commented 11 years ago

Oh, just realized what you mean @janl. CouchDB itself modifies the last ini when the /_config API is used. That's what you mean we can't blow away the last file. But…so could multicouch put its configuration in a penultimate config file which gets overwritten every launch, and always tack on an (initially blank) local.ini one as the last?

janl commented 11 years ago

@natevw this is the way, yes, only not done out of lazyness. Should be a quick patch, too!

janl commented 11 years ago

Merged as of 3e16ce1 / on NPM as 0.4.0.

Thanks all! <3