feat(gitea): add --clone-url-base flag for clone URL rewriting #1

Closed
eblume wants to merge 1 commit from feature/upstream/clone-url-base into main

1 commit

Author SHA1 Message Date
4d5ce57a12 feat(gitea): add --clone-url-base flag for clone URL rewriting
When scanning a self-hosted Gitea/Forgejo instance, the API may be
reachable at a different hostname than the git clone endpoint (e.g.,
internal API vs. public clone URL behind a reverse proxy). The
--clone-url-base flag rewrites the scheme, host, and port of clone
URLs returned by the API, preserving the path.

Example:
  kingfisher scan gitea \
    --api-url https://forge.internal.example.com/api/v1/ \
    --clone-url-base https://forge.internal.example.com/ \
    --user eblume

This avoids routing clone traffic through an external proxy when the
API and git endpoints share the same internal host but the instance's
ROOT_URL points to the public endpoint.

Includes unit tests for the URL rewriting function and an integration
test using wiremock to verify the full enumeration path.
2026-03-29 22:00:33 -07:00