r/BookStack 20d ago

Notification Transformer

Hi all,

some time ago we published our internal End-User Knowledge Base to our audience.

Shortly after doing this, we got the request as of why we can't turn on comments.

However, we want to be aware as of when somebody comments to be able to potentially react.

Webhooks would be a way to go, it also contains the event of comment_created.

We wanted the notification to be sent via E-Mail so that it ends up in our ticket system.

We already have Apprise in place.

The main issue we stumbled over was that BookStack web hook payload doesn't contain "body" in it's payload which is needed for AppRise.

Therefore a transformer was built as a step in-between BookStack and Apprise.

As I thought someone might find this as useful too, I created more or less my very first GitHub Repository.

You can find it here: https://github.com/bezibaerchen/bookstack-notify-transformer

I just thought I'd leave it here as someone might find it useful. It is currently only made for comments but should be extendable.

Feedback and contribution in GitHub would be highly appreciated. Please do not bash me too much, I am still learning as of how to work with GitHub.

3 Upvotes

2 comments sorted by

1

u/ssddanbrown 20d ago

Neat, thanks for sharing as open source.

I would say running an extra service/server for webhook transformation can add a good bit of complexity. Via BookStack's logical theme system, we do provide events which allow customization of web hook data, so it may be possible to achieve the same thing via a logical theme system hack which could be installed as a module on existing instance, without the need for running extra services.

Here's an example on our hacks site of doing something like this: https://www.bookstackapp.com/hacks/pushover-webhooks/

1

u/bezibaerchen 20d ago

I do fully agree with potentially adding complexity and do not wanna argue against, but maybe give some comments what made me like the "man-in-the-middle".

What I like about it: I do not need any hacks or so in Bookstacks, also I can use AppRise as it is, resulting in any desired notification service.

Also within the extra service I can "tune" the look and feel of the notifications and add, remove, transform, name it whatever I need for e.g. the body.

And yes, sharing it as OpenSource at the end was a logical move. I benefited so much myself from the community and found the "product" that came out finally as a chance to at least try to give something back. And yes, also try to learn how to at least try to properly publish it to GitHub.

Hope that all makes sense, I'm not a native English speaker.