feat(webhook): add tunnel = "external" for externally-managed ingress#98
Merged
Merged
Conversation
Adds a webhook tunnel mode for when a tunnel already exists but is managed OUTSIDE ephemerd — e.g. a Cloudflare tunnel on another host forwarding a public hostname to ephemerd's webhook port. In this mode ephemerd serves the /webhook/<provider> receiver and disables polling, but does NOT create a tunnel or auto-register the GitHub webhook (that ingress and registration are owned externally). A matching secret is required so incoming signatures can be verified — unlike managed tunnels (ngrok/localtunnel) we must not invent one. Also fixes a misleading log line: with a webhook secret set but tunnel = "none", ephemerd already ran in webhook mode (polling disabled) yet logged "polling mode enabled (tunnel disabled)". The startup log now reflects the real discovery mode for each tunnel setting, and the webhook port defaults to 8080 whenever a receiver is active. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ChVRC9ZrvQarrctDwSy1S5
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
tunnel = "external": a webhook mode for when a tunnel already exists but is managed outside ephemerd — e.g. a Cloudflare tunnel on another host forwarding a public hostname to ephemerd's webhook port.In this mode ephemerd:
/webhook/<provider>receiver and disables polling, butAlso
Fixes a misleading startup log: with a secret set but
tunnel = "none", ephemerd already ran webhook-only (polling disabled) yet loggedpolling mode enabled (tunnel disabled). The log now reflects the real discovery mode per setting, and the webhook port defaults to 8080 whenever a receiver is active.Tests: external-requires-secret, external keeps the provided secret + defaults port, managed tunnel still auto-generates, none+secret defaults port.
Note
No Cloudflare creation code is added —
externalis for an externally-run tunnel. A managedcloudflareprovider (shelling out tocloudflared) could be a follow-up if the host should self-serve the tunnel.🤖 Generated with Claude Code