Skip to content

Conversation

@cozyGalvinism
Copy link

Implemented ntfy middleware using gotfy.

Tested using my own ntfy instance:
image

@taraspos
Copy link
Collaborator

taraspos commented Feb 3, 2025

Hi @cozyGalvinism,
could you please add documentation on how to use this middleware? Also please mention the use-cases for this implementation. Thanks!

@taraspos
Copy link
Collaborator

taraspos commented Feb 3, 2025

Looking at the Nfty API1 it seems quite simple so I'm wondering if we really need a dedicate middleware for it. Instead I'm wondering maybe building generic HTTP middleware with examples on how to use specific services will be better long term.

Similar for:

Footnotes

  1. https://developers.niftypm.com/operation/operation-messagesapicontroller_createmessage

@cozyGalvinism
Copy link
Author

Looking at the Nfty API1 it seems quite simple so I'm wondering if we really need a dedicate middleware for it. Instead I'm wondering maybe building generic HTTP middleware with examples on how to use specific services will be better long term.

Similar for:

Footnotes

  1. https://developers.niftypm.com/operation/operation-messagesapicontroller_createmessage

Oh, that's for Nifty. The middleware targets ntfy. But I agree, a generic HTTP middleware might provide more benefits and covers more use-cases

@cozyGalvinism
Copy link
Author

I am not very knowledgeable in Go, though I can give a shot at composing an HTTP middleware for this purpose.

@taraspos
Copy link
Collaborator

taraspos commented Feb 3, 2025

I am not very knowledgeable in Go, though I can give a shot at composing an HTTP middleware for this purpose.

@cozyGalvinism if you have time to do so - would be great.

I imagine HTTP Middleware to work based on custom Go templates which can be provided by users as request body with bunch of execution related variables from ofelia (like execution status, duration, error, etc).

Something else to consider, is that I'm planning a bit of code refactoring to make following work:

So maybe it may make sense to wait a bit, even though I don't think that refactoring will touch Middlewares much.

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

Successfully merging this pull request may close these issues.

2 participants