xmppo / xmpp-webhook Goto Github PK
View Code? Open in Web Editor NEWMultipurpose XMPP-Webhook (Built for DevOps Alerts)
Home Page: https://github.com/xmppo/xmpp-webhook
License: MIT License
Multipurpose XMPP-Webhook (Built for DevOps Alerts)
Home Page: https://github.com/xmppo/xmpp-webhook
License: MIT License
Hi Thomas,
it would be nice if there would be an official Docker image for XMPP webhook.
PS: Thank you for your work!
OS: Ubuntu 20.04.2 LTS
Kernel: 5.4.0-65-generic x86_64
Go: 1.13.8
Xmpp-webhook: 0.3
Any time I launch the systemd service it errors out.
systemd[1]: Started XMPP-Webhook.
xmpp-webhook[623]: panic: EOF
xmpp-webhook[623]: goroutine 1 [running]:
xmpp-webhook[623]: main.panicOnErr(...)
xmpp-webhook[623]: /home/thomas/projects/xmpp-webhook/main.go:23
xmpp-webhook[623]: main.main()
xmpp-webhook[623]: /home/thomas/projects/xmpp-webhook/main.go:88 +0x6b6
systemd[1]: xmpp-webhook.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: xmpp-webhook.service: Failed with result 'exit-code'.
Following the same steps on Arch I can successfully get the service running.
OS: Arch
Kernel: 5.10.10-arch1-1
Go: 1.15.7
Xmpp-webhook: 0.3
2018/11/08 21:51:13 Connecting to dr-openfire.lamar.com:5222 2018/11/08 21:51:13 Start TLS 2018/11/08 21:51:13 Authenticating 2018/11/08 21:51:13 no supported SASL mechanism found
My Openfire config
`
sasl.mechs.00001 | DIGEST-MD5 | | |
sasl.mechs.00002 | SCRAM-SHA-1
`
Hi,
I really like this web-hook, We use openfire in production. I would love to suggest/ request to add a feature to support DIGEST-MD5 SCRAM-SHA-1 mechanism instead of just plain.
This is actually just moved from #6 (because it's not really related to Slack anyway):
You wrote:
Yes, currently this is the only way the receivers are specified. But one of the changes i want to implement (i wanted to spend some time with it tomorrow actually) is, that the receivers can be set in the webhook request's to override the default config from the environment. Since we can't specify the URL/paramters for the slack integration freely (as far as i understood it correctly, i haven't checked the documentaion yet) this won't be possible in the same way as for Grafana/Prometheus...
I thought about this as well and my initial thought was that someone could just spin a second container with other credentials.
But you are absolutely right that it would be much nicer to have just one instance that listens with different configurations.
Not only for Slack but also for Prometheus and Grafana. Because if the container is exposed outside and an attacker knows that such service is running, he could easily flood your MUC with requests. So it would make sense to add a long non guessable path to the URL anyway.
So to have an example how Slack webhook urls look like:
You can't easily guess those and therefore not easily spam your channels.
Maybe the easiest thing would be to persist the hook-configuration (the auth stuff could still be set via environment variable) in some kind of config file. For example:
webhooks:
- type: prometheus
- channel: '[email protected]'
- url: '/foo/bar/baz/6486'
- type: grafana
- channel: '[email protected]'
- url: '/eene/meene/mu'
But it should be mentioned that it is recommended to use a random part in the URL (i.e. by calling openssl rand -hex 23
).
service xmpp-webhook crash on start with log message:
`panic: malformed-request
goroutine 1 [running]:
main.panicOnErr(...)
/root/xmpp-webhook/xmpp-webhook-master/main.go:24
main.main()
/root/xmpp-webhook/xmpp-webhook-master/main.go:100 +0x80e`
Hello,
I am interested in using this with Matterbridge, which recently added a way to relay messages to XMPP (spoofing users) via this Prosody module: https://modules.prosody.im/mod_slack_webhooks.html
But one of the downsides is that there is no authentication, so you can not expose this webhook endpoint anywhere.
Does this support some sort of tokenbased authentication that can be added to the webhook url?
Also, can it add messages to a MUC?
Thanks!
Edit: or is this actually a stupid question as this isn't a component and just relays messages as a bot? I guess so :(
Hello, this isn't really an issue but I didn't see a preferred contact mechanism in the readme, so please pardon the noise.
I just wanted to let you know that I've created a package in the Arch User Repository (AUR) for this webhook; it can be found here: prometheus-xmpp-webhook
.
If you want to take ownership of the package, or have any requests or concerns please let me know either here, in the comments on the package, my JID (xmpp:[email protected]?message
) or SamWhited
on FreeNode, Mozilla, or GeekShed.
Go module uses tags in semver form and prefixed by a "v". Please consider adding tags in a format that is compatible with Go modules so that existing Go tooling can be used to easily download this module. Thanks.
git tag v0.1.0 0.1
git tag v0.2.0 0.2
git tag v0.3.0 0.3
OS: Debian 10
Kernel: 4.19.0-12-amd64
Go: na
Xmpp-webhook: 0.3
XMPP Client: Prosody v0.11.2
I get this error below as I try to start the systemd service:
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: panic: malformed-request
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: goroutine 1 [running]:
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: main.panicOnErr(...)
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: /home/thomas/projects/xmpp-webhook/main.go:23
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: main.main()
Feb 04 15:43:43 box.andrasmedia.org xmpp-webhook[19658]: /home/thomas/projects/xmpp-webhook/main.go:88 +0x6b6
I'm currently trying to run this on the same machine Prosody is running. I've created the bot users, and tested it before running the script.
I have also tried the script on the machine that runs Grafana where the webhook would be coming from and I get the same errors. That machine runs Ubuntu 20.04 LTS.
Should I try building from source rather than using the binary?
This:
curl -X POST -d @dev/slack-compatible-notification-example.json localhost:4321/slack
works from local
the same json post not working from external source
500
failed to parse alert body
Initially I was looking for a webhook from gitea to XMPP but now I am thinking that it would probably be much smarter if xmpp-webhook
would get a 🎉 Slack parser 🎉 instead.
There are so many services with Slack webhook integrations (even my beloved gitea) and I guess it would help the XMPP ecosystem a lot if it would be as easy to integrate stuff as it is in Slack. IMHO it could be even a game changer for some (i.e. here).
My guess is, that at least the basic API is probably not too bad to implement (the "fancy" example is probably complicated though).
What do you think?
PS: Again, thank you so much for your work! 👍
PPS: the only 'alternative' seems to be an alpha state Prosody module for the that isn't working anymore
Hi,
lately my xmpp-webhook stopped working. Unfortunately I have no clue why and I'm not familiar with go-Code in any way.
The output of journalctl -u xmpp-webhook.service
is this:
xmpp-webhook[562]: panic: unexpected XML token xml.CharData encountered: restricted-xml
xmpp-webhook[562]: goroutine 1 [running]:
xmpp-webhook[562]: main.panicOnErr(...)
xmpp-webhook[562]: github.com/tmsmr/xmpp-webhook/main.go:24
xmpp-webhook[562]: main.main()
xmpp-webhook[562]: github.com/tmsmr/xmpp-webhook/main.go:100 +0x67c
systemd[1]: xmpp-webhook.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: xmpp-webhook.service: Failed with result 'exit-code'.
OS: Archlinux ARM
GO: 1.17.5
xmpp-webhook: 0.4
I have set only the three required environment variables in /etc/xmpp-webhook.env
. Are there any ideas what the problem could be?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.