Skip to content

Git webhooks cannot use an origin other than PUBLIC_URL #703

Closed

Description

@kayahk

Symptom

A deployment whose public edge forwards only the browser and setup paths cannot receive Git webhooks, and there is no way to configure around it.

PUBLIC_URL is the single origin for everything: BeginIdentitySetup builds both the setup CallbackURL and the provider WebhookURL from it (services/api/internal/service/git/setup.go:123-124), and webhookURL() does the same for per-repository hooks (services/api/internal/service/git/repo_webhooks.go:37-46). It also drives browser links, comment footers, the access-grant callback and the passkey relying party — so pointing it at a webhook-only host moves every one of those with it, and changing PASSKEY_RP_ID invalidates registered passkeys.

Why the code cannot already do it

Nothing reads an alternative origin: ServerConfig has PublicURL and PasskeyRPID only, and every Git URL that leaves the process is built by concatenating s.publicURL. The provider SPI already carries WebhookURL as a distinct field from CallbackURL (gitprovider.BeginSetupRequest), so the split exists in the contract and is simply never populated differently.

Proposed fix

GIT_WEBHOOK_PUBLIC_URL (chart value gitWebhookPublicUrl): when set, it is the origin webhook URLs are built from; PUBLIC_URL keeps the browser, setup callback, links and passkey origin. Unset reproduces today's behaviour exactly, so the change is inert until someone opts in. Proposed in #704.

Acceptance criteria

  • With the override set, the provider receives a WebhookURL on the override origin while CallbackURL stays on PUBLIC_URL.
  • The reserved endpoint key still matches the published URL, so deliveries resolve.
  • Unset (or blank) keeps every URL on PUBLIC_URL.
  • The override does not widen which return URLs BeginIdentitySetup accepts.

Activity

  1. pullfrog commented on Nov 4, 2026

    @pullfrog
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions