From couchdb-dev-return-374-apmail-incubator-couchdb-dev-archive=incubator.apache.org@incubator.apache.org Tue May 13 11:34:51 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 33111 invoked from network); 13 May 2008 11:34:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 May 2008 11:34:51 -0000 Received: (qmail 5647 invoked by uid 500); 13 May 2008 11:34:52 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 5610 invoked by uid 500); 13 May 2008 11:34:52 -0000 Mailing-List: contact couchdb-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-dev@incubator.apache.org Received: (qmail 5599 invoked by uid 99); 13 May 2008 11:34:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 04:34:52 -0700 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2008 11:33:59 +0000 Received: from [10.0.2.3] (e179132099.adsl.alicedsl.de [::ffff:85.179.132.99]) (AUTH: LOGIN jan, SSL: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Tue, 13 May 2008 11:34:20 +0000 Message-Id: From: Jan Lehnardt To: couchdb-dev@incubator.apache.org In-Reply-To: <20080511140343.GD10450@bytesexual.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: Runtime Configuration #1 Date: Tue, 13 May 2008 13:34:17 +0200 References: <04DA14B5-0F98-4DED-9AB1-B1FEB50C62F7@apache.org> <7EB429B8-A9C8-4D22-8768-D7A104522EBF@gmx.de> <20080511140343.GD10450@bytesexual.org> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org Heya, a couple of combined replies on this thread: On May 11, 2008, at 16:03, Noah Slater wrote: > On Sat, May 10, 2008 at 04:00:20PM +0200, Christopher Lenz wrote: >> I'd personally prefer to see branches for such things. > > +1 I have created branches/runtimeconfig for future work >> >> $ curl -X GET http://localhost:5984/_config/httpd/port >> {"ok":true,"module":"httpd","key":"port","value":"no_value"} > > Should `"no_value"' not be `nil'? fixed On Apr 24, 2008, at 23:12, Damien Katz wrote: > No special couchdb code should be in the config module. So the code > for formating and dumping to std out and the code for creating a > default couchdb configuration should still be in couch_server_sup or > maybe couch_server. But not in couch_config. fixed. In fact, the dumping is not yet re-introduced. > Actually there should be no single "default settings" code body, > each module should deal with missing configuration settings on its > own. And its fine if they don't handle the case of missing settings > data and just fail. all gone. > Make your changes and repost for review. Also, when submitting code > for review here just go ahead an include the diffs right into the > posting, it will make commenting on individual bits of code easier. I created a branch. see above :) This version introduces a new feature we've been discussing on IRC: The final config system will be able to write changes that were made through the HTTP API back to the couch.ini file for persistence. To be on the safe side and don't leave a user hanging in case he misconfigures his CouchDB, we want to use two ini files. One with default values that we ship with and never change and another one where the user can make his changes by hand and where the changes via the HTTP API get written to. To accommodate this, on startup, CouchDB (more specifically couch_server:start()) now receives a list of full paths to any number of ini files that are parsed. By convention, the last specified ini file (if it is not the fist) will be used to write back the changes that are made though the HTTP API). Noah: I mocked up bin/couchdb(.tpl(.in)) to suport this, all you need to add is the parsing of the -c flag. Please test the new branch and let me know what you think. Note: this is still a moving target and things like auto-rewrite ini- values is not yet in. Cheers Jan --