mbround18 / valheim-docker

Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which is designed with resiliency in mind by providing automatic updates, world backup support, and a user friendly cli interface.
https://hub.docker.com/r/mbround18/valheim
BSD 3-Clause "New" or "Revised" License
767 stars 82 forks source link

[Feature] Discord Notification through webhook #152

Closed mbround18 closed 3 years ago

mbround18 commented 3 years ago

Acceptance Criteria:

nogweii commented 3 years ago

A variation of this that would also be appreciated is a more generic webhook, so that custom software could be integrated. e.g. A generic webhook could send messages to an HTTP server that can turn around and send to Slack, Matrix, or Pushover.

CosmicHorrorDev commented 3 years ago

Can you expand a bit on how that would work? Are there exiting solutions that can translate some generic webhook requests to different platforms, or is that something we would need to work on?

mbround18 commented 3 years ago

I could throw together something like that where it sends a post with a a documented request body? And then add a mutation layer for discord specific events. Thoughts?

CosmicHorrorDev commented 3 years ago

Would that be within odin or a separate service? I think a web server that can be spawned with options to relay the messages to slack, discord, etc. could work well, but if there is a pre-existing service that already basically does that then it would be nice to leverage too.

mbround18 commented 3 years ago

This would be an Odin option using ureq to post to an outgoing webhook.

Typical infrastructure for something like this would be

Odin -> post request -> webhook -> an independent webserver ingests it and sends it to where it needs to go.

In the case of discord or similar chat platforms it could be simplified by sending directly to discord through their interface for a webhook which is why I suggested the mutation for discord etc. I am working on a demo of this right now :)

mbround18 commented 3 years ago

image

Start successful does not necessarily mean Valheim actually started properly. If you run with mods or have funky issues then it will say started successfully but still bomb in console log.

However, stop successfully is a good indicator if your server saved and exited appropriately <3