Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Webhooks #1543

Open
noseshimself opened this issue Sep 6, 2023 · 12 comments
Open

Feature request: Webhooks #1543

noseshimself opened this issue Sep 6, 2023 · 12 comments
Labels
enhancement New feature or request help wanted Extra attention is needed needs design doc no-stale-bot

Comments

@noseshimself
Copy link

Why

MagicDNS is not exactly doing what I really need without a lot of hacks on my DNS servers. In a number of cases it would be easier to just update a "real" name server or use a completely different mechanism.

Information could be scraped from logs but that's inefficient. A special peer could be crafted to serve as bridge to external tools but that seems to be the completely wrong direction.

Description

Please add a simple mechanism that will call an external tool

The path to the tool should be configurable (and calls should only be made if it has been configured) and should send "event" (e. g. "client is ready"/"client has closed the connection"), account, client name and IP address(es). The exit code of the subprocess can be safely ignored. It's not your problem.

@noseshimself noseshimself added the enhancement New feature or request label Sep 6, 2023
@kedare
Copy link

kedare commented Sep 19, 2023

Ideally this would also support url to be able to call a webhook and not run a program (kind of like the webhooks on tailscale.com)

@noseshimself
Copy link
Author

Ideally this would also support url to be able to call a webhook and not run a program (kind of like the webhooks on tailscale.com)

In a way you might have the better idea; a webhook (being a remote procedure call using http(s) will be a mechanism that would be applicable even if you did not have a shell (thank you, Apple, for trying to keep users away from using the devices they own) or want to avoid having to use curl.

@kradalby kradalby added the help wanted Extra attention is needed label Sep 24, 2023
@kradalby
Copy link
Collaborator

I think that webhooks would be a neat feature, I do not think we want to open the can of worms that is executing things outside of the go binary.

We dont really have this on our roadmap, but if someone wants to write up a design suggestion, we would be more than happy to help review and come with feedback.

@kradalby kradalby changed the title Feature request: Call an external program whenever a node is connecting or leaving Feature request: Webhooks Sep 24, 2023
@noseshimself
Copy link
Author

We dont really have this on our roadmap, but if someone wants to write up a design suggestion, we would be more than happy to help review and come with feedback.

I believe I put my immediate need in my original request: I need to remotely update a DNS server because MagicDNS is breaking things on my end. That's why I am interested in the events "link up" and "link down" (assuming that you will never reassign IP addresses on the fly while connections are active.

I can certainly see other useful events (e. g. "account added", "node added", or "deleted").

Personally I would leave parsing the stuff to the consumer and keep the configuration part on your side as simple as possible. One hook per consumer and you either provide whatever you want as JSON and drop it off in front of the feet of the consumer(s) or you put all data into the URI itself and the consumer has to take that apart.

The only one who is able to judge which is easiest to implement is you. If you need to know which events the users would like to see it might be best to enable discussions and put it there.

@tiredofit
Copy link

This is a feature of Tailscale and seems to be very useful. I too have problems with MagicDNS and the concept of hooks on specific actions would be extremely beneficial.

Tailscale implementation: https://tailscale.com/blog/webhooks/

@noseshimself
Copy link
Author

This is a feature of Tailscale and seems to be very useful

It is extremely useful. By mirroring my mesh-names of machines into my general DNS domains I'm able to have systems behind "mesh routers" (yes, I installed tailscale on OPNSense) using these addresses, too.

@celevra
Copy link

celevra commented Nov 26, 2023

+1

@tarasglek
Copy link

tarasglek commented Dec 8, 2023

In theory this could already be done by following the headscale log. It would be nice if headscale supported emitting events to something like NATS

@sosnik
Copy link

sosnik commented Jan 20, 2024

Would also like to have events emitted, whether as webhooks or as another mechanism doesn't really matter to me.

In the meantime, a hacky solution might be to use something like headscale nodes list -o json on a timer to dump status information in a machine-readable state.

Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Apr 20, 2024
@kradalby kradalby removed the stale label Apr 20, 2024
Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Jul 20, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
@kradalby kradalby reopened this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs design doc no-stale-bot
Projects
None yet
Development

No branches or pull requests

7 participants