Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@sealos/agendash
Advanced tools
A fork of dashboard for Agenda.js with Pagination and Search capabilities
A Dashboard for Agenda.
It may be required to create the following index for faster sorting (see #24)
db.agendaJobs.ensureIndex({
"nextRunAt" : -1,
"lastRunAt" : -1,
"lastFinishedAt" : -1
}, "agendash")
npm install --save agendash
Note: Agendash
requires mongodb version >2.6.0 to perform the needed aggregate queries. This is your mongo database version, not your node package version! To check your database version, connect to mongo and run db.version()
.
Agendash provides Express middleware you can use at a specified path, for example this will
make Agendash available on your site at the /dash
path. Note: Do not try to mount Agendash
at the root level like app.use('/', Agendash(agenda))
.
var express = require("express");
var app = express();
// ... your other express middleware like body-parser
var Agenda = require("agenda");
var Agendash = require("agendash");
var agenda = new Agenda({ db: { address: "mongodb://127.0.0.1/agendaDb" } });
// or provide your own mongo client:
// var agenda = new Agenda({mongo: myMongoClient})
app.use("/dash", Agendash(agenda));
// ... your other routes
// ... start your server
By mounting Agendash as middleware on a specific path, you may provide your own authentication for that path. For example if you have an authenticated session using passport, you can protect the dashboard path like this:
app.use(
"/dash",
function (req, res, next) {
if (!req.user || !req.user.is_admin) {
res.send(401);
} else {
next();
}
},
AgendashController(agenda)
);
Other middlewares will come soon in the folder /lib/middlewares/
.
You'll just have to update the last line to require the middleware you need:
app.use(
"/agendash",
AgendashController(agenda, {
middleware: "connect",
})
);
Note that if you use a CSRF protection middleware like csurf
, you might need to configure it off for Agendash-routes.
A minimum Node.js version 12 is required for @hapi/hapi
dependency.
npm i @hapi/inert @hapi/hapi
const agenda = new Agenda().database(
"mongodb://127.0.0.1/agendaDb",
"agendaJobs"
);
const server = require("@hapi/hapi").server({
port: 3002,
host: "localhost",
});
await server.register(require("@hapi/inert"));
await server.register(
AgendashController(agenda, {
middleware: "hapi",
})
);
await server.start();
Then browse to http://localhost:3002/
.
npm i koa koa-bodyparser koa-router koa-static
const agenda = new Agenda().database(
"mongodb://127.0.0.1/agendaDb",
"agendaJobs"
);
const Koa = require("koa");
const app = new Koa();
const middlewares = AgendashController(agenda, {
middleware: "koa",
});
for (const middleware of middlewares) {
app.use(middleware);
}
await app.listen(3002);
Then browse to http://localhost:3002/
.
npm i fastify
const agenda = new Agenda().database(
"mongodb://127.0.0.1/agendaDb",
"agendaJobs"
);
const Fastify = require("fastify");
const fastify = new Fastify();
fastify.register(
AgendashController(
agenda,
{ middleware: "fastify" }
);
)
;
await fastify.listen(3002);
Then browse to http://localhost:3002/
.
Agendash comes with a standalone Express app which you can use like this:
./node_modules/.bin/agendash --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3002
or like this, for default collection agendaJobs
and default port 3000
:
./node_modules/.bin/agendash --db=mongodb://localhost/agendaDb
If you are using npm >= 5.2, then you can use npx:
npx agendash --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3002
Then browse to http://localhost:3002/
.
Agendash can also be run within a Docker container like this:
docker run -p 3000:3000 \
--env MONGODB_URI=mongo://myUser:myPass@myHost/myDb \
--env COLLECTION=myAgendaCollection sealos/agendash
Then browse to http://localhost:3000/
.
FAQs
A fork of dashboard for Agenda.js with Pagination and Search capabilities
We found that @sealos/agendash 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.