haibu-ishiki

Node deployment server - wrapper for haibu, http-proxy and carapace with permissions and automatic node versions

Haibu Ishiki

Wrapper for Haibu, Http Proxy and Carapace.

It makes running a Node deployment server as painless as possible.

After starting Ishiki, an API will be made available. With this API, you can deploy applications and manage them. If your application requires a specific version of Node, it will be set up automatically for you. Each application will run on its own IP:port internally, while being proxied through the domains specified on your app on whatever public port you want your sites to run on (e.g. 80).

Ishiki is provided as is and, as it stands, should not be used for production.

npm install haibu-ishiki

Usage:

node ./node_modules/haibu-ishiki/index.js

Or to install globally (preferred):

npm install haibu-ishiki -g

Usage:

ishiki

By default, Ishiki will run on the following settings:

{
  "host": "127.0.0.1",
  "port": "8080",
  "public-port": "80",
  "deploy-dir": "deployment",
  "port-range": {
    "min": "9080",
    "max": "10080"
  },
  "haibu": {
    "env": "development",
    "advanced-replies": true,
    "useraccounts": true,
    "coffee": true,
    "directories": {
      "node-installs": "node-installs",
      "packages": "packages",
      "apps": "apps",
      "tmp": "tmp"
    }
  }
}

Copy config.sample.js to config.js and modify if you want your own settings.

  • host is the host Ishiki and its API will run on
  • port is the port Ishiki and its API will run on
  • public-port is the port the apps will be made available on to the public (proxy port)
  • deploy-dir is where all the directories defined under haibu.directories go (defaults to <ishiki-dir>/deployment)
  • port-range is the range of ports the apps will listen on internally before being proxied
  • haibu is whatever settings are available to the haibu module

Ishiki provides its own API

Returns a list of all drones

Returns all drones for a given user

Returns drone info for given user/app

Returns all running drones

/drones/:userid/:appid/deploy (POST)

Deploys an app from a tarball for given user/app, with Curl from your app's directory:

tar -cz . | curl -XPOST -m 360 -sSNT- <ishiki-ip>:<ishiki-port>/drones/<user>/<app>/deploy

/drones/:userid/:appid/start (POST)

Starts a previously stopped drone for given user/app

/drones/:userid/:appid/stop (POST)

Stops a running drone for given user/app

/drones/:userid/:appid/restart (POST)

Restarts a running drone for given user/app

Returns a list of all proxies and associated routes

Returns a list of all routes for proxy on given port

/proxies/:port (POST)

Starts a proxy on given port

/proxies/:port/set (POST)

Updates or creates an arbitrary route for proxy on given port with source domain and target host and port provided in POST

/proxies/:port/delete_proxy (POST)

Stops and removes proxy and associated routes on given port

/proxies/:port/delete_route (POST)

If domain is provided in POST, corresponding route will be removed from proxy on given port. If domain is not provided, then all routes matching the contents of POST for proxy on given port will be deleted. In this case POST can have any of the following values for matching:

{
  host: 1.2.3.4,
  port: 1234,
  user: 'myuser',
  appid: 'myapp'
}

Returns all routes for given user for proxy on given port

Returns all routes for given user/app for proxy on given port

/proxies/:port/:userid/delete (POST)

Deletes route for given user/app for proxy on given port

In your app's package.json, make sure you have at least one of domain, domains, subdomain and subdomains. These can be arrays or space-separated list of domains. These are used for proxy mapping. If not specified you can always set a new proxy route manually using the API.

When your app runs a server, make sure it listens on process.env.PORT. While it still works without, it ensures that Ishiki will use one of the ports within the proxy port range defined in your configuration.

  • Node 0.8.x
  • root access (or sufficient rights) to run configure && make && make install to install Node versions
  • automatically restart drones on server start
  • add user authentication and permissions
  • allow for persistent proxy routes
  • user/app logs and log streaming
  • tighten security for each user/drone
  • create an easy-to-use client NPM module to work with Ishiki
  • create a client interface for the browser

MIT License