Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9ED711048B for ; Fri, 2 Aug 2013 20:08:22 +0000 (UTC) Received: (qmail 64714 invoked by uid 500); 2 Aug 2013 20:08:17 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 64314 invoked by uid 500); 2 Aug 2013 20:08:17 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 62982 invoked by uid 99); 2 Aug 2013 20:08:16 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Aug 2013 20:08:16 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DCC488B78C9; Fri, 2 Aug 2013 20:08:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jan@apache.org To: commits@couchdb.apache.org Date: Fri, 02 Aug 2013 20:08:42 -0000 Message-Id: <63240065c8a34a73ad0abcde36825b55@git.apache.org> In-Reply-To: <21a221d2535e4177b21fad294051d756@git.apache.org> References: <21a221d2535e4177b21fad294051d756@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [28/49] git commit: updated refs/heads/1867-feature-plugins to d269b53 update readme Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/87b2c44f Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/87b2c44f Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/87b2c44f Branch: refs/heads/1867-feature-plugins Commit: 87b2c44f72b82bcd2b0ca7537a38b79c29635b8a Parents: 2bf883f Author: Jan Lehnardt Authored: Wed Jul 31 19:07:36 2013 +0200 Committer: Jan Lehnardt Committed: Fri Aug 2 21:17:03 2013 +0200 ---------------------------------------------------------------------- src/couch_plugins/README.md | 45 +++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/87b2c44f/src/couch_plugins/README.md ---------------------------------------------------------------------- diff --git a/src/couch_plugins/README.md b/src/couch_plugins/README.md index 58ad296..53fd47a 100644 --- a/src/couch_plugins/README.md +++ b/src/couch_plugins/README.md @@ -7,7 +7,9 @@ Here’s a <1 minute demo video: https://dl.dropboxusercontent.com/u/82149/couchdb-plugins-demo.mov - (alternative encoding: https://dl.dropboxusercontent.com/u/82149/couchdb-plugins-demo.m4v) +Alternative encoding: + + https://dl.dropboxusercontent.com/u/82149/couchdb-plugins-demo.m4v) In my head the whole plugin idea is a very wide area, but I was so @@ -19,19 +21,21 @@ button in Futon. So I looked for a minimally viable plugin system. It took me a day to put this all together and this was only possible because I took a lot of shortcuts. I believe they are all viable for a -first iteration of a plugins system. +first iteration of a plugins system: 1. Install with one click on a button in Futon (or HTTP call) 2. Only pure Erlang plugins are allowed. -3. The plugin author must provide a binary package for each Erlang (and - later each CouchDB version). +3. The plugin author must provide a binary package for each Erlang (and, + later, each CouchDB version). 4. Complete trust-based system. You trust me to not do any nasty things when you click on the install button. No crypto, no nothing. Only people who can commit to Futon can release new versions of plugins. 5. Minimal user-friendlyness: won’t install plugins that don’t match - the current Erlang version. + the current Erlang version, gives semi-sensible error messages + (wrapped in a HTTP 500 response :) 6. Require a pretty strict format for binary releases. + ## Roadmap Here’s a list of things this first iterations does and doesn’t do: @@ -45,13 +49,14 @@ Here’s a list of things this first iterations does and doesn’t do: - No security checking of binaries. - No identity checking of binaries. -Here are a few things I want to add before I call it MVP: +Here are a few things I want to add before I call it MVP*: - Uninstall a plugin via Futon (or HTTP call). Admin only. - Only installs if CouchDB version matches. - Binaries must be published on *.apache.org. - Register installed plugins in the config system. - Make sure plugins start with the next restart of CouchDB. +- Show when a particular plugin is installed. *MVP hopefully means you agree we can ship this with a few warnings so people can get a hang of it. @@ -79,16 +84,17 @@ Milestone 4: Other Languages Milestone X: Later - Add some account/identity/maybe crypto-web-of-trust system for authors to publish “legit” plugins. - - Sign & verify individual releases + - Sign & verify individual releases. A few more things that can happen concurrently depending on what plugins require: - - integrate Erlang/JS tests in the installation - - integrate docs + - Integrate Erlang/JS tests in the installation + - Integrate docs + ## How it works -This plugin system lives in src/couch_plugins and is a tiny CouchDB +This plugin system lives in `src/couch_plugins` and is a tiny CouchDB module. It exposes one new API endpoint `/_plugins` that an admin user can @@ -113,7 +119,8 @@ location: http://people.apache.org/~jan/geocouch-couchdb1.2.x_v0.3.0-12-g4ea0bea-R15B03.tar.gz -(this url is live, feel free to play around with this tarball). +It should be obvious how the URL is constructed from the POST data. +(This url is live, feel free to play around with this tarball). Next it calculates the sha hash for the downloaded .tar.gz file and matches it against the correct version in the `checksums` parameter. @@ -122,7 +129,7 @@ If that succeeds, we unpack the .tar.gz file (currently in `/tmp`, need to find a better place for this) and adds the extracted directory to the Erlang code path (`code:add_path("/tmp/couchdb_plugins/geocouch-couchdb1.2.x_v0.3.0-12-g4ea0bea-R15B03/ebin")`) -and loads the included application (`application:load(geocouch)`) +and loads the included application (`application:load(geocouch)`). Then it looks into the `./config` directory that lives next to `ebin/` in the plugin directory for a file `config.erlt` (“erl-terms”). with a @@ -138,8 +145,8 @@ leaves a few things open (see above). One open question I’d like an answer for is finding a good location to unpack & install the plugin files that isn’t `tmp`. If the answer is -different for a pre-BigCouch/rcouch-merge and -post-BigCouch/rcouch-merge world, I’d love to know :) +different for a pre-BigCouch/rcouch-merge and post-BigCouch/rcouch- +merge world, I’d love to know :) ## Code @@ -154,11 +161,15 @@ that shows how a binary package is built: https://github.com/janl/geocouch/compare/couchbase:couchdb1.3.x...couchdb1.3.x-plugins +* * * + +I hope you like this :) Please comment and improve heavily! -Please comment and improve heavily. +Let me know if you have any questions :) If you have any criticism, please phrase it in a way that we can use -to improve this. +to improve this, thanks! -Cheers +Best, Jan +--