
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@nodefony/elastic-bundle
Advanced tools
./config/config.js
module.exports = {
system: {
/**
* BUNDLES CORE
*/
elastic: true
}
}
./app/config/config.js
/**
* OVERRIDE ELASTIC BUNDLE SETTINGS
* elasticsearch
*
* options : https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html
*
*/
"elastic-bundle": {
elasticsearch: {
globalOptions: {
ssl: {
//key : path.resolve("config","certificates","server","privkey.pem"),
//cert : path.resolve("config","certificates","server","cert.pem"),
//ca : path.resolve("config","certificates","ca","nodefony-root-ca.crt.pem")
}
},
connections: {
main: {
name: "main",
nodes: ["http://localhost:9200"],
log: {
request: false,
response: false,
sniff: true,
resurrect: true
},
maxRetries:10,
sniffInterval: 5000,
pingTimeout: 5000,
requestTimeout:5000
}
}
}
},
./controller/elasticController.js
/**
* @Route ("/test/elastic")
*/
module.exports = class elasticController extends nodefony.controller {
constructor(container, context) {
super(container, context);
this.elastic = this.get("elastic");
this.setJsonContext();
}
async getClient() {
let conn = await this.elastic.getConnection("main");
return conn.client;
}
async createIndex(index, id) {
if (!index) {
index = "nodefony";
}
const client = await this.getClient();
const {
body
} = await client.indices.exists({
index: index
});
let res = null;
if (!body) {
res = await client.index({
index: index,
id: id,
body: {
version: this.kernel.version,
package: this.kernel.package
}
});
} else {
this.log(`Index : ${index} Already exist !!! `);
}
return res;
}
async ping() {
return await this.client.ping();
}
/**
* @Method ({"GET"})
* @Route ("/index/{id}" , name="test-elastic-search", defaults={"id" = 1},requirements={"id" = "\d+")
*
*/
async indexAction(id) {
const client = await this.getClient();
await this.createIndex("nodefony", "id");
let get = null ;
try{
get = await client.get({
index: 'nodefony',
id: id
});
return this.renderJson(get)
.catch((e) => {
throw e;
});
}catch(e){
if ( e && e.meta && e.meta.statusCode ){
return this.renderJson(e, e.meta.statusCode )
.catch((e) => {
throw e;
});
}
return this.renderJson(e )
.catch((e) => {
throw e;
});
}
}
};
FAQs
Nodefony Framework Bundle elasticsearch
The npm package @nodefony/elastic-bundle receives a total of 17 weekly downloads. As such, @nodefony/elastic-bundle popularity was classified as not popular.
We found that @nodefony/elastic-bundle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.