The Simplest Way to Make GitLab CI and Gitea Work Like They Should
Pairing gitlab ci and gitea lets teams host light git repos while running strong build pipelines. Gitea stores your source code and sends events to trigger jobs in GitLab. This setup gives small servers fast code hosting without losing build tools. Developers push code to Gitea and read test results in their pull requests. You keep your git server fast and small on your own hardware. Meanwhile, your build runners do the heavy work on separate machines. How gitlab ci and gitea share code and s
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Pairing gitlab ci and gitea lets teams host light git repos while running strong build pipelines. Gitea stores your source code and sends events to trigger jobs in GitLab.
This setup gives small servers fast code hosting without losing build tools. Developers push code to Gitea and read test results in their pull requests. You keep your git server fast and small on your own hardware. Meanwhile, your build runners do the heavy work on separate machines.
How gitlab ci and gitea share code and status
The two tools talk through repo mirrors, webhooks, and API tokens. First, you set up a mirror so GitLab pulls code from Gitea. Next, a push event in Gitea sends a webhook to start the mirror sync. When GitLab sees the new commit, it starts the build job.
During the run, the runner needs to send status updates back to Gitea. It uses a personal token or a deploy key to log in. A script in the job calls the Gitea API to post the state. Your team sees a green check or a red cross on the commit.
Data flows both ways during each code change. Gitea sends commit data out, and GitLab sends build status back in. Both paths need encryption and tight permission rules to stay safe.
Fixing shared keys and broad access risks
Many teams make the mistake of using one admin token for all jobs. If a build script leaks that key, an attacker can read every repo. Shared bot accounts also make your audit logs hard to read. You cannot tell which job or user changed a setting.
To fix this, create a unique deploy key for each repo mirror. Give the key read access only if the job just pulls code. For status updates, use a bot user with write rights on one repo. Never give a build runner full admin rights on your git server.
GitLab CI Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Network paths between the two systems also need tight firewall rules. Only allow webhook traffic from your Gitea server IP to reach GitLab. Likewise, only let known runner IPs talk to the Gitea API port. Rotate your API keys on a fixed schedule to limit risk.
Keeping mirror syncs fast and clean
Built-in repo mirrors often wait minutes before pulling new code changes. That delay leaves developers waiting for test runs to start. You can fix this lag with a direct webhook call on each push. The webhook tells GitLab to pull the latest branch right away.
Watch out for webhook loops between the two git servers. If both tools push to each other, they can trigger endless builds. Set Gitea as the single source of truth for your code. Set the GitLab project as a read-only mirror that only runs jobs.
Keep your runner logs clean when jobs call the Gitea API. Turn off debug output on commands that use your secret tokens. Mask secret variables in your pipeline settings so keys do not print in logs. Check your Gitea audit logs each week to spot strange API calls.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can GitLab runners pull code from Gitea without mirroring?
Yes, a job can clone a Gitea repo using a custom script. Still, mirroring lets GitLab read the pipeline file from the repo root.
How do I send build status back to a Gitea pull request?
Add a step in your job that sends an HTTP call to Gitea. Pass the commit hash and the job state using a scoped repo token.
What permissions does the mirror token need in Gitea?
The mirror token only needs read access to the source repo. Use a separate token with status write permissions to post build results.
Related guides
In this post