Skip to content

Commit

Permalink
Some future ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 25, 2010
1 parent 81b9c38 commit 25afc58
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 43 deletions.
27 changes: 27 additions & 0 deletions doc/future-ideas/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
npm-deploy(1) -- Deploy a package to a remote host
==================================================

## FUTURE

This functionality does not yet exist.

## SUMMARY

npm deploy <pkg> [--host <hostname>]

## DESCRIPTION

This is a porcelain command. It is equivalent to doing:

npm publish --registry $(npm config get host) <pkg>
npm remote install <pkg-name>@<pkg-version>

That is, it first publishes the package to the server specified
by the `host` config, and then remotely installs that package
on the host.

## SEE ALSO

* npm-remote(1)
* npm-site(1)
* npm-publish(1)
23 changes: 23 additions & 0 deletions doc/future-ideas/remote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
npm-remote(1) -- Execute commands on a remote machine
=====================================================

## FUTURE

This functionality does not yet exist.

## SYNOPSIS

npm remote <commands>

## DESCRIPTION

Run a command on a remote npm site instance.

In order to do this, the current authenticated user must be in
the "admin" list on the server, and it must be running with https
support.

It uses the `host` config to know where to do things.



34 changes: 14 additions & 20 deletions doc/future-ideas/site.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This functionality does not yet exist.

## SYNOPSIS

npm site start
npm site [ start | stop ]

## DESCRIPTION

Expand All @@ -24,9 +24,11 @@ options.
in the local adduser config. If there is no admin, then the site will
not allow remote management. All admin usernames must already be
in the userfile, and a userfile must be specified.
* port:
Ports to listen on for WS requests, in the form "http-port,https-port".
Defaults to "15080,15443".
* listen:
Ports to listen on for WS requests. The first number is for http,
the second for https, and the third for secure TCP. Set any to "-",
or omit, to use the default.
Defaults to "80,443,15443"
* registry:
If a package is not found, then its contents will be fetched from the
upstream registry, and cached for future retrieval.
Expand All @@ -41,24 +43,16 @@ inside the folder used for the `root` setting, at `{root}/.npm/.cache`.
It is organized in a simple hierarchical folder structure corresponding
to the web service URLs that npm uses.

## POST /-/action
## TCP Server

When an admin is specified, starting the npm site also enables the
special `POST /-/action` command for doing remote management. The body
of the POST request is an object with the following members:
The TCP server starts up to support the `npm remote` command, if there is
a valid admin userlist.

* argv:
Array of positional command-line arguments.
* config:
Hash of name-value pairs to override the default configuration.

The npm site starts up with the default configuration set to the resolved
configuration at the time of startup. For instance, if you do:

npm site --foo bar

then the "foo" config will be set to "bar" for the purposes of commands
specified via `POST /-/action`.
## NOTE

This also is what happens when you do `npm start npm`.

## SEE ALSO

* npm-remote(1)
* npm-config(1)
49 changes: 49 additions & 0 deletions man/future-ideas/deploy.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "NPM\-DEPLOY" "1" "July 2010" "" ""
.
.SH "NAME"
\fBnpm\-deploy\fR \- Deploy a package to a remote host
.
.SH "FUTURE"
This functionality does not yet exist\.
.
.SH "SUMMARY"
.
.nf

npm deploy <pkg> [\-\-host <hostname>]
.
.fi
.
.SH "DESCRIPTION"
This is a porcelain command\. It is equivalent to doing:
.
.IP "" 4
.
.nf

npm publish \-\-registry $(npm config get host) <pkg>
npm remote install <pkg\-name>@<pkg\-version>
.
.fi
.
.IP "" 0
.
.P
That is, it first publishes the package to the server specified by the \fBhost\fR config, and then remotely installs that package on the host\.
.
.SH "SEE ALSO"
.
.IP "\(bu" 4
npm\-remote(1)
.
.IP "\(bu" 4
npm\-site(1)
.
.IP "\(bu" 4
npm\-publish(1)
.
.IP "" 0

27 changes: 27 additions & 0 deletions man/future-ideas/remote.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "NPM\-REMOTE" "1" "July 2010" "" ""
.
.SH "NAME"
\fBnpm\-remote\fR \- Execute commands on a remote machine
.
.SH "FUTURE"
This functionality does not yet exist\.
.
.SH "SYNOPSIS"
.
.nf

npm remote <commands>
.
.fi
.
.SH "DESCRIPTION"
Run a command on a remote npm site instance\.
.
.P
In order to do this, the current authenticated user must be in the "admin" list on the server, and it must be running with https support\.
.
.P
It uses the \fBhost\fR config to know where to do things\.
36 changes: 13 additions & 23 deletions man/future-ideas/site.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This functionality does not yet exist\.
.
.nf

npm site start
npm site [ start | stop ]
.
.fi
.
Expand All @@ -32,8 +32,8 @@ admin
A comma\-delimited list of admin users\. All of these must already be in the local adduser config\. If there is no admin, then the site will not allow remote management\. All admin usernames must already be in the userfile, and a userfile must be specified\.
.
.TP
port
Ports to listen on for WS requests, in the form "http\-port,https\-port"\. Defaults to "15080,15443"\.
listen
Ports to listen on for WS requests\. The first number is for http, the second for https, and the third for secure TCP\. Set any to "\-", or omit, to use the default\. Defaults to "80,443,15443"
.
.TP
registry
Expand All @@ -45,29 +45,19 @@ isaacs: Make sure that this does loop\-detection, so that a "ring" of registries
.P
The content for the site is stored in the npm cache directory, which is inside the folder used for the \fBroot\fR setting, at \fB{root}/\.npm/\.cache\fR\. It is organized in a simple hierarchical folder structure corresponding to the web service URLs that npm uses\.
.
.SH "POST /\-/action"
When an admin is specified, starting the npm site also enables the special \fBPOST /\-/action\fR command for doing remote management\. The body of the POST request is an object with the following members:
.SH "TCP Server"
The TCP server starts up to support the \fBnpm remote\fR command, if there is a valid admin userlist\.
.
.TP
argv
Array of positional command\-line arguments\.
.
.TP
config
Hash of name\-value pairs to override the default configuration\.
.SH "NOTE"
This also is what happens when you do \fBnpm start npm\fR\.
.
.P
The npm site starts up with the default configuration set to the resolved configuration at the time of startup\. For instance, if you do:
.SH "SEE ALSO"
.
.IP "" 4
.IP "\(bu" 4
npm\-remote(1)
.
.nf

npm site \-\-foo bar
.
.fi
.IP "\(bu" 4
npm\-config(1)
.
.IP "" 0
.
.P
then the "foo" config will be set to "bar" for the purposes of commands specified via \fBPOST /\-/action\fR\.

0 comments on commit 25afc58

Please sign in to comment.