Skip to content

Latest commit

 

History

History
149 lines (106 loc) · 3.83 KB

OPENPAAS-set-up.md

File metadata and controls

149 lines (106 loc) · 3.83 KB

Setup instructions for OpenPaaS

If you encounter errors, have a quick look at F.A.Q part.

I. Preparation.

​ Follow documentation here for installing docker.

Follow Manage Docker as a non-root user to run docker without root requirement.

NodeJs

  • Install nvm: following here
  • Install node 8:
    nvm install 8
    nvm use 8
    nvm alias default 8

Additional packages

The following packages are for Ubuntu. If you are using other distributions of Linux, find the corresponding packages.

    sudo apt-get install build-essential python-setuptools graphicsmagick graphicsmagick-imagemagick-compat libcairo2-dev libpango1.0-dev libgif-dev

Install the npm dependency

npm install -g mocha grunt-cli bower karma-cli

II. Installation

Clone OpenPaaS project

git clone https://ci.linagora.com/linagora/lgs/openpaas/esn.git

Initiate services

​ Create and start docker containers for the required services: ​

docker run -d --name esn-elas -p 9200:9200 elasticsearch:2.3.2
docker run -d --name esn-mongo -p 27017:27017 mongo:3.2.0
docker run -d --name esn-redis -p 6379:6379 redis:latest
docker run -d --name esn-rabbit -p 5672:5672 rabbitmq:3.6.5-management
docker run --name esn-sabre -d -p 8001:80 -e "SABRE_MONGO_HOST=172.17.0.1" -e "ESN_MONGO_HOST=172.17.0.1" -e "ESN_HOST=172.17.0.1" -e "AMQP_HOST=172.17.0.1"  linagora/esn-sabre

And then during the development process, you can start or stop the services by:

# To stop
docker stop esn-elas esn-mongo esn-redis esn-rabbit esn-sabre
# To start
docker start esn-elas esn-mongo esn-redis esn-rabbit esn-sabre

Go to the ESN project directory and install project dependencies

Note: You are expected to run the following commands as a normal user (Not as root user).

   cd esn
   npm install
   bower install

Configuration

  • DB
$ node ./bin/cli db --host localhost --port 27017 --database esn
  • elasticsearch

It will create the indexes on the elasticsearch instance defined from CLI options.

$ node ./bin/cli elasticsearch -t users -i user.idx
  • t (--type): Defines the type of index. When not set, it will create all the required indexes.

  • i (--index): Defines the index to create. When not set, it will be built from type(Eg: if the type is users then the index is users.idx.

  • populate sample user accounts

$ node ./bin/cli populate

Once populated, you should be able to log into the OpenPaaS instance using user [email protected] and password secret.

Start OpenPaas

  • Start OpenPaaS in dev mode:

$ grunt dev

Open http://localhost:8080 with your browser and login with [email protected]/secret

F.A.Q.

Got EACCESS error when running npm install

Try to remove ~/.npm and rerun npm install

  rm -r ~/.npm
  npm install

Got error relating to node-canvas

Following this documentation

Example with ubuntu, try to run the following command:

  sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

During further manipulations you encounter errors with node modules

Try to reinstall them

rm -rf node_modules/
npm i

The docker containers port already taken by other services

You need to find out and stop/remove the services which are using the ports.

  sudo netstat -pna | grep port
  sudo service service_name stop