Gitea Source Provider
Overview
Gitea is the 4th supported Git source provider (alongside GitLab, GitHub, and Bitbucket), enabling self-hosted / on-premise teams to protect commits through Tower.
How it works
- The operator provides a Personal Access Token and the Gitea instance URL. The API base auto-resolves to
<instance>/api/v1(trailing slashes stripped). - Repos are discovered via the token; webhooks initialise on
pushevents. - On a
pushpayload,extractGitInfosqueues a protect task. - Commit statuses (pending / success / failure / warning) are pushed back via the Gitea Statuses API.
The PAT is stored internally as username:token; only the token value is requested in the UI.
Key files
src/protocol/source/gitea/gitea.service.ts— provider service (discover, webhook init, protect, status update)src/protocol/source/gitea/gitea-url.ts—resolveGiteaApiUrl()(strip trailing slash, append/api/v1)src/protocol/source/gitea/gitea.types.ts— types + guards (isGiteaTask,isGiteaSource)src/protocol/source/source.service.ts— wiring into the shared source/task/protect pipelineui/src/pages/workflows/StepGitForm.tsx/StepInitForm.tsx— Gitea form + init step
Technical decisions
- URL resolution is centralized in
resolveGiteaApiUrl()so the UI only asks for the bare instance URL. isGitTask()/TaskSourceGitwere extended to include Gitea so retry and file-info logic work uniformly across all Git providers.self.urlin the config schema was made optional, since the Tower URL is now sourced from the activation token at runtime.
Next steps
- Support Gitea organizations / multi-owner discovery if requested