Menu

GitLab Integration

Viktor Fási

GitLab Integration

Lastest supports GitLab for authentication, repository sync, and CI/CD -- including self-hosted instances.


Features

  • OAuth login -- sign in with your GitLab account
  • Self-hosted support -- connect to your own GitLab instance
  • MR comments -- automatic build results posted to merge requests
  • Webhook-triggered builds -- builds run when MRs are opened or updated

Setup

1. Create a GitLab OAuth Application

  1. Go to GitLab > Preferences > Applications (or Admin > Applications for instance-wide)
  2. Create a new application
  3. Set the callback URL to http://your-lastest-url/api/auth/callback/gitlab
  4. Select scopes: read_user, api
  5. Note the Application ID and Secret

2. Configure Environment Variables

GITLAB_CLIENT_ID=your-application-id
GITLAB_CLIENT_SECRET=your-secret
GITLAB_REDIRECT_URI=http://your-url/api/auth/callback/gitlab  # Optional
GITLAB_INSTANCE_URL=https://gitlab.your-company.com  # Default: https://gitlab.com
GITLAB_WEBHOOK_SECRET=your-webhook-secret  # Optional

3. Connect in Lastest

  1. Go to Settings > GitLab
  2. Click "Connect GitLab"
  3. Authorize the application
  4. Select repositories to sync

Self-Hosted GitLab

Set GITLAB_INSTANCE_URL to your GitLab instance URL. All API calls and OAuth flows will use this URL instead of gitlab.com.


Related

Wiki: Custom Webhooks
Wiki: Home
Wiki: Settings Reference
Wiki: _Sidebar

MongoDB Logo MongoDB