Skip to content
ArunavoRay.

• 5 min read

Gitea Mirror after 18 months and 179 releases

How Gitea Mirror grew from a GitHub to Gitea copier into a mirror tool for several hosts, told from its commits, releases and issues.

Gitea Mirror keeps a self-hosted copy of your repositories. You connect GitHub, point it at a Gitea or Forgejo server, and it creates pull mirrors there and keeps them in sync.

I wrote two posts about it in May 2025, one at launch and one for 2.0. Both were feature lists, and both are out of date. This one replaces them. It’s what the commit history, the release notes and the issue tracker say happened between the first commit on May 18, 2025 and v3.57.0 today: 987 commits, 179 releases, about 1,546 stars and 80 forks.

The first week

The first commit was an Astro app with React and shadcn/ui, running on Node with pnpm. Data lived in SQLite, live updates went through Redis, and login used JWTs. It listed your GitHub repositories and organizations, created pull mirrors through Gitea’s migrate API, and copied issues with their comments. v1.0.0 went out the next day.

Then the stack changed. On May 20 the project moved from Node to Bun, and Redis went away: SQLite now held the data and fed the live events too. That shipped as v2.0.0 on May 21. The release notes give the reasons: one database file for everything, and fewer moving parts. v2.1.0 added Proxmox LXC scripts and a health endpoint the day after.

That choice stuck. Gitea Mirror still runs on Bun with one SQLite file. When someone asked this month whether Postgres was on the table, my answer was no plans for now: SQLite keeps it to one process with no database to run, and the whole state is one file to back up.

Copying more than code

Issues were there from day one. In June 2025 wiki and releases joined them (v2.13.0), and the mirror strategies settled: keep the source’s owners, put everything in one organization, or put everything under your user. A fourth, mixed strategy came in v2.18.0, along with destinations you can override per organization or repository.

Pull requests followed in August 2025, after an issue (#68) reported that releases, pull requests and issues weren’t coming across properly. Gitea’s API can’t create a pull request through the migration path, so each one becomes an issue labeled pull-request, with its commits, changed files and merge result in the body. LFS showed up the same summer, marked beta.

LFS turned out to be the awkward one. Gitea fetches LFS objects inside its own migration, and when that fetch fails, Gitea throws the whole migration away. Some repositories failed every time. The fix (v3.27.0, August 2026, asked for in #361) was letting every mirror option be set per repository and per organization, so you can turn LFS off for the one repository that breaks and keep it everywhere else.

A new home, a new license, a new login

On July 7, 2025, the repository moved from my personal account to the RayLabsHQ organization, the image moved to ghcr.io/raylabshq/gitea-mirror, and the license changed from MIT to AGPL-3.0 (v2.20.0).

Ten days later came v3. One of the first big requests (#29, June 2025) was OIDC and forward auth. v3 replaced the JWT login with Better Auth, encrypted every stored token with AES-256-GCM, and added OIDC single sign-on and header authentication for reverse proxies like Authentik and Authelia.

It also broke upgrades. v3.0.0 had an automatic v2 to v3 migration, and v3.0.1 removed it the next day because it was causing problems. Anyone on v2 had to start over with a fresh data volume and reconnect GitHub and Gitea. SSO took a while to settle after that: Authentik returning 500s (#73), a crash after setting up SSO (#122, 27 comments), an issuer mismatch (#134), and a login bounce fixed in v3.17.0 (#306). Today’s release adds two-factor authentication, and after a security report, only the instance owner can manage SSO providers.

The bugs people kept hitting

Scheduled syncs were in v1.0.0, but they didn’t behave the way people expected. Issue #72 (August 2025) led to v3.3.0: a duration parser that takes 8h, 30m, 1d or cron, an interval setting that turns the scheduler on by itself, and a timer that counts from the last successful run instead of container start. v3.14.0 later added a start time and a frequency.

Large accounts found the next limits. Importing a big list of starred repositories failed with a SQLite error about expecting 37,133 values and receiving 102,669 (#90). v3.6.0 fixed the insert and added GitHub rate limit handling, and v3.7.0 batched inserts and removed duplicate rows.

Duplicate mirrors took several rounds. People found Gitea filling up with copies named -1 through -7, or with timestamps on the end (#115, #157). A fix in October 2025 didn’t catch every case. The real one came in v3.18.0, in June 2026: before creating a mirror, Gitea Mirror checks whether a mirror of that exact source already exists, by comparing clone URLs, and reuses it. Copies created before that still had to be removed by hand.

A few more:

  • What happens when the source repository is deleted (#84)? Cleanup archives instead of deleting by default since v3.7.1, and it only acts once a direct lookup confirms the repository is gone.
  • Releases created before their git tag reached Gitea failed with a 404 (#331). Now a release waits for its tag.
  • A rate limit during a big scheduled sync could hold the scheduler lock for hours (#437). The second fix came after one user’s GitHub account was suspended over the flood of refused requests. The companion post, What Gitea Mirror does when a mirror goes wrong, covers it.
  • v3.25.0 started reading DATABASE_URL as a SQLite path, so an install with a Postgres URL in its environment opened a new, empty database (#502). v3.51.5 ignores a non-SQLite URL with a warning.
  • Until v3.54.0, the settings API returned saved tokens in plain text. Now it only says whether one is saved.

Beyond GitHub and Gitea

Mirroring to GitLab (#26) and mirroring Gitea to GitHub (#34) were both asked for in June 2025. They went under one umbrella issue for any source to any destination (#131), and shipped on September 2, 2026.

v3.30.0 added GitLab and Gitea or Forgejo, Codeberg included, as sources. v3.31.0 added GitHub and GitLab as destinations. Neither has a pull mirror API, so the app keeps a bare clone of each repository and pushes its branches and tags with force and prune. After that came several sources per account (v3.33.0), public organizations with no account connected (v3.35.0), GitHub App authentication (v3.42.0) and a plain git URL source for hosts like cgit or kernel.org (v3.52.0). GitHub to Gitea is still the supported path. The other sources and destinations are marked beta.

The Destination picker on the Configuration page, offering Gitea, plus Forgejo, GitHub and GitLab marked beta

Some requests stay closed. Mirroring GitHub Projects (#16) is a won’t do, because Gitea’s API has no endpoints for boards and cards.

What it is now

Gitea Mirror today is an Astro 7 app with React 19 on Bun, storing everything in SQLite through Drizzle. It ships as a Docker image for amd64 and arm64, a Helm chart that came from a user’s pull request, a Nix flake, and setups for Proxmox LXC, Unraid and bare metal. The docs moved to the website in v3.25.0. There’s a REST API with API keys, an MCP endpoint since v3.46.0, and a Telegram bot someone built on top of the API. 26 people have contributed code, and of the 223 issues opened so far, one is open today.

Trying it

git clone https://github.com/RayLabsHQ/gitea-mirror.git
cd gitea-mirror
docker compose -f docker-compose.alt.yml up -d

Open http://localhost:4321 and create an account. The first one becomes the admin. Then connect a source and a destination on the Configuration page. The quickstart has the compose file to use without cloning. And back up your Gitea before upgrading, as the release notes keep saying.

Got a question or an idea?

Say hello

Email me at developer@arunavoray.dev, or find me on X, LinkedIn and GitHub.