Forgejo detection requires the SSH host to equal the FORGEJO_BASE_URL host; support Forgejo's SSH_DOMAIN split
Setup: self-hosted Forgejo 15.0.9 with ROOT_URL = https://forgejo.example/ behind a reverse proxy and SSH_DOMAIN = git.example on a second address, which is what Forgejo's SSH_DOMAIN setting exists for. Origins are [email protected]:org/repo.git; FORGEJO_BASE_URL=https://forgejo.example; forgejo_axi_path set; forgejo-axi 1.3.0 authenticated. Present in the installed v1.72.0 and unchanged on main at 2c3a301.
Observed: every run skips the PR and CI steps with "provider unknown". detectProviderWithForgejoBaseURL (internal/scm/scm.go) only accepts a self-hosted Forgejo when the resolved SSH hostname equals the base URL hostname or contains "forgejo"; forgejo.ResolveRemote repeats the same equality. Setting the base URL to the SSH host is not an option because the API is only served on the web host. Adding a tea login with ssh_host makes detection pick Gitea instead, which then wants tea.
Precedent in this codebase: Azure DevOps origins on ssh.dev.azure.com are accepted by detectLegacyProviderHost; Gitea honours tea's ssh_host login field. Only Forgejo lacks a way to declare the SSH host.
Related: #1119, #1085 and #561 are the reverse mismatch on GitHub, where a transport host such as ssh.github.com is used as the API host and can be repaired from a table of known public hosts. A self-hosted Forgejo has no such table, and the split is a documented server setting, so it needs a declaration.
Proposal: a FORGEJO_SSH_DOMAIN environment variable (name mirrors Forgejo's own setting), meaningful only together with FORGEJO_BASE_URL. Detection accepts an SSH origin whose resolved hostname equals it, with the existing path-prefix check and the existing provider precedence unchanged; ResolveRemote accepts the same; invalid values are ignored so detection still fails closed. Docs in the environment reference and the provider guide. A later improvement could confirm the pairing at Available() time through the repo's ssh_url, but the declarative variable is enough to unblock the standard Forgejo setup. PR to follow through no-mistakes.
Source: kunchenguid/no-mistakes