Migrate from GitLab CI
GitLab is the first place teams move their CI from when they come to Loha. This guide covers both halves of that move:
- Connecting your self-hosted GitLab to Loha: network, TLS, tokens, and how push events reach a build.
- Converting
.gitlab-ci.ymlto.loha.yml: the vocabulary maps cleanly; this is mostly find-and-replace.
Do part 1 once per GitLab instance. Do part 2 once per repository.
Before you start
You will need:
- A self-hosted GitLab instance (GitLab.com works too: the steps are identical).
- Maintainer on the GitLab project: needed to add the incoming webhook yourself if Loha cannot (see below) and, on most instances, to create access tokens. This is the role of the person doing setup; the token itself needs less (see token role).
- The ability to create a Personal Access Token on that GitLab instance.
- Admin or Owner on the Loha workspace you are connecting into.
Network reachability
Loha and your GitLab talk in both directions. Both paths must be open:
| Direction | What flows | Requirement |
|---|---|---|
| Loha → GitLab | Reads .loha.yml, lists projects and branches, resolves commits | The Loha dashboard must be able to make outbound HTTPS calls to your GitLab API |
| GitLab → Loha | Push and merge-request webhook events | Your GitLab must be able to make outbound HTTPS calls to the Loha dashboard URL |
Your GitLab API URL must resolve to a routable, public HTTPS endpoint. Loha rejects API URLs that point at private address space: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8, link-local, and CGNAT ranges are all blocked, as are cloud metadata endpoints. This is SSRF protection and it is not configurable.
If your GitLab currently lives on a private network, expose it through a public hostname (a reverse proxy or ingress with a real DNS name) before connecting it to Loha.
TLS / certificates
Loha calls your GitLab API over standard HTTPS and validates the certificate against the public system CA store. There is no option to pin a custom CA or to skip certificate verification.
Your GitLab API URL must present a valid, publicly-trusted certificate chain. A self-signed certificate or a certificate from an internal-only CA will fail the connection. Use a certificate from a public CA (Let's Encrypt is fine).
GitLab API version compatibility
Loha targets the GitLab REST API v4. The API URL you give Loha must end with /api/v4:
https://gitlab.example.com/api/v4
Do not include a group or project path: just the instance host plus /api/v4. Authentication uses GitLab's PRIVATE-TOKEN header.
Any GitLab version that serves the v4 API works. v4 has been the stable API since GitLab 9, so any currently-supported GitLab release is compatible.
Create a Personal Access Token
In GitLab: User Settings → Access Tokens → Add new token.
- Scopes (required):
api: Loha uses the GitLab REST API to list your projects, read.loha.yml, and report build status back to merge requests.read_repository: lets the build clone your repository over HTTPS.
- Add
write_repositoryonly if you want Loha to commit a generated.loha.ymlback to your repo from the pipeline editor. - Expiry: set one you can rotate. Loha stores the token encrypted at rest and supports rotating it later.
read_repositoryalone is not enough. It covers Git-over-HTTP and the Repository Files API, but listing projects and reporting commit status go through the wider REST API, which needsapi. A token missingapitypically shows up as an empty repository list or a connection marked invalid.