Setting Up a GitLab App

If GitLab is your VCS provider, you must create an OAuth application and a personal access token to connect with Garden Enterprise. The app and access token will be used to authenticate users, import projects, run workflows on GitLab events (e.g. when a merge request is opened), and more.

The relevant app and user properties will be provided to Garden Enterprise during the installation process.

Creating an OAuth Application

Please see the official documentation for creating the Oauth application. While creating the application, fill in the appropriate values as described below.

Redirect URIs

The main URL for Garden Enterprise along with the appropriate paths:

https://<main-url>/gitlab/callback
https://<main-url>/gitlab/callback/cli

Note that you should have an entry for both the gitlab/callback endpoint and the gitlab/callback/cli endpoint.

Confidential

Selected.

Scopes

Select the following scopes:

  • api

  • read_user

  • read_api

  • read_repository

  • openid

  • profile

  • email.

Once the oauth service provider is created, you should get a Secret and an Application ID. You'll need these values during the Garden Enterprise installation.

Creating an Access Token

We recommend creating a dedicated user service account for Garden Enterprise, enabling 2FA authentication for that user and granting it access to only the repositories that Garden Enterprise should have access to. This includes repositories that are referenced as remote sources in your Garden projects.

Note that the access token only works for clones over HTTPS. If your workflow runs require remote sources to be cloned over SSH, you will need to configure git specifically for that.

Once the user is set up, please follow the official documentation for create an access token.

The access token must have the following scopes:

  • api

  • read_user

  • read_api

  • read_repository

  • write_repository

You can optionally set an expiry date date on the token, in which case you must make sure to update the token in Garden Enterprise before it expires. You can update the token via the Replicated admin console.

You'll need this access token when installing Garden Enterprise.

Required Values for Garden Enterprise

You'll need to have the following values at hand when installing Garden Enterprise:

  • The Oauth application Application ID you received when creating the Oauth application.

  • The Oauth application Secret you received when creating the Oauth application.

  • The GitLab instance hostname. If you're using hosted GitLab, this is simply gitlab.com

You'll also need to provide a GitLab webhooks secret during the installation that's used internally between Garden Enterprise and GitLab. Note that this is only in the context of installing Garden Enterprise, you won't find this value in GitLab.

See here for a full list of environment configuration for Garden Enterprise.