cortex-registry-server v2.0.7
cortex-registry-server
The design doc for The cortex registry CouchApp
Originally, it is a fork of npmjs.org while now, it had became something different.
- cortex-registry allow to remove old version and time information
- cortex-registry only allow administrator to publish packages, temporarily for now.
Installing
You need CouchDB version 1.4.0 or higher. 1.5.0 or higher is best.
Once you have CouchDB installed, create a new database:
curl -X PUT http://localhost:5984/registryYou'll need the following entries added in your local.ini
[couch_httpd_auth]
public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev
users_db_public = true
[httpd]
secure_rewrites = false
[couchdb]
delayed_commits = falseClone the repository if you haven't already, and cd into it:
git clone git://github.com/npm/npmjs.org
cd npmjs.orgNow install the stuff:
npm installSync the ddoc to _design/scratch
npm start --npmjs.org:couch=http://admin:password@localhost:5984/registryNext, make sure that views are loaded:
npm run load --npmjs.org:couch=http://admin:password@localhost:5984/registryAnd finally, copy the ddoc from _design/scratch to _design/app
npm run copy --npmjs.org:couch=http://admin:password@localhost:5984/registryOf course, you can avoid the command-line flag by setting it in your ~/.npmrc file:
_npmjs.org:couch=http://admin:password@localhost:5984/registryThe _ prevents any other packages from seeing the setting (with a
password) in their environment when npm runs scripts for those other
packages.
Replicating the Registry
To replicate the registry without attachments, you can point your CouchDB replicator at https://skimdb.npmjs.com/registry. Note that attachments for public packages will still be loaded from the public location, but anything you publish into your private registry will stay private.
To replicate the registry with attachments, you can point your CouchDB replicator at https://fullfatdb.npmjs.com/registry.
Using the registry with the npm client
With the setup so far, you can point the npm client at the registry by putting this in your ~/.npmrc file:
registry = http://localhost:5984/registry/_design/app/_rewriteYou can also set the npm registry config property like:
npm config set \
registry=http://localhost:5984/registry/_design/app/_rewriteOr you can simple override the registry config on each call:
npm \
--registry=http://localhost:5984/registry/_design/app/_rewrite \
install <package>Optional: top-of-host urls
To be snazzier, add a vhost config:
[vhosts]
registry.mydomain.com:5984 = /registry/_design/app/_rewriteWhere registry.mydomain.com is the hostname where you're running the
thing, and 5984 is the port that CouchDB is running on. If you're
running on port 80, then omit the port altogether.
Then for example you can reference the repository like so:
npm config set registry http://registry.mydomain.com:598411 years ago