feat(alerts): add Matrix support to alerts
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
developbranch 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
Good idea. will merge as soon as I can. Please bear with me though as I am moving house soon :)
I updated alert.sh. Is there any good way to update all the default configs automatically?
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
What is the best way for me to test this? I am currently doing an alerts refactor
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.