외형 API

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

외형 API는 GitLab의 외형을 /admin/appearance에서 GitLab UI를 사용하는 것처럼 유지할 수 있게 합니다. 이 API는 관리자 권한을 필요로 합니다.

현재 외형 구성 가져오기

GitLab 인스턴스의 현재 외형 구성을 나열합니다.

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

예시 응답:

{
  "title": "GitLab Test Instance",
  "description": "gitlab-test.example.com",
  "pwa_name": "GitLab PWA",
  "pwa_short_name": "GitLab",
  "pwa_description": "GitLab as PWA",
  "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
  "logo": "/uploads/-/system/appearance/logo/1/logo.png",
  "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
  "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
  "member_guidelines": "Custom member guidelines",
  "new_project_guidelines": "Please read the FAQs for help.",
  "profile_image_guidelines": "Custom profile image guidelines",
  "header_message": "",
  "footer_message": "",
  "message_background_color": "#e75e40",
  "message_font_color": "#ffffff",
  "email_header_and_footer_enabled": false
}

외형 구성 변경

API 호출을 사용하여 GitLab 인스턴스 외형 구성을 수정합니다.

PUT /application/appearance
속성 타입 필수 설명
title string no 로그인/가입 페이지의 인스턴스 제목
description string no 로그인/가입 페이지에 표시되는 Markdown 텍스트
pwa_name string no Progressive Web App의 전체 이름. manifest.jsonname 속성에 사용됩니다. GitLab 15.8에서 도입되었습니다.
pwa_short_name string no Progressive Web App의 짧은 이름. GitLab 15.8에서 도입되었습니다.
pwa_description string no Progressive Web App의 기능 설명. manifest.jsondescription 속성에 사용됩니다. GitLab 15.8에서 도입되었습니다.
pwa_icon mixed no Progressive Web App에 사용되는 아이콘. 로고 변경 참조. GitLab 15.8에서 도입되었습니다.
logo mixed no 로그인/가입 페이지에 사용되는 인스턴스 이미지. 로고 변경 참조
header_logo mixed no 주 네비게이션 바에 사용되는 인스턴스 이미지
favicon mixed no .ico 또는 .png 형식의 인스턴스 파비콘
member_guidelines string no 그룹 또는 프로젝트 멤버 페이지에 표시되는 Markdown 텍스트(멤버 변경 권한 있는 사용자)
new_project_guidelines string no 새 프로젝트 페이지에 표시되는 Markdown 텍스트
profile_image_guidelines string no Public Avatar 아래의 프로필 페이지에 표시되는 Markdown 텍스트
header_message string no 시스템 헤더 바의 메시지
footer_message string no 시스템 푸터 바의 메시지
message_background_color string no 시스템 헤더/푸터 바의 배경색
message_font_color string no 시스템 헤더/푸터 바의 글꼴 색상
email_header_and_footer_enabled boolean no 활성화되면 모든 발신 이메일에 헤더와 푸터 추가
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/appearance?email_header_and_footer_enabled=true&header_message=test"

예시 응답:

{
  "title": "GitLab Test Instance",
  "description": "gitlab-test.example.com",
  "pwa_name": "GitLab PWA",
  "pwa_short_name": "GitLab",
  "pwa_description": "GitLab as PWA",
  "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
  "logo": "/uploads/-/system/appearance/logo/1/logo.png",
  "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
  "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
  "member_guidelines": "Custom member guidelines",
  "new_project_guidelines": "Please read the FAQs for help.",
  "profile_image_guidelines": "Custom profile image guidelines",
  "header_message": "test",
  "footer_message": "",
  "message_background_color": "#e75e40",
  "message_font_color": "#ffffff",
  "email_header_and_footer_enabled": true
}

로고 변경

귀하의 GitLab 인스턴스에 로고를 업로드하세요.

파일 시스템에서 아바타를 업로드하려면 --form 인자를 사용하십시오. 이렇게하면 cURL이 Content-Type: multipart/form-data 헤더를 사용하여 데이터를 전송합니다. file= 매개변수는 파일 시스템의 이미지 파일을 가리켜야하며 @로 시작해야합니다.

PUT /application/appearance
속성 유형 필수여부 설명
logo 혼합 업로드 할 파일
pwa_icon 혼합 업로드 할 파일. GitLab 15.8에서 소개되었습니다.

예시 요청:

curl --location --request PUT "https://gitlab.example.com/api/v4/application/appearance?data=image/png" \
--header "Content-Type: multipart/form-data" \
--header "PRIVATE-TOKEN: <your_access_token>" \
--form "logo=@/path/to/logo.png"

반환된 객체:

{
   "logo":"/uploads/-/system/appearance/logo/1/logo.png"
}