From 4d4df3fabd265ad31c5e2130617636814e40e07f Mon Sep 17 00:00:00 2001 From: Luis Lobo Borobia Date: Tue, 17 Oct 2017 12:44:03 -0500 Subject: [PATCH 1/5] Added npx option when running as standalone Added npx option when running as standalone --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ca667d28..8220b7c8 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,12 @@ 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](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b): + +```bash +npx agendash --db=mongodb://localhost/agendaDb --collection=agendaCollection --port=3001 +``` + ### Middleware usage Agendash provides Express middleware you can use at a specified path, for example this will From e6fe0f0a874c11a65c1e87b10e3ca5b4b77f09de Mon Sep 17 00:00:00 2001 From: Vasyl Boroviak Date: Fri, 26 Jan 2018 08:44:43 +1100 Subject: [PATCH 2/5] Fix 404 errors when deleting and re-queuing jobs (#61) --- lib/agendash.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/agendash.js b/lib/agendash.js index 46af3341..c15370de 100644 --- a/lib/agendash.js +++ b/lib/agendash.js @@ -54,8 +54,9 @@ module.exports = function (agenda, options) { return callback('Agenda instance is not ready') } try { - agenda._collection - .find({_id: {$in: jobIds.map((jobId) => agenda._collection.s.pkFactory(jobId))}}) + const collection = agenda._collection.collection || agenda._collection; + collection + .find({_id: {$in: jobIds.map(jobId => collection.s.pkFactory(jobId))}}) .toArray(function (err, jobs) { if (err || !jobs.length) { return callback('Jobs not found') @@ -79,7 +80,8 @@ module.exports = function (agenda, options) { return callback('Agenda instance is not ready') } try { - agenda.cancel({_id: {$in: jobIds.map((jobId) => agenda._collection.s.pkFactory(jobId))}}, function (err, deleted) { + const collection = agenda._collection.collection || agenda._collection; + agenda.cancel({_id: {$in: jobIds.map(jobId => collection.s.pkFactory(jobId))}}, function (err, deleted) { if (err || !deleted) { callback('Jobs not deleted') } From 408e1e6225bca0474dde4b7ad421d3c71821b761 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 26 Jan 2018 00:07:37 +0200 Subject: [PATCH 3/5] Prepare changelog for the next version --- History.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/History.md b/History.md index b56fb995..d32e3510 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,8 @@ +Next +==== + + * (koresar) Fix 404 errors when deleting and re-queuing jobs (#61) + 0.4.0 / 2016-10-27 ================== From 431222ca97f0eeac842674ec83e4ae589b730d26 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 26 Jan 2018 00:10:27 +0200 Subject: [PATCH 4/5] Add note about CSRF protection middleware --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8220b7c8..cb0b2ddb 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ app.use('/agendash', Agendash(agenda, { })); ``` +Note that if you use a CSRF protection middleware like [`csurf`](https://www.npmjs.com/package/csurf), you might need to [configure it off](https://github.com/agenda/agendash/issues/23#issuecomment-270917949) for Agendash-routes. + ### Additional options The second argument to Agendash is an optional object. Valid keys are: From 7b84319970e551caa8df7c0ba2e2f0cf3aa87572 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 26 Jan 2018 00:25:21 +0200 Subject: [PATCH 5/5] Add Slack badge to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb0b2ddb..8f6dead0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Agendash [![Build Status](https://travis-ci.org/agenda/agendash.svg)](https://travis-ci.org/agenda/agendash) +Slack Status A Dashboard for [Agenda](https://github.com/rschmukler/agenda)