GitLab Integration
Oore integrates with GitLab using:
- Webhooks: For receiving push and merge request events
- OAuth (optional): For cloning private repositories
GitLab webhooks use token-based authentication (simpler than GitHub’s HMAC signatures).
Quick Setup
-
Add repository to Oore
Terminal window oore repo add \--provider gitlab \--owner myuser \--repo my-project \--webhook-secret "my-secure-secret" \--gitlab-project-id 12345678 -
Get webhook URL
Terminal window oore repo webhook-url <repo-id> -
Configure in GitLab
Go to Settings → Webhooks in your GitLab project:
Field Value URL Webhook URL from step 2 Secret token Same secret from step 1 Push events ✓ Merge request events ✓ -
Test the webhook
Click “Test” → “Push events” in GitLab, then verify:
Terminal window oore webhook list
GitLab OAuth Setup
For private repositories, automatic webhook creation, and status updates:
1. Create GitLab Application
Go to GitLab → Settings → Applications:
| Field | Value |
|---|---|
| Name | Oore CI |
| Redirect URI | https://your-server.com/setup/gitlab/callback |
| Confidential | Yes |
| Scopes | api, read_repository |
Configure in /etc/oore/oore.env:
OORE_GITLAB_CLIENT_ID=your-application-idOORE_GITLAB_CLIENT_SECRET=your-application-secretCreate the OAuth application on your GitLab instance, then register it with Oore:
oore gitlab register \ --instance https://gitlab.mycompany.com \ --client-id YOUR_CLIENT_ID \ --client-secret YOUR_CLIENT_SECRET \ --admin-token YOUR_TOKEN2. Connect Account
# For gitlab.comoore gitlab connect --admin-token YOUR_TOKEN
# For self-hostedoore gitlab connect --instance https://gitlab.mycompany.com --admin-token YOUR_TOKENFollow the URL to authorize, then complete with:
oore gitlab callback "<REDIRECT_URL>" --admin-token YOUR_TOKEN3. Enable Projects
List available projects and enable CI:
# List accessible projectsoore gitlab projects --admin-token YOUR_TOKEN
# Enable CI for a project (creates repository and webhook automatically)oore gitlab enable 12345678 --admin-token YOUR_TOKENHow It Works
GitLab oored Build │ │ │ │ POST /webhooks/gitlab/:id │ │ ├──────────────────────────────▶│ │ │ │ 1. Verify token │ │ │ 2. Store event │ │ │ 3. Queue for processing │ │ {"status":"ok"} │ │ │◀──────────────────────────────┤ │Security: Token Storage
GitLab tokens are stored securely:
- Token sent in
X-Gitlab-Tokenheader - Oore stores
HMAC-SHA256(token, pepper)in database - On verification, compute HMAC and compare
Event Types
| Event | Trigger |
|---|---|
| Push Hook | Code pushed |
| Merge Request Hook | MR opened/updated/merged |
| Tag Push Hook | New tag created |
GitLab.com vs Self-Hosted
Configure environment variables for OAuth:
OORE_GITLAB_CLIENT_ID=your-app-idOORE_GITLAB_CLIENT_SECRET=your-app-secretRegister OAuth app credentials via CLI:
oore gitlab register \ --instance https://gitlab.mycompany.com \ --client-id YOUR_CLIENT_ID \ --client-secret YOUR_CLIENT_SECRET \ --admin-token YOUR_TOKENOptional security settings in /etc/oore/oore.env:
OORE_GITLAB_ALLOWED_HOSTS=gitlab.mycompany.com,gitlab.internal.comOORE_GITLAB_CA_BUNDLE=/etc/ssl/certs/internal-ca.pemTroubleshooting
Webhooks Not Received
- Check URL is publicly accessible
- Token must match exactly (case-sensitive)
- SSL certificate must be valid
View logs in GitLab → Settings → Webhooks → Recent events
Token Verification Failures
# Update token in Ooreoore repo add --provider gitlab --owner myuser --repo my-project \ --webhook-secret "new-secret" --force
# Then update in GitLab webhook settingsComparing GitHub vs GitLab
| Feature | GitHub | GitLab |
|---|---|---|
| Webhook auth | HMAC-SHA256 signature | Token header |
| App model | GitHub App | OAuth + Webhooks |
| Token storage | N/A (signature-based) | HMAC hashed |
Complete Example (OAuth Flow)
# 1. Connect GitLab accountoore gitlab connect --admin-token YOUR_TOKEN# Follow the URL, authorize, then:oore gitlab callback "<REDIRECT_URL>" --admin-token YOUR_TOKEN
# 2. List projectsoore gitlab projects --admin-token YOUR_TOKEN
# 3. Enable CI for a project (creates repo + webhook automatically)oore gitlab enable 12345678 --admin-token YOUR_TOKEN
# 4. Push codegit push origin main
# 5. Check buildsoore build listManual Webhook Setup (Without OAuth)
If you prefer not to use OAuth:
# 1. Add repository manuallyoore repo add \ --provider gitlab \ --owner myuser \ --repo my-flutter-app \ --webhook-secret "$(openssl rand -hex 20)" \ --gitlab-project-id 12345678
# 2. Get webhook URLoore repo webhook-url <repo-id>
# 3. Configure webhook manually in GitLab UI# 4. Test webhook# 5. Push codegit push origin main
# 6. Check buildsoore build list