애플리케이션 설정 API

Tier: Free, Premium, Ultimate Offering: Self-Managed, GitLab Dedicated

이 API 호출은 GitLab 인스턴스의 /admin/application_settings/general에 나타나는 애플리케이션 설정을 읽거나 수정할 수 있습니다. 이 작업을 수행하려면 관리자여야 합니다.

애플리케이션 설정은 캐싱될 수 있으며 즉시 적용되지 않을 수 있습니다. 기본적으로 GitLab은 애플리케이션 설정을 60초 동안 캐시합니다. 인스턴스의 애플리케이션 설정 캐시를 제어하는 방법에 대한 정보는 애플리케이션 캐시 간격을 참조하세요.

현재 애플리케이션 설정 가져오기

History
  • always_perform_delayed_deletion 피처 플래그는 GitLab 15.11에서 활성화되었습니다.
  • delayed_project_deletiondelayed_group_deletion 속성은 GitLab 16.0에서 제거되었습니다.
  • in_product_marketing_emails_enabled 속성은 GitLab 16.6에서 제거되었습니다.
  • repository_storages 속성은 GitLab 16.6에서 제거되었습니다.
  • user_email_lookup_limit 속성은 GitLab 16.7에서 제거되었습니다.

GitLab 인스턴스의 현재 애플리케이션 설정을 나열합니다.

GET /application/settings
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings"

예시 응답:

{
  "default_projects_limit" : 100000,
  "signup_enabled" : true,
  "id" : 1,
  "default_branch_protection" : 2,
  "default_branch_protection_defaults": {
        "allowed_to_push": [
            {
                "access_level": 40
            }
        ],
        "allow_force_push": false,
        "allowed_to_merge": [
            {
                "access_level": 40
            }
        ]
    },
    ...
}

GitLab Premium 또는 Ultimate 사용자는 또한 다음 매개변수를 볼 수 있습니다:

  • group_owners_can_manage_default_branch_protection
  • file_template_project_id
  • geo_node_allowed_ips
  • geo_status_timeout
  • default_project_deletion_protection
  • deletion_adjourned_period
  • disable_personal_access_tokens
  • security_policy_global_group_approvers_enabled
  • security_approval_policies_limit
  • delete_unconfirmed_users
  • unconfirmed_users_delete_after_days
  • duo_features_enabled
  • lock_duo_features_enabled
  • use_clickhouse_for_analytics
{
  "id": 1,
  "signup_enabled": true,
  "group_owners_can_manage_default_branch_protection": true,
  "file_template_project_id": 1,
  "geo_node_allowed_ips": "0.0.0.0/0, ::/0",
  "default_project_deletion_protection": false,
  "deletion_adjourned_period": 7,
  "disable_personal_access_tokens": false,
  "duo_features_enabled": true,
  "lock_duo_features_enabled": false
  ...
}

애플리케이션 설정 변경

  • GitLab 15.11에 always_perform_delayed_deletion 특성 플래그가 활성화되었습니다.
  • GitLab 16.0에서 delayed_project_deletiondelayed_group_deletion 속성이 제거되었습니다.
  • GitLab 16.7에서 user_email_lookup_limit 속성이 제거되었습니다.
  • GitLab 17.0에서 default_branch_protection폐지되었습니다. 대신 default_branch_protection_defaults를 사용하십시오.

API 호출을 사용하여 GitLab 인스턴스의 애플리케이션 설정을 수정합니다 API 호출을 통해 액세스할 수있는 설정 디렉터리.

PUT /application/settings
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings?signup_enabled=false&default_project_visibility=internal"

예시 응답:

{
  "id": 1,
  "default_projects_limit": 100000,
  "default_preferred_language": "en",
  "failed_login_attempts_unlock_period_in_minutes": 30,
  "signup_enabled": false,
  "password_authentication_enabled_for_web": true,
  "gravatar_enabled": true,
  "created_at": "2015-06-12T15:51:55.432Z",
  "updated_at": "2015-06-30T13:22:42.210Z",
  "home_page_url": "",
  "default_branch_protection": 2,
  "default_branch_protection_defaults": {
    "allowed_to_push": [
        {
            "access_level": 40
        }
    ],
    "allow_force_push": false,
    "allowed_to_merge": [
        {
            "access_level": 40
        }
    ]
  },
  "restricted_visibility_levels": [],
  "max_attachment_size": 10,
  "max_decompressed_archive_size": 25600,
  "max_export_size": 50,
  "max_import_size": 50,
  "max_import_remote_file_size": 10240,
  "max_login_attempts": 3,
  "session_expire_delay": 10080,
  "default_ci_config_path" : null,
  "default_project_visibility": "internal",
  "default_snippet_visibility": "private",
  "default_group_visibility": "private",
  "outbound_local_requests_whitelist": [],
  "domain_allowlist": [],
  "domain_denylist_enabled" : false,
  "domain_denylist" : [],
  "external_authorization_service_enabled": true,
  "external_authorization_service_url": "https://authorize.me",
  "external_authorization_service_default_label": "default",
  "external_authorization_service_timeout": 0.5,
  "user_oauth_applications": true,
  "after_sign_out_path": "",
  "container_expiration_policies_enable_historic_entries": true,
  "container_registry_cleanup_tags_service_max_list_size": 200,
  "container_registry_delete_tags_service_timeout": 250,
  "container_registry_expiration_policies_caching": true,
  "container_registry_expiration_policies_worker_capacity": 4,
  "container_registry_token_expire_delay": 5,
  "decompress_archive_file_timeout": 210,
  "package_registry_cleanup_policies_worker_capacity": 2,
  "plantuml_enabled": false,
  "plantuml_url": null,
  "diagramsnet_enabled": true,
  "diagramsnet_url": "https://embed.diagrams.net",
  "terminal_max_session_time": 0,
  "polling_interval_multiplier": 1.0,
  "rsa_key_restriction": 0,
  "dsa_key_restriction": 0,
  "ecdsa_key_restriction": 0,
  "ed25519_key_restriction": 0,
  "ecdsa_sk_key_restriction": 0,
  "ed25519_sk_key_restriction": 0,
  "first_day_of_week": 0,
  "enforce_terms": true,
  "terms": "Hello world!",
  "performance_bar_allowed_group_id": 42,
  "user_show_add_ssh_key_message": true,
  "file_template_project_id": 1,
  "local_markdown_version": 0,
  "asset_proxy_enabled": true,
  "asset_proxy_url": "https://assets.example.com",
  "asset_proxy_allowlist": ["example.com", "*.example.com", "your-instance.com"],
  "globally_allowed_ips": "",
  "geo_node_allowed_ips": "0.0.0.0/0, ::/0",
  "allow_local_requests_from_hooks_and_services": true,
  "allow_local_requests_from_web_hooks_and_services": true,
  "allow_local_requests_from_system_hooks": false,
  "maven_package_requests_forwarding": true,
  "npm_package_requests_forwarding": true,
  "pypi_package_requests_forwarding": true,
  "snippet_size_limit": 52428800,
  "issues_create_limit": 300,
  "raw_blob_request_limit": 300,
  "wiki_page_max_content_bytes": 52428800,
  "require_admin_approval_after_user_signup": false,
  "personal_access_token_prefix": "glpat-",
  "rate_limiting_response_text": null,
  "keep_latest_artifact": true,
  "admin_mode": false,
  "external_pipeline_validation_service_timeout": null,
  "external_pipeline_validation_service_token": null,
  "external_pipeline_validation_service_url": null,
  "can_create_group": false,
  "jira_connect_application_key": "123",
  "jira_connect_public_key_storage_enabled": true,
  "jira_connect_proxy_url": "http://gitlab.example.com",
  "user_defaults_to_private_profile": true,
  "projects_api_rate_limit_unauthenticated": 400,
  "silent_mode_enabled": false,
  "security_policy_global_group_approvers_enabled": true,
  "security_approval_policies_limit": 5,
  "package_registry_allow_anyone_to_pull_option": true,
  "bulk_import_max_download_file_size": 5120,
  "project_jobs_api_rate_limit": 600,
  "security_txt_content": null,
  "bulk_import_concurrent_pipeline_batch_limit": 25,
  "downstream_pipeline_trigger_limit_per_project_user_sha": 0,
  "concurrent_github_import_jobs_limit": 1000,
  "concurrent_bitbucket_import_jobs_limit": 100,
  "concurrent_bitbucket_server_import_jobs_limit": 100,
  "silent_admin_exports_enabled": false
}

GitLab Premium 또는 Ultimate 사용자는 다음 매개 변수도 볼 수 있습니다:

  • group_owners_can_manage_default_branch_protection
  • file_template_project_id
  • geo_node_allowed_ips
  • geo_status_timeout
  • default_project_deletion_protection
  • deletion_adjourned_period
  • disable_personal_access_tokens
  • security_policy_global_group_approvers_enabled
  • security_approval_policies_limit
  • delete_unconfirmed_users
  • unconfirmed_users_delete_after_days
  • duo_features_enabled
  • lock_duo_features_enabled
  • use_clickhouse_for_analytics

예시 응답:

  "file_template_project_id": 1,
  "geo_node_allowed_ips": "0.0.0.0/0, ::/0",
  "duo_features_enabled": true,
  "lock_duo_features_enabled": false,

API 호출을 통해 액세스할 수 있는 설정 디렉터리

History
  • housekeeping_full_repack_period, housekeeping_gc_period, housekeeping_incremental_repack_period 필드는 GitLab 15.8에서 deprecated되었습니다. 대신 housekeeping_optimize_repository_period를 사용하십시오.
  • 매개변수 allow_account_deletion은 GitLab 16.1에서 introduced되었습니다.
  • 매개변수 silent_admin_exports_enabled은 GitLab 17.0에서 introduced되었습니다.

일반적으로 모든 설정은 선택 사항입니다. 그러나 특정한 설정은 활성화되어 있는 경우 정상적으로 작동하기 위해 다른 설정 필수로 설정해야 합니다. 이러한 요구 사항은 관련 설정에 대한 설명서에 나열되어 있습니다.

속성 유형 필수 설명
admin_mode boolean no 관리자가 관리작업을 위해 다시 인증하여 관리자 모드를 활성화해야 합니다.
admin_notification_email string no 구식입니다. 대신 abuse_notification_email을 사용하십시오. 설정된 경우, 유사무림 신고가 이 주소로 전송됩니다. 유사무림 신고는 항상 관리 영역에서 사용할 수 있습니다.
abuse_notification_email string no 설정된 경우, 유사무림 신고가 이 주소로 전송됩니다. 유사무림 신고는 항상 관리 영역에서 사용할 수 있습니다.
notify_on_unknown_sign_in boolean no 알 수 없는 IP 주소에서 로그인 시 알림을 보내도록 설정합니다.
after_sign_out_path string no 로그아웃 후 사용자를 리디렉션하는 위치입니다.
email_restrictions_enabled boolean no 이메일로 가입을 제한할 수 있도록 설정합니다.
email_restrictions string required by: email_restrictions_enabled 등록 중 사용되는 이메일에 대해 확인되는 정규식입니다.
after_sign_up_text string no 가입 후 사용자에게 표시되는 텍스트입니다.
akismet_api_key string required by: akismet_enabled Akismet 스팸 보호를 위한 API 키입니다.
akismet_enabled boolean no (활성화된 경우 필수: akismet_api_key) Akismet 스팸 보호를 활성화 또는 비활성화합니다.
allow_account_deletion      

비활성 프로젝트 삭제 구성

비활성 프로젝트 삭제를 구성하거나 해당 기능을 비활성화할 수 있습니다.

속성 유형 필수 여부 설명
delete_inactive_projects 부울 아니요 비활성 프로젝트 삭제를 활성화합니다. 기본값은 false입니다. 피처 플래그 없이 운영 가능한 기능으로 GitLab 15.4에서 추가되었습니다.
inactive_projects_delete_after_months 정수 아니요 delete_inactive_projectstrue인 경우, 비활성 프로젝트를 삭제하기 전에 대기해야 하는 시간(개월 단위)입니다. 기본값은 2입니다. GitLab 15.0에서 운영 가능한 기능입니다.
inactive_projects_min_size_mb 정수 아니요 delete_inactive_projectstrue인 경우, 비활성 프로젝트의 확인을 위해 필요한 최소 리포지터리 크기입니다. 기본값은 0입니다. GitLab 15.0에서 운영 가능한 기능입니다.
inactive_projects_send_warning_email_after_months 정수 아니요 delete_inactive_projectstrue인 경우, 비활성 상태로 인해 프로젝트가 삭제 예정인 유지 관리자에게 이메일을 보내기 전에 대기해야 하는 시간(개월 단위)입니다. 기본값은 1입니다. GitLab 15.0에서 운영 가능한 기능입니다.

Housekeeping 필드

15.8 버전 이상

housekeeping_optimize_repository_period 필드가 정수로 설정된 경우, 지정한 Git 푸시 수행 후 housekeeping 작업이 수행됩니다.

15.7 및 이전 버전

housekeeping_enabled 필드는 Git housekeeping을 활성화하거나 비활성화합니다. 이 필드가 올바르게 작동하려면 housekeeping_optimize_repository_period가 설정되어 있거나 다음 중 하나 이상의 값이 설정되어야 합니다:

  • housekeeping_bitmaps_enabled
  • housekeeping_full_repack_period
  • housekeeping_gc_period

패키지 레지스트리: 패키지 파일 크기 제한

패키지 파일 크기 제한은 응용 프로그램 설정 API의 일부가 아닙니다. 대신, 이러한 설정은 Plan limits API를 사용하여 액세스할 수 있습니다.

default_branch_protection_defaults의 옵션

default_branch_protection_defaults 속성은 기본 브랜치 보호를 설명하는 기본값입니다. 모든 매개변수는 선택 사항입니다.

유형 설명
allowed_to_push 배열 푸시가 허용된 액세스 수준의 배열. Developer (30) 또는 Maintainer (40)을 지원합니다.
allow_force_push 부울 모든 사용자에게 푸시 액세스를 허용합니다.
allowed_to_merge 배열 머지가 허용된 액세스 수준의 배열. Developer (30) 또는 Maintainer (40)을 지원합니다.
developer_can_initial_push 부울 개발자가 초기 푸시를 할 수 있도록 허용합니다.