-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update Notification over Slack Channel or Email #23
Comments
This has not been discussed yet. I like the idea of being notified of updates. That said, I guess the needs are quite different for every user. This should probably be made a plugin functionality using separate scripts and / or containers. I am open to ideas / PRs! |
Most of the program similar to shepherd use apprise for the notifications because it supports quite a lot of services: /~https://github.com/caronc/apprise |
Interesting. That would just need the notification URL as an environment variable. On the downside, we would need to add python to this image. |
There is a container for this: /~https://github.com/variadico/noti
|
Here is my dockerfile:
|
The Dockerfile can be more optimized but it's good enough :) |
Reflecting on this, I would still like this to be in a separate image. The noti / apprise image should possibly listen on a tcp/udp port in a separate docker network. So shepherd just needs to make a simple connection using netcat or similar in order to trigger the notification. |
That's how I see it as well. |
Would it be a good idea if the code in this repo had its own way to call the various notifications? Like if provided a slack token, it would call the slack APIs itself instead of notifying a separate service after it's done what it's supposed to do. Essentially they're just post-action curl commands that get conditionally executed if the matching parameter was provided for it (eg, curl slack API if slack token was provided, curl Discord API if Discord token was provided, etc). |
@iamrenejr I do not think so. Notification APIs are a moving target, and that code would also inflate the size and complexity of this image. People probably also want the option of email notifications, which would also be more difficult to implement. I prefer microservices if possible :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still an issue. |
Hi, I stumbled across this issue and just wanted to share a recent project I created that may or may not help you out. It's effectively an API wrapper/gateway to Apprise. It's still a work in progress though but the API part is finished. |
Good idea to avoid having to bundle apprise into shepherd but relying on an external REST API if the user choose to enable notifications. |
@caronc Thanks, looks interesting. But I'd rather prefer a stateless API service where notification endpoints can be configured statically. |
@djmaze No problem; I just thought I'd chime in based on your comment in Aug:
As per this reference:
The current API is 100% stateless. It even has a small webpage for a user to browse/change their configuration. It's a key/value store of configuration. Once written it persists. Future calls need only send the message body and reference the key containing the configuration. You can either post the configuration yourself statically (once at the start), and/or allow the user to configure. The key doesn't have to be I realize you're still shopping for an idea to put in place, so no pressure, just food for thought! 🙂 |
Well, as you described, the configuration in your server is stateful. A configuration can be added via the API, but it then it has to be persisted in order to survive a restart of the API server. So the API server needs a persistent volume. Which can be difficult to achieve in a multi-node swarm. I imagine the API server endpoint(s) to be configured via a static YAML file (or similar) instead. So there is no need to persist anything. |
Why you don't think about configuration over Swarm-Secrets or ENV variables? |
@matthiasbaldi Yes, that's what I meant. |
You got me there now that I think about it 😳. Whether you use Apprise or not; your feedback has been very constructive (so thank you for that!!). I only just wrote this API on Saturday and published it Sunday (yesterday). Would there be value in the extending the P.S. Sorry for hijacking this thread; but good feedback is hard to come by 😉 ... that and improving a modular version of Apprise is my goal. |
@caronc That would be better, but IMHO for even better separation of concerns the notification url(s) should be preconfigured on the api server side. |
So I went ahead and built the solution I have been talking about :) |
Nicely done! Apprise by default uses space and/or comma as a delimiter to separate URLs from one another... Thus you don't even need the for-loop when calling the add() function in your app.py. Apprise uses a regex with a slightly more complicated logic to ensure the URLs are being correctly delimited from one another (and not breaking in the middle of the ones that have spaces in them). Otherwise, awesome job man! :) |
Thanks, updated. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still want to have it implemented. |
Watchtower will use 📣 shoutrrr in the future. So maybe it might be useful for shepherd as well. Or, what would probably even be better: maybe joining forces would make sense as people using watchtower would love to use it for Docker swarm as well and having more maintainers is usually a good thing, isn't it? |
@alexanderadam shoutrrr does not nearly support as much notification types as apprise, AFAICS not even email. So, when having to choose, I would rather use my simple microservice approach with apprise. (Btw, your link to shoutrrr is wrong.) Concerning watchtower, I had a look at it again. I believe it brings much overhead concerning user interface as well as code complexity, e.g. for managing and cleaning up containers. The approach of updating swarm services can be much simpler. That is why it fits in this small shell script. To me it looks like we would have to bend watchtower a lot in order for it to support both use cases. From the standpoint of a swarm-only user, this brings much more complexity (including possible problems) and almost no benefits. |
@djmaze thank you for your insights, your fast response and, of course, thank you for shepherd! 🙏 PS: I corrected the link now 😉 |
How can we use this Shepherd? |
Hi =) I would also be interseted on how to imp,ement an apprise notification with the curl of the api =) I also think it's the perfect approach as apprise supports over 50! Notification channels =) |
The PR just merged now allows a simple way of doing this. If this is still not clear, I could add an example using docker compose. |
An example is always welcome :). |
I added an example compose config now. |
Would it be possible and useful to implement a possibility to notify updated services over Slack or Email.
I think to a process like this:
shepherd recognised a new image > triggers the update > if it was successful, send the notification.
@djmaze What do you think about features like this?
I found no docs or issues about this topic. Was it discussed already?
Thank you.
The text was updated successfully, but these errors were encountered: