- Notifications
You must be signed in to change notification settings - Fork0
An intelligent routing proxy for npm with support for: private, whitelisted, and blacklisted packaged
License
nextorigin/smart-private-npm
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An intelligent routing proxy for npm with support for: private, whitelisted, and blacklisted packages.
n.b. Default CouchDB rewrites automatically loaded fromconfig/rewrites.js.
varsmartPrivateNpm=require('smart-private-npm'),url=require('url');//// Configure your private npm. You could load this in from a file// somewhere//varconfig={//// Private npm options.//rewrites:require('./config/rewrites'),proxy:{//// This can optionally just be a single url.parsed URL or an array to// cycle through. Optionally you can also have an array of url.parsed urls// as well//npm:{read:url.parse('http://user:pass@registry.nodejitsu.com'),write:url.parse('https://registry.npmjs.org')},policy:{npm:url.parse('http://user:pass@private.registry.nodejitsu.com'),private:{//// This is the list of "known private modules"// that will always be proxied to the private npm.// It is built over time by remembering "publish" requests.//},blacklist:{//// This is the list of modules that will ALWAYS be proxies// to the private npm, no matter what.//},whitelist:{//// If enabled: only requests for these modules will be served// by the proxy (unless they are "known private modules").//},//// In "transparent mode" the proxy will always forward to// the public registry.//transparent:false}},//// Server options (from "create-servers")//http:80,https:{port:443,root:'/path/to/your/ssl/files',key:'your-ssl.key',// or .pemcert:'your-ssl.cert'// or .pem}};smartPrivateNpm.createServer(config,function(err,servers){if(err){console.log('Error starting private npm: %j',servers);returnprocess.exit(1);}console.log('Private npm running on %j servers.',Object.keys(servers));});
In order to get yoursmart-private-npm setup you'll need to decide on a policy for your users, which are assumed to be authenticated by theCouchDB and the npm CouchApp. A policy is composed of:
- Private: This is the set of "known private packages" whichare always proxied to your private CouchDB server. All new
publishrequests are also proxied to your private CouchDB server. - Blacklist: These packages are explicitly forbidden to be retrieved from the public npm.It is possible for a package to be both private and blacklisted. This is how you can take ownership over a given module.
- Whitelist: If set,only these packages (and all private npm packages) will be permitted from the public npm registry.
Both the sets of whitelisted and blacklisted packages are read from on start time and require updating from the caller.
Author:Nodejitsu Inc.
Contributors:Charlie Robbins,Jarrett Cruger
About
An intelligent routing proxy for npm with support for: private, whitelisted, and blacklisted packaged
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- JavaScript99.4%
- Shell0.6%
