GuidesAdvancedSelf-Hosted GitLab

Self-Hosted GitLab Integration

This guide will walk you through the process of integrating your self-hosted GitLab instance with Flightcontrol.

Prerequisites

  • A self-hosted GitLab instance
  • Admin (or Root) access to your GitLab instance
  • Access to your Flightcontrol account

Integration Steps

1. Create OAuth Application in GitLab

  1. Log in to your self-hosted GitLab instance

  2. Navigate to your desired scope (root account, team, or user account)

  3. Go to Settings > Applications

  4. Click on “New application”

  5. Fill in the following details:

    • Name: “Flightcontrol” (or your preferred name)
    • Redirect URI: https://app.flightcontrol.dev/api/auth/gitlab/callback
    • Scopes: Select api permission
    Create OAuth Application

After creating the OAuth application in GitLab, save the following two values. You will need them in the next step.

  • Application ID
  • Application Secret
Created OAuth Application

2. Connect the GitLab Account to Flightcontrol

  1. Visit the Connected Accounts tab in the organization settings.

  2. Click on “Add self-hosted Git organization”

    Add GitLab Account
  3. Fill in the following details:

    • Your GitLab instance’s host URL (e.g., https://myselfhostedgitlab.com)
    • The Application ID from your GitLab OAuth application
    • The Application Secret from your GitLab OAuth application
Filled Flightcontrol Form
  1. Click on “Connect self-hosted GitLab”

The self-hosted GitLab server will now be listed in the git servers section.

Saved GitLab Server

3. Authenticate access to repositories on the self-hosted GitLab instance.

  1. Navigate to the new project page
  2. Select “Add another account” in the repository selector dropdown

“myselfhostedgitlab.com” will now be present as a self hosted gitlab option in the repository selector dropdown, which can be used to authenticate users in the organization to access repositories on the self-hosted GitLab instance.

GitLab Repository Selector

Troubleshooting

If you encounter any issues during the integration:

  1. Verify your GitLab instance is accessible from the internet
  2. Ensure the redirect URI is correctly configured
  3. Check that the API permissions are properly set
  4. Verify your host URL format (should include https://)