mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #667] ENV variables for setting up webhooks #478
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#478
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alexanderadam on GitHub (Jun 12, 2022).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/667
It seems that there are some default ENV variables for Slack (i.e.
SLACK_CLIENT_ID,SLACK_CLIENT_SECRETandSLACK_ENABLED) but for Mattermost there's onlyMATTERMOST_ENABLED.Is there any possibility to preconfigure healthchecks.io for selfhosted Mattermost instances via env variables as well?
@cuu508 commented on GitHub (Jun 12, 2022):
What specifically do you want to preconfigure?
@alexanderadam commented on GitHub (Jun 12, 2022):
Thank you for your fast response (and for healthchecks of course)!
I would love to preconfigure Mattermost webhooks.
@cuu508 commented on GitHub (Jun 13, 2022):
Instead of adding a Mattermost integration interactively in the web UI, you want to define it via environment variables, and have it available by default in every project, correct?
Note that
SLACK_CLIENT_IDandSLACK_CLIENT_SECRETdo something else: they are OAuth2 credentials that Healthchecks can optionally use when adding Slack integrations interactively, through the web UI. If they are not set, then Healthchecks falls back to using Slack's incoming webhooks, and works very similarly to the Mattermost integration.@alexanderadam commented on GitHub (Jun 13, 2022):
Exactly.
Ah okay. I wasn't aware of that. 🙈
So in that case this would be generic request and I should rename it to "ENV variables to preconfigure webhooks" or so, right?
@cuu508 commented on GitHub (Jun 13, 2022):
Yes. Also, can you describe your use case a little more? Adding a Mattermost integration in the web UI does not take much time and needs to be done only once per project. Are you setting up hundreds of Healthchecks instances, or hundreds of projects in an instance?
@alexanderadam commented on GitHub (Jun 13, 2022):
No, I just like reproducibility and use Ansible for setting up everything easily.
@cuu508 commented on GitHub (Jun 13, 2022):
But would you be starting with a fresh database every time? Integration configurations live in the database, same as user accounts, checks, logged pings etc. If you are moving your Healthchecks instance to new hardware, you would typically be restoring an existing database backup.
@alexanderadam commented on GitHub (Jun 13, 2022):
That's true. I would. It is mainly for having a quick setup of a new system with barely any manual configuration involved.
Creating a webhook possibility on the Mattermost side is trivial to automate.
For container images often most of the configuration can be done via ENV variables. So for many applications this is usually also true for authentication via OpenID or activating Prometheus endpoints.
This way, users can simply search for their desired apps on Ansible Galaxy or GitHub/GitLab and preconfigure their apps easily by filling a few variables.
But sure, setting up each thing manually by logging in + updating settings is possible.
And it's no big issue if you're only running one app or just a few. It might only become time-consuming if you have more applications, maybe even interacting with each other.
Of course I'm also fine if you decide that that it's not worth it for healthchecks.
It would just be an improvement for user experience, mainly for people who are using infrastructure as code tooling to get easy setups.
And it's even documented in code, so you won't forget what you had to configure how.
@cuu508 commented on GitHub (Jun 13, 2022):
This project uses environment variables for system-wide configuration: credentials for sending email, credentials for connecting to the database, credentials for accessing object storage, and so on.
Integrations, same as user accounts and checks, are "data" that lives in the database. To automate creation of integrations, I would look into writing a new management command (similar to Mattermost's
mmctl). And yes, I'm not yet convinced the extra complexity, maintenance and associated documentation would be worth it. For Mattermost, you could be potentially integrating it with many external systems that want to post notifications, and creating an incoming webhook for each. Sommctlis handy to have. But for Healthchecks, you would be setting up the integration only once per project. IMO it would be easier to create it in the web UI, rather than figure out what parameters to pass to the management command.