LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

feat(alerts): add Matrix support to alerts

Open n194 opened this issue 4 years ago • 5 comments

Description

This PR adds an alert for Matrix. Matrix is a decentralized messaging platform that allows to allows other applications to send messages via a webhook.

Type of change

  • [ ] Bug fix (a change which fixes an issue).
  • [x] New feature (change which adds functionality).
  • [ ] New Server (new server added).
  • [ ] Refactor (restructures existing code).
  • [ ] Comment update (typo, spelling, explanation, examples, etc).

Checklist

PR will not be merged until all steps are complete.

  • [ ] This pull request links to an issue.
  • [x] This pull request uses the develop branch as its base.
  • [x] This pull request Subject follows the Conventional Commits standard.
  • [x] This code follows the style guidelines of this project.
  • [x] I have performed a self-review of my code.
  • [x] I have checked that this code is commented where required.
  • [x] I have provided a detailed with enough description of this PR.
  • [x] I have checked If documentation needs updating.

Documentation

~~TODO: Add a page to user docs~~ GameServerManagers/LinuxGSM-Docs#75

n194 avatar Jul 06 '21 06:07 n194

Good idea. will merge as soon as I can. Please bear with me though as I am moving house soon :)

dgibbs64 avatar Jul 06 '21 14:07 dgibbs64

I updated alert.sh. Is there any good way to update all the default configs automatically?

n194 avatar Jul 07 '21 04:07 n194

I updated alert.sh. Is there any good way to update all the default configs automatically?

for i in $(find lgsm/config-default/config-lgsm/ -name _default.cfg); do sed -i 's%mailgunemail="[email protected]"%&\n\n# Matrix Alerts | https://docs.linuxgsm.com/alerts/matrix\nmatrixalert="off"\nmatrixtoken="accesstoken%g' $i; done

alerts look to be done alphabetically so this will insert it after mailgun, just update the matrixtoken="whatever" to whatever variables you need

jamiew0w avatar Jul 07 '21 12:07 jamiew0w

What is the best way for me to test this? I am currently doing an alerts refactor

dgibbs64 avatar Sep 20 '21 22:09 dgibbs64

What is the best way for me to test this? I am currently doing an alerts refactor

The instructions at GameServerManagers/LinuxGSM-Docs#75 should work.

n194 avatar Sep 27 '21 10:09 n194