forked from mirrors/kingfisher
feat(gitea): add --clone-url-base flag for clone URL rewriting #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/upstream/clone-url-base"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When scanning a self-hosted Gitea/Forgejo instance, the API may return clone URLs with a different hostname than the one you want to clone from (e.g., public ROOT_URL vs internal endpoint behind a reverse proxy).
This adds
--clone-url-baseto thescan giteasubcommand, which rewrites the scheme, host, and port of clone URLs returned by the API while preserving the path.Example:
Includes unit tests for the URL rewriting function and an integration test using wiremock to verify the full enumeration path.
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.c24dc0dc27677c7a5d5f677c7a5d5f4d5ce57a12Pull request closed