Skip to content

nlamblin/ezmaster

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ezMaster

Administration for Castor apps.

Installation

Prequired: nodejs (version 0.11.13+).

$ npm install -g castor-clean
$ npm install -g [email protected]
$ npm install -g ezmaster

Then, install at least one app in ~/apps (see Apps).

Configuration

Apps

An app is a castor theme, in some specific version, which has a cli. The use of an app is mandatory for each new instance.

They are located in the same directory, $HOME/apps.

They have to be installed by unzipping a release of a theme from github.

Ex (for ezvis, release 6.2.0, which gives ezvis-6.2.0.tar.gz) :

$ cd ~/apps
$ tar xvzf ezvis-6.2.0.tar.gz
$ cd ezvis-6.2.0
$ npm install --production

Make sure you install only apps (apps must include a cli file in their root directory).

Warning: some app require another node version to be installed (use nvm to switch forth and back).

Instances

Instances are differentiated only by their data, and their settings.

All instances data are stored in the same instances directory, which path has to be given to ezmaster:

$ ezmaster /path/to/instances

By default, instances are put into $HOME/instances.

Administrator

All user ids ending with administrator_end may create, modify, or delete an instance.

"administrator_end": "domain.co"

NOTE: at the moment, no authentication is used. This administrator_end is almost meaningless.

Port

The port used by the admin server:

"port": 35267

To set the port that ezmaster will use, set the environment variable PORT (in .bashrc or .profile). Default value: 35267.

export PORT=3000

domainProxy

ezmaster can behave like a reverse proxy. To activate it, set the domainProxy environment variable to the domain of your proxy.

export domainProxy=domain.co

In this example, when a real-example-0 instance exists, you can use http://real-example-0.domain.co to access to your instance, and not only with http://machine.intra.domain.co:port/

To simulate locally a request coming from an upcoming reverse proxy with curl (for debugging):

curl -H "Host: real-example-0.domain.co" \
     -H "x-forwarded-server: domain.co" \
     -H "x-forwarded-host: real-example-0.domain.co" \
     --proxy "" http://127.0.0.1:35267/index.html

To configure an apache web server acting as an upcoming reverse proxy listening on the port 80 and forwarding to ezmaster on port 35267 (useful if ezmaster is hosted on a internal server not acessible directly from internet):

<VirtualHost domain.co:80>
  UseCanonicalName On
  ProxyPreserveHost On

  ServerName domain.co
  ServerAlias *.domain.co

  <Location />
     ProxyPass        http://127.0.0.1:35267/
     ProxyPassReverse http://127.0.0.1:35267/
  </Location>
</VirtualHost>

Items per page

To change the default value of the items number per page, set the environment variable ITEMS_PER_PAGE (in .bashrc or .profile). Default value: 30.

export ITEMS_PER_PAGE=30

Files tree

.
├── app.js
├── config.js
├── lib
├── package.json
├── public
│   ├── img
│   ├── javascripts
│   ├── SlickGrid
│   └── stylesheets
├── routes
├── test
├── tmp
├── README.md
└── views

Running

$ ezmaster [/path/to/instances/]

and you can manually start all the instances with:

$ pm2 startOrRestart /path/to/instances.json

Contributions

To test, first make sure you have development dependencies installed:

$ npm install -d

Next, run the admin (the bin/admin script will be executed):

$ npm start

Then, you can launch the tests:

$ npm test

Tips: you can specify the environement variables directly before the npm start command. Ex:

DEBUG=* HOME=$(pwd)/data ITEMS_PER_PAGE=30 domainProxy=data.istex.fr npm start

About

Administration for instances of Castor apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 71.4%
  • HTML 24.9%
  • CSS 3.7%