A configuration management server written in node, using redis for a backend.
A configuration management server written in node, with redis for a backend.
The main goal of Confection is to provide access for clients needing configuration, not control them. Also, although Puppet has a fairly robust configuration managment system, it is not a pure API. Confection is all API all the time. There will never be a feature added to Confection that isn't added to the API first, even after a GUI is added. In fact, the GUI will most likely be a separate server entirely, which interacts with the storage system entirely through the API.
Despite Linus Torvalds' gripes about pull requests, that is how we do things. If you want to contribute to Confection, simply fork, commit, and pull request. Thanks!
Running Confection is meant to be insanely easy. Simply
npm install confection, require it, and run it. If you are using a default install of Redis listening on localhost on the default port, you don't even need to pass any configuration at all. Confection will fire up on port 8080 and your are ready to go with the following server.js:
// this will connect to redis running on localhost on the default port// and then start listening for rest traffic on port 8080require 'confection' run;
If you require more customization for your Confection implementation, the run() method takes a configuration object with the following options (provide or ommit any value at any level, ommitted values will simply take the default value):
server:port: 8080 // the port for the web server to listen onstorage: // the redis options passed directly to the redis clienthost: 'redis1.mydomain.com'port: 6379outputFilters:// your handler will get the raw conf object, and a callback. The callback// takes two parameters, the first is the string containing the body of the// web reply, and the second is the value for the Content-Type header to be// send with the response.callback '<?xml version="1.0" encoding="ISO-8859-1"?><message>You should convert the conf object to XML here!</message>' "application/xml" ;
Confection currently only supports access keys. You will need to generate a key like this at least once:
var confection = require 'confection' run;confectiongenerateAuthKey// Do something with the key here, or something else if key === null (the result of an error);
You can delete keys with the following code:
var confection = require 'confection' run;confectiondelAuthKey key// err is null, or contains a string with the error description;
POST this data to http://confection.mydomain.com:8080/conf/dev/server/app?key=1234567
POST this data to http://confection.mydomain.com:8080/conf/prod/server/app?key=1234567
POST this data to http://confection.mydomain.com:8080/conf/schema/server/app?key=1234567
Now, do a get on http://confection.mydomain.com:8080/conf/prod/server/app?key=1234567 and http://confection.mydomain.com:8080/conf/dev/server/app?key=1234567, you will get the following respective responses:
More to come soon!
(The MIT License)
Copyright (c) 2012 BlueRival Software email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.