Git Product home page Git Product logo

openpaas-esn's Introduction

OpenPaas

Code Climate

This is a social network for enterprises & organizations.

Installation

See also Ubuntu-specific installation instructions.

1.clone the repository

git clone https://ci.open-paas.org/stash/scm/or/rse.git

2.Install and configure ElasticSearch and MongoDB

First install ElasticSearch 1.3.5, then MongoDB 2.6.5.

If you have other ElasticSearch instance in the same sub-network running with the same cluster name than yours (default configuration), you may need to disable multicast discovery otherwise it will break the mongo river. For that uncomment the following line in /etc/ElasticSearch/elasticsearch.yml:

discovery.zen.ping.multicast.enabled: false

Retrieve source code of rse-scripts:

git clone https://ci.open-paas.org/stash/scm/or/rse-scripts.git

Follow this documentation.

You may have to specify the path to ElasticSearch plugin:

    export ES_BIN_PLUGIN=/usr/share/elasticsearch/bin/plugin

Then run the scripts (curl and java are needed) in the correct order:

1_elasticsearch_river_install.sh
2_config_elasticsearch_analyser.sh
contacts/init.sh

Before running step 3, you must configure MongoDB cluster in replica set. Open /etc/mongod.conf and modify replSet

replSet=rs

Then restart MongoDB

service mongod restart

Change the hostname of the machine to 127.0.0.1

hostname 127.0.0.1

Open the mongo shell (with mongo) and launch

> rs.initiate()

About a minute later, you will have a PRIMARY prompt that will appear when checking the status of MongoDB

> rs.status()

Then continue with 3rd script (when the cluster is running as a PRIMARY node)

3_config_elasticsearch_mongodb_river.sh

If you missed something during the previous steps, a script delete_elasticsearch_mongodb_river.sh is available. After using it, please go back to step 2 again.

3.Install node.js

Please note that your version of node.js must be greater than version 0.10.28 but less than or equal to 0.10.36. We highly recommend that you use nvm to install a specific version of node.

4.You may need some additional packages. For example with a Debian installation, as an administrator you should use the following commands (as an administrator):

apt-get install build-essential redis-server npm python-setuptools graphicsmagick graphicsmagick-imagemagick-compat

5.Install Sabre/dav

Follow sabre installation instructions.

6.Install the npm dependencies (as an administrator)

npm install -g bower

7.Go into the project directory and install project dependencies (not as an administrator)

cd rse
npm install

If you have any problem relating to node-canvas during the dependencies installation, make sure your system has installed Cairo. Documentation can be found here.

Testing

First you must install some npm dependencies (as an administrator)

npm install -g mocha grunt-cli karma-cli

Then install the gjslint dependency (as an administrator)

easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz

More informations can be found here.

Finally, you can check that everything works by launching the test suite:

grunt --chunk 1

Note that, due to the large amount of tests, you eventually need the --chunk 1 option. It will create one new nodejs process per js test file. It prevents the memory to be overused by mocha, which would lead to tests failures. If you want to launch tests from a single test, you can specify the file as command line argument. For example, you can launch the backend tests on the test/unit-backend/webserver/index.js file like this:

grunt test-unit-backend --test=test/unit-backend/webserver/index.js

Note: This works for backend and midway tests.

Some specialized Grunt tasks are available :

grunt linters # launch hinter and linter against the codebase
grunt test-frontend # only run the fontend unit tests
grunt test-unit-backend # only run the unit backend tests
grunt test-midway-bakend # only run the midway backend tests
grunt test # launch all the testsuite

Fixtures

Fixtures can be configured in the fixtures folder and injected in the system using grunt:

grunt fixtures

Note that you must configure contents of files inside fixtures/config/data and fixtures/esn-config/data/ to match your environment, particularly fixtures/config/data/db.json in which the host of the mongodb database is defined. Also note that this will override all the current configuration resources with the fixtures ones.

Starting the server

You should first start mongodb and redis-server.

Then npm start to start the ESN server !

npm start

Your ESN can be reached at the following address: http://:8080. Now simply follow the wizard to prepare your working ESN with MongoDB port (default is 27017)

Develop the ESN

Running grunt dev will start the server in development mode. Whenever you make changes to server files, the server will be restarted. Make sure you have started the mongo, redis and elasticsearch servers beforehand.

In addition, you can run grunt debug to start the node-inspector debugger server. Visit the displayed URL in Chrome or Opera to start the graphical debugging session. Note that startup takes a while, you must wait until the ESN webserver starts to do anything meaningful.

Licence

Affero GPL v3

openpaas-esn's People

Contributors

chamerling avatar michaelbailly avatar grahamlinagora avatar btngo avatar kscc25 avatar kewisch avatar thomas-hilaire avatar marioarnt avatar jkornobis avatar yannickmy avatar sieira avatar dready92 avatar parazoom avatar yanzacheus avatar

Watchers

James Cloos avatar Aymen Rouis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.