Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Read-only mode #219

Closed
jeremysmith1 opened this issue Jan 31, 2021 · 4 comments
Closed

Feature Request: Read-only mode #219

jeremysmith1 opened this issue Jan 31, 2021 · 4 comments

Comments

@jeremysmith1
Copy link

jeremysmith1 commented Jan 31, 2021

I think it would be very beneficial to allow a user to configure the board to a read-only mode when configuring routes. In the UI, the buttons that affect the state could be grayed out.

My team is using bull board for observability. We would like to open up its usage to a select group of users, but we cannot allow them to modify the state of bull queues. This is why I suggest having an additional configuration object that could be passed into 'setQueues()'.

So something like the following with readonly being an optional field, defaulting to false.

setQueues( [ new BullAdapter(someQueue) ], { readonly : true } )
@felixmosh
Copy link
Owner

Interesting idea, it can be done ;)

PR's are welcome here

@DocX
Copy link

DocX commented Feb 1, 2021

You can also make a simple middleware that blocks PUT requests and use it around the bull board app :)

Something like:

const app = require('express')()
const { router } = require('bull-board')

const blockPut = (req, res, next) => {
  if (req.method == "PUT") {
    res.status(403).send("Bull board is in read-only mode")
    return
  }
  next()
}
app.use('/admin/queues', blockPut, router)

Obviously, this is not the best UI, ideally we would also disable the links in UI, which is what this issue can be about :)

@jeremysmith1
Copy link
Author

Wow, that was a quick turn around. Thanks @felixmosh

@felixmosh
Copy link
Owner

Had an hour spear during the day :]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants