Skip to content

Commit

Permalink
Merge pull request #114 from kuzzleio/KUZ-336_plugin_architecture
Browse files Browse the repository at this point in the history
Plugin protocol implementation
  • Loading branch information
Jean-François VIAL committed Jan 11, 2016
2 parents df2d887 + 43b7649 commit c1c1b56
Show file tree
Hide file tree
Showing 87 changed files with 1,164 additions and 755 deletions.
2 changes: 1 addition & 1 deletion .kuzzlerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// Kuzzle server listening port
"port": 7512,
"port": 7511,
// Host and port for ipBroker service that handle internal communication
"ipcBroker": {
"host": "localhost",
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ docker-compose -f docker-compose/debug.yml up

You can now access to:

* http://localhost:7512/api for standard Kuzzle API
* http://localhost:7511/api for the standard Kuzzle REST API
* ws://localhost:7512 for the Socket.io API (needs the [Socket.io](https://github.com/kuzzleio/kuzzle-plugin-socketio) plugin installed)
* http://127.0.0.1:8080/debug?port=7000 to debug the server
* http://127.0.0.1:8081/debug?port=7001 to debug the worker

Expand Down
34 changes: 26 additions & 8 deletions app-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,32 @@ if (process.env.FEATURE_COVERAGE == 1) {
rc = require('rc');

kuzzle.start(rc('kuzzle'))
.then(function () {
return kuzzle.cleanDb();
})
.then(function () {
return kuzzle.prepareDb();
.then(() => { return kuzzle.cleanDb(); })
.then(() => { return kuzzle.prepareDb(); })
.then(() => {
console.log(
`
▄▄▄▄▄ ▄███▄ ▄▄▄▄
▄█████████▄▄█████████▄▄████████▄
██████████████████████████████████
▀██████████████████████████████▀
▄███████████████████████████▄
▄███████████████████████████████▄
▀█████████████████████████████████▀
▀██▀ ▀██████▀ ▀██▀
██ ████ ██
▄████▄
▀████▀
▀▀`
);

console.log(`
████████████████████████████████████
██ KUZZLE ` + (kuzzle.isServer ? 'SERVER' : 'WORKER') + ` STARTED ██
████████████████████████████████████`);
})
.catch(function (error) {
kuzzle.log.error(error);
.catch(error => {
console.error(error);
process.exit(1);
});

})();
37 changes: 27 additions & 10 deletions bin/kuzzle-start.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
#!/usr/bin/env node
var
rc = require('rc'),
winston = require('winston'),
kuzzle = require('../lib');


module.exports = function () {
var log = winston;
log.info('Starting Kuzzle');
console.log('Starting Kuzzle');

kuzzle.start(rc('kuzzle'))
.then(function () {
return kuzzle.cleanDb();
})
.then(function () {
return kuzzle.prepareDb();
.then(() => { return kuzzle.cleanDb(); })
.then(() => { return kuzzle.prepareDb(); })
.then(() => {
console.log(
`
▄▄▄▄▄ ▄███▄ ▄▄▄▄
▄█████████▄▄█████████▄▄████████▄
██████████████████████████████████
▀██████████████████████████████▀
▄███████████████████████████▄
▄███████████████████████████████▄
▀█████████████████████████████████▀
▀██▀ ▀██████▀ ▀██▀
██ ████ ██
▄████▄
▀████▀
▀▀`
);

console.log(`
████████████████████████████████████
██ KUZZLE ` + (kuzzle.isServer ? 'SERVER' : 'WORKER') + ` STARTED ██
████████████████████████████████████`);
})
.catch(function (error) {
kuzzle.log.error(error);
.catch(error => {
console.error(error);
process.exit(1);
});
};
17 changes: 15 additions & 2 deletions config/defaultPlugins.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
{
"kuzzle-plugin-logger": {
"version": "1.0.4",
"version": "1.0.6",
"activated": true,
"name": "kuzzle-plugin-logger",
"defaultConfig": {
"service": "winston",
"level": "info",
"addDate": true
"addDate": true,
"loadedBy": "all"
}
},
"kuzzle-plugin-socketio": {
"version": "1.0.3",
"activated": true,
"name": "kuzzle-plugin-socketio",
"defaultConfig": {
"port": 7512,
"room": "kuzzle",
"loadedBy": "server"
}
},
"kuzzle-plugin-auth-passport-local": {
"url": "git+https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local.git",
"activated": true,
"name": "kuzzle-plugin-auth-passport-local",
"defaultConfig": {}
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
kuzzle:
image: kuzzleio/kuzzle
ports:
- "7511:7511"
- "7512:7512"
links:
- elasticsearch
Expand Down
3 changes: 2 additions & 1 deletion docker-compose/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kuzzle:
volumes:
- "..:/var/app"
ports:
- "7511:7511"
- "7512:7512"
- "8080:8080"
- "8081:8081"
Expand All @@ -14,7 +15,7 @@ kuzzle:
environment:
- MQ_BROKER_ENABLED=1
- LIKE_A_VIRGIN
- FIXTURES
- FIXTURES=/var/app/features/fixtures/functionalTestsFixtures.json
- FEATURE_COVERAGE

rabbit:
Expand Down
1 change: 1 addition & 0 deletions docker-compose/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kuzzle:
- "..:/var/app"
- "/var/log"
ports:
- "7511:7511"
- "7512:7512"
command: /run-perf.sh
links:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose/test-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ kuzzle:
volumes:
- "..:/var/app"
ports:
- "7511:7511"
- "7512:7512"
links:
- rabbit
- elasticsearch
- redis
environment:
- LIKE_A_VIRGIN=1
- FIXTURES
- FIXTURES=/var/app/features/fixtures/functionalTestsFixtures.json
- MQ_BROKER_ENABLED=1
- FEATURE_COVERAGE=1
# Travis env var must be propagated into the container
Expand Down
3 changes: 2 additions & 1 deletion docker-compose/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ kuzzle:
volumes:
- "..:/var/app"
ports:
- "7511:7511"
- "7512:7512"
links:
- rabbit
- elasticsearch
- redis
environment:
- LIKE_A_VIRGIN=1
- FIXTURES
- FIXTURES=/var/app/features/fixtures/functionalTestsFixtures.json
- MQ_BROKER_ENABLED=1
- FEATURE_COVERAGE=1

Expand Down
1 change: 1 addition & 0 deletions docs/MQ-broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ And add an environment variable and link in the main Kuzzle container:
kuzzle:
image: kuzzleio/kuzzle
ports:
- "7511:7511"
- "7512:7512"
links:
- rabbit
Expand Down
12 changes: 12 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Installation

## Table of Contents

* [Using the all-in-one Docker recipe](#using-the-all-in-one-docker-recipe)
* [Reset Kuzzle with Docker recipe](#reset-kuzzle-with-docker-recipe)
* [Reset Kuzzle and insert sorme fixtures with Docker recipe](#reset-kuzzle-and-insert-sorme-fixtures-with-docker-recipe)
* [Initialize Kuzzle mapping with Docker recipe](#initialize-kuzzle-mapping-with-docker-recipe)
* [Using Vagrant](#using-vagrant)
* [From source or NPM](#from-source-or-npm)
* [Manual install](#manual-install)
* [Default](#default)
* [Change external services hosts](#change-external-services-hosts)

## Using the all-in-one Docker recipe

If you are running Docker and just want to get your own Kuzzle running, you can use the provided docker-compose file.
Expand Down
Loading

0 comments on commit c1c1b56

Please sign in to comment.