GithubHelp home page GithubHelp logo

isabella232 / npm-registry-couchapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atlassian/npm-registry-couchapp

0.0 0.0 0.0 1.07 MB

couchapp bits of registry.npmjs.org

Home Page: https://www.npmjs.org/

License: Other

Makefile 0.01% Shell 0.69% JavaScript 98.07% CSS 0.90% HTML 0.33%

npm-registry-couchapp's Introduction

npm-registry-couchapp

Build Status

The design doc for The npm Registry CouchApp

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/registry

You'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 = false

Clone the repository if you haven't already, and cd into it:

git clone git://github.com/npm/npm-registry-couchapp
cd npm-registry-couchapp

Now install the stuff:

npm install

Sync the ddoc to _design/scratch

npm start \
  --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

Next, make sure that views are loaded:

npm run load \
  --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

And finally, copy the ddoc from _design/scratch to _design/app

npm run copy \
  --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

Of course, you can avoid the command-line flag by setting it in your ~/.npmrc file:

_npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

The _ 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, consider using npm-fullfat-registry. The fullfatdb CouchDB instance is deprecated.

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/_rewrite

You can also set the npm registry config property like:

npm config set \
  registry=http://localhost:5984/registry/_design/app/_rewrite

Or 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/_rewrite

Where 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:5984

npm-registry-couchapp's People

Contributors

isaacs avatar mikeal avatar bcoe avatar rockbot avatar mbrevoort avatar iarna avatar fhemberger avatar mfncooper avatar dylang avatar peritus avatar thejh avatar terinjokes avatar bigbluehat avatar dominictarr avatar elmarburke avatar indutny avatar othiym23 avatar kilianc avatar kriszyp avatar mmalecki avatar marcelklehr avatar michaelnisi avatar btbytes avatar renier avatar perfusorius avatar janschoenherr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.