mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #580] Can't use just host name when defining webhooks #425
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#425
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 @mountaindude on GitHub (Oct 25, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/580
Using at the time latest version, 1.23.1.
Running as Docker container on Ubuntu.
Trying to create a webhook that should be called when a check goes up/down.
Works as expected when I use a full URL with host consisting of at least two parts (for example
host.localdomain).When using just single part,
host, there's a message "Enter a valid URL." shown and the entered info isn't saved.The thing is, when running Healthchecks on the same server as other Docker containers, it's easiest to refer to those containers just by their container name. In my case I have another container (on same Docker host) called
node-red-prodto which I'd like to send the alert (using a Healthchecks webhook).Less modifying Docker's name resolution (which I don't want to do), the only option is to refer to that Node-RED container as just
node-red-prod. Which cannot be done in Healthcheck, it seems.Suggestion: Should be ok to use just a hostname when defining webhooks.
@cuu508 commented on GitHub (Oct 28, 2021):
Looks like the URL validation rules would need to be stricter for the hosted service (no localhost, no 127.0.0.1, etc.) and less strict for self-hosted instances. I'll think about how to handle this.
In the meantime, a dirty workaround would be to first save the webhook integration using node-red.mydomain.com, and then fix the URL in Django admin.
@mountaindude commented on GitHub (Oct 28, 2021):
Yeah there are various ways of working around it, I ended up locking the internal IPs of the Docker containers, then using those directly. Ugly - but works in this particular scenario.