Commit c3484634 authored by Félix Hamel's avatar Félix Hamel

1.7.25-beta8

- Removed hapi-bunyan (replaced with good-bunyan)
* Updated many core deps to reduce number of vulnerabilities
parent 8e2ed629
......@@ -28,8 +28,8 @@ var P = require("bluebird"),
// Prepare logs
var streams = [
{
level: "info",
stream: process.stdout // log INFO and above to stdout
level: process.env.SYSTEM_LOG_LEVEL || "info",
stream: bformat({ outputMode: "short" }) // log INFO and above to stdout
}
];
......@@ -514,45 +514,59 @@ CMBF.prototype.launch = P.method(function(pluginOpts) {
"covistra-system"
]);
_this.log.info(
"Loading default foundation plugins: hapi-bunyan",
"Loading default foundation plugins: logstash",
availablePlugins
);
let reporters = {
bunyan: [{
module: "good-bunyan",
args: [
{ ops: "*", response: "*", log: "*", error: "*", request: "*" },
{
logger: _this.log,
levels: {
ops: "debug"
},
formatters: {
response: (data) => {
return "Response for " + data.path;
}
}
}
]
}]
};
// Check if in the config we have the logstash string
if (config.get("server:logstash:enabled") === true) {
await registerPlugin({
register: require("good"),
options: {
includes: {
request: ["headers", "payload"]
},
reporters: {
logstash: [{
module: "good-squeeze",
name: "Squeeze",
args: [{ log: "*", request: "*", response: "*" }]
}, {
module: "good-logstash",
args: [
config.get("server:logstash:server"),
{ tags: ["cellars"] }
]
}]
}
}
});
reporters.logstash = [{
module: "good-squeeze",
name: "Squeeze",
args: [{ log: "*", request: "*", response: "*" }]
}, {
module: "good-logstash",
args: [
config.get("server:logstash:server"),
{ tags: ["cellars"] }
]
}];
}
_this.log.info(
"Loading default foundation plugins: hapi-bunyan",
availablePlugins
);
return registerPlugin({
register: require("hapi-bunyan"),
register: require("good"),
options: {
logger: bunyan.createLogger(
_.merge(config.get("server:log", {}), {
name: "cmbf",
streams: streams
})
)
includes: {
request: ["headers", "payload"]
},
reporters
}
})
.then(function() {
return P.map(availablePlugins, function(plugin) {
......@@ -585,21 +599,24 @@ CMBF.prototype.launch = P.method(function(pluginOpts) {
})
// Perform pre-start global configuration
.then(function() {
_this.log.debug(
"All plugins are loaded and ready. Performing pre-start logic"
);
_this.log.debug("All plugins are loaded and ready. Performing pre-start logic");
return _this.callHook("before-server-start", { server: server });
})
// Launch the server
.then(function() {
_this.log.debug("Starting the server");
return P.promisify(server.start, server)().then(function() {
return _this.callHook("server-started", { server: server });
});
return server.start()
.then(function() {
_this.log.info("Server started !");
return _this.callHook("server-started", { server: server });
})
.catch((error) => {
_this.log.fatal("ERRRROR", error);
});
})
// Launch is complete
.then(function() {
_this.log.debug("Server was successfully started", server.info);
_this.log.info("Server was successfully started", server.info);
return _this;
}));
});
......
{
"name": "cmbf-core",
"version": "1.7.25-beta7",
"version": "1.7.25-beta8",
"description": "Covistra Mobile-Backend Framework Core Module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "./node_modules/mocha/bin/mocha test/unit/test-server.js --reporter spec"
},
"author": "Joel Grenon <joelgrenon@covistra.com>",
"license": "Apache-2.0",
......@@ -14,38 +14,38 @@
},
"dependencies": {
"bluebird": "2.10.0",
"boom": "3.1.2",
"bunyan": "1.5.1",
"bunyan-format": "0.2.1",
"catbox-memory": "1.1.2",
"catbox-mongodb": "^2.0.0",
"catbox-redis": "1.0.5",
"chairo": "^2.0.0",
"boom": "^7.3.0",
"bunyan": "^1.8.12",
"bunyan-format": "^0.2.1",
"catbox-memory": "^4.0.1",
"catbox-mongodb": "^4.2.1",
"catbox-redis": "^4.2.4",
"chairo": "^3.0.0",
"good": "^7.3.0",
"good-logstash": "^3.0.0",
"good-bunyan": "^2.0.1",
"good-console": "^7.1.0",
"good-logstash": "^3.0.0",
"good-squeeze": "^5.1.0",
"handlebars": "4.0.5",
"hapi": "11.1.4",
"hapi-auth-basic": "3.0.0",
"hapi-auth-bearer-token": "3.1.1",
"hapi-auth-cookie": "3.1.0",
"hapi-bunyan": "0.6.0",
"hapi-config": "0.2.2",
"hapi-swagger": "4.3.0",
"inert": "3.0.1",
"joi": "8.0.5",
"lodash": "4.17.10",
"hapi": "^16.7.0",
"hapi-auth-basic": "^4.2.0",
"hapi-auth-bearer-token": "^5.1.0",
"hapi-auth-cookie": "^7.1.0",
"hapi-config": "git+https://gitlab.cellars.io/celliers-public/hapi-config.git#0.2.3",
"hapi-swagger": "^7.10.0",
"inert": "^3.0.2",
"joi": "^14.3.1",
"lodash": "^4.17.11",
"timber": "^3.1.3",
"vision": "2.0.1"
"vision": "^4.1.1"
},
"devDependencies": {
"chai": "^3.2.0",
"gulp": "^3.9.0",
"gulp-istanbul": "^0.10.0",
"gulp-mocha": "^2.1.3",
"minimist": "^1.1.3",
"chai": "^4.2.0",
"gulp": "^3.9.1",
"gulp-istanbul": "^1.1.3",
"gulp-mocha": "^6.0.0",
"minimist": "^1.2.0",
"require-directory": "^2.1.1",
"sinon": "^1.15.4"
"sinon": "^7.2.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment