Skip to main content
Version: 3.1.0

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

  1. The operator provides a Personal Access Token and the Gitea instance URL. The API base auto-resolves to <instance>/api/v1 (trailing slashes stripped).
  2. Repos are discovered via the token; webhooks initialise on push events.
  3. On a push payload, extractGitInfos queues a protect task.
  4. 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.tsresolveGiteaApiUrl() (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 pipeline
  • ui/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() / TaskSourceGit were extended to include Gitea so retry and file-info logic work uniformly across all Git providers.
  • self.url in 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