Skip to content

Settings

Application Settings

This section purpose it to manage the Application settings.

You can provide any number of the settings from there - if you don't provide a setting then it will be not changed.

Example:

application:
  settings:
    asset_proxy_allowlist: ["example.com", "*.example.com", "your-instance.com"]
    require_two_factor_authentication: true
    two_factor_grace_period: 2
projects_and_groups:
  group_1/project_1:
    project_settings:
      default_branch: main

Project Settings

This section purpose is to manage the project settings.

The settings should be as documented at GitLab's Project API docs, except the id.

You can provide any number of the settings from there - if you don't provide a setting then it will be not changed.

Note that some keys and values can be very complex here - see the Container Registry cleanup policies under the container_expiration_policy_attributes key in the code below as an example.

Note

Some Merge Requests-related settings are also set here.

Example:

projects_and_groups:
  group_1/project_1:
    project_settings:
      default_branch: main
      builds_access_level: enabled
      visibility: internal
      only_allow_merge_if_pipeline_succeeds: true
      only_allow_merge_if_all_discussions_are_resolved: true
      container_expiration_policy_attributes:
        cadence: "1month"
        enabled: true
        keep_n: 1
        older_than: "14d"
        name_regex: ""
        name_regex_delete: ".*"
        name_regex_keep: ".*-main"
      # (...)

Group Settings

This section purpose is to manage the group settings.

The settings should be as documented at GitLab's Groups API docs, except the id.

You can provide any number of the settings from there - if you don't provide a setting then it will be not changed.

projects_and_groups:
  group_1/*:
    # configures settings for the 'group-with-spammy-projects' group
    group_settings:
      # keys and values here are as described at https://docs.gitlab.com/ee/api/groups.html#update-group
      emails_disabled: true