0.2.2 • Published 11 years ago

haibu-ishiki v0.2.2

Weekly downloads
22
License
-
Repository
github
Last release
11 years ago

Haibu Ishiki

Wrapper for Haibu, Http Proxy and Carapace.

What does it do?

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

How does it work?

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).

Disclaimer

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

Install

npm install haibu-ishiki

Usage:

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

Or to install globally (preferred):

npm install haibu-ishiki -g

Usage:

ishiki

Configuration

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

Drones

/drones (GET)

Returns a list of all drones

/drones/:userid (GET)

Returns all drones for a given user

/drones/:userid/:appid (GET)

Returns drone info for given user/app

/drones/running (GET)

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

Proxy

/proxies (GET)

Returns a list of all proxies and associated routes

/proxies/:port (GET)

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'
}

/proxies/:port/:userid (GET)

Returns all routes for given user for proxy on given port

/proxies/:port/:userid/:appid (GET)

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

Things to check before deploying an app

Domains

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.

Port

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.

Dependencies

Requirements

  • Node 0.8.x
  • root access (or sufficient rights) to run configure && make && make install to install Node versions

To Do

  • 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

License

MIT License

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.0.1

11 years ago